You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@marmotta.apache.org by wi...@apache.org on 2014/06/13 10:57:21 UTC

[001/100] [abbrv] [partial] Reverting the erroneous merge by Sebastian according to the instructions in INFRA-6876

Repository: marmotta
Updated Branches:
  refs/heads/ldp e1f88ee41 -> b61ebf856


http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/platform/marmotta-core/src/main/resources/web/public/js/lib/jquery-ui-1.8.21.js
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/resources/web/public/js/lib/jquery-ui-1.8.21.js b/platform/marmotta-core/src/main/resources/web/public/js/lib/jquery-ui-1.8.21.js
deleted file mode 100755
index 3fe9ccb..0000000
--- a/platform/marmotta-core/src/main/resources/web/public/js/lib/jquery-ui-1.8.21.js
+++ /dev/null
@@ -1,125 +0,0 @@
-/*! jQuery UI - v1.8.21 - 2012-06-05
-* https://github.com/jquery/jquery-ui
-* Includes: jquery.ui.core.js
-* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */
-(function(a,b){function c(b,c){var e=b.nodeName.toLowerCase();if("area"===e){var f=b.parentNode,g=f.name,h;return!b.href||!g||f.nodeName.toLowerCase()!=="map"?!1:(h=a("img[usemap=#"+g+"]")[0],!!h&&d(h))}return(/input|select|textarea|button|object/.test(e)?!b.disabled:"a"==e?b.href||c:c)&&d(b)}function d(b){return!a(b).parents().andSelf().filter(function(){return a.curCSS(this,"visibility")==="hidden"||a.expr.filters.hidden(this)}).length}a.ui=a.ui||{};if(a.ui.version)return;a.extend(a.ui,{version:"1.8.21",keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91}}),a.fn.extend({propAttr:a.fn.prop||a.fn.attr,_focus:a.fn.focus,focus:function(b,c){return typeof b=="number
 "?this.each(function(){var d=this;setTimeout(function(){a(d).focus(),c&&c.call(d)},b)}):this._focus.apply(this,arguments)},scrollParent:function(){var b;return a.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?b=this.parents().filter(function(){return/(relative|absolute|fixed)/.test(a.curCSS(this,"position",1))&&/(auto|scroll)/.test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0):b=this.parents().filter(function(){return/(auto|scroll)/.test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0),/fixed/.test(this.css("position"))||!b.length?a(document):b},zIndex:function(c){if(c!==b)return this.css("zIndex",c);if(this.length){var d=a(this[0]),e,f;while(d.length&&d[0]!==document){e=d.css("position");if(e==="absolute"||e==="relative"||e==="fixed"){f=parseInt(d.css("zIndex"),10);if(!isNaN(f)&&f!==0)return f}d=d.parent()}}return 0},disableSelectio
 n:function(){return this.bind((a.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(a){a.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}}),a.each(["Width","Height"],function(c,d){function h(b,c,d,f){return a.each(e,function(){c-=parseFloat(a.curCSS(b,"padding"+this,!0))||0,d&&(c-=parseFloat(a.curCSS(b,"border"+this+"Width",!0))||0),f&&(c-=parseFloat(a.curCSS(b,"margin"+this,!0))||0)}),c}var e=d==="Width"?["Left","Right"]:["Top","Bottom"],f=d.toLowerCase(),g={innerWidth:a.fn.innerWidth,innerHeight:a.fn.innerHeight,outerWidth:a.fn.outerWidth,outerHeight:a.fn.outerHeight};a.fn["inner"+d]=function(c){return c===b?g["inner"+d].call(this):this.each(function(){a(this).css(f,h(this,c)+"px")})},a.fn["outer"+d]=function(b,c){return typeof b!="number"?g["outer"+d].call(this,b):this.each(function(){a(this).css(f,h(this,b,!0,c)+"px")})}}),a.extend(a.expr[":"],{data:function(b,c,d){return!!a.data(b,d[3])},focusable:function(b)
 {return c(b,!isNaN(a.attr(b,"tabindex")))},tabbable:function(b){var d=a.attr(b,"tabindex"),e=isNaN(d);return(e||d>=0)&&c(b,!e)}}),a(function(){var b=document.body,c=b.appendChild(c=document.createElement("div"));c.offsetHeight,a.extend(c.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0}),a.support.minHeight=c.offsetHeight===100,a.support.selectstart="onselectstart"in c,b.removeChild(c).style.display="none"}),a.extend(a.ui,{plugin:{add:function(b,c,d){var e=a.ui[b].prototype;for(var f in d)e.plugins[f]=e.plugins[f]||[],e.plugins[f].push([c,d[f]])},call:function(a,b,c){var d=a.plugins[b];if(!d||!a.element[0].parentNode)return;for(var e=0;e<d.length;e++)a.options[d[e][0]]&&d[e][1].apply(a.element,c)}},contains:function(a,b){return document.compareDocumentPosition?a.compareDocumentPosition(b)&16:a!==b&&a.contains(b)},hasScroll:function(b,c){if(a(b).css("overflow")==="hidden")return!1;var d=c&&c==="left"?"scrollLeft":"scrollTop",e=!1;return b[d]>0?!0:(b[d]=1,e=b[d]>0,b[d]=0
 ,e)},isOverAxis:function(a,b,c){return a>b&&a<b+c},isOver:function(b,c,d,e,f,g){return a.ui.isOverAxis(b,d,f)&&a.ui.isOverAxis(c,e,g)}})})(jQuery);;/*! jQuery UI - v1.8.21 - 2012-06-05
-* https://github.com/jquery/jquery-ui
-* Includes: jquery.ui.widget.js
-* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */
-(function(a,b){if(a.cleanData){var c=a.cleanData;a.cleanData=function(b){for(var d=0,e;(e=b[d])!=null;d++)try{a(e).triggerHandler("remove")}catch(f){}c(b)}}else{var d=a.fn.remove;a.fn.remove=function(b,c){return this.each(function(){return c||(!b||a.filter(b,[this]).length)&&a("*",this).add([this]).each(function(){try{a(this).triggerHandler("remove")}catch(b){}}),d.call(a(this),b,c)})}}a.widget=function(b,c,d){var e=b.split(".")[0],f;b=b.split(".")[1],f=e+"-"+b,d||(d=c,c=a.Widget),a.expr[":"][f]=function(c){return!!a.data(c,b)},a[e]=a[e]||{},a[e][b]=function(a,b){arguments.length&&this._createWidget(a,b)};var g=new c;g.options=a.extend(!0,{},g.options),a[e][b].prototype=a.extend(!0,g,{namespace:e,widgetName:b,widgetEventPrefix:a[e][b].prototype.widgetEventPrefix||b,widgetBaseClass:f},d),a.widget.bridge(b,a[e][b])},a.widget.bridge=function(c,d){a.fn[c]=function(e){var f=typeof e=="string",g=Array.prototype.slice.call(arguments,1),h=this;return e=!f&&g.length?a.extend.apply(null,[!0,e
 ].concat(g)):e,f&&e.charAt(0)==="_"?h:(f?this.each(function(){var d=a.data(this,c),f=d&&a.isFunction(d[e])?d[e].apply(d,g):d;if(f!==d&&f!==b)return h=f,!1}):this.each(function(){var b=a.data(this,c);b?b.option(e||{})._init():a.data(this,c,new d(e,this))}),h)}},a.Widget=function(a,b){arguments.length&&this._createWidget(a,b)},a.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:!1},_createWidget:function(b,c){a.data(c,this.widgetName,this),this.element=a(c),this.options=a.extend(!0,{},this.options,this._getCreateOptions(),b);var d=this;this.element.bind("remove."+this.widgetName,function(){d.destroy()}),this._create(),this._trigger("create"),this._init()},_getCreateOptions:function(){return a.metadata&&a.metadata.get(this.element[0])[this.widgetName]},_create:function(){},_init:function(){},destroy:function(){this.element.unbind("."+this.widgetName).removeData(this.widgetName),this.widget().unbind("."+this.widgetName).removeAttr("aria-disabled").removeClass(
 this.widgetBaseClass+"-disabled "+"ui-state-disabled")},widget:function(){return this.element},option:function(c,d){var e=c;if(arguments.length===0)return a.extend({},this.options);if(typeof c=="string"){if(d===b)return this.options[c];e={},e[c]=d}return this._setOptions(e),this},_setOptions:function(b){var c=this;return a.each(b,function(a,b){c._setOption(a,b)}),this},_setOption:function(a,b){return this.options[a]=b,a==="disabled"&&this.widget()[b?"addClass":"removeClass"](this.widgetBaseClass+"-disabled"+" "+"ui-state-disabled").attr("aria-disabled",b),this},enable:function(){return this._setOption("disabled",!1)},disable:function(){return this._setOption("disabled",!0)},_trigger:function(b,c,d){var e,f,g=this.options[b];d=d||{},c=a.Event(c),c.type=(b===this.widgetEventPrefix?b:this.widgetEventPrefix+b).toLowerCase(),c.target=this.element[0],f=c.originalEvent;if(f)for(e in f)e in c||(c[e]=f[e]);return this.element.trigger(c,d),!(a.isFunction(g)&&g.call(this.element[0],c,d)===!1||
 c.isDefaultPrevented())}}})(jQuery);;/*! jQuery UI - v1.8.21 - 2012-06-05
-* https://github.com/jquery/jquery-ui
-* Includes: jquery.ui.mouse.js
-* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */
-(function(a,b){var c=!1;a(document).mouseup(function(a){c=!1}),a.widget("ui.mouse",{options:{cancel:":input,option",distance:1,delay:0},_mouseInit:function(){var b=this;this.element.bind("mousedown."+this.widgetName,function(a){return b._mouseDown(a)}).bind("click."+this.widgetName,function(c){if(!0===a.data(c.target,b.widgetName+".preventClickEvent"))return a.removeData(c.target,b.widgetName+".preventClickEvent"),c.stopImmediatePropagation(),!1}),this.started=!1},_mouseDestroy:function(){this.element.unbind("."+this.widgetName),a(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(b){if(c)return;this._mouseStarted&&this._mouseUp(b),this._mouseDownEvent=b;var d=this,e=b.which==1,f=typeof this.options.cancel=="string"&&b.target.nodeName?a(b.target).closest(this.options.cancel).length:!1;if(!e||f||!this._mouseCapture(b))return!0;this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(t
 his._mouseDelayTimer=setTimeout(function(){d.mouseDelayMet=!0},this.options.delay));if(this._mouseDistanceMet(b)&&this._mouseDelayMet(b)){this._mouseStarted=this._mouseStart(b)!==!1;if(!this._mouseStarted)return b.preventDefault(),!0}return!0===a.data(b.target,this.widgetName+".preventClickEvent")&&a.removeData(b.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(a){return d._mouseMove(a)},this._mouseUpDelegate=function(a){return d._mouseUp(a)},a(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate),b.preventDefault(),c=!0,!0},_mouseMove:function(b){return!a.browser.msie||document.documentMode>=9||!!b.button?this._mouseStarted?(this._mouseDrag(b),b.preventDefault()):(this._mouseDistanceMet(b)&&this._mouseDelayMet(b)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,b)!==!1,this._mouseStarted?this._mouseDrag(b):this._mouseUp(b)),!this._mouseStarted):this._mouseUp(b)},_mouseUp:fun
 ction(b){return a(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,b.target==this._mouseDownEvent.target&&a.data(b.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(b)),!1},_mouseDistanceMet:function(a){return Math.max(Math.abs(this._mouseDownEvent.pageX-a.pageX),Math.abs(this._mouseDownEvent.pageY-a.pageY))>=this.options.distance},_mouseDelayMet:function(a){return this.mouseDelayMet},_mouseStart:function(a){},_mouseDrag:function(a){},_mouseStop:function(a){},_mouseCapture:function(a){return!0}})})(jQuery);;/*! jQuery UI - v1.8.21 - 2012-06-05
-* https://github.com/jquery/jquery-ui
-* Includes: jquery.ui.position.js
-* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */
-(function(a,b){a.ui=a.ui||{};var c=/left|center|right/,d=/top|center|bottom/,e="center",f={},g=a.fn.position,h=a.fn.offset;a.fn.position=function(b){if(!b||!b.of)return g.apply(this,arguments);b=a.extend({},b);var h=a(b.of),i=h[0],j=(b.collision||"flip").split(" "),k=b.offset?b.offset.split(" "):[0,0],l,m,n;return i.nodeType===9?(l=h.width(),m=h.height(),n={top:0,left:0}):i.setTimeout?(l=h.width(),m=h.height(),n={top:h.scrollTop(),left:h.scrollLeft()}):i.preventDefault?(b.at="left top",l=m=0,n={top:b.of.pageY,left:b.of.pageX}):(l=h.outerWidth(),m=h.outerHeight(),n=h.offset()),a.each(["my","at"],function(){var a=(b[this]||"").split(" ");a.length===1&&(a=c.test(a[0])?a.concat([e]):d.test(a[0])?[e].concat(a):[e,e]),a[0]=c.test(a[0])?a[0]:e,a[1]=d.test(a[1])?a[1]:e,b[this]=a}),j.length===1&&(j[1]=j[0]),k[0]=parseInt(k[0],10)||0,k.length===1&&(k[1]=k[0]),k[1]=parseInt(k[1],10)||0,b.at[0]==="right"?n.left+=l:b.at[0]===e&&(n.left+=l/2),b.at[1]==="bottom"?n.top+=m:b.at[1]===e&&(n.top+=m/2),
 n.left+=k[0],n.top+=k[1],this.each(function(){var c=a(this),d=c.outerWidth(),g=c.outerHeight(),h=parseInt(a.curCSS(this,"marginLeft",!0))||0,i=parseInt(a.curCSS(this,"marginTop",!0))||0,o=d+h+(parseInt(a.curCSS(this,"marginRight",!0))||0),p=g+i+(parseInt(a.curCSS(this,"marginBottom",!0))||0),q=a.extend({},n),r;b.my[0]==="right"?q.left-=d:b.my[0]===e&&(q.left-=d/2),b.my[1]==="bottom"?q.top-=g:b.my[1]===e&&(q.top-=g/2),f.fractions||(q.left=Math.round(q.left),q.top=Math.round(q.top)),r={left:q.left-h,top:q.top-i},a.each(["left","top"],function(c,e){a.ui.position[j[c]]&&a.ui.position[j[c]][e](q,{targetWidth:l,targetHeight:m,elemWidth:d,elemHeight:g,collisionPosition:r,collisionWidth:o,collisionHeight:p,offset:k,my:b.my,at:b.at})}),a.fn.bgiframe&&c.bgiframe(),c.offset(a.extend(q,{using:b.using}))})},a.ui.position={fit:{left:function(b,c){var d=a(window),e=c.collisionPosition.left+c.collisionWidth-d.width()-d.scrollLeft();b.left=e>0?b.left-e:Math.max(b.left-c.collisionPosition.left,b.left
 )},top:function(b,c){var d=a(window),e=c.collisionPosition.top+c.collisionHeight-d.height()-d.scrollTop();b.top=e>0?b.top-e:Math.max(b.top-c.collisionPosition.top,b.top)}},flip:{left:function(b,c){if(c.at[0]===e)return;var d=a(window),f=c.collisionPosition.left+c.collisionWidth-d.width()-d.scrollLeft(),g=c.my[0]==="left"?-c.elemWidth:c.my[0]==="right"?c.elemWidth:0,h=c.at[0]==="left"?c.targetWidth:-c.targetWidth,i=-2*c.offset[0];b.left+=c.collisionPosition.left<0?g+h+i:f>0?g+h+i:0},top:function(b,c){if(c.at[1]===e)return;var d=a(window),f=c.collisionPosition.top+c.collisionHeight-d.height()-d.scrollTop(),g=c.my[1]==="top"?-c.elemHeight:c.my[1]==="bottom"?c.elemHeight:0,h=c.at[1]==="top"?c.targetHeight:-c.targetHeight,i=-2*c.offset[1];b.top+=c.collisionPosition.top<0?g+h+i:f>0?g+h+i:0}}},a.offset.setOffset||(a.offset.setOffset=function(b,c){/static/.test(a.curCSS(b,"position"))&&(b.style.position="relative");var d=a(b),e=d.offset(),f=parseInt(a.curCSS(b,"top",!0),10)||0,g=parseInt(a.
 curCSS(b,"left",!0),10)||0,h={top:c.top-e.top+f,left:c.left-e.left+g};"using"in c?c.using.call(b,h):d.css(h)},a.fn.offset=function(b){var c=this[0];return!c||!c.ownerDocument?null:b?a.isFunction(b)?this.each(function(c){a(this).offset(b.call(this,c,a(this).offset()))}):this.each(function(){a.offset.setOffset(this,b)}):h.call(this)}),function(){var b=document.getElementsByTagName("body")[0],c=document.createElement("div"),d,e,g,h,i;d=document.createElement(b?"div":"body"),g={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},b&&a.extend(g,{position:"absolute",left:"-1000px",top:"-1000px"});for(var j in g)d.style[j]=g[j];d.appendChild(c),e=b||document.documentElement,e.insertBefore(d,e.firstChild),c.style.cssText="position: absolute; left: 10.7432222px; top: 10.432325px; height: 30px; width: 201px;",h=a(c).offset(function(a,b){return b}).offset(),d.innerHTML="",e.removeChild(d),i=h.top+h.left+(b?2e3:0),f.fractions=i>21&&i<22}()})(jQuery);;/*! jQuery UI - v1.8.21
  - 2012-06-05
-* https://github.com/jquery/jquery-ui
-* Includes: jquery.ui.draggable.js
-* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */
-(function(a,b){a.widget("ui.draggable",a.ui.mouse,{widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1},_create:function(){this.options.helper=="original"&&!/^(?:r|a|f)/.test(this.element.css("position"))&&(this.element[0].style.position="relative"),this.options.addClasses&&this.element.addClass("ui-draggable"),this.options.disabled&&this.element.addClass("ui-draggable-disabled"),this._mouseInit()},destroy:function(){if(!this.element.data("draggable"))return;return this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled"),this._mouseDestroy(),this},_mouseCapture:function(b){var c=this.options;return thi
 s.helper||c.disabled||a(b.target).is(".ui-resizable-handle")?!1:(this.handle=this._getHandle(b),this.handle?(c.iframeFix&&a(c.iframeFix===!0?"iframe":c.iframeFix).each(function(){a('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1e3}).css(a(this).offset()).appendTo("body")}),!0):!1)},_mouseStart:function(b){var c=this.options;return this.helper=this._createHelper(b),this.helper.addClass("ui-draggable-dragging"),this._cacheHelperProportions(),a.ui.ddmanager&&(a.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(),this.offset=this.positionAbs=this.element.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},a.extend(this.offset,{click:{left:b.pageX-this.offset.left,top:b.pageY-this.offset.top},parent:this._getParentOffset(),rel
 ative:this._getRelativeOffset()}),this.originalPosition=this.position=this._generatePosition(b),this.originalPageX=b.pageX,this.originalPageY=b.pageY,c.cursorAt&&this._adjustOffsetFromHelper(c.cursorAt),c.containment&&this._setContainment(),this._trigger("start",b)===!1?(this._clear(),!1):(this._cacheHelperProportions(),a.ui.ddmanager&&!c.dropBehaviour&&a.ui.ddmanager.prepareOffsets(this,b),this._mouseDrag(b,!0),a.ui.ddmanager&&a.ui.ddmanager.dragStart(this,b),!0)},_mouseDrag:function(b,c){this.position=this._generatePosition(b),this.positionAbs=this._convertPositionTo("absolute");if(!c){var d=this._uiHash();if(this._trigger("drag",b,d)===!1)return this._mouseUp({}),!1;this.position=d.position}if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+"px";if(!this.options.axis||this.options.axis!="x")this.helper[0].style.top=this.position.top+"px";return a.ui.ddmanager&&a.ui.ddmanager.drag(this,b),!1},_mouseStop:function(b){var c=!1;a.ui.ddmanager&&!
 this.options.dropBehaviour&&(c=a.ui.ddmanager.drop(this,b)),this.dropped&&(c=this.dropped,this.dropped=!1);var d=this.element[0],e=!1;while(d&&(d=d.parentNode))d==document&&(e=!0);if(!e&&this.options.helper==="original")return!1;if(this.options.revert=="invalid"&&!c||this.options.revert=="valid"&&c||this.options.revert===!0||a.isFunction(this.options.revert)&&this.options.revert.call(this.element,c)){var f=this;a(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){f._trigger("stop",b)!==!1&&f._clear()})}else this._trigger("stop",b)!==!1&&this._clear();return!1},_mouseUp:function(b){return this.options.iframeFix===!0&&a("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)}),a.ui.ddmanager&&a.ui.ddmanager.dragStop(this,b),a.ui.mouse.prototype._mouseUp.call(this,b)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear(),this},_getHandle:function(b){var c=!this.options.handle
 ||!a(this.options.handle,this.element).length?!0:!1;return a(this.options.handle,this.element).find("*").andSelf().each(function(){this==b.target&&(c=!0)}),c},_createHelper:function(b){var c=this.options,d=a.isFunction(c.helper)?a(c.helper.apply(this.element[0],[b])):c.helper=="clone"?this.element.clone().removeAttr("id"):this.element;return d.parents("body").length||d.appendTo(c.appendTo=="parent"?this.element[0].parentNode:c.appendTo),d[0]!=this.element[0]&&!/(fixed|absolute)/.test(d.css("position"))&&d.css("position","absolute"),d},_adjustOffsetFromHelper:function(b){typeof b=="string"&&(b=b.split(" ")),a.isArray(b)&&(b={left:+b[0],top:+b[1]||0}),"left"in b&&(this.offset.click.left=b.left+this.margins.left),"right"in b&&(this.offset.click.left=this.helperProportions.width-b.right+this.margins.left),"top"in b&&(this.offset.click.top=b.top+this.margins.top),"bottom"in b&&(this.offset.click.top=this.helperProportions.height-b.bottom+this.margins.top)},_getParentOffset:function(){thi
 s.offsetParent=this.helper.offsetParent();var b=this.offsetParent.offset();this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0])&&(b.left+=this.scrollParent.scrollLeft(),b.top+=this.scrollParent.scrollTop());if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&a.browser.msie)b={top:0,left:0};return{top:b.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:b.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var a=this.element.position();return{top:a.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:a.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop")
 ,10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var b=this.options;b.containment=="parent"&&(b.containment=this.helper[0].parentNode);if(b.containment=="document"||b.containment=="window")this.containment=[b.containment=="document"?0:a(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,b.containment=="document"?0:a(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,(b.containment=="document"?0:a(window).scrollLeft())+a(b.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(b.containment=="document"?0:a(window).scrollTop())+(a(b.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|wind
 ow|parent)$/.test(b.containment)&&b.containment.constructor!=Array){var c=a(b.containment),d=c[0];if(!d)return;var e=c.offset(),f=a(d).css("overflow")!="hidden";this.containment=[(parseInt(a(d).css("borderLeftWidth"),10)||0)+(parseInt(a(d).css("paddingLeft"),10)||0),(parseInt(a(d).css("borderTopWidth"),10)||0)+(parseInt(a(d).css("paddingTop"),10)||0),(f?Math.max(d.scrollWidth,d.offsetWidth):d.offsetWidth)-(parseInt(a(d).css("borderLeftWidth"),10)||0)-(parseInt(a(d).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(f?Math.max(d.scrollHeight,d.offsetHeight):d.offsetHeight)-(parseInt(a(d).css("borderTopWidth"),10)||0)-(parseInt(a(d).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relative_container=c}else b.containment.constructor==Array&&(this.containment=b.containment)},_convertPositionTo:function(b,c){c||(c=this.position);var d=b=="absolute"?1:-1,e=this.options,f=this.cssPosition=="abs
 olute"&&(this.scrollParent[0]==document||!a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,g=/(html|body)/i.test(f[0].tagName);return{top:c.top+this.offset.relative.top*d+this.offset.parent.top*d-(a.browser.safari&&a.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():g?0:f.scrollTop())*d),left:c.left+this.offset.relative.left*d+this.offset.parent.left*d-(a.browser.safari&&a.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():g?0:f.scrollLeft())*d)}},_generatePosition:function(b){var c=this.options,d=this.cssPosition=="absolute"&&(this.scrollParent[0]==document||!a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,e=/(html|body)/i.test(d[0].tagName),f=b.pageX,g=b.pageY;if(this.originalPosition){var h;if(this.containment){if(this.relative_container){var i=this.relative_container.offset();h
 =[this.containment[0]+i.left,this.containment[1]+i.top,this.containment[2]+i.left,this.containment[3]+i.top]}else h=this.containment;b.pageX-this.offset.click.left<h[0]&&(f=h[0]+this.offset.click.left),b.pageY-this.offset.click.top<h[1]&&(g=h[1]+this.offset.click.top),b.pageX-this.offset.click.left>h[2]&&(f=h[2]+this.offset.click.left),b.pageY-this.offset.click.top>h[3]&&(g=h[3]+this.offset.click.top)}if(c.grid){var j=c.grid[1]?this.originalPageY+Math.round((g-this.originalPageY)/c.grid[1])*c.grid[1]:this.originalPageY;g=h?j-this.offset.click.top<h[1]||j-this.offset.click.top>h[3]?j-this.offset.click.top<h[1]?j+c.grid[1]:j-c.grid[1]:j:j;var k=c.grid[0]?this.originalPageX+Math.round((f-this.originalPageX)/c.grid[0])*c.grid[0]:this.originalPageX;f=h?k-this.offset.click.left<h[0]||k-this.offset.click.left>h[2]?k-this.offset.click.left<h[0]?k+c.grid[0]:k-c.grid[0]:k:k}}return{top:g-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(a.browser.safari&&a.browser.version
 <526&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollTop():e?0:d.scrollTop()),left:f-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(a.browser.safari&&a.browser.version<526&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():e?0:d.scrollLeft())}},_clear:function(){this.helper.removeClass("ui-draggable-dragging"),this.helper[0]!=this.element[0]&&!this.cancelHelperRemoval&&this.helper.remove(),this.helper=null,this.cancelHelperRemoval=!1},_trigger:function(b,c,d){return d=d||this._uiHash(),a.ui.plugin.call(this,b,[c,d]),b=="drag"&&(this.positionAbs=this._convertPositionTo("absolute")),a.Widget.prototype._trigger.call(this,b,c,d)},plugins:{},_uiHash:function(a){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),a.extend(a.ui.draggable,{version:"1.8.21"}),a.ui.plugin.add("draggable","connectToSortable",{start:function(b,c){var d=a(
 this).data("draggable"),e=d.options,f=a.extend({},c,{item:d.element});d.sortables=[],a(e.connectToSortable).each(function(){var c=a.data(this,"sortable");c&&!c.options.disabled&&(d.sortables.push({instance:c,shouldRevert:c.options.revert}),c.refreshPositions(),c._trigger("activate",b,f))})},stop:function(b,c){var d=a(this).data("draggable"),e=a.extend({},c,{item:d.element});a.each(d.sortables,function(){this.instance.isOver?(this.instance.isOver=0,d.cancelHelperRemoval=!0,this.instance.cancelHelperRemoval=!1,this.shouldRevert&&(this.instance.options.revert=!0),this.instance._mouseStop(b),this.instance.options.helper=this.instance.options._helper,d.options.helper=="original"&&this.instance.currentItem.css({top:"auto",left:"auto"})):(this.instance.cancelHelperRemoval=!1,this.instance._trigger("deactivate",b,e))})},drag:function(b,c){var d=a(this).data("draggable"),e=this,f=function(b){var c=this.offset.click.top,d=this.offset.click.left,e=this.positionAbs.top,f=this.positionAbs.left,g
 =b.height,h=b.width,i=b.top,j=b.left;return a.ui.isOver(e+c,f+d,i,j,g,h)};a.each(d.sortables,function(f){this.instance.positionAbs=d.positionAbs,this.instance.helperProportions=d.helperProportions,this.instance.offset.click=d.offset.click,this.instance._intersectsWith(this.instance.containerCache)?(this.instance.isOver||(this.instance.isOver=1,this.instance.currentItem=a(e).clone().removeAttr("id").appendTo(this.instance.element).data("sortable-item",!0),this.instance.options._helper=this.instance.options.helper,this.instance.options.helper=function(){return c.helper[0]},b.target=this.instance.currentItem[0],this.instance._mouseCapture(b,!0),this.instance._mouseStart(b,!0,!0),this.instance.offset.click.top=d.offset.click.top,this.instance.offset.click.left=d.offset.click.left,this.instance.offset.parent.left-=d.offset.parent.left-this.instance.offset.parent.left,this.instance.offset.parent.top-=d.offset.parent.top-this.instance.offset.parent.top,d._trigger("toSortable",b),d.dropped=
 this.instance.element,d.currentItem=d.element,this.instance.fromOutside=d),this.instance.currentItem&&this.instance._mouseDrag(b)):this.instance.isOver&&(this.instance.isOver=0,this.instance.cancelHelperRemoval=!0,this.instance.options.revert=!1,this.instance._trigger("out",b,this.instance._uiHash(this.instance)),this.instance._mouseStop(b,!0),this.instance.options.helper=this.instance.options._helper,this.instance.currentItem.remove(),this.instance.placeholder&&this.instance.placeholder.remove(),d._trigger("fromSortable",b),d.dropped=!1)})}}),a.ui.plugin.add("draggable","cursor",{start:function(b,c){var d=a("body"),e=a(this).data("draggable").options;d.css("cursor")&&(e._cursor=d.css("cursor")),d.css("cursor",e.cursor)},stop:function(b,c){var d=a(this).data("draggable").options;d._cursor&&a("body").css("cursor",d._cursor)}}),a.ui.plugin.add("draggable","opacity",{start:function(b,c){var d=a(c.helper),e=a(this).data("draggable").options;d.css("opacity")&&(e._opacity=d.css("opacity")
 ),d.css("opacity",e.opacity)},stop:function(b,c){var d=a(this).data("draggable").options;d._opacity&&a(c.helper).css("opacity",d._opacity)}}),a.ui.plugin.add("draggable","scroll",{start:function(b,c){var d=a(this).data("draggable");d.scrollParent[0]!=document&&d.scrollParent[0].tagName!="HTML"&&(d.overflowOffset=d.scrollParent.offset())},drag:function(b,c){var d=a(this).data("draggable"),e=d.options,f=!1;if(d.scrollParent[0]!=document&&d.scrollParent[0].tagName!="HTML"){if(!e.axis||e.axis!="x")d.overflowOffset.top+d.scrollParent[0].offsetHeight-b.pageY<e.scrollSensitivity?d.scrollParent[0].scrollTop=f=d.scrollParent[0].scrollTop+e.scrollSpeed:b.pageY-d.overflowOffset.top<e.scrollSensitivity&&(d.scrollParent[0].scrollTop=f=d.scrollParent[0].scrollTop-e.scrollSpeed);if(!e.axis||e.axis!="y")d.overflowOffset.left+d.scrollParent[0].offsetWidth-b.pageX<e.scrollSensitivity?d.scrollParent[0].scrollLeft=f=d.scrollParent[0].scrollLeft+e.scrollSpeed:b.pageX-d.overflowOffset.left<e.scrollSensit
 ivity&&(d.scrollParent[0].scrollLeft=f=d.scrollParent[0].scrollLeft-e.scrollSpeed)}else{if(!e.axis||e.axis!="x")b.pageY-a(document).scrollTop()<e.scrollSensitivity?f=a(document).scrollTop(a(document).scrollTop()-e.scrollSpeed):a(window).height()-(b.pageY-a(document).scrollTop())<e.scrollSensitivity&&(f=a(document).scrollTop(a(document).scrollTop()+e.scrollSpeed));if(!e.axis||e.axis!="y")b.pageX-a(document).scrollLeft()<e.scrollSensitivity?f=a(document).scrollLeft(a(document).scrollLeft()-e.scrollSpeed):a(window).width()-(b.pageX-a(document).scrollLeft())<e.scrollSensitivity&&(f=a(document).scrollLeft(a(document).scrollLeft()+e.scrollSpeed))}f!==!1&&a.ui.ddmanager&&!e.dropBehaviour&&a.ui.ddmanager.prepareOffsets(d,b)}}),a.ui.plugin.add("draggable","snap",{start:function(b,c){var d=a(this).data("draggable"),e=d.options;d.snapElements=[],a(e.snap.constructor!=String?e.snap.items||":data(draggable)":e.snap).each(function(){var b=a(this),c=b.offset();this!=d.element[0]&&d.snapElements.pu
 sh({item:this,width:b.outerWidth(),height:b.outerHeight(),top:c.top,left:c.left})})},drag:function(b,c){var d=a(this).data("draggable"),e=d.options,f=e.snapTolerance,g=c.offset.left,h=g+d.helperProportions.width,i=c.offset.top,j=i+d.helperProportions.height;for(var k=d.snapElements.length-1;k>=0;k--){var l=d.snapElements[k].left,m=l+d.snapElements[k].width,n=d.snapElements[k].top,o=n+d.snapElements[k].height;if(!(l-f<g&&g<m+f&&n-f<i&&i<o+f||l-f<g&&g<m+f&&n-f<j&&j<o+f||l-f<h&&h<m+f&&n-f<i&&i<o+f||l-f<h&&h<m+f&&n-f<j&&j<o+f)){d.snapElements[k].snapping&&d.options.snap.release&&d.options.snap.release.call(d.element,b,a.extend(d._uiHash(),{snapItem:d.snapElements[k].item})),d.snapElements[k].snapping=!1;continue}if(e.snapMode!="inner"){var p=Math.abs(n-j)<=f,q=Math.abs(o-i)<=f,r=Math.abs(l-h)<=f,s=Math.abs(m-g)<=f;p&&(c.position.top=d._convertPositionTo("relative",{top:n-d.helperProportions.height,left:0}).top-d.margins.top),q&&(c.position.top=d._convertPositionTo("relative",{top:o,left
 :0}).top-d.margins.top),r&&(c.position.left=d._convertPositionTo("relative",{top:0,left:l-d.helperProportions.width}).left-d.margins.left),s&&(c.position.left=d._convertPositionTo("relative",{top:0,left:m}).left-d.margins.left)}var t=p||q||r||s;if(e.snapMode!="outer"){var p=Math.abs(n-i)<=f,q=Math.abs(o-j)<=f,r=Math.abs(l-g)<=f,s=Math.abs(m-h)<=f;p&&(c.position.top=d._convertPositionTo("relative",{top:n,left:0}).top-d.margins.top),q&&(c.position.top=d._convertPositionTo("relative",{top:o-d.helperProportions.height,left:0}).top-d.margins.top),r&&(c.position.left=d._convertPositionTo("relative",{top:0,left:l}).left-d.margins.left),s&&(c.position.left=d._convertPositionTo("relative",{top:0,left:m-d.helperProportions.width}).left-d.margins.left)}!d.snapElements[k].snapping&&(p||q||r||s||t)&&d.options.snap.snap&&d.options.snap.snap.call(d.element,b,a.extend(d._uiHash(),{snapItem:d.snapElements[k].item})),d.snapElements[k].snapping=p||q||r||s||t}}}),a.ui.plugin.add("draggable","stack",{st
 art:function(b,c){var d=a(this).data("draggable").options,e=a.makeArray(a(d.stack)).sort(function(b,c){return(parseInt(a(b).css("zIndex"),10)||0)-(parseInt(a(c).css("zIndex"),10)||0)});if(!e.length)return;var f=parseInt(e[0].style.zIndex)||0;a(e).each(function(a){this.style.zIndex=f+a}),this[0].style.zIndex=f+e.length}}),a.ui.plugin.add("draggable","zIndex",{start:function(b,c){var d=a(c.helper),e=a(this).data("draggable").options;d.css("zIndex")&&(e._zIndex=d.css("zIndex")),d.css("zIndex",e.zIndex)},stop:function(b,c){var d=a(this).data("draggable").options;d._zIndex&&a(c.helper).css("zIndex",d._zIndex)}})})(jQuery);;/*! jQuery UI - v1.8.21 - 2012-06-05
-* https://github.com/jquery/jquery-ui
-* Includes: jquery.ui.droppable.js
-* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */
-(function(a,b){a.widget("ui.droppable",{widgetEventPrefix:"drop",options:{accept:"*",activeClass:!1,addClasses:!0,greedy:!1,hoverClass:!1,scope:"default",tolerance:"intersect"},_create:function(){var b=this.options,c=b.accept;this.isover=0,this.isout=1,this.accept=a.isFunction(c)?c:function(a){return a.is(c)},this.proportions={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight},a.ui.ddmanager.droppables[b.scope]=a.ui.ddmanager.droppables[b.scope]||[],a.ui.ddmanager.droppables[b.scope].push(this),b.addClasses&&this.element.addClass("ui-droppable")},destroy:function(){var b=a.ui.ddmanager.droppables[this.options.scope];for(var c=0;c<b.length;c++)b[c]==this&&b.splice(c,1);return this.element.removeClass("ui-droppable ui-droppable-disabled").removeData("droppable").unbind(".droppable"),this},_setOption:function(b,c){b=="accept"&&(this.accept=a.isFunction(c)?c:function(a){return a.is(c)}),a.Widget.prototype._setOption.apply(this,arguments)},_activate:function(b){var c=
 a.ui.ddmanager.current;this.options.activeClass&&this.element.addClass(this.options.activeClass),c&&this._trigger("activate",b,this.ui(c))},_deactivate:function(b){var c=a.ui.ddmanager.current;this.options.activeClass&&this.element.removeClass(this.options.activeClass),c&&this._trigger("deactivate",b,this.ui(c))},_over:function(b){var c=a.ui.ddmanager.current;if(!c||(c.currentItem||c.element)[0]==this.element[0])return;this.accept.call(this.element[0],c.currentItem||c.element)&&(this.options.hoverClass&&this.element.addClass(this.options.hoverClass),this._trigger("over",b,this.ui(c)))},_out:function(b){var c=a.ui.ddmanager.current;if(!c||(c.currentItem||c.element)[0]==this.element[0])return;this.accept.call(this.element[0],c.currentItem||c.element)&&(this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("out",b,this.ui(c)))},_drop:function(b,c){var d=c||a.ui.ddmanager.current;if(!d||(d.currentItem||d.element)[0]==this.element[0])return!1;var e=!1;r
 eturn this.element.find(":data(droppable)").not(".ui-draggable-dragging").each(function(){var b=a.data(this,"droppable");if(b.options.greedy&&!b.options.disabled&&b.options.scope==d.options.scope&&b.accept.call(b.element[0],d.currentItem||d.element)&&a.ui.intersect(d,a.extend(b,{offset:b.element.offset()}),b.options.tolerance))return e=!0,!1}),e?!1:this.accept.call(this.element[0],d.currentItem||d.element)?(this.options.activeClass&&this.element.removeClass(this.options.activeClass),this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("drop",b,this.ui(d)),this.element):!1},ui:function(a){return{draggable:a.currentItem||a.element,helper:a.helper,position:a.position,offset:a.positionAbs}}}),a.extend(a.ui.droppable,{version:"1.8.21"}),a.ui.intersect=function(b,c,d){if(!c.offset)return!1;var e=(b.positionAbs||b.position.absolute).left,f=e+b.helperProportions.width,g=(b.positionAbs||b.position.absolute).top,h=g+b.helperProportions.height,i=c.offset.lef
 t,j=i+c.proportions.width,k=c.offset.top,l=k+c.proportions.height;switch(d){case"fit":return i<=e&&f<=j&&k<=g&&h<=l;case"intersect":return i<e+b.helperProportions.width/2&&f-b.helperProportions.width/2<j&&k<g+b.helperProportions.height/2&&h-b.helperProportions.height/2<l;case"pointer":var m=(b.positionAbs||b.position.absolute).left+(b.clickOffset||b.offset.click).left,n=(b.positionAbs||b.position.absolute).top+(b.clickOffset||b.offset.click).top,o=a.ui.isOver(n,m,k,i,c.proportions.height,c.proportions.width);return o;case"touch":return(g>=k&&g<=l||h>=k&&h<=l||g<k&&h>l)&&(e>=i&&e<=j||f>=i&&f<=j||e<i&&f>j);default:return!1}},a.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(b,c){var d=a.ui.ddmanager.droppables[b.options.scope]||[],e=c?c.type:null,f=(b.currentItem||b.element).find(":data(droppable)").andSelf();g:for(var h=0;h<d.length;h++){if(d[h].options.disabled||b&&!d[h].accept.call(d[h].element[0],b.currentItem||b.element))continue;for(var i=0;i<f.lengt
 h;i++)if(f[i]==d[h].element[0]){d[h].proportions.height=0;continue g}d[h].visible=d[h].element.css("display")!="none";if(!d[h].visible)continue;e=="mousedown"&&d[h]._activate.call(d[h],c),d[h].offset=d[h].element.offset(),d[h].proportions={width:d[h].element[0].offsetWidth,height:d[h].element[0].offsetHeight}}},drop:function(b,c){var d=!1;return a.each(a.ui.ddmanager.droppables[b.options.scope]||[],function(){if(!this.options)return;!this.options.disabled&&this.visible&&a.ui.intersect(b,this,this.options.tolerance)&&(d=this._drop.call(this,c)||d),!this.options.disabled&&this.visible&&this.accept.call(this.element[0],b.currentItem||b.element)&&(this.isout=1,this.isover=0,this._deactivate.call(this,c))}),d},dragStart:function(b,c){b.element.parents(":not(body,html)").bind("scroll.droppable",function(){b.options.refreshPositions||a.ui.ddmanager.prepareOffsets(b,c)})},drag:function(b,c){b.options.refreshPositions&&a.ui.ddmanager.prepareOffsets(b,c),a.each(a.ui.ddmanager.droppables[b.opt
 ions.scope]||[],function(){if(this.options.disabled||this.greedyChild||!this.visible)return;var d=a.ui.intersect(b,this,this.options.tolerance),e=!d&&this.isover==1?"isout":d&&this.isover==0?"isover":null;if(!e)return;var f;if(this.options.greedy){var g=this.element.parents(":data(droppable):eq(0)");g.length&&(f=a.data(g[0],"droppable"),f.greedyChild=e=="isover"?1:0)}f&&e=="isover"&&(f.isover=0,f.isout=1,f._out.call(f,c)),this[e]=1,this[e=="isout"?"isover":"isout"]=0,this[e=="isover"?"_over":"_out"].call(this,c),f&&e=="isout"&&(f.isout=0,f.isover=1,f._over.call(f,c))})},dragStop:function(b,c){b.element.parents(":not(body,html)").unbind("scroll.droppable"),b.options.refreshPositions||a.ui.ddmanager.prepareOffsets(b,c)}}})(jQuery);;/*! jQuery UI - v1.8.21 - 2012-06-05
-* https://github.com/jquery/jquery-ui
-* Includes: jquery.ui.resizable.js
-* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */
-(function(a,b){a.widget("ui.resizable",a.ui.mouse,{widgetEventPrefix:"resize",options:{alsoResize:!1,animate:!1,animateDuration:"slow",animateEasing:"swing",aspectRatio:!1,autoHide:!1,containment:!1,ghost:!1,grid:!1,handles:"e,s,se",helper:!1,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:1e3},_create:function(){var b=this,c=this.options;this.element.addClass("ui-resizable"),a.extend(this,{_aspectRatio:!!c.aspectRatio,aspectRatio:c.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:c.helper||c.ghost||c.animate?c.helper||"ui-resizable-helper":null}),this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)&&(this.element.wrap(a('<div class="ui-wrapper" style="overflow: hidden;"></div>').css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("resizable",this.element.data(
 "resizable")),this.elementIsWrapper=!0,this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")}),this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0}),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css({margin:this.originalElement.css("margin")}),this._proportionallyResize()),this.handles=c.handles||(a(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se");if(this.handles.constructor==String){this.handles=="all"&&(this.handles="n,e,s,w,se,sw,ne
 ,nw");var d=this.handles.split(",");this.handles={};for(var e=0;e<d.length;e++){var f=a.trim(d[e]),g="ui-resizable-"+f,h=a('<div class="ui-resizable-handle '+g+'"></div>');h.css({zIndex:c.zIndex}),"se"==f&&h.addClass("ui-icon ui-icon-gripsmall-diagonal-se"),this.handles[f]=".ui-resizable-"+f,this.element.append(h)}}this._renderAxis=function(b){b=b||this.element;for(var c in this.handles){this.handles[c].constructor==String&&(this.handles[c]=a(this.handles[c],this.element).show());if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var d=a(this.handles[c],this.element),e=0;e=/sw|ne|nw|se|n|s/.test(c)?d.outerHeight():d.outerWidth();var f=["padding",/ne|nw|n/.test(c)?"Top":/se|sw|s/.test(c)?"Bottom":/^e$/.test(c)?"Right":"Left"].join("");b.css(f,e),this._proportionallyResize()}if(!a(this.handles[c]).length)continue}},this._renderAxis(this.element),this._handles=a(".ui-resizable-handle",this.element).disableSelection(),this._handles.mouseov
 er(function(){if(!b.resizing){if(this.className)var a=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);b.axis=a&&a[1]?a[1]:"se"}}),c.autoHide&&(this._handles.hide(),a(this.element).addClass("ui-resizable-autohide").hover(function(){if(c.disabled)return;a(this).removeClass("ui-resizable-autohide"),b._handles.show()},function(){if(c.disabled)return;b.resizing||(a(this).addClass("ui-resizable-autohide"),b._handles.hide())})),this._mouseInit()},destroy:function(){this._mouseDestroy();var b=function(b){a(b).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};if(this.elementIsWrapper){b(this.element);var c=this.element;c.after(this.originalElement.css({position:c.css("position"),width:c.outerWidth(),height:c.outerHeight(),top:c.css("top"),left:c.css("left")})).remove()}return this.originalElement.css("resize",this.originalResizeStyle),b(this.originalElement),this},_mouseCaptu
 re:function(b){var c=!1;for(var d in this.handles)a(this.handles[d])[0]==b.target&&(c=!0);return!this.options.disabled&&c},_mouseStart:function(b){var d=this.options,e=this.element.position(),f=this.element;this.resizing=!0,this.documentScroll={top:a(document).scrollTop(),left:a(document).scrollLeft()},(f.is(".ui-draggable")||/absolute/.test(f.css("position")))&&f.css({position:"absolute",top:e.top,left:e.left}),this._renderProxy();var g=c(this.helper.css("left")),h=c(this.helper.css("top"));d.containment&&(g+=a(d.containment).scrollLeft()||0,h+=a(d.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:g,top:h},this.size=this._helper?{width:f.outerWidth(),height:f.outerHeight()}:{width:f.width(),height:f.height()},this.originalSize=this._helper?{width:f.outerWidth(),height:f.outerHeight()}:{width:f.width(),height:f.height()},this.originalPosition={left:g,top:h},this.sizeDiff={width:f.outerWidth()-f.width(),height:f.outerHeight()-f.height()},this.originalM
 ousePosition={left:b.pageX,top:b.pageY},this.aspectRatio=typeof d.aspectRatio=="number"?d.aspectRatio:this.originalSize.width/this.originalSize.height||1;var i=a(".ui-resizable-"+this.axis).css("cursor");return a("body").css("cursor",i=="auto"?this.axis+"-resize":i),f.addClass("ui-resizable-resizing"),this._propagate("start",b),!0},_mouseDrag:function(b){var c=this.helper,d=this.options,e={},f=this,g=this.originalMousePosition,h=this.axis,i=b.pageX-g.left||0,j=b.pageY-g.top||0,k=this._change[h];if(!k)return!1;var l=k.apply(this,[b,i,j]),m=a.browser.msie&&a.browser.version<7,n=this.sizeDiff;this._updateVirtualBoundaries(b.shiftKey);if(this._aspectRatio||b.shiftKey)l=this._updateRatio(l,b);return l=this._respectSize(l,b),this._propagate("resize",b),c.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"}),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),this._updateCache(l),this._trigg
 er("resize",b,this.ui()),!1},_mouseStop:function(b){this.resizing=!1;var c=this.options,d=this;if(this._helper){var e=this._proportionallyResizeElements,f=e.length&&/textarea/i.test(e[0].nodeName),g=f&&a.ui.hasScroll(e[0],"left")?0:d.sizeDiff.height,h=f?0:d.sizeDiff.width,i={width:d.helper.width()-h,height:d.helper.height()-g},j=parseInt(d.element.css("left"),10)+(d.position.left-d.originalPosition.left)||null,k=parseInt(d.element.css("top"),10)+(d.position.top-d.originalPosition.top)||null;c.animate||this.element.css(a.extend(i,{top:k,left:j})),d.helper.height(d.size.height),d.helper.width(d.size.width),this._helper&&!c.animate&&this._proportionallyResize()}return a("body").css("cursor","auto"),this.element.removeClass("ui-resizable-resizing"),this._propagate("stop",b),this._helper&&this.helper.remove(),!1},_updateVirtualBoundaries:function(a){var b=this.options,c,e,f,g,h;h={minWidth:d(b.minWidth)?b.minWidth:0,maxWidth:d(b.maxWidth)?b.maxWidth:Infinity,minHeight:d(b.minHeight)?b.mi
 nHeight:0,maxHeight:d(b.maxHeight)?b.maxHeight:Infinity};if(this._aspectRatio||a)c=h.minHeight*this.aspectRatio,f=h.minWidth/this.aspectRatio,e=h.maxHeight*this.aspectRatio,g=h.maxWidth/this.aspectRatio,c>h.minWidth&&(h.minWidth=c),f>h.minHeight&&(h.minHeight=f),e<h.maxWidth&&(h.maxWidth=e),g<h.maxHeight&&(h.maxHeight=g);this._vBoundaries=h},_updateCache:function(a){var b=this.options;this.offset=this.helper.offset(),d(a.left)&&(this.position.left=a.left),d(a.top)&&(this.position.top=a.top),d(a.height)&&(this.size.height=a.height),d(a.width)&&(this.size.width=a.width)},_updateRatio:function(a,b){var c=this.options,e=this.position,f=this.size,g=this.axis;return d(a.height)?a.width=a.height*this.aspectRatio:d(a.width)&&(a.height=a.width/this.aspectRatio),g=="sw"&&(a.left=e.left+(f.width-a.width),a.top=null),g=="nw"&&(a.top=e.top+(f.height-a.height),a.left=e.left+(f.width-a.width)),a},_respectSize:function(a,b){var c=this.helper,e=this._vBoundaries,f=this._aspectRatio||b.shiftKey,g=thi
 s.axis,h=d(a.width)&&e.maxWidth&&e.maxWidth<a.width,i=d(a.height)&&e.maxHeight&&e.maxHeight<a.height,j=d(a.width)&&e.minWidth&&e.minWidth>a.width,k=d(a.height)&&e.minHeight&&e.minHeight>a.height;j&&(a.width=e.minWidth),k&&(a.height=e.minHeight),h&&(a.width=e.maxWidth),i&&(a.height=e.maxHeight);var l=this.originalPosition.left+this.originalSize.width,m=this.position.top+this.size.height,n=/sw|nw|w/.test(g),o=/nw|ne|n/.test(g);j&&n&&(a.left=l-e.minWidth),h&&n&&(a.left=l-e.maxWidth),k&&o&&(a.top=m-e.minHeight),i&&o&&(a.top=m-e.maxHeight);var p=!a.width&&!a.height;return p&&!a.left&&a.top?a.top=null:p&&!a.top&&a.left&&(a.left=null),a},_proportionallyResize:function(){var b=this.options;if(!this._proportionallyResizeElements.length)return;var c=this.helper||this.element;for(var d=0;d<this._proportionallyResizeElements.length;d++){var e=this._proportionallyResizeElements[d];if(!this.borderDif){var f=[e.css("borderTopWidth"),e.css("borderRightWidth"),e.css("borderBottomWidth"),e.css("borde
 rLeftWidth")],g=[e.css("paddingTop"),e.css("paddingRight"),e.css("paddingBottom"),e.css("paddingLeft")];this.borderDif=a.map(f,function(a,b){var c=parseInt(a,10)||0,d=parseInt(g[b],10)||0;return c+d})}if(!a.browser.msie||!a(c).is(":hidden")&&!a(c).parents(":hidden").length)e.css({height:c.height()-this.borderDif[0]-this.borderDif[2]||0,width:c.width()-this.borderDif[1]-this.borderDif[3]||0});else continue}},_renderProxy:function(){var b=this.element,c=this.options;this.elementOffset=b.offset();if(this._helper){this.helper=this.helper||a('<div style="overflow:hidden;"></div>');var d=a.browser.msie&&a.browser.version<7,e=d?1:0,f=d?2:-1;this.helper.addClass(this._helper).css({width:this.element.outerWidth()+f,height:this.element.outerHeight()+f,position:"absolute",left:this.elementOffset.left-e+"px",top:this.elementOffset.top-e+"px",zIndex:++c.zIndex}),this.helper.appendTo("body").disableSelection()}else this.helper=this.element},_change:{e:function(a,b,c){return{width:this.originalSiz
 e.width+b}},w:function(a,b,c){var d=this.options,e=this.originalSize,f=this.originalPosition;return{left:f.left+b,width:e.width-b}},n:function(a,b,c){var d=this.options,e=this.originalSize,f=this.originalPosition;return{top:f.top+c,height:e.height-c}},s:function(a,b,c){return{height:this.originalSize.height+c}},se:function(b,c,d){return a.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[b,c,d]))},sw:function(b,c,d){return a.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[b,c,d]))},ne:function(b,c,d){return a.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[b,c,d]))},nw:function(b,c,d){return a.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[b,c,d]))}},_propagate:function(b,c){a.ui.plugin.call(this,b,[c,this.ui()]),b!="resize"&&this._trigger(b,c,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:thi
 s.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),a.extend(a.ui.resizable,{version:"1.8.21"}),a.ui.plugin.add("resizable","alsoResize",{start:function(b,c){var d=a(this).data("resizable"),e=d.options,f=function(b){a(b).each(function(){var b=a(this);b.data("resizable-alsoresize",{width:parseInt(b.width(),10),height:parseInt(b.height(),10),left:parseInt(b.css("left"),10),top:parseInt(b.css("top"),10)})})};typeof e.alsoResize=="object"&&!e.alsoResize.parentNode?e.alsoResize.length?(e.alsoResize=e.alsoResize[0],f(e.alsoResize)):a.each(e.alsoResize,function(a){f(a)}):f(e.alsoResize)},resize:function(b,c){var d=a(this).data("resizable"),e=d.options,f=d.originalSize,g=d.originalPosition,h={height:d.size.height-f.height||0,width:d.size.width-f.width||0,top:d.position.top-g.top||0,left:d.position.left-g.left||0},i=function(b,d){a(b).each(function(){var b=a(this),e=a(this).data("resizable-alsoresize"),f={},g=d&&d.length?d:b.parents(c.originalElement[0]).length?[
 "width","height"]:["width","height","top","left"];a.each(g,function(a,b){var c=(e[b]||0)+(h[b]||0);c&&c>=0&&(f[b]=c||null)}),b.css(f)})};typeof e.alsoResize=="object"&&!e.alsoResize.nodeType?a.each(e.alsoResize,function(a,b){i(a,b)}):i(e.alsoResize)},stop:function(b,c){a(this).removeData("resizable-alsoresize")}}),a.ui.plugin.add("resizable","animate",{stop:function(b,c){var d=a(this).data("resizable"),e=d.options,f=d._proportionallyResizeElements,g=f.length&&/textarea/i.test(f[0].nodeName),h=g&&a.ui.hasScroll(f[0],"left")?0:d.sizeDiff.height,i=g?0:d.sizeDiff.width,j={width:d.size.width-i,height:d.size.height-h},k=parseInt(d.element.css("left"),10)+(d.position.left-d.originalPosition.left)||null,l=parseInt(d.element.css("top"),10)+(d.position.top-d.originalPosition.top)||null;d.element.animate(a.extend(j,l&&k?{top:l,left:k}:{}),{duration:e.animateDuration,easing:e.animateEasing,step:function(){var c={width:parseInt(d.element.css("width"),10),height:parseInt(d.element.css("height"),1
 0),top:parseInt(d.element.css("top"),10),left:parseInt(d.element.css("left"),10)};f&&f.length&&a(f[0]).css({width:c.width,height:c.height}),d._updateCache(c),d._propagate("resize",b)}})}}),a.ui.plugin.add("resizable","containment",{start:function(b,d){var e=a(this).data("resizable"),f=e.options,g=e.element,h=f.containment,i=h instanceof a?h.get(0):/parent/.test(h)?g.parent().get(0):h;if(!i)return;e.containerElement=a(i);if(/document/.test(h)||h==document)e.containerOffset={left:0,top:0},e.containerPosition={left:0,top:0},e.parentData={element:a(document),left:0,top:0,width:a(document).width(),height:a(document).height()||document.body.parentNode.scrollHeight};else{var j=a(i),k=[];a(["Top","Right","Left","Bottom"]).each(function(a,b){k[a]=c(j.css("padding"+b))}),e.containerOffset=j.offset(),e.containerPosition=j.position(),e.containerSize={height:j.innerHeight()-k[3],width:j.innerWidth()-k[1]};var l=e.containerOffset,m=e.containerSize.height,n=e.containerSize.width,o=a.ui.hasScroll(i
 ,"left")?i.scrollWidth:n,p=a.ui.hasScroll(i)?i.scrollHeight:m;e.parentData={element:i,left:l.left,top:l.top,width:o,height:p}}},resize:function(b,c){var d=a(this).data("resizable"),e=d.options,f=d.containerSize,g=d.containerOffset,h=d.size,i=d.position,j=d._aspectRatio||b.shiftKey,k={top:0,left:0},l=d.containerElement;l[0]!=document&&/static/.test(l.css("position"))&&(k=g),i.left<(d._helper?g.left:0)&&(d.size.width=d.size.width+(d._helper?d.position.left-g.left:d.position.left-k.left),j&&(d.size.height=d.size.width/d.aspectRatio),d.position.left=e.helper?g.left:0),i.top<(d._helper?g.top:0)&&(d.size.height=d.size.height+(d._helper?d.position.top-g.top:d.position.top),j&&(d.size.width=d.size.height*d.aspectRatio),d.position.top=d._helper?g.top:0),d.offset.left=d.parentData.left+d.position.left,d.offset.top=d.parentData.top+d.position.top;var m=Math.abs((d._helper?d.offset.left-k.left:d.offset.left-k.left)+d.sizeDiff.width),n=Math.abs((d._helper?d.offset.top-k.top:d.offset.top-g.top)+d
 .sizeDiff.height),o=d.containerElement.get(0)==d.element.parent().get(0),p=/relative|absolute/.test(d.containerElement.css("position"));o&&p&&(m-=d.parentData.left),m+d.size.width>=d.parentData.width&&(d.size.width=d.parentData.width-m,j&&(d.size.height=d.size.width/d.aspectRatio)),n+d.size.height>=d.parentData.height&&(d.size.height=d.parentData.height-n,j&&(d.size.width=d.size.height*d.aspectRatio))},stop:function(b,c){var d=a(this).data("resizable"),e=d.options,f=d.position,g=d.containerOffset,h=d.containerPosition,i=d.containerElement,j=a(d.helper),k=j.offset(),l=j.outerWidth()-d.sizeDiff.width,m=j.outerHeight()-d.sizeDiff.height;d._helper&&!e.animate&&/relative/.test(i.css("position"))&&a(this).css({left:k.left-h.left-g.left,width:l,height:m}),d._helper&&!e.animate&&/static/.test(i.css("position"))&&a(this).css({left:k.left-h.left-g.left,width:l,height:m})}}),a.ui.plugin.add("resizable","ghost",{start:function(b,c){var d=a(this).data("resizable"),e=d.options,f=d.size;d.ghost=d.
 originalElement.clone(),d.ghost.css({opacity:.25,display:"block",position:"relative",height:f.height,width:f.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass(typeof e.ghost=="string"?e.ghost:""),d.ghost.appendTo(d.helper)},resize:function(b,c){var d=a(this).data("resizable"),e=d.options;d.ghost&&d.ghost.css({position:"relative",height:d.size.height,width:d.size.width})},stop:function(b,c){var d=a(this).data("resizable"),e=d.options;d.ghost&&d.helper&&d.helper.get(0).removeChild(d.ghost.get(0))}}),a.ui.plugin.add("resizable","grid",{resize:function(b,c){var d=a(this).data("resizable"),e=d.options,f=d.size,g=d.originalSize,h=d.originalPosition,i=d.axis,j=e._aspectRatio||b.shiftKey;e.grid=typeof e.grid=="number"?[e.grid,e.grid]:e.grid;var k=Math.round((f.width-g.width)/(e.grid[0]||1))*(e.grid[0]||1),l=Math.round((f.height-g.height)/(e.grid[1]||1))*(e.grid[1]||1);/^(se|s|e)$/.test(i)?(d.size.width=g.width+k,d.size.height=g.height+l):/^(ne)$/.test(i)?(d.size.width=g.
 width+k,d.size.height=g.height+l,d.position.top=h.top-l):/^(sw)$/.test(i)?(d.size.width=g.width+k,d.size.height=g.height+l,d.position.left=h.left-k):(d.size.width=g.width+k,d.size.height=g.height+l,d.position.top=h.top-l,d.position.left=h.left-k)}});var c=function(a){return parseInt(a,10)||0},d=function(a){return!isNaN(parseInt(a,10))}})(jQuery);;/*! jQuery UI - v1.8.21 - 2012-06-05
-* https://github.com/jquery/jquery-ui
-* Includes: jquery.ui.selectable.js
-* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */
-(function(a,b){a.widget("ui.selectable",a.ui.mouse,{options:{appendTo:"body",autoRefresh:!0,distance:0,filter:"*",tolerance:"touch"},_create:function(){var b=this;this.element.addClass("ui-selectable"),this.dragged=!1;var c;this.refresh=function(){c=a(b.options.filter,b.element[0]),c.addClass("ui-selectee"),c.each(function(){var b=a(this),c=b.offset();a.data(this,"selectable-item",{element:this,$element:b,left:c.left,top:c.top,right:c.left+b.outerWidth(),bottom:c.top+b.outerHeight(),startselected:!1,selected:b.hasClass("ui-selected"),selecting:b.hasClass("ui-selecting"),unselecting:b.hasClass("ui-unselecting")})})},this.refresh(),this.selectees=c.addClass("ui-selectee"),this._mouseInit(),this.helper=a("<div class='ui-selectable-helper'></div>")},destroy:function(){return this.selectees.removeClass("ui-selectee").removeData("selectable-item"),this.element.removeClass("ui-selectable ui-selectable-disabled").removeData("selectable").unbind(".selectable"),this._mouseDestroy(),this},_mou
 seStart:function(b){var c=this;this.opos=[b.pageX,b.pageY];if(this.options.disabled)return;var d=this.options;this.selectees=a(d.filter,this.element[0]),this._trigger("start",b),a(d.appendTo).append(this.helper),this.helper.css({left:b.clientX,top:b.clientY,width:0,height:0}),d.autoRefresh&&this.refresh(),this.selectees.filter(".ui-selected").each(function(){var d=a.data(this,"selectable-item");d.startselected=!0,!b.metaKey&&!b.ctrlKey&&(d.$element.removeClass("ui-selected"),d.selected=!1,d.$element.addClass("ui-unselecting"),d.unselecting=!0,c._trigger("unselecting",b,{unselecting:d.element}))}),a(b.target).parents().andSelf().each(function(){var d=a.data(this,"selectable-item");if(d){var e=!b.metaKey&&!b.ctrlKey||!d.$element.hasClass("ui-selected");return d.$element.removeClass(e?"ui-unselecting":"ui-selected").addClass(e?"ui-selecting":"ui-unselecting"),d.unselecting=!e,d.selecting=e,d.selected=e,e?c._trigger("selecting",b,{selecting:d.element}):c._trigger("unselecting",b,{unsele
 cting:d.element}),!1}})},_mouseDrag:function(b){var c=this;this.dragged=!0;if(this.options.disabled)return;var d=this.options,e=this.opos[0],f=this.opos[1],g=b.pageX,h=b.pageY;if(e>g){var i=g;g=e,e=i}if(f>h){var i=h;h=f,f=i}return this.helper.css({left:e,top:f,width:g-e,height:h-f}),this.selectees.each(function(){var i=a.data(this,"selectable-item");if(!i||i.element==c.element[0])return;var j=!1;d.tolerance=="touch"?j=!(i.left>g||i.right<e||i.top>h||i.bottom<f):d.tolerance=="fit"&&(j=i.left>e&&i.right<g&&i.top>f&&i.bottom<h),j?(i.selected&&(i.$element.removeClass("ui-selected"),i.selected=!1),i.unselecting&&(i.$element.removeClass("ui-unselecting"),i.unselecting=!1),i.selecting||(i.$element.addClass("ui-selecting"),i.selecting=!0,c._trigger("selecting",b,{selecting:i.element}))):(i.selecting&&((b.metaKey||b.ctrlKey)&&i.startselected?(i.$element.removeClass("ui-selecting"),i.selecting=!1,i.$element.addClass("ui-selected"),i.selected=!0):(i.$element.removeClass("ui-selecting"),i.selec
 ting=!1,i.startselected&&(i.$element.addClass("ui-unselecting"),i.unselecting=!0),c._trigger("unselecting",b,{unselecting:i.element}))),i.selected&&!b.metaKey&&!b.ctrlKey&&!i.startselected&&(i.$element.removeClass("ui-selected"),i.selected=!1,i.$element.addClass("ui-unselecting"),i.unselecting=!0,c._trigger("unselecting",b,{unselecting:i.element})))}),!1},_mouseStop:function(b){var c=this;this.dragged=!1;var d=this.options;return a(".ui-unselecting",this.element[0]).each(function(){var d=a.data(this,"selectable-item");d.$element.removeClass("ui-unselecting"),d.unselecting=!1,d.startselected=!1,c._trigger("unselected",b,{unselected:d.element})}),a(".ui-selecting",this.element[0]).each(function(){var d=a.data(this,"selectable-item");d.$element.removeClass("ui-selecting").addClass("ui-selected"),d.selecting=!1,d.selected=!0,d.startselected=!0,c._trigger("selected",b,{selected:d.element})}),this._trigger("stop",b),this.helper.remove(),!1}}),a.extend(a.ui.selectable,{version:"1.8.21"})})
 (jQuery);;/*! jQuery UI - v1.8.21 - 2012-06-05
-* https://github.com/jquery/jquery-ui
-* Includes: jquery.ui.sortable.js
-* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */
-(function(a,b){a.widget("ui.sortable",a.ui.mouse,{widgetEventPrefix:"sort",ready:!1,options:{appendTo:"parent",axis:!1,connectWith:!1,containment:!1,cursor:"auto",cursorAt:!1,dropOnEmpty:!0,forcePlaceholderSize:!1,forceHelperSize:!1,grid:!1,handle:!1,helper:"original",items:"> *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1e3},_create:function(){var a=this.options;this.containerCache={},this.element.addClass("ui-sortable"),this.refresh(),this.floating=this.items.length?a.axis==="x"||/left|right/.test(this.items[0].item.css("float"))||/inline|table-cell/.test(this.items[0].item.css("display")):!1,this.offset=this.element.offset(),this._mouseInit(),this.ready=!0},destroy:function(){a.Widget.prototype.destroy.call(this),this.element.removeClass("ui-sortable ui-sortable-disabled"),this._mouseDestroy();for(var b=this.items.length-1;b>=0;b--)this.items[b].item.removeData(this.widgetName+"-item");return thi
 s},_setOption:function(b,c){b==="disabled"?(this.options[b]=c,this.widget()[c?"addClass":"removeClass"]("ui-sortable-disabled")):a.Widget.prototype._setOption.apply(this,arguments)},_mouseCapture:function(b,c){var d=this;if(this.reverting)return!1;if(this.options.disabled||this.options.type=="static")return!1;this._refreshItems(b);var e=null,f=this,g=a(b.target).parents().each(function(){if(a.data(this,d.widgetName+"-item")==f)return e=a(this),!1});a.data(b.target,d.widgetName+"-item")==f&&(e=a(b.target));if(!e)return!1;if(this.options.handle&&!c){var h=!1;a(this.options.handle,e).find("*").andSelf().each(function(){this==b.target&&(h=!0)});if(!h)return!1}return this.currentItem=e,this._removeCurrentsFromItems(),!0},_mouseStart:function(b,c,d){var e=this.options,f=this;this.currentContainer=this,this.refreshPositions(),this.helper=this._createHelper(b),this._cacheHelperProportions(),this._cacheMargins(),this.scrollParent=this.helper.scrollParent(),this.offset=this.currentItem.offset
 (),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},a.extend(this.offset,{click:{left:b.pageX-this.offset.left,top:b.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.helper.css("position","absolute"),this.cssPosition=this.helper.css("position"),this.originalPosition=this._generatePosition(b),this.originalPageX=b.pageX,this.originalPageY=b.pageY,e.cursorAt&&this._adjustOffsetFromHelper(e.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!=this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),e.containment&&this._setContainment(),e.cursor&&(a("body").css("cursor")&&(this._storedCursor=a("body").css("cursor")),a("body").css("cursor",e.cursor)),e.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",e.opacity)),e.zIndex&&(this.helper.css("zIndex")&&(this._storedZIn
 dex=this.helper.css("zIndex")),this.helper.css("zIndex",e.zIndex)),this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",b,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions();if(!d)for(var g=this.containers.length-1;g>=0;g--)this.containers[g]._trigger("activate",b,f._uiHash(this));return a.ui.ddmanager&&(a.ui.ddmanager.current=this),a.ui.ddmanager&&!e.dropBehaviour&&a.ui.ddmanager.prepareOffsets(this,b),this.dragging=!0,this.helper.addClass("ui-sortable-helper"),this._mouseDrag(b),!0},_mouseDrag:function(b){this.position=this._generatePosition(b),this.positionAbs=this._convertPositionTo("absolute"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs);if(this.options.scroll){var c=this.options,d=!1;this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-b.pageY<c.scrollSensitivity?this.scro
 llParent[0].scrollTop=d=this.scrollParent[0].scrollTop+c.scrollSpeed:b.pageY-this.overflowOffset.top<c.scrollSensitivity&&(this.scrollParent[0].scrollTop=d=this.scrollParent[0].scrollTop-c.scrollSpeed),this.overflowOffset.left+this.scrollParent[0].offsetWidth-b.pageX<c.scrollSensitivity?this.scrollParent[0].scrollLeft=d=this.scrollParent[0].scrollLeft+c.scrollSpeed:b.pageX-this.overflowOffset.left<c.scrollSensitivity&&(this.scrollParent[0].scrollLeft=d=this.scrollParent[0].scrollLeft-c.scrollSpeed)):(b.pageY-a(document).scrollTop()<c.scrollSensitivity?d=a(document).scrollTop(a(document).scrollTop()-c.scrollSpeed):a(window).height()-(b.pageY-a(document).scrollTop())<c.scrollSensitivity&&(d=a(document).scrollTop(a(document).scrollTop()+c.scrollSpeed)),b.pageX-a(document).scrollLeft()<c.scrollSensitivity?d=a(document).scrollLeft(a(document).scrollLeft()-c.scrollSpeed):a(window).width()-(b.pageX-a(document).scrollLeft())<c.scrollSensitivity&&(d=a(document).scrollLeft(a(document).scrollL
 eft()+c.scrollSpeed))),d!==!1&&a.ui.ddmanager&&!c.dropBehaviour&&a.ui.ddmanager.prepareOffsets(this,b)}this.positionAbs=this._convertPositionTo("absolute");if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+"px";if(!this.options.axis||this.options.axis!="x")this.helper[0].style.top=this.position.top+"px";for(var e=this.items.length-1;e>=0;e--){var f=this.items[e],g=f.item[0],h=this._intersectsWithPointer(f);if(!h)continue;if(g!=this.currentItem[0]&&this.placeholder[h==1?"next":"prev"]()[0]!=g&&!a.ui.contains(this.placeholder[0],g)&&(this.options.type=="semi-dynamic"?!a.ui.contains(this.element[0],g):!0)){this.direction=h==1?"down":"up";if(this.options.tolerance=="pointer"||this._intersectsWithSides(f))this._rearrange(b,f);else break;this._trigger("change",b,this._uiHash());break}}return this._contactContainers(b),a.ui.ddmanager&&a.ui.ddmanager.drag(this,b),this._trigger("sort",b,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseS
 top:function(b,c){if(!b)return;a.ui.ddmanager&&!this.options.dropBehaviour&&a.ui.ddmanager.drop(this,b);if(this.options.revert){var d=this,e=d.placeholder.offset();d.reverting=!0,a(this.helper).animate({left:e.left-this.offset.parent.left-d.margins.left+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft),top:e.top-this.offset.parent.top-d.margins.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)},parseInt(this.options.revert,10)||500,function(){d._clear(b)})}else this._clear(b,c);return!1},cancel:function(){var b=this;if(this.dragging){this._mouseUp({target:null}),this.options.helper=="original"?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):this.currentItem.show();for(var c=this.containers.length-1;c>=0;c--)this.containers[c]._trigger("deactivate",null,b._uiHash(this)),this.containers[c].containerCache.over&&(this.containers[c]._trigger("out",null,b._uiHash(this)),this.containers[c].containerCache.over=0)}return 
 this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.options.helper!="original"&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),a.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?a(this.domPosition.prev).after(this.currentItem):a(this.domPosition.parent).prepend(this.currentItem)),this},serialize:function(b){var c=this._getItemsAsjQuery(b&&b.connected),d=[];return b=b||{},a(c).each(function(){var c=(a(b.item||this).attr(b.attribute||"id")||"").match(b.expression||/(.+)[-=_](.+)/);c&&d.push((b.key||c[1]+"[]")+"="+(b.key&&b.expression?c[1]:c[2]))}),!d.length&&b.key&&d.push(b.key+"="),d.join("&")},toArray:function(b){var c=this._getItemsAsjQuery(b&&b.connected),d=[];return b=b||{},c.each(function(){d.push(a(b.item||this).attr(b.attribute||"id")||"")}),d},_intersectsWith:function(a){var b=this.positionAbs.left,c=b+this.helperProportions.width,d=this.positionAbs.top
 ,e=d+this.helperProportions.height,f=a.left,g=f+a.width,h=a.top,i=h+a.height,j=this.offset.click.top,k=this.offset.click.left,l=d+j>h&&d+j<i&&b+k>f&&b+k<g;return this.options.tolerance=="pointer"||this.options.forcePointerForContainers||this.options.tolerance!="pointer"&&this.helperProportions[this.floating?"width":"height"]>a[this.floating?"width":"height"]?l:f<b+this.helperProportions.width/2&&c-this.helperProportions.width/2<g&&h<d+this.helperProportions.height/2&&e-this.helperProportions.height/2<i},_intersectsWithPointer:function(b){var c=this.options.axis==="x"||a.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,b.top,b.height),d=this.options.axis==="y"||a.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,b.left,b.width),e=c&&d,f=this._getDragVerticalDirection(),g=this._getDragHorizontalDirection();return e?this.floating?g&&g=="right"||f=="down"?2:1:f&&(f=="down"?2:1):!1},_intersectsWithSides:function(b){var c=a.ui.isOverAxis(this.positionAbs.top+this.offset.c
 lick.top,b.top+b.height/2,b.height),d=a.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,b.left+b.width/2,b.width),e=this._getDragVerticalDirection(),f=this._getDragHorizontalDirection();return this.floating&&f?f=="right"&&d||f=="left"&&!d:e&&(e=="down"&&c||e=="up"&&!c)},_getDragVerticalDirection:function(){var a=this.positionAbs.top-this.lastPositionAbs.top;return a!=0&&(a>0?"down":"up")},_getDragHorizontalDirection:function(){var a=this.positionAbs.left-this.lastPositionAbs.left;return a!=0&&(a>0?"right":"left")},refresh:function(a){return this._refreshItems(a),this.refreshPositions(),this},_connectWith:function(){var a=this.options;return a.connectWith.constructor==String?[a.connectWith]:a.connectWith},_getItemsAsjQuery:function(b){var c=this,d=[],e=[],f=this._connectWith();if(f&&b)for(var g=f.length-1;g>=0;g--){var h=a(f[g]);for(var i=h.length-1;i>=0;i--){var j=a.data(h[i],this.widgetName);j&&j!=this&&!j.options.disabled&&e.push([a.isFunction(j.options.items)?j.options
 .items.call(j.element):a(j.options.items,j.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),j])}}e.push([a.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):a(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]);for(var g=e.length-1;g>=0;g--)e[g][0].each(function(){d.push(this)});return a(d)},_removeCurrentsFromItems:function(){var a=this.currentItem.find(":data("+this.widgetName+"-item)");for(var b=0;b<this.items.length;b++)for(var c=0;c<a.length;c++)a[c]==this.items[b].item[0]&&this.items.splice(b,1)},_refreshItems:function(b){this.items=[],this.containers=[this];var c=this.items,d=this,e=[[a.isFunction(this.options.items)?this.options.items.call(this.element[0],b,{item:this.currentItem}):a(this.options.items,this.element),this]],f=this._connectWith();if(f&&this.ready)for(var g=f.length-1;g>=0;g--){var h=a(f[g]);for(var i=h.length-1;i>=0;i--){var j=
 a.data(h[i],this.widgetName);j&&j!=this&&!j.options.disabled&&(e.push([a.isFunction(j.options.items)?j.options.items.call(j.element[0],b,{item:this.currentItem}):a(j.options.items,j.element),j]),this.containers.push(j))}}for(var g=e.length-1;g>=0;g--){var k=e[g][1],l=e[g][0];for(var i=0,m=l.length;i<m;i++){var n=a(l[i]);n.data(this.widgetName+"-item",k),c.push({item:n,instance:k,width:0,height:0,left:0,top:0})}}},refreshPositions:function(b){this.offsetParent&&this.helper&&(this.offset.parent=this._getParentOffset());for(var c=this.items.length-1;c>=0;c--){var d=this.items[c];if(d.instance!=this.currentContainer&&this.currentContainer&&d.item[0]!=this.currentItem[0])continue;var e=this.options.toleranceElement?a(this.options.toleranceElement,d.item):d.item;b||(d.width=e.outerWidth(),d.height=e.outerHeight());var f=e.offset();d.left=f.left,d.top=f.top}if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(var c=this.con
 tainers.length-1;c>=0;c--){var f=this.containers[c].element.offset();this.containers[c].containerCache.left=f.left,this.containers[c].containerCache.top=f.top,this.containers[c].containerCache.width=this.containers[c].element.outerWidth(),this.containers[c].containerCache.height=this.containers[c].element.outerHeight()}return this},_createPlaceholder:function(b){var c=b||this,d=c.options;if(!d.placeholder||d.placeholder.constructor==String){var e=d.placeholder;d.placeholder={element:function(){var b=a(document.createElement(c.currentItem[0].nodeName)).addClass(e||c.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper")[0];return e||(b.style.visibility="hidden"),b},update:function(a,b){if(e&&!d.forcePlaceholderSize)return;b.height()||b.height(c.currentItem.innerHeight()-parseInt(c.currentItem.css("paddingTop")||0,10)-parseInt(c.currentItem.css("paddingBottom")||0,10)),b.width()||b.width(c.currentItem.innerWidth()-parseInt(c.currentItem.css("paddingLeft
 ")||0,10)-parseInt(c.currentItem.css("paddingRight")||0,10))}}}c.placeholder=a(d.placeholder.element.call(c.element,c.currentItem)),c.currentItem.after(c.placeholder),d.placeholder.update(c,c.placeholder)},_contactContainers:function(b){var c=null,d=null;for(var e=this.containers.length-1;e>=0;e--){if(a.ui.contains(this.currentItem[0],this.containers[e].element[0]))continue;if(this._intersectsWith(this.containers[e].containerCache)){if(c&&a.ui.contains(this.containers[e].element[0],c.element[0]))continue;c=this.containers[e],d=e}else this.containers[e].containerCache.over&&(this.containers[e]._trigger("out",b,this._uiHash(this)),this.containers[e].containerCache.over=0)}if(!c)return;if(this.containers.length===1)this.containers[d]._trigger("over",b,this._uiHash(this)),this.containers[d].containerCache.over=1;else if(this.currentContainer!=this.containers[d]){var f=1e4,g=null,h=this.positionAbs[this.containers[d].floating?"left":"top"];for(var i=this.items.length-1;i>=0;i--){if(!a.ui
 .contains(this.containers[d].element[0],this.items[i].item[0]))continue;var j=this.containers[d].floating?this.items[i].item.offset().left:this.items[i].item.offset().top;Math.abs(j-h)<f&&(f=Math.abs(j-h),g=this.items[i],this.direction=j-h>0?"down":"up")}if(!g&&!this.options.dropOnEmpty)return;this.currentContainer=this.containers[d],g?this._rearrange(b,g,null,!0):this._rearrange(b,null,this.containers[d].element,!0),this._trigger("change",b,this._uiHash()),this.containers[d]._trigger("change",b,this._uiHash(this)),this.options.placeholder.update(this.currentContainer,this.placeholder),this.containers[d]._trigger("over",b,this._uiHash(this)),this.containers[d].containerCache.over=1}},_createHelper:function(b){var c=this.options,d=a.isFunction(c.helper)?a(c.helper.apply(this.element[0],[b,this.currentItem])):c.helper=="clone"?this.currentItem.clone():this.currentItem;return d.parents("body").length||a(c.appendTo!="parent"?c.appendTo:this.currentItem[0].parentNode)[0].appendChild(d[0]
 ),d[0]==this.currentItem[0]&&(this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")}),(d[0].style.width==""||c.forceHelperSize)&&d.width(this.currentItem.width()),(d[0].style.height==""||c.forceHelperSize)&&d.height(this.currentItem.height()),d},_adjustOffsetFromHelper:function(b){typeof b=="string"&&(b=b.split(" ")),a.isArray(b)&&(b={left:+b[0],top:+b[1]||0}),"left"in b&&(this.offset.click.left=b.left+this.margins.left),"right"in b&&(this.offset.click.left=this.helperProportions.width-b.right+this.margins.left),"top"in b&&(this.offset.click.top=b.top+this.margins.top),"bottom"in b&&(this.offset.click.top=this.helperProportions.height-b.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var b=this.offsetParent.offset();this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&a.ui.cont
 ains(this.scrollParent[0],this.offsetParent[0])&&(b.left+=this.scrollParent.scrollLeft(),b.top+=this.scrollParent.scrollTop());if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&a.browser.msie)b={top:0,left:0};return{top:b.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:b.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var a=this.currentItem.position();return{top:a.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:a.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}}
 ,_setContainment:function(){var b=this.options;b.containment=="parent"&&(b.containment=this.helper[0].parentNode);if(b.containment=="document"||b.containment=="window")this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,a(b.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(a(b.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(b.containment)){var c=a(b.containment)[0],d=a(b.containment).offset(),e=a(c).css("overflow")!="hidden";this.containment=[d.left+(parseInt(a(c).css("borderLeftWidth"),10)||0)+(parseInt(a(c).css("paddingLeft"),10)||0)-this.margins.left,d.top+(parseInt(a(c).css("borderTopWidth"),10)||0)+(parseInt(a(c).css("paddingTop"),10)||0)-this.margins.top,d.left+(e?Math.max(c.scrollWidth,c.offsetWidth):c.offsetWidth)-(parseInt(a(c).css("bo
 rderLeftWidth"),10)||0)-(parseInt(a(c).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,d.top+(e?Math.max(c.scrollHeight,c.offsetHeight):c.offsetHeight)-(parseInt(a(c).css("borderTopWidth"),10)||0)-(parseInt(a(c).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}},_convertPositionTo:function(b,c){c||(c=this.position);var d=b=="absolute"?1:-1,e=this.options,f=this.cssPosition=="absolute"&&(this.scrollParent[0]==document||!a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,g=/(html|body)/i.test(f[0].tagName);return{top:c.top+this.offset.relative.top*d+this.offset.parent.top*d-(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():g?0:f.scrollTop())*d),left:c.left+this.offset.relative.left*d+this.offset.parent.left*d-(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():g?0:f.scrollLeft())*d
 )}},_generatePosition:function(b){var c=this.options,d=this.cssPosition=="absolute"&&(this.scrollParent[0]==document||!a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,e=/(html|body)/i.test(d[0].tagName);this.cssPosition=="relative"&&(this.scrollParent[0]==document||this.scrollParent[0]==this.offsetParent[0])&&(this.offset.relative=this._getRelativeOffset());var f=b.pageX,g=b.pageY;if(this.originalPosition){this.containment&&(b.pageX-this.offset.click.left<this.containment[0]&&(f=this.containment[0]+this.offset.click.left),b.pageY-this.offset.click.top<this.containment[1]&&(g=this.containment[1]+this.offset.click.top),b.pageX-this.offset.click.left>this.containment[2]&&(f=this.containment[2]+this.offset.click.left),b.pageY-this.offset.click.top>this.containment[3]&&(g=this.containment[3]+this.offset.click.top));if(c.grid){var h=this.originalPageY+Math.round((g-this.originalPageY)/c.grid[1])*c.grid[1];g=this.containment?h-this.offset.click
 .top<this.containment[1]||h-this.offset.click.top>this.containment[3]?h-this.offset.click.top<this.containment[1]?h+c.grid[1]:h-c.grid[1]:h:h;var i=this.originalPageX+Math.round((f-this.originalPageX)/c.grid[0])*c.grid[0];f=this.containment?i-this.offset.click.left<this.containment[0]||i-this.offset.click.left>this.containment[2]?i-this.offset.click.left<this.containment[0]?i+c.grid[0]:i-c.grid[0]:i:i}}return{top:g-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(a.browser.safari&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollTop():e?0:d.scrollTop()),left:f-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(a.browser.safari&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():e?0:d.scrollLeft())}},_rearrange:function(a,b,c,d){c?c[0].appendChild(this.placeholder[0]):b.item[0].parentNode.insertBefore(this.placeholder[0],this.direction=="down"?b.item[0]:b.item[0].nextSibling)
 ,this.counter=this.counter?++this.counter:1;var e=this,f=this.counter;window.setTimeout(function(){f==e.counter&&e.refreshPositions(!d)},0)},_clear:function(b,c){this.reverting=!1;var d=[],e=this;!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem),this._noFinalSort=null;if(this.helper[0]==this.currentItem[0]){for(var f in this._storedCSS)if(this._storedCSS[f]=="auto"||this._storedCSS[f]=="static")this._storedCSS[f]="";this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else this.currentItem.show();this.fromOutside&&!c&&d.push(function(a){this._trigger("receive",a,this._uiHash(this.fromOutside))}),(this.fromOutside||this.domPosition.prev!=this.currentItem.prev().not(".ui-sortable-helper")[0]||this.domPosition.parent!=this.currentItem.parent()[0])&&!c&&d.push(function(a){this._trigger("update",a,this._uiHash())});if(!a.ui.contains(this.element[0],this.currentItem[0])){c||d.push(function(a){this._trigger("remove",a,this._u
 iHash())});for(var f=this.containers.length-1;f>=0;f--)a.ui.contains(this.containers[f].element[0],this.currentItem[0])&&!c&&(d.push(function(a){return function(b){a._trigger("receive",b,this._uiHash(this))}}.call(this,this.containers[f])),d.push(function(a){return function(b){a._trigger("update",b,this._uiHash(this))}}.call(this,this.containers[f])))}for(var f=this.containers.length-1;f>=0;f--)c||d.push(function(a){return function(b){a._trigger("deactivate",b,this._uiHash(this))}}.call(this,this.containers[f])),this.containers[f].containerCache.over&&(d.push(function(a){return function(b){a._trigger("out",b,this._uiHash(this))}}.call(this,this.containers[f])),this.containers[f].containerCache.over=0);this._storedCursor&&a("body").css("cursor",this._storedCursor),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex",this._storedZIndex=="auto"?"":this._storedZIndex),this.dragging=!1;if(this.cancelHelperRemoval){if(!c){this._t
 rigger("beforeStop",b,this._uiHash());for(var f=0;f<d.length;f++)d[f].call(this,b);this._trigger("stop",b,this._uiHash())}return!1}c||this._trigger("beforeStop",b,this._uiHash()),this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.helper[0]!=this.currentItem[0]&&this.helper.remove(),this.helper=null;if(!c){for(var f=0;f<d.length;f++)d[f].call(this,b);this._trigger("stop",b,this._uiHash())}return this.fromOutside=!1,!0},_trigger:function(){a.Widget.prototype._trigger.apply(this,arguments)===!1&&this.cancel()},_uiHash:function(b){var c=b||this;return{helper:c.helper,placeholder:c.placeholder||a([]),position:c.position,originalPosition:c.originalPosition,offset:c.positionAbs,item:c.currentItem,sender:b?b.element:null}}}),a.extend(a.ui.sortable,{version:"1.8.21"})})(jQuery);;/*! jQuery UI - v1.8.21 - 2012-06-05
-* https://github.com/jquery/jquery-ui
-* Includes: jquery.ui.accordion.js
-* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */
-(function(a,b){a.widget("ui.accordion",{options:{active:0,animated:"slide",autoHeight:!0,clearStyle:!1,collapsible:!1,event:"click",fillSpace:!1,header:"> li > :first-child,> :not(li):even",icons:{header:"ui-icon-triangle-1-e",headerSelected:"ui-icon-triangle-1-s"},navigation:!1,navigationFilter:function(){return this.href.toLowerCase()===location.href.toLowerCase()}},_create:function(){var b=this,c=b.options;b.running=0,b.element.addClass("ui-accordion ui-widget ui-helper-reset").children("li").addClass("ui-accordion-li-fix"),b.headers=b.element.find(c.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all").bind("mouseenter.accordion",function(){if(c.disabled)return;a(this).addClass("ui-state-hover")}).bind("mouseleave.accordion",function(){if(c.disabled)return;a(this).removeClass("ui-state-hover")}).bind("focus.accordion",function(){if(c.disabled)return;a(this).addClass("ui-state-focus")}).bind("blur.accordion",function(){if(c.disabled)return;a(this)
 .removeClass("ui-state-focus")}),b.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom");if(c.navigation){var d=b.element.find("a").filter(c.navigationFilter).eq(0);if(d.length){var e=d.closest(".ui-accordion-header");e.length?b.active=e:b.active=d.closest(".ui-accordion-content").prev()}}b.active=b._findActive(b.active||c.active).addClass("ui-state-default ui-state-active").toggleClass("ui-corner-all").toggleClass("ui-corner-top"),b.active.next().addClass("ui-accordion-content-active"),b._createIcons(),b.resize(),b.element.attr("role","tablist"),b.headers.attr("role","tab").bind("keydown.accordion",function(a){return b._keydown(a)}).next().attr("role","tabpanel"),b.headers.not(b.active||"").attr({"aria-expanded":"false","aria-selected":"false",tabIndex:-1}).next().hide(),b.active.length?b.active.attr({"aria-expanded":"true","aria-selected":"true",tabIndex:0}):b.headers.eq(0).attr("tabIndex",0),a.browser.safari||b.headers.find("a").attr("
 tabIndex",-1),c.event&&b.headers.bind(c.event.split(" ").join(".accordion ")+".accordion",function(a){b._clickHandler.call(b,a,this),a.preventDefault()})},_createIcons:function(){var b=this.options;b.icons&&(a("<span></span>").addClass("ui-icon "+b.icons.header).prependTo(this.headers),this.active.children(".ui-icon").toggleClass(b.icons.header).toggleClass(b.icons.headerSelected),this.element.addClass("ui-accordion-icons"))},_destroyIcons:function(){this.headers.children(".ui-icon").remove(),this.element.removeClass("ui-accordion-icons")},destroy:function(){var b=this.options;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role"),this.headers.unbind(".accordion").removeClass("ui-accordion-header ui-accordion-disabled ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top").removeAttr("role").removeAttr("aria-expanded").removeAttr("aria-selected").removeAttr("tabIndex"),this.headers.find("a").removeAttr("tabIndex
 "),this._destroyIcons();var c=this.headers.next().css("display","").removeAttr("role").removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-accordion-disabled ui-state-disabled");return(b.autoHeight||b.fillHeight)&&c.css("height",""),a.Widget.prototype.destroy.call(this)},_setOption:function(b,c){a.Widget.prototype._setOption.apply(this,arguments),b=="active"&&this.activate(c),b=="icons"&&(this._destroyIcons(),c&&this._createIcons()),b=="disabled"&&this.headers.add(this.headers.next())[c?"addClass":"removeClass"]("ui-accordion-disabled ui-state-disabled")},_keydown:function(b){if(this.options.disabled||b.altKey||b.ctrlKey)return;var c=a.ui.keyCode,d=this.headers.length,e=this.headers.index(b.target),f=!1;switch(b.keyCode){case c.RIGHT:case c.DOWN:f=this.headers[(e+1)%d];break;case c.LEFT:case c.UP:f=this.headers[(e-1+d)%d];break;case c.SPACE:case c.ENTER:this._clickHandler({target:b.target},b.target),b.preventDefault()}r
 eturn f?(a(b.target).attr("tabIndex",-1),a(f).attr("tabIndex",0),f.focus(),!1):!0},resize:function(){var b=this.options,c;if(b.fillSpace){if(a.browser.msie){var d=this.eleme

<TRUNCATED>

[082/100] [abbrv] git commit: trying to enable kiwi backend when another profile (e.g. cleanall) is explicitly activated

Posted by wi...@apache.org.
trying to enable kiwi backend when another profile (e.g. cleanall) is explicitly activated


Project: http://git-wip-us.apache.org/repos/asf/marmotta/repo
Commit: http://git-wip-us.apache.org/repos/asf/marmotta/commit/c3b393eb
Tree: http://git-wip-us.apache.org/repos/asf/marmotta/tree/c3b393eb
Diff: http://git-wip-us.apache.org/repos/asf/marmotta/diff/c3b393eb

Branch: refs/heads/ldp
Commit: c3b393eb64a351211e52417b79aa074a0887138e
Parents: e680766
Author: Sergio Fernández <wi...@apache.org>
Authored: Tue Apr 15 14:54:31 2014 +0200
Committer: Sergio Fernández <wi...@apache.org>
Committed: Tue Apr 15 14:54:31 2014 +0200

----------------------------------------------------------------------
 launchers/marmotta-webapp/pom.xml | 2 --
 1 file changed, 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/marmotta/blob/c3b393eb/launchers/marmotta-webapp/pom.xml
----------------------------------------------------------------------
diff --git a/launchers/marmotta-webapp/pom.xml b/launchers/marmotta-webapp/pom.xml
index 3dc1aa2..91d7dda 100644
--- a/launchers/marmotta-webapp/pom.xml
+++ b/launchers/marmotta-webapp/pom.xml
@@ -204,7 +204,6 @@
         <profile>
             <id>kiwi</id>
             <activation>
-                <activeByDefault>true</activeByDefault>
                 <property>
                     <name>marmotta.backend</name>
                     <value>kiwi</value>
@@ -284,7 +283,6 @@
                     <groupId>com.thinkaurelius.titan</groupId>
                     <artifactId>titan-hbase</artifactId>
                     <version>${titan.version}</version>
-
                     <exclusions>
                         <exclusion>
                             <groupId>org.mortbay.jetty</groupId>


[096/100] [abbrv] git commit: Merge remote-tracking branch 'origin/develop' into develop

Posted by wi...@apache.org.
Merge remote-tracking branch 'origin/develop' into develop


Project: http://git-wip-us.apache.org/repos/asf/marmotta/repo
Commit: http://git-wip-us.apache.org/repos/asf/marmotta/commit/c684a1b8
Tree: http://git-wip-us.apache.org/repos/asf/marmotta/tree/c684a1b8
Diff: http://git-wip-us.apache.org/repos/asf/marmotta/diff/c684a1b8

Branch: refs/heads/ldp
Commit: c684a1b8302ad6454ef6b6267c421333ff7df560
Parents: c4d1598 ab80f74
Author: Jakob Frank <ja...@apache.org>
Authored: Tue May 20 12:36:16 2014 +0200
Committer: Jakob Frank <ja...@apache.org>
Committed: Tue May 20 12:36:16 2014 +0200

----------------------------------------------------------------------
 .../ldclient/provider/youtube/YoutubePlaylistProvider.java       | 3 ---
 .../marmotta/ldclient/test/youtube/youtube-playlist.sparql       | 4 ++--
 2 files changed, 2 insertions(+), 5 deletions(-)
----------------------------------------------------------------------



[064/100] [abbrv] git commit: MARMOTTA-438: rebuilt ldp vocab

Posted by wi...@apache.org.
MARMOTTA-438: rebuilt ldp vocab


Project: http://git-wip-us.apache.org/repos/asf/marmotta/repo
Commit: http://git-wip-us.apache.org/repos/asf/marmotta/commit/68d815e5
Tree: http://git-wip-us.apache.org/repos/asf/marmotta/tree/68d815e5
Diff: http://git-wip-us.apache.org/repos/asf/marmotta/diff/68d815e5

Branch: refs/heads/ldp
Commit: 68d815e57116b81e6206b347dca17f5cecc27404
Parents: 41cd34a
Author: Sergio Fernández <wi...@apache.org>
Authored: Tue Apr 8 11:41:55 2014 +0200
Committer: Sergio Fernández <wi...@apache.org>
Committed: Tue Apr 8 11:41:55 2014 +0200

----------------------------------------------------------------------
 .../apache/marmotta/commons/vocabulary/LDP.java | 221 ++++++++++++++++++-
 1 file changed, 219 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/marmotta/blob/68d815e5/commons/marmotta-sesame-tools/marmotta-model-vocabs/src/main/java/org/apache/marmotta/commons/vocabulary/LDP.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-sesame-tools/marmotta-model-vocabs/src/main/java/org/apache/marmotta/commons/vocabulary/LDP.java b/commons/marmotta-sesame-tools/marmotta-model-vocabs/src/main/java/org/apache/marmotta/commons/vocabulary/LDP.java
index 0c9ccbd..1293c1b 100644
--- a/commons/marmotta-sesame-tools/marmotta-model-vocabs/src/main/java/org/apache/marmotta/commons/vocabulary/LDP.java
+++ b/commons/marmotta-sesame-tools/marmotta-model-vocabs/src/main/java/org/apache/marmotta/commons/vocabulary/LDP.java
@@ -21,35 +21,248 @@ import org.openrdf.model.ValueFactory;
 import org.openrdf.model.impl.ValueFactoryImpl;
 
 /**
- * LDP Namespace
+ * W3C Linked Data Platform (LDP).
+ * <p>
+ * This ontology provides an informal representation of the concepts and
+ * terms as defined in the LDP specification. Consult the LDP
+ * specification for normative reference..
+ * <p>
+ * Namespace Ldp.
+ * Prefix: {@code <http://www.w3.org/ns/ldp#>}
+ *
+ * @see <a href="http://www.w3.org/2012/ldp">http://www.w3.org/2012/ldp</a>
+ * @see <a href="http://www.w3.org/TR/ldp-ucr/">http://www.w3.org/TR/ldp-ucr/</a>
+ * @see <a href="http://www.w3.org/TR/ldp/">http://www.w3.org/TR/ldp/</a>
+ * @see <a href="http://www.w3.org/2011/09/LinkedData/">http://www.w3.org/2011/09/LinkedData/</a>
  */
 public class LDP {
 
+    /** {@code http://www.w3.org/ns/ldp#} **/
     public static final String NAMESPACE = "http://www.w3.org/ns/ldp#";
 
+    /** {@code ldp} **/
     public static final String PREFIX = "ldp";
 
+    /**
+     * BasicContainer
+     * <p>
+     * {@code http://www.w3.org/ns/ldp#BasicContainer}.
+     * <p>
+     * An LDPC that uses a predefined predicate to simply link to its
+     * contained resources.
+     *
+     * @see <a href="http://www.w3.org/ns/ldp#BasicContainer">BasicContainer</a>
+     */
     public static final URI BasicContainer;
+
+    /**
+     * Container
+     * <p>
+     * {@code http://www.w3.org/ns/ldp#Container}.
+     * <p>
+     * A Linked Data Platform RDF Source (LDP-RS) that also conforms to
+     * additional patterns and conventions for managing membership. Readers
+     * should refer to the specification defining this ontology for the list
+     * of behaviors associated with it.
+     *
+     * @see <a href="http://www.w3.org/ns/ldp#Container">Container</a>
+     */
     public static final URI Container;
+
+    /**
+     * contains
+     * <p>
+     * {@code http://www.w3.org/ns/ldp#contains}.
+     * <p>
+     * Links a container with resources created through the container.
+     *
+     * @see <a href="http://www.w3.org/ns/ldp#contains">contains</a>
+     */
     public static final URI contains;
+
+    /**
+     * DirectContainer
+     * <p>
+     * {@code http://www.w3.org/ns/ldp#DirectContainer}.
+     * <p>
+     * An LDPC that is similar to a LDP-DC but it allows an indirection with
+     * the ability to list as member a resource, such as a URI representing a
+     * real-world object, that is different from the resource that is created
+     *
+     * @see <a href="http://www.w3.org/ns/ldp#DirectContainer">DirectContainer</a>
+     */
     public static final URI DirectContainer;
+
+    /**
+     * hasMemberRelation
+     * <p>
+     * {@code http://www.w3.org/ns/ldp#hasMemberRelation}.
+     * <p>
+     * Indicates which predicate is used in membership triples, and that the
+     * membership triple pattern is < membership-constant-URI ,
+     * object-of-hasMemberRelation, member-URI >.
+     *
+     * @see <a href="http://www.w3.org/ns/ldp#hasMemberRelation">hasMemberRelation</a>
+     */
     public static final URI hasMemberRelation;
+
+    /**
+     * IndirectContainer
+     * <p>
+     * {@code http://www.w3.org/ns/ldp#IndirectContainer}.
+     * <p>
+     * An LDPC that has the flexibility of choosing what form the membership
+     * triples take.
+     *
+     * @see <a href="http://www.w3.org/ns/ldp#IndirectContainer">IndirectContainer</a>
+     */
     public static final URI IndirectContainer;
+
+    /**
+     * insertedContentRelation
+     * <p>
+     * {@code http://www.w3.org/ns/ldp#insertedContentRelation}.
+     * <p>
+     * Indicates which triple in a creation request should be used as the
+     * member-URI value in the membership triple added when the creation
+     * request is successful.
+     *
+     * @see <a href="http://www.w3.org/ns/ldp#insertedContentRelation">insertedContentRelation</a>
+     */
     public static final URI insertedContentRelation;
+
+    /**
+     * isMemmberOfRelation
+     * <p>
+     * {@code http://www.w3.org/ns/ldp#isMemberOfRelation}.
+     * <p>
+     * Indicates which predicate is used in membership triples, and that the
+     * membership triple pattern is < member-URI ,
+     * object-of-isMemberOfRelation, membership-constant-URI >.
+     *
+     * @see <a href="http://www.w3.org/ns/ldp#isMemberOfRelation">isMemberOfRelation</a>
+     */
     public static final URI isMemberOfRelation;
+
+    /**
+     * member
+     * <p>
+     * {@code http://www.w3.org/ns/ldp#member}.
+     * <p>
+     * LDP servers should use this predicate as the membership predicate if
+     * there is no obvious predicate from an application vocabulary to use.
+     *
+     * @see <a href="http://www.w3.org/ns/ldp#member">member</a>
+     */
     public static final URI member;
+
+    /**
+     * membershipResource
+     * <p>
+     * {@code http://www.w3.org/ns/ldp#membershipResource}.
+     * <p>
+     * Indicates the membership-constant-URI in a membership triple.
+     * Depending upon the membership triple pattern a container uses, as
+     * indicated by the presence of ldp:hasMemberRelation or
+     * ldp:isMemberOfRelation, the membership-constant-URI might occupy
+     * either the subject or object position in membership triples.
+     *
+     * @see <a href="http://www.w3.org/ns/ldp#membershipResource">membershipResource</a>
+     */
     public static final URI membershipResource;
+
+    /**
+     * MemberSubject
+     * <p>
+     * {@code http://www.w3.org/ns/ldp#MemberSubject}.
+     * <p>
+     * Used to indicate default and typical behavior for
+     * ldp:insertedContentRelation, where the member-URI value in the
+     * membership triple added when a creation request is successful is the
+     * URI assigned to the newly created resource.
+     *
+     * @see <a href="http://www.w3.org/ns/ldp#MemberSubject">MemberSubject</a>
+     */
     public static final URI MemberSubject;
+
+    /**
+     * NonRDFSource
+     * <p>
+     * {@code http://www.w3.org/ns/ldp#NonRDFSource}.
+     * <p>
+     * A Linked Data Platform Resource (LDPR) whose state is NOT represented
+     * as RDF.
+     *
+     * @see <a href="http://www.w3.org/ns/ldp#NonRDFSource">NonRDFSource</a>
+     */
     public static final URI NonRDFSource;
+
+    /**
+     * PreferContainment
+     * <p>
+     * {@code http://www.w3.org/ns/ldp#PreferContainment}.
+     * <p>
+     * URI identifying a LDPC's containment triples, for example to allow
+     * clients to express interest in receiving them.
+     *
+     * @see <a href="http://www.w3.org/ns/ldp#PreferContainment">PreferContainment</a>
+     */
     public static final URI PreferContainment;
+
+    /**
+     * PreferEmptyContainer
+     * <p>
+     * {@code http://www.w3.org/ns/ldp#PreferEmptyContainer}.
+     * <p>
+     * URI identifying the subset of a LDPC's triples present in an empty
+     * LDPC, for example to allow clients to express interest in receiving
+     * them. Currently this excludes containment and membership triples, but
+     * in the future other exclusions might be added. This definition is
+     * written to automatically exclude those new classes of triples.
+     *
+     * @see <a href="http://www.w3.org/ns/ldp#PreferEmptyContainer">PreferEmptyContainer</a>
+     */
     public static final URI PreferEmptyContainer;
+
+    /**
+     * PreferMembership
+     * <p>
+     * {@code http://www.w3.org/ns/ldp#PreferMembership}.
+     * <p>
+     * URI identifying a LDPC's membership triples, for example to allow
+     * clients to express interest in receiving them.
+     *
+     * @see <a href="http://www.w3.org/ns/ldp#PreferMembership">PreferMembership</a>
+     */
     public static final URI PreferMembership;
+
+    /**
+     * RDFSource
+     * <p>
+     * {@code http://www.w3.org/ns/ldp#RDFSource}.
+     * <p>
+     * A Linked Data Platform Resource (LDPR) whose state is represented as
+     * RDF.
+     *
+     * @see <a href="http://www.w3.org/ns/ldp#RDFSource">RDFSource</a>
+     */
     public static final URI RDFSource;
+
+    /**
+     * Resource
+     * <p>
+     * {@code http://www.w3.org/ns/ldp#Resource}.
+     * <p>
+     * A HTTP-addressable resource whose lifecycle is managed by a LDP
+     * server.
+     *
+     * @see <a href="http://www.w3.org/ns/ldp#Resource">Resource</a>
+     */
     public static final URI Resource;
 
     static {
-        //TODO: check missing terms in the vocab
         ValueFactory factory = ValueFactoryImpl.getInstance();
+
         BasicContainer = factory.createURI(LDP.NAMESPACE, "BasicContainer");
         Container = factory.createURI(LDP.NAMESPACE, "Container");
         contains = factory.createURI(LDP.NAMESPACE, "contains");
@@ -69,4 +282,8 @@ public class LDP {
         Resource = factory.createURI(LDP.NAMESPACE, "Resource");
     }
 
+    private LDP() {
+        //static access only
+    }
+
 }


[035/100] [abbrv] [partial] Reverting the erroneous merge by Sebastian according to the instructions in INFRA-6876

Posted by wi...@apache.org.
http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/extras/webjars/codemirror/src/main/resources/codemirror.js
----------------------------------------------------------------------
diff --git a/extras/webjars/codemirror/src/main/resources/codemirror.js b/extras/webjars/codemirror/src/main/resources/codemirror.js
new file mode 100644
index 0000000..e53195d
--- /dev/null
+++ b/extras/webjars/codemirror/src/main/resources/codemirror.js
@@ -0,0 +1,5831 @@
+// CodeMirror version 3.16
+//
+// CodeMirror is the only global var we claim
+//
+// License: MIT-License <http://codemirror.net/LICENSE>
+window.CodeMirror = (function() {
+  "use strict";
+
+  // BROWSER SNIFFING
+
+  // Crude, but necessary to handle a number of hard-to-feature-detect
+  // bugs and behavior differences.
+  var gecko = /gecko\/\d/i.test(navigator.userAgent);
+  var ie = /MSIE \d/.test(navigator.userAgent);
+  var ie_lt8 = ie && (document.documentMode == null || document.documentMode < 8);
+  var ie_lt9 = ie && (document.documentMode == null || document.documentMode < 9);
+  var webkit = /WebKit\//.test(navigator.userAgent);
+  var qtwebkit = webkit && /Qt\/\d+\.\d+/.test(navigator.userAgent);
+  var chrome = /Chrome\//.test(navigator.userAgent);
+  var opera = /Opera\//.test(navigator.userAgent);
+  var safari = /Apple Computer/.test(navigator.vendor);
+  var khtml = /KHTML\//.test(navigator.userAgent);
+  var mac_geLion = /Mac OS X 1\d\D([7-9]|\d\d)\D/.test(navigator.userAgent);
+  var mac_geMountainLion = /Mac OS X 1\d\D([8-9]|\d\d)\D/.test(navigator.userAgent);
+  var phantom = /PhantomJS/.test(navigator.userAgent);
+
+  var ios = /AppleWebKit/.test(navigator.userAgent) && /Mobile\/\w+/.test(navigator.userAgent);
+  // This is woefully incomplete. Suggestions for alternative methods welcome.
+  var mobile = ios || /Android|webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(navigator.userAgent);
+  var mac = ios || /Mac/.test(navigator.platform);
+  var windows = /win/i.test(navigator.platform);
+
+  var opera_version = opera && navigator.userAgent.match(/Version\/(\d*\.\d*)/);
+  if (opera_version) opera_version = Number(opera_version[1]);
+  if (opera_version && opera_version >= 15) { opera = false; webkit = true; }
+  // Some browsers use the wrong event properties to signal cmd/ctrl on OS X
+  var flipCtrlCmd = mac && (qtwebkit || opera && (opera_version == null || opera_version < 12.11));
+  var captureMiddleClick = gecko || (ie && !ie_lt9);
+
+  // Optimize some code when these features are not used
+  var sawReadOnlySpans = false, sawCollapsedSpans = false;
+
+  // CONSTRUCTOR
+
+  function CodeMirror(place, options) {
+    if (!(this instanceof CodeMirror)) return new CodeMirror(place, options);
+
+    this.options = options = options || {};
+    // Determine effective options based on given values and defaults.
+    for (var opt in defaults) if (!options.hasOwnProperty(opt) && defaults.hasOwnProperty(opt))
+      options[opt] = defaults[opt];
+    setGuttersForLineNumbers(options);
+
+    var docStart = typeof options.value == "string" ? 0 : options.value.first;
+    var display = this.display = makeDisplay(place, docStart);
+    display.wrapper.CodeMirror = this;
+    updateGutters(this);
+    if (options.autofocus && !mobile) focusInput(this);
+
+    this.state = {keyMaps: [],
+                  overlays: [],
+                  modeGen: 0,
+                  overwrite: false, focused: false,
+                  suppressEdits: false, pasteIncoming: false,
+                  draggingText: false,
+                  highlight: new Delayed()};
+
+    themeChanged(this);
+    if (options.lineWrapping)
+      this.display.wrapper.className += " CodeMirror-wrap";
+
+    var doc = options.value;
+    if (typeof doc == "string") doc = new Doc(options.value, options.mode);
+    operation(this, attachDoc)(this, doc);
+
+    // Override magic textarea content restore that IE sometimes does
+    // on our hidden textarea on reload
+    if (ie) setTimeout(bind(resetInput, this, true), 20);
+
+    registerEventHandlers(this);
+    // IE throws unspecified error in certain cases, when
+    // trying to access activeElement before onload
+    var hasFocus; try { hasFocus = (document.activeElement == display.input); } catch(e) { }
+    if (hasFocus || (options.autofocus && !mobile)) setTimeout(bind(onFocus, this), 20);
+    else onBlur(this);
+
+    operation(this, function() {
+      for (var opt in optionHandlers)
+        if (optionHandlers.propertyIsEnumerable(opt))
+          optionHandlers[opt](this, options[opt], Init);
+      for (var i = 0; i < initHooks.length; ++i) initHooks[i](this);
+    })();
+  }
+
+  // DISPLAY CONSTRUCTOR
+
+  function makeDisplay(place, docStart) {
+    var d = {};
+
+    var input = d.input = elt("textarea", null, null, "position: absolute; padding: 0; width: 1px; height: 1em; outline: none; font-size: 4px;");
+    if (webkit) input.style.width = "1000px";
+    else input.setAttribute("wrap", "off");
+    // if border: 0; -- iOS fails to open keyboard (issue #1287)
+    if (ios) input.style.border = "1px solid black";
+    input.setAttribute("autocorrect", "off"); input.setAttribute("autocapitalize", "off"); input.setAttribute("spellcheck", "false");
+
+    // Wraps and hides input textarea
+    d.inputDiv = elt("div", [input], null, "overflow: hidden; position: relative; width: 3px; height: 0px;");
+    // The actual fake scrollbars.
+    d.scrollbarH = elt("div", [elt("div", null, null, "height: 1px")], "CodeMirror-hscrollbar");
+    d.scrollbarV = elt("div", [elt("div", null, null, "width: 1px")], "CodeMirror-vscrollbar");
+    d.scrollbarFiller = elt("div", null, "CodeMirror-scrollbar-filler");
+    d.gutterFiller = elt("div", null, "CodeMirror-gutter-filler");
+    // DIVs containing the selection and the actual code
+    d.lineDiv = elt("div", null, "CodeMirror-code");
+    d.selectionDiv = elt("div", null, null, "position: relative; z-index: 1");
+    // Blinky cursor, and element used to ensure cursor fits at the end of a line
+    d.cursor = elt("div", "\u00a0", "CodeMirror-cursor");
+    // Secondary cursor, shown when on a 'jump' in bi-directional text
+    d.otherCursor = elt("div", "\u00a0", "CodeMirror-cursor CodeMirror-secondarycursor");
+    // Used to measure text size
+    d.measure = elt("div", null, "CodeMirror-measure");
+    // Wraps everything that needs to exist inside the vertically-padded coordinate system
+    d.lineSpace = elt("div", [d.measure, d.selectionDiv, d.lineDiv, d.cursor, d.otherCursor],
+                         null, "position: relative; outline: none");
+    // Moved around its parent to cover visible view
+    d.mover = elt("div", [elt("div", [d.lineSpace], "CodeMirror-lines")], null, "position: relative");
+    // Set to the height of the text, causes scrolling
+    d.sizer = elt("div", [d.mover], "CodeMirror-sizer");
+    // D is needed because behavior of elts with overflow: auto and padding is inconsistent across browsers
+    d.heightForcer = elt("div", null, null, "position: absolute; height: " + scrollerCutOff + "px; width: 1px;");
+    // Will contain the gutters, if any
+    d.gutters = elt("div", null, "CodeMirror-gutters");
+    d.lineGutter = null;
+    // Provides scrolling
+    d.scroller = elt("div", [d.sizer, d.heightForcer, d.gutters], "CodeMirror-scroll");
+    d.scroller.setAttribute("tabIndex", "-1");
+    // The element in which the editor lives.
+    d.wrapper = elt("div", [d.inputDiv, d.scrollbarH, d.scrollbarV,
+                            d.scrollbarFiller, d.gutterFiller, d.scroller], "CodeMirror");
+    // Work around IE7 z-index bug
+    if (ie_lt8) { d.gutters.style.zIndex = -1; d.scroller.style.paddingRight = 0; }
+    if (place.appendChild) place.appendChild(d.wrapper); else place(d.wrapper);
+
+    // Needed to hide big blue blinking cursor on Mobile Safari
+    if (ios) input.style.width = "0px";
+    if (!webkit) d.scroller.draggable = true;
+    // Needed to handle Tab key in KHTML
+    if (khtml) { d.inputDiv.style.height = "1px"; d.inputDiv.style.position = "absolute"; }
+    // Need to set a minimum width to see the scrollbar on IE7 (but must not set it on IE8).
+    else if (ie_lt8) d.scrollbarH.style.minWidth = d.scrollbarV.style.minWidth = "18px";
+
+    // Current visible range (may be bigger than the view window).
+    d.viewOffset = d.lastSizeC = 0;
+    d.showingFrom = d.showingTo = docStart;
+
+    // Used to only resize the line number gutter when necessary (when
+    // the amount of lines crosses a boundary that makes its width change)
+    d.lineNumWidth = d.lineNumInnerWidth = d.lineNumChars = null;
+    // See readInput and resetInput
+    d.prevInput = "";
+    // Set to true when a non-horizontal-scrolling widget is added. As
+    // an optimization, widget aligning is skipped when d is false.
+    d.alignWidgets = false;
+    // Flag that indicates whether we currently expect input to appear
+    // (after some event like 'keypress' or 'input') and are polling
+    // intensively.
+    d.pollingFast = false;
+    // Self-resetting timeout for the poller
+    d.poll = new Delayed();
+
+    d.cachedCharWidth = d.cachedTextHeight = null;
+    d.measureLineCache = [];
+    d.measureLineCachePos = 0;
+
+    // Tracks when resetInput has punted to just putting a short
+    // string instead of the (large) selection.
+    d.inaccurateSelection = false;
+
+    // Tracks the maximum line length so that the horizontal scrollbar
+    // can be kept static when scrolling.
+    d.maxLine = null;
+    d.maxLineLength = 0;
+    d.maxLineChanged = false;
+
+    // Used for measuring wheel scrolling granularity
+    d.wheelDX = d.wheelDY = d.wheelStartX = d.wheelStartY = null;
+
+    return d;
+  }
+
+  // STATE UPDATES
+
+  // Used to get the editor into a consistent state again when options change.
+
+  function loadMode(cm) {
+    cm.doc.mode = CodeMirror.getMode(cm.options, cm.doc.modeOption);
+    cm.doc.iter(function(line) {
+      if (line.stateAfter) line.stateAfter = null;
+      if (line.styles) line.styles = null;
+    });
+    cm.doc.frontier = cm.doc.first;
+    startWorker(cm, 100);
+    cm.state.modeGen++;
+    if (cm.curOp) regChange(cm);
+  }
+
+  function wrappingChanged(cm) {
+    if (cm.options.lineWrapping) {
+      cm.display.wrapper.className += " CodeMirror-wrap";
+      cm.display.sizer.style.minWidth = "";
+    } else {
+      cm.display.wrapper.className = cm.display.wrapper.className.replace(" CodeMirror-wrap", "");
+      computeMaxLength(cm);
+    }
+    estimateLineHeights(cm);
+    regChange(cm);
+    clearCaches(cm);
+    setTimeout(function(){updateScrollbars(cm);}, 100);
+  }
+
+  function estimateHeight(cm) {
+    var th = textHeight(cm.display), wrapping = cm.options.lineWrapping;
+    var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3);
+    return function(line) {
+      if (lineIsHidden(cm.doc, line))
+        return 0;
+      else if (wrapping)
+        return (Math.ceil(line.text.length / perLine) || 1) * th;
+      else
+        return th;
+    };
+  }
+
+  function estimateLineHeights(cm) {
+    var doc = cm.doc, est = estimateHeight(cm);
+    doc.iter(function(line) {
+      var estHeight = est(line);
+      if (estHeight != line.height) updateLineHeight(line, estHeight);
+    });
+  }
+
+  function keyMapChanged(cm) {
+    var map = keyMap[cm.options.keyMap], style = map.style;
+    cm.display.wrapper.className = cm.display.wrapper.className.replace(/\s*cm-keymap-\S+/g, "") +
+      (style ? " cm-keymap-" + style : "");
+    cm.state.disableInput = map.disableInput;
+  }
+
+  function themeChanged(cm) {
+    cm.display.wrapper.className = cm.display.wrapper.className.replace(/\s*cm-s-\S+/g, "") +
+      cm.options.theme.replace(/(^|\s)\s*/g, " cm-s-");
+    clearCaches(cm);
+  }
+
+  function guttersChanged(cm) {
+    updateGutters(cm);
+    regChange(cm);
+    setTimeout(function(){alignHorizontally(cm);}, 20);
+  }
+
+  function updateGutters(cm) {
+    var gutters = cm.display.gutters, specs = cm.options.gutters;
+    removeChildren(gutters);
+    for (var i = 0; i < specs.length; ++i) {
+      var gutterClass = specs[i];
+      var gElt = gutters.appendChild(elt("div", null, "CodeMirror-gutter " + gutterClass));
+      if (gutterClass == "CodeMirror-linenumbers") {
+        cm.display.lineGutter = gElt;
+        gElt.style.width = (cm.display.lineNumWidth || 1) + "px";
+      }
+    }
+    gutters.style.display = i ? "" : "none";
+  }
+
+  function lineLength(doc, line) {
+    if (line.height == 0) return 0;
+    var len = line.text.length, merged, cur = line;
+    while (merged = collapsedSpanAtStart(cur)) {
+      var found = merged.find();
+      cur = getLine(doc, found.from.line);
+      len += found.from.ch - found.to.ch;
+    }
+    cur = line;
+    while (merged = collapsedSpanAtEnd(cur)) {
+      var found = merged.find();
+      len -= cur.text.length - found.from.ch;
+      cur = getLine(doc, found.to.line);
+      len += cur.text.length - found.to.ch;
+    }
+    return len;
+  }
+
+  function computeMaxLength(cm) {
+    var d = cm.display, doc = cm.doc;
+    d.maxLine = getLine(doc, doc.first);
+    d.maxLineLength = lineLength(doc, d.maxLine);
+    d.maxLineChanged = true;
+    doc.iter(function(line) {
+      var len = lineLength(doc, line);
+      if (len > d.maxLineLength) {
+        d.maxLineLength = len;
+        d.maxLine = line;
+      }
+    });
+  }
+
+  // Make sure the gutters options contains the element
+  // "CodeMirror-linenumbers" when the lineNumbers option is true.
+  function setGuttersForLineNumbers(options) {
+    var found = false;
+    for (var i = 0; i < options.gutters.length; ++i) {
+      if (options.gutters[i] == "CodeMirror-linenumbers") {
+        if (options.lineNumbers) found = true;
+        else options.gutters.splice(i--, 1);
+      }
+    }
+    if (!found && options.lineNumbers)
+      options.gutters.push("CodeMirror-linenumbers");
+  }
+
+  // SCROLLBARS
+
+  // Re-synchronize the fake scrollbars with the actual size of the
+  // content. Optionally force a scrollTop.
+  function updateScrollbars(cm) {
+    var d = cm.display, docHeight = cm.doc.height;
+    var totalHeight = docHeight + paddingVert(d);
+    d.sizer.style.minHeight = d.heightForcer.style.top = totalHeight + "px";
+    d.gutters.style.height = Math.max(totalHeight, d.scroller.clientHeight - scrollerCutOff) + "px";
+    var scrollHeight = Math.max(totalHeight, d.scroller.scrollHeight);
+    var needsH = d.scroller.scrollWidth > (d.scroller.clientWidth + 1);
+    var needsV = scrollHeight > (d.scroller.clientHeight + 1);
+    if (needsV) {
+      d.scrollbarV.style.display = "block";
+      d.scrollbarV.style.bottom = needsH ? scrollbarWidth(d.measure) + "px" : "0";
+      d.scrollbarV.firstChild.style.height =
+        (scrollHeight - d.scroller.clientHeight + d.scrollbarV.clientHeight) + "px";
+    } else {
+      d.scrollbarV.style.display = "";
+      d.scrollbarV.firstChild.style.height = "0";
+    }
+    if (needsH) {
+      d.scrollbarH.style.display = "block";
+      d.scrollbarH.style.right = needsV ? scrollbarWidth(d.measure) + "px" : "0";
+      d.scrollbarH.firstChild.style.width =
+        (d.scroller.scrollWidth - d.scroller.clientWidth + d.scrollbarH.clientWidth) + "px";
+    } else {
+      d.scrollbarH.style.display = "";
+      d.scrollbarH.firstChild.style.width = "0";
+    }
+    if (needsH && needsV) {
+      d.scrollbarFiller.style.display = "block";
+      d.scrollbarFiller.style.height = d.scrollbarFiller.style.width = scrollbarWidth(d.measure) + "px";
+    } else d.scrollbarFiller.style.display = "";
+    if (needsH && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {
+      d.gutterFiller.style.display = "block";
+      d.gutterFiller.style.height = scrollbarWidth(d.measure) + "px";
+      d.gutterFiller.style.width = d.gutters.offsetWidth + "px";
+    } else d.gutterFiller.style.display = "";
+
+    if (mac_geLion && scrollbarWidth(d.measure) === 0)
+      d.scrollbarV.style.minWidth = d.scrollbarH.style.minHeight = mac_geMountainLion ? "18px" : "12px";
+  }
+
+  function visibleLines(display, doc, viewPort) {
+    var top = display.scroller.scrollTop, height = display.wrapper.clientHeight;
+    if (typeof viewPort == "number") top = viewPort;
+    else if (viewPort) {top = viewPort.top; height = viewPort.bottom - viewPort.top;}
+    top = Math.floor(top - paddingTop(display));
+    var bottom = Math.ceil(top + height);
+    return {from: lineAtHeight(doc, top), to: lineAtHeight(doc, bottom)};
+  }
+
+  // LINE NUMBERS
+
+  function alignHorizontally(cm) {
+    var display = cm.display;
+    if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) return;
+    var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;
+    var gutterW = display.gutters.offsetWidth, l = comp + "px";
+    for (var n = display.lineDiv.firstChild; n; n = n.nextSibling) if (n.alignable) {
+      for (var i = 0, a = n.alignable; i < a.length; ++i) a[i].style.left = l;
+    }
+    if (cm.options.fixedGutter)
+      display.gutters.style.left = (comp + gutterW) + "px";
+  }
+
+  function maybeUpdateLineNumberWidth(cm) {
+    if (!cm.options.lineNumbers) return false;
+    var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;
+    if (last.length != display.lineNumChars) {
+      var test = display.measure.appendChild(elt("div", [elt("div", last)],
+                                                 "CodeMirror-linenumber CodeMirror-gutter-elt"));
+      var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;
+      display.lineGutter.style.width = "";
+      display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding);
+      display.lineNumWidth = display.lineNumInnerWidth + padding;
+      display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;
+      display.lineGutter.style.width = display.lineNumWidth + "px";
+      return true;
+    }
+    return false;
+  }
+
+  function lineNumberFor(options, i) {
+    return String(options.lineNumberFormatter(i + options.firstLineNumber));
+  }
+  function compensateForHScroll(display) {
+    return getRect(display.scroller).left - getRect(display.sizer).left;
+  }
+
+  // DISPLAY DRAWING
+
+  function updateDisplay(cm, changes, viewPort, forced) {
+    var oldFrom = cm.display.showingFrom, oldTo = cm.display.showingTo, updated;
+    var visible = visibleLines(cm.display, cm.doc, viewPort);
+    for (;;) {
+      if (!updateDisplayInner(cm, changes, visible, forced)) break;
+      forced = false;
+      updated = true;
+      updateSelection(cm);
+      updateScrollbars(cm);
+
+      // Clip forced viewport to actual scrollable area
+      if (viewPort)
+        viewPort = Math.min(cm.display.scroller.scrollHeight - cm.display.scroller.clientHeight,
+                            typeof viewPort == "number" ? viewPort : viewPort.top);
+      visible = visibleLines(cm.display, cm.doc, viewPort);
+      if (visible.from >= cm.display.showingFrom && visible.to <= cm.display.showingTo)
+        break;
+      changes = [];
+    }
+
+    if (updated) {
+      signalLater(cm, "update", cm);
+      if (cm.display.showingFrom != oldFrom || cm.display.showingTo != oldTo)
+        signalLater(cm, "viewportChange", cm, cm.display.showingFrom, cm.display.showingTo);
+    }
+    return updated;
+  }
+
+  // Uses a set of changes plus the current scroll position to
+  // determine which DOM updates have to be made, and makes the
+  // updates.
+  function updateDisplayInner(cm, changes, visible, forced) {
+    var display = cm.display, doc = cm.doc;
+    if (!display.wrapper.clientWidth) {
+      display.showingFrom = display.showingTo = doc.first;
+      display.viewOffset = 0;
+      return;
+    }
+
+    // Bail out if the visible area is already rendered and nothing changed.
+    if (!forced && changes.length == 0 &&
+        visible.from > display.showingFrom && visible.to < display.showingTo)
+      return;
+
+    if (maybeUpdateLineNumberWidth(cm))
+      changes = [{from: doc.first, to: doc.first + doc.size}];
+    var gutterW = display.sizer.style.marginLeft = display.gutters.offsetWidth + "px";
+    display.scrollbarH.style.left = cm.options.fixedGutter ? gutterW : "0";
+
+    // Used to determine which lines need their line numbers updated
+    var positionsChangedFrom = Infinity;
+    if (cm.options.lineNumbers)
+      for (var i = 0; i < changes.length; ++i)
+        if (changes[i].diff && changes[i].from < positionsChangedFrom) { positionsChangedFrom = changes[i].from; }
+
+    var end = doc.first + doc.size;
+    var from = Math.max(visible.from - cm.options.viewportMargin, doc.first);
+    var to = Math.min(end, visible.to + cm.options.viewportMargin);
+    if (display.showingFrom < from && from - display.showingFrom < 20) from = Math.max(doc.first, display.showingFrom);
+    if (display.showingTo > to && display.showingTo - to < 20) to = Math.min(end, display.showingTo);
+    if (sawCollapsedSpans) {
+      from = lineNo(visualLine(doc, getLine(doc, from)));
+      while (to < end && lineIsHidden(doc, getLine(doc, to))) ++to;
+    }
+
+    // Create a range of theoretically intact lines, and punch holes
+    // in that using the change info.
+    var intact = [{from: Math.max(display.showingFrom, doc.first),
+                   to: Math.min(display.showingTo, end)}];
+    if (intact[0].from >= intact[0].to) intact = [];
+    else intact = computeIntact(intact, changes);
+    // When merged lines are present, we might have to reduce the
+    // intact ranges because changes in continued fragments of the
+    // intact lines do require the lines to be redrawn.
+    if (sawCollapsedSpans)
+      for (var i = 0; i < intact.length; ++i) {
+        var range = intact[i], merged;
+        while (merged = collapsedSpanAtEnd(getLine(doc, range.to - 1))) {
+          var newTo = merged.find().from.line;
+          if (newTo > range.from) range.to = newTo;
+          else { intact.splice(i--, 1); break; }
+        }
+      }
+
+    // Clip off the parts that won't be visible
+    var intactLines = 0;
+    for (var i = 0; i < intact.length; ++i) {
+      var range = intact[i];
+      if (range.from < from) range.from = from;
+      if (range.to > to) range.to = to;
+      if (range.from >= range.to) intact.splice(i--, 1);
+      else intactLines += range.to - range.from;
+    }
+    if (!forced && intactLines == to - from && from == display.showingFrom && to == display.showingTo) {
+      updateViewOffset(cm);
+      return;
+    }
+    intact.sort(function(a, b) {return a.from - b.from;});
+
+    // Avoid crashing on IE's "unspecified error" when in iframes
+    try {
+      var focused = document.activeElement;
+    } catch(e) {}
+    if (intactLines < (to - from) * .7) display.lineDiv.style.display = "none";
+    patchDisplay(cm, from, to, intact, positionsChangedFrom);
+    display.lineDiv.style.display = "";
+    if (focused && document.activeElement != focused && focused.offsetHeight) focused.focus();
+
+    var different = from != display.showingFrom || to != display.showingTo ||
+      display.lastSizeC != display.wrapper.clientHeight;
+    // This is just a bogus formula that detects when the editor is
+    // resized or the font size changes.
+    if (different) {
+      display.lastSizeC = display.wrapper.clientHeight;
+      startWorker(cm, 400);
+    }
+    display.showingFrom = from; display.showingTo = to;
+
+    updateHeightsInViewport(cm);
+    updateViewOffset(cm);
+
+    return true;
+  }
+
+  function updateHeightsInViewport(cm) {
+    var display = cm.display;
+    var prevBottom = display.lineDiv.offsetTop;
+    for (var node = display.lineDiv.firstChild, height; node; node = node.nextSibling) if (node.lineObj) {
+      if (ie_lt8) {
+        var bot = node.offsetTop + node.offsetHeight;
+        height = bot - prevBottom;
+        prevBottom = bot;
+      } else {
+        var box = getRect(node);
+        height = box.bottom - box.top;
+      }
+      var diff = node.lineObj.height - height;
+      if (height < 2) height = textHeight(display);
+      if (diff > .001 || diff < -.001) {
+        updateLineHeight(node.lineObj, height);
+        var widgets = node.lineObj.widgets;
+        if (widgets) for (var i = 0; i < widgets.length; ++i)
+          widgets[i].height = widgets[i].node.offsetHeight;
+      }
+    }
+  }
+
+  function updateViewOffset(cm) {
+    var off = cm.display.viewOffset = heightAtLine(cm, getLine(cm.doc, cm.display.showingFrom));
+    // Position the mover div to align with the current virtual scroll position
+    cm.display.mover.style.top = off + "px";
+  }
+
+  function computeIntact(intact, changes) {
+    for (var i = 0, l = changes.length || 0; i < l; ++i) {
+      var change = changes[i], intact2 = [], diff = change.diff || 0;
+      for (var j = 0, l2 = intact.length; j < l2; ++j) {
+        var range = intact[j];
+        if (change.to <= range.from && change.diff) {
+          intact2.push({from: range.from + diff, to: range.to + diff});
+        } else if (change.to <= range.from || change.from >= range.to) {
+          intact2.push(range);
+        } else {
+          if (change.from > range.from)
+            intact2.push({from: range.from, to: change.from});
+          if (change.to < range.to)
+            intact2.push({from: change.to + diff, to: range.to + diff});
+        }
+      }
+      intact = intact2;
+    }
+    return intact;
+  }
+
+  function getDimensions(cm) {
+    var d = cm.display, left = {}, width = {};
+    for (var n = d.gutters.firstChild, i = 0; n; n = n.nextSibling, ++i) {
+      left[cm.options.gutters[i]] = n.offsetLeft;
+      width[cm.options.gutters[i]] = n.offsetWidth;
+    }
+    return {fixedPos: compensateForHScroll(d),
+            gutterTotalWidth: d.gutters.offsetWidth,
+            gutterLeft: left,
+            gutterWidth: width,
+            wrapperWidth: d.wrapper.clientWidth};
+  }
+
+  function patchDisplay(cm, from, to, intact, updateNumbersFrom) {
+    var dims = getDimensions(cm);
+    var display = cm.display, lineNumbers = cm.options.lineNumbers;
+    if (!intact.length && (!webkit || !cm.display.currentWheelTarget))
+      removeChildren(display.lineDiv);
+    var container = display.lineDiv, cur = container.firstChild;
+
+    function rm(node) {
+      var next = node.nextSibling;
+      if (webkit && mac && cm.display.currentWheelTarget == node) {
+        node.style.display = "none";
+        node.lineObj = null;
+      } else {
+        node.parentNode.removeChild(node);
+      }
+      return next;
+    }
+
+    var nextIntact = intact.shift(), lineN = from;
+    cm.doc.iter(from, to, function(line) {
+      if (nextIntact && nextIntact.to == lineN) nextIntact = intact.shift();
+      if (lineIsHidden(cm.doc, line)) {
+        if (line.height != 0) updateLineHeight(line, 0);
+        if (line.widgets && cur && cur.previousSibling) for (var i = 0; i < line.widgets.length; ++i) {
+          var w = line.widgets[i];
+          if (w.showIfHidden) {
+            var prev = cur.previousSibling;
+            if (/pre/i.test(prev.nodeName)) {
+              var wrap = elt("div", null, null, "position: relative");
+              prev.parentNode.replaceChild(wrap, prev);
+              wrap.appendChild(prev);
+              prev = wrap;
+            }
+            var wnode = prev.appendChild(elt("div", [w.node], "CodeMirror-linewidget"));
+            if (!w.handleMouseEvents) wnode.ignoreEvents = true;
+            positionLineWidget(w, wnode, prev, dims);
+          }
+        }
+      } else if (nextIntact && nextIntact.from <= lineN && nextIntact.to > lineN) {
+        // This line is intact. Skip to the actual node. Update its
+        // line number if needed.
+        while (cur.lineObj != line) cur = rm(cur);
+        if (lineNumbers && updateNumbersFrom <= lineN && cur.lineNumber)
+          setTextContent(cur.lineNumber, lineNumberFor(cm.options, lineN));
+        cur = cur.nextSibling;
+      } else {
+        // For lines with widgets, make an attempt to find and reuse
+        // the existing element, so that widgets aren't needlessly
+        // removed and re-inserted into the dom
+        if (line.widgets) for (var j = 0, search = cur, reuse; search && j < 20; ++j, search = search.nextSibling)
+          if (search.lineObj == line && /div/i.test(search.nodeName)) { reuse = search; break; }
+        // This line needs to be generated.
+        var lineNode = buildLineElement(cm, line, lineN, dims, reuse);
+        if (lineNode != reuse) {
+          container.insertBefore(lineNode, cur);
+        } else {
+          while (cur != reuse) cur = rm(cur);
+          cur = cur.nextSibling;
+        }
+
+        lineNode.lineObj = line;
+      }
+      ++lineN;
+    });
+    while (cur) cur = rm(cur);
+  }
+
+  function buildLineElement(cm, line, lineNo, dims, reuse) {
+    var lineElement = lineContent(cm, line);
+    var markers = line.gutterMarkers, display = cm.display, wrap;
+
+    if (!cm.options.lineNumbers && !markers && !line.bgClass && !line.wrapClass && !line.widgets)
+      return lineElement;
+
+    // Lines with gutter elements, widgets or a background class need
+    // to be wrapped again, and have the extra elements added to the
+    // wrapper div
+
+    if (reuse) {
+      reuse.alignable = null;
+      var isOk = true, widgetsSeen = 0, insertBefore = null;
+      for (var n = reuse.firstChild, next; n; n = next) {
+        next = n.nextSibling;
+        if (!/\bCodeMirror-linewidget\b/.test(n.className)) {
+          reuse.removeChild(n);
+        } else {
+          for (var i = 0; i < line.widgets.length; ++i) {
+            var widget = line.widgets[i];
+            if (widget.node == n.firstChild) {
+              if (!widget.above && !insertBefore) insertBefore = n;
+              positionLineWidget(widget, n, reuse, dims);
+              ++widgetsSeen;
+              break;
+            }
+          }
+          if (i == line.widgets.length) { isOk = false; break; }
+        }
+      }
+      reuse.insertBefore(lineElement, insertBefore);
+      if (isOk && widgetsSeen == line.widgets.length) {
+        wrap = reuse;
+        reuse.className = line.wrapClass || "";
+      }
+    }
+    if (!wrap) {
+      wrap = elt("div", null, line.wrapClass, "position: relative");
+      wrap.appendChild(lineElement);
+    }
+    // Kludge to make sure the styled element lies behind the selection (by z-index)
+    if (line.bgClass)
+      wrap.insertBefore(elt("div", null, line.bgClass + " CodeMirror-linebackground"), wrap.firstChild);
+    if (cm.options.lineNumbers || markers) {
+      var gutterWrap = wrap.insertBefore(elt("div", null, null, "position: absolute; left: " +
+                                             (cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) + "px"),
+                                         wrap.firstChild);
+      if (cm.options.fixedGutter) (wrap.alignable || (wrap.alignable = [])).push(gutterWrap);
+      if (cm.options.lineNumbers && (!markers || !markers["CodeMirror-linenumbers"]))
+        wrap.lineNumber = gutterWrap.appendChild(
+          elt("div", lineNumberFor(cm.options, lineNo),
+              "CodeMirror-linenumber CodeMirror-gutter-elt",
+              "left: " + dims.gutterLeft["CodeMirror-linenumbers"] + "px; width: "
+              + display.lineNumInnerWidth + "px"));
+      if (markers)
+        for (var k = 0; k < cm.options.gutters.length; ++k) {
+          var id = cm.options.gutters[k], found = markers.hasOwnProperty(id) && markers[id];
+          if (found)
+            gutterWrap.appendChild(elt("div", [found], "CodeMirror-gutter-elt", "left: " +
+                                       dims.gutterLeft[id] + "px; width: " + dims.gutterWidth[id] + "px"));
+        }
+    }
+    if (ie_lt8) wrap.style.zIndex = 2;
+    if (line.widgets && wrap != reuse) for (var i = 0, ws = line.widgets; i < ws.length; ++i) {
+      var widget = ws[i], node = elt("div", [widget.node], "CodeMirror-linewidget");
+      if (!widget.handleMouseEvents) node.ignoreEvents = true;
+      positionLineWidget(widget, node, wrap, dims);
+      if (widget.above)
+        wrap.insertBefore(node, cm.options.lineNumbers && line.height != 0 ? gutterWrap : lineElement);
+      else
+        wrap.appendChild(node);
+      signalLater(widget, "redraw");
+    }
+    return wrap;
+  }
+
+  function positionLineWidget(widget, node, wrap, dims) {
+    if (widget.noHScroll) {
+      (wrap.alignable || (wrap.alignable = [])).push(node);
+      var width = dims.wrapperWidth;
+      node.style.left = dims.fixedPos + "px";
+      if (!widget.coverGutter) {
+        width -= dims.gutterTotalWidth;
+        node.style.paddingLeft = dims.gutterTotalWidth + "px";
+      }
+      node.style.width = width + "px";
+    }
+    if (widget.coverGutter) {
+      node.style.zIndex = 5;
+      node.style.position = "relative";
+      if (!widget.noHScroll) node.style.marginLeft = -dims.gutterTotalWidth + "px";
+    }
+  }
+
+  // SELECTION / CURSOR
+
+  function updateSelection(cm) {
+    var display = cm.display;
+    var collapsed = posEq(cm.doc.sel.from, cm.doc.sel.to);
+    if (collapsed || cm.options.showCursorWhenSelecting)
+      updateSelectionCursor(cm);
+    else
+      display.cursor.style.display = display.otherCursor.style.display = "none";
+    if (!collapsed)
+      updateSelectionRange(cm);
+    else
+      display.selectionDiv.style.display = "none";
+
+    // Move the hidden textarea near the cursor to prevent scrolling artifacts
+    if (cm.options.moveInputWithCursor) {
+      var headPos = cursorCoords(cm, cm.doc.sel.head, "div");
+      var wrapOff = getRect(display.wrapper), lineOff = getRect(display.lineDiv);
+      display.inputDiv.style.top = Math.max(0, Math.min(display.wrapper.clientHeight - 10,
+                                                        headPos.top + lineOff.top - wrapOff.top)) + "px";
+      display.inputDiv.style.left = Math.max(0, Math.min(display.wrapper.clientWidth - 10,
+                                                         headPos.left + lineOff.left - wrapOff.left)) + "px";
+    }
+  }
+
+  // No selection, plain cursor
+  function updateSelectionCursor(cm) {
+    var display = cm.display, pos = cursorCoords(cm, cm.doc.sel.head, "div");
+    display.cursor.style.left = pos.left + "px";
+    display.cursor.style.top = pos.top + "px";
+    display.cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + "px";
+    display.cursor.style.display = "";
+
+    if (pos.other) {
+      display.otherCursor.style.display = "";
+      display.otherCursor.style.left = pos.other.left + "px";
+      display.otherCursor.style.top = pos.other.top + "px";
+      display.otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + "px";
+    } else { display.otherCursor.style.display = "none"; }
+  }
+
+  // Highlight selection
+  function updateSelectionRange(cm) {
+    var display = cm.display, doc = cm.doc, sel = cm.doc.sel;
+    var fragment = document.createDocumentFragment();
+    var clientWidth = display.lineSpace.offsetWidth, pl = paddingLeft(cm.display);
+
+    function add(left, top, width, bottom) {
+      if (top < 0) top = 0;
+      fragment.appendChild(elt("div", null, "CodeMirror-selected", "position: absolute; left: " + left +
+                               "px; top: " + top + "px; width: " + (width == null ? clientWidth - left : width) +
+                               "px; height: " + (bottom - top) + "px"));
+    }
+
+    function drawForLine(line, fromArg, toArg) {
+      var lineObj = getLine(doc, line);
+      var lineLen = lineObj.text.length;
+      var start, end;
+      function coords(ch, bias) {
+        return charCoords(cm, Pos(line, ch), "div", lineObj, bias);
+      }
+
+      iterateBidiSections(getOrder(lineObj), fromArg || 0, toArg == null ? lineLen : toArg, function(from, to, dir) {
+        var leftPos = coords(from, "left"), rightPos, left, right;
+        if (from == to) {
+          rightPos = leftPos;
+          left = right = leftPos.left;
+        } else {
+          rightPos = coords(to - 1, "right");
+          if (dir == "rtl") { var tmp = leftPos; leftPos = rightPos; rightPos = tmp; }
+          left = leftPos.left;
+          right = rightPos.right;
+        }
+        if (fromArg == null && from == 0) left = pl;
+        if (rightPos.top - leftPos.top > 3) { // Different lines, draw top part
+          add(left, leftPos.top, null, leftPos.bottom);
+          left = pl;
+          if (leftPos.bottom < rightPos.top) add(left, leftPos.bottom, null, rightPos.top);
+        }
+        if (toArg == null && to == lineLen) right = clientWidth;
+        if (!start || leftPos.top < start.top || leftPos.top == start.top && leftPos.left < start.left)
+          start = leftPos;
+        if (!end || rightPos.bottom > end.bottom || rightPos.bottom == end.bottom && rightPos.right > end.right)
+          end = rightPos;
+        if (left < pl + 1) left = pl;
+        add(left, rightPos.top, right - left, rightPos.bottom);
+      });
+      return {start: start, end: end};
+    }
+
+    if (sel.from.line == sel.to.line) {
+      drawForLine(sel.from.line, sel.from.ch, sel.to.ch);
+    } else {
+      var fromLine = getLine(doc, sel.from.line), toLine = getLine(doc, sel.to.line);
+      var singleVLine = visualLine(doc, fromLine) == visualLine(doc, toLine);
+      var leftEnd = drawForLine(sel.from.line, sel.from.ch, singleVLine ? fromLine.text.length : null).end;
+      var rightStart = drawForLine(sel.to.line, singleVLine ? 0 : null, sel.to.ch).start;
+      if (singleVLine) {
+        if (leftEnd.top < rightStart.top - 2) {
+          add(leftEnd.right, leftEnd.top, null, leftEnd.bottom);
+          add(pl, rightStart.top, rightStart.left, rightStart.bottom);
+        } else {
+          add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom);
+        }
+      }
+      if (leftEnd.bottom < rightStart.top)
+        add(pl, leftEnd.bottom, null, rightStart.top);
+    }
+
+    removeChildrenAndAdd(display.selectionDiv, fragment);
+    display.selectionDiv.style.display = "";
+  }
+
+  // Cursor-blinking
+  function restartBlink(cm) {
+    if (!cm.state.focused) return;
+    var display = cm.display;
+    clearInterval(display.blinker);
+    var on = true;
+    display.cursor.style.visibility = display.otherCursor.style.visibility = "";
+    if (cm.options.cursorBlinkRate > 0)
+      display.blinker = setInterval(function() {
+        display.cursor.style.visibility = display.otherCursor.style.visibility = (on = !on) ? "" : "hidden";
+      }, cm.options.cursorBlinkRate);
+  }
+
+  // HIGHLIGHT WORKER
+
+  function startWorker(cm, time) {
+    if (cm.doc.mode.startState && cm.doc.frontier < cm.display.showingTo)
+      cm.state.highlight.set(time, bind(highlightWorker, cm));
+  }
+
+  function highlightWorker(cm) {
+    var doc = cm.doc;
+    if (doc.frontier < doc.first) doc.frontier = doc.first;
+    if (doc.frontier >= cm.display.showingTo) return;
+    var end = +new Date + cm.options.workTime;
+    var state = copyState(doc.mode, getStateBefore(cm, doc.frontier));
+    var changed = [], prevChange;
+    doc.iter(doc.frontier, Math.min(doc.first + doc.size, cm.display.showingTo + 500), function(line) {
+      if (doc.frontier >= cm.display.showingFrom) { // Visible
+        var oldStyles = line.styles;
+        line.styles = highlightLine(cm, line, state);
+        var ischange = !oldStyles || oldStyles.length != line.styles.length;
+        for (var i = 0; !ischange && i < oldStyles.length; ++i) ischange = oldStyles[i] != line.styles[i];
+        if (ischange) {
+          if (prevChange && prevChange.end == doc.frontier) prevChange.end++;
+          else changed.push(prevChange = {start: doc.frontier, end: doc.frontier + 1});
+        }
+        line.stateAfter = copyState(doc.mode, state);
+      } else {
+        processLine(cm, line, state);
+        line.stateAfter = doc.frontier % 5 == 0 ? copyState(doc.mode, state) : null;
+      }
+      ++doc.frontier;
+      if (+new Date > end) {
+        startWorker(cm, cm.options.workDelay);
+        return true;
+      }
+    });
+    if (changed.length)
+      operation(cm, function() {
+        for (var i = 0; i < changed.length; ++i)
+          regChange(this, changed[i].start, changed[i].end);
+      })();
+  }
+
+  // Finds the line to start with when starting a parse. Tries to
+  // find a line with a stateAfter, so that it can start with a
+  // valid state. If that fails, it returns the line with the
+  // smallest indentation, which tends to need the least context to
+  // parse correctly.
+  function findStartLine(cm, n, precise) {
+    var minindent, minline, doc = cm.doc, maxScan = cm.doc.mode.innerMode ? 1000 : 100;
+    for (var search = n, lim = n - maxScan; search > lim; --search) {
+      if (search <= doc.first) return doc.first;
+      var line = getLine(doc, search - 1);
+      if (line.stateAfter && (!precise || search <= doc.frontier)) return search;
+      var indented = countColumn(line.text, null, cm.options.tabSize);
+      if (minline == null || minindent > indented) {
+        minline = search - 1;
+        minindent = indented;
+      }
+    }
+    return minline;
+  }
+
+  function getStateBefore(cm, n, precise) {
+    var doc = cm.doc, display = cm.display;
+    if (!doc.mode.startState) return true;
+    var pos = findStartLine(cm, n, precise), state = pos > doc.first && getLine(doc, pos-1).stateAfter;
+    if (!state) state = startState(doc.mode);
+    else state = copyState(doc.mode, state);
+    doc.iter(pos, n, function(line) {
+      processLine(cm, line, state);
+      var save = pos == n - 1 || pos % 5 == 0 || pos >= display.showingFrom && pos < display.showingTo;
+      line.stateAfter = save ? copyState(doc.mode, state) : null;
+      ++pos;
+    });
+    return state;
+  }
+
+  // POSITION MEASUREMENT
+
+  function paddingTop(display) {return display.lineSpace.offsetTop;}
+  function paddingVert(display) {return display.mover.offsetHeight - display.lineSpace.offsetHeight;}
+  function paddingLeft(display) {
+    var e = removeChildrenAndAdd(display.measure, elt("pre", null, null, "text-align: left")).appendChild(elt("span", "x"));
+    return e.offsetLeft;
+  }
+
+  function measureChar(cm, line, ch, data, bias) {
+    var dir = -1;
+    data = data || measureLine(cm, line);
+
+    for (var pos = ch;; pos += dir) {
+      var r = data[pos];
+      if (r) break;
+      if (dir < 0 && pos == 0) dir = 1;
+    }
+    bias = pos > ch ? "left" : pos < ch ? "right" : bias;
+    if (bias == "left" && r.leftSide) r = r.leftSide;
+    else if (bias == "right" && r.rightSide) r = r.rightSide;
+    return {left: pos < ch ? r.right : r.left,
+            right: pos > ch ? r.left : r.right,
+            top: r.top,
+            bottom: r.bottom};
+  }
+
+  function findCachedMeasurement(cm, line) {
+    var cache = cm.display.measureLineCache;
+    for (var i = 0; i < cache.length; ++i) {
+      var memo = cache[i];
+      if (memo.text == line.text && memo.markedSpans == line.markedSpans &&
+          cm.display.scroller.clientWidth == memo.width &&
+          memo.classes == line.textClass + "|" + line.bgClass + "|" + line.wrapClass)
+        return memo;
+    }
+  }
+
+  function clearCachedMeasurement(cm, line) {
+    var exists = findCachedMeasurement(cm, line);
+    if (exists) exists.text = exists.measure = exists.markedSpans = null;
+  }
+
+  function measureLine(cm, line) {
+    // First look in the cache
+    var cached = findCachedMeasurement(cm, line);
+    if (cached) return cached.measure;
+
+    // Failing that, recompute and store result in cache
+    var measure = measureLineInner(cm, line);
+    var cache = cm.display.measureLineCache;
+    var memo = {text: line.text, width: cm.display.scroller.clientWidth,
+                markedSpans: line.markedSpans, measure: measure,
+                classes: line.textClass + "|" + line.bgClass + "|" + line.wrapClass};
+    if (cache.length == 16) cache[++cm.display.measureLineCachePos % 16] = memo;
+    else cache.push(memo);
+    return measure;
+  }
+
+  function measureLineInner(cm, line) {
+    var display = cm.display, measure = emptyArray(line.text.length);
+    var pre = lineContent(cm, line, measure, true);
+
+    // IE does not cache element positions of inline elements between
+    // calls to getBoundingClientRect. This makes the loop below,
+    // which gathers the positions of all the characters on the line,
+    // do an amount of layout work quadratic to the number of
+    // characters. When line wrapping is off, we try to improve things
+    // by first subdividing the line into a bunch of inline blocks, so
+    // that IE can reuse most of the layout information from caches
+    // for those blocks. This does interfere with line wrapping, so it
+    // doesn't work when wrapping is on, but in that case the
+    // situation is slightly better, since IE does cache line-wrapping
+    // information and only recomputes per-line.
+    if (ie && !ie_lt8 && !cm.options.lineWrapping && pre.childNodes.length > 100) {
+      var fragment = document.createDocumentFragment();
+      var chunk = 10, n = pre.childNodes.length;
+      for (var i = 0, chunks = Math.ceil(n / chunk); i < chunks; ++i) {
+        var wrap = elt("div", null, null, "display: inline-block");
+        for (var j = 0; j < chunk && n; ++j) {
+          wrap.appendChild(pre.firstChild);
+          --n;
+        }
+        fragment.appendChild(wrap);
+      }
+      pre.appendChild(fragment);
+    }
+
+    removeChildrenAndAdd(display.measure, pre);
+
+    var outer = getRect(display.lineDiv);
+    var vranges = [], data = emptyArray(line.text.length), maxBot = pre.offsetHeight;
+    // Work around an IE7/8 bug where it will sometimes have randomly
+    // replaced our pre with a clone at this point.
+    if (ie_lt9 && display.measure.first != pre)
+      removeChildrenAndAdd(display.measure, pre);
+
+    function measureRect(rect) {
+      var top = rect.top - outer.top, bot = rect.bottom - outer.top;
+      if (bot > maxBot) bot = maxBot;
+      if (top < 0) top = 0;
+      for (var i = vranges.length - 2; i >= 0; i -= 2) {
+        var rtop = vranges[i], rbot = vranges[i+1];
+        if (rtop > bot || rbot < top) continue;
+        if (rtop <= top && rbot >= bot ||
+            top <= rtop && bot >= rbot ||
+            Math.min(bot, rbot) - Math.max(top, rtop) >= (bot - top) >> 1) {
+          vranges[i] = Math.min(top, rtop);
+          vranges[i+1] = Math.max(bot, rbot);
+          break;
+        }
+      }
+      if (i < 0) { i = vranges.length; vranges.push(top, bot); }
+      return {left: rect.left - outer.left,
+              right: rect.right - outer.left,
+              top: i, bottom: null};
+    }
+    function finishRect(rect) {
+      rect.bottom = vranges[rect.top+1];
+      rect.top = vranges[rect.top];
+    }
+
+    for (var i = 0, cur; i < measure.length; ++i) if (cur = measure[i]) {
+      var node = cur, rect = null;
+      // A widget might wrap, needs special care
+      if (/\bCodeMirror-widget\b/.test(cur.className) && cur.getClientRects) {
+        if (cur.firstChild.nodeType == 1) node = cur.firstChild;
+        var rects = node.getClientRects();
+        if (rects.length > 1) {
+          rect = data[i] = measureRect(rects[0]);
+          rect.rightSide = measureRect(rects[rects.length - 1]);
+        }
+      }
+      if (!rect) rect = data[i] = measureRect(getRect(node));
+      if (cur.measureRight) rect.right = getRect(cur.measureRight).left;
+      if (cur.leftSide) rect.leftSide = measureRect(getRect(cur.leftSide));
+    }
+    removeChildren(cm.display.measure);
+    for (var i = 0, cur; i < data.length; ++i) if (cur = data[i]) {
+      finishRect(cur);
+      if (cur.leftSide) finishRect(cur.leftSide);
+      if (cur.rightSide) finishRect(cur.rightSide);
+    }
+    return data;
+  }
+
+  function measureLineWidth(cm, line) {
+    var hasBadSpan = false;
+    if (line.markedSpans) for (var i = 0; i < line.markedSpans; ++i) {
+      var sp = line.markedSpans[i];
+      if (sp.collapsed && (sp.to == null || sp.to == line.text.length)) hasBadSpan = true;
+    }
+    var cached = !hasBadSpan && findCachedMeasurement(cm, line);
+    if (cached) return measureChar(cm, line, line.text.length, cached.measure, "right").right;
+
+    var pre = lineContent(cm, line, null, true);
+    var end = pre.appendChild(zeroWidthElement(cm.display.measure));
+    removeChildrenAndAdd(cm.display.measure, pre);
+    return getRect(end).right - getRect(cm.display.lineDiv).left;
+  }
+
+  function clearCaches(cm) {
+    cm.display.measureLineCache.length = cm.display.measureLineCachePos = 0;
+    cm.display.cachedCharWidth = cm.display.cachedTextHeight = null;
+    if (!cm.options.lineWrapping) cm.display.maxLineChanged = true;
+    cm.display.lineNumChars = null;
+  }
+
+  function pageScrollX() { return window.pageXOffset || (document.documentElement || document.body).scrollLeft; }
+  function pageScrollY() { return window.pageYOffset || (document.documentElement || document.body).scrollTop; }
+
+  // Context is one of "line", "div" (display.lineDiv), "local"/null (editor), or "page"
+  function intoCoordSystem(cm, lineObj, rect, context) {
+    if (lineObj.widgets) for (var i = 0; i < lineObj.widgets.length; ++i) if (lineObj.widgets[i].above) {
+      var size = widgetHeight(lineObj.widgets[i]);
+      rect.top += size; rect.bottom += size;
+    }
+    if (context == "line") return rect;
+    if (!context) context = "local";
+    var yOff = heightAtLine(cm, lineObj);
+    if (context == "local") yOff += paddingTop(cm.display);
+    else yOff -= cm.display.viewOffset;
+    if (context == "page" || context == "window") {
+      var lOff = getRect(cm.display.lineSpace);
+      yOff += lOff.top + (context == "window" ? 0 : pageScrollY());
+      var xOff = lOff.left + (context == "window" ? 0 : pageScrollX());
+      rect.left += xOff; rect.right += xOff;
+    }
+    rect.top += yOff; rect.bottom += yOff;
+    return rect;
+  }
+
+  // Context may be "window", "page", "div", or "local"/null
+  // Result is in "div" coords
+  function fromCoordSystem(cm, coords, context) {
+    if (context == "div") return coords;
+    var left = coords.left, top = coords.top;
+    // First move into "page" coordinate system
+    if (context == "page") {
+      left -= pageScrollX();
+      top -= pageScrollY();
+    } else if (context == "local" || !context) {
+      var localBox = getRect(cm.display.sizer);
+      left += localBox.left;
+      top += localBox.top;
+    }
+
+    var lineSpaceBox = getRect(cm.display.lineSpace);
+    return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top};
+  }
+
+  function charCoords(cm, pos, context, lineObj, bias) {
+    if (!lineObj) lineObj = getLine(cm.doc, pos.line);
+    return intoCoordSystem(cm, lineObj, measureChar(cm, lineObj, pos.ch, null, bias), context);
+  }
+
+  function cursorCoords(cm, pos, context, lineObj, measurement) {
+    lineObj = lineObj || getLine(cm.doc, pos.line);
+    if (!measurement) measurement = measureLine(cm, lineObj);
+    function get(ch, right) {
+      var m = measureChar(cm, lineObj, ch, measurement, right ? "right" : "left");
+      if (right) m.left = m.right; else m.right = m.left;
+      return intoCoordSystem(cm, lineObj, m, context);
+    }
+    function getBidi(ch, partPos) {
+      var part = order[partPos], right = part.level % 2;
+      if (ch == bidiLeft(part) && partPos && part.level < order[partPos - 1].level) {
+        part = order[--partPos];
+        ch = bidiRight(part) - (part.level % 2 ? 0 : 1);
+        right = true;
+      } else if (ch == bidiRight(part) && partPos < order.length - 1 && part.level < order[partPos + 1].level) {
+        part = order[++partPos];
+        ch = bidiLeft(part) - part.level % 2;
+        right = false;
+      }
+      if (right && ch == part.to && ch > part.from) return get(ch - 1);
+      return get(ch, right);
+    }
+    var order = getOrder(lineObj), ch = pos.ch;
+    if (!order) return get(ch);
+    var partPos = getBidiPartAt(order, ch);
+    var val = getBidi(ch, partPos);
+    if (bidiOther != null) val.other = getBidi(ch, bidiOther);
+    return val;
+  }
+
+  function PosWithInfo(line, ch, outside, xRel) {
+    var pos = new Pos(line, ch);
+    pos.xRel = xRel;
+    if (outside) pos.outside = true;
+    return pos;
+  }
+
+  // Coords must be lineSpace-local
+  function coordsChar(cm, x, y) {
+    var doc = cm.doc;
+    y += cm.display.viewOffset;
+    if (y < 0) return PosWithInfo(doc.first, 0, true, -1);
+    var lineNo = lineAtHeight(doc, y), last = doc.first + doc.size - 1;
+    if (lineNo > last)
+      return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, true, 1);
+    if (x < 0) x = 0;
+
+    for (;;) {
+      var lineObj = getLine(doc, lineNo);
+      var found = coordsCharInner(cm, lineObj, lineNo, x, y);
+      var merged = collapsedSpanAtEnd(lineObj);
+      var mergedPos = merged && merged.find();
+      if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))
+        lineNo = mergedPos.to.line;
+      else
+        return found;
+    }
+  }
+
+  function coordsCharInner(cm, lineObj, lineNo, x, y) {
+    var innerOff = y - heightAtLine(cm, lineObj);
+    var wrongLine = false, adjust = 2 * cm.display.wrapper.clientWidth;
+    var measurement = measureLine(cm, lineObj);
+
+    function getX(ch) {
+      var sp = cursorCoords(cm, Pos(lineNo, ch), "line",
+                            lineObj, measurement);
+      wrongLine = true;
+      if (innerOff > sp.bottom) return sp.left - adjust;
+      else if (innerOff < sp.top) return sp.left + adjust;
+      else wrongLine = false;
+      return sp.left;
+    }
+
+    var bidi = getOrder(lineObj), dist = lineObj.text.length;
+    var from = lineLeft(lineObj), to = lineRight(lineObj);
+    var fromX = getX(from), fromOutside = wrongLine, toX = getX(to), toOutside = wrongLine;
+
+    if (x > toX) return PosWithInfo(lineNo, to, toOutside, 1);
+    // Do a binary search between these bounds.
+    for (;;) {
+      if (bidi ? to == from || to == moveVisually(lineObj, from, 1) : to - from <= 1) {
+        var ch = x < fromX || x - fromX <= toX - x ? from : to;
+        var xDiff = x - (ch == from ? fromX : toX);
+        while (isExtendingChar.test(lineObj.text.charAt(ch))) ++ch;
+        var pos = PosWithInfo(lineNo, ch, ch == from ? fromOutside : toOutside,
+                              xDiff < 0 ? -1 : xDiff ? 1 : 0);
+        return pos;
+      }
+      var step = Math.ceil(dist / 2), middle = from + step;
+      if (bidi) {
+        middle = from;
+        for (var i = 0; i < step; ++i) middle = moveVisually(lineObj, middle, 1);
+      }
+      var middleX = getX(middle);
+      if (middleX > x) {to = middle; toX = middleX; if (toOutside = wrongLine) toX += 1000; dist = step;}
+      else {from = middle; fromX = middleX; fromOutside = wrongLine; dist -= step;}
+    }
+  }
+
+  var measureText;
+  function textHeight(display) {
+    if (display.cachedTextHeight != null) return display.cachedTextHeight;
+    if (measureText == null) {
+      measureText = elt("pre");
+      // Measure a bunch of lines, for browsers that compute
+      // fractional heights.
+      for (var i = 0; i < 49; ++i) {
+        measureText.appendChild(document.createTextNode("x"));
+        measureText.appendChild(elt("br"));
+      }
+      measureText.appendChild(document.createTextNode("x"));
+    }
+    removeChildrenAndAdd(display.measure, measureText);
+    var height = measureText.offsetHeight / 50;
+    if (height > 3) display.cachedTextHeight = height;
+    removeChildren(display.measure);
+    return height || 1;
+  }
+
+  function charWidth(display) {
+    if (display.cachedCharWidth != null) return display.cachedCharWidth;
+    var anchor = elt("span", "x");
+    var pre = elt("pre", [anchor]);
+    removeChildrenAndAdd(display.measure, pre);
+    var width = anchor.offsetWidth;
+    if (width > 2) display.cachedCharWidth = width;
+    return width || 10;
+  }
+
+  // OPERATIONS
+
+  // Operations are used to wrap changes in such a way that each
+  // change won't have to update the cursor and display (which would
+  // be awkward, slow, and error-prone), but instead updates are
+  // batched and then all combined and executed at once.
+
+  var nextOpId = 0;
+  function startOperation(cm) {
+    cm.curOp = {
+      // An array of ranges of lines that have to be updated. See
+      // updateDisplay.
+      changes: [],
+      forceUpdate: false,
+      updateInput: null,
+      userSelChange: null,
+      textChanged: null,
+      selectionChanged: false,
+      cursorActivity: false,
+      updateMaxLine: false,
+      updateScrollPos: false,
+      id: ++nextOpId
+    };
+    if (!delayedCallbackDepth++) delayedCallbacks = [];
+  }
+
+  function endOperation(cm) {
+    var op = cm.curOp, doc = cm.doc, display = cm.display;
+    cm.curOp = null;
+
+    if (op.updateMaxLine) computeMaxLength(cm);
+    if (display.maxLineChanged && !cm.options.lineWrapping && display.maxLine) {
+      var width = measureLineWidth(cm, display.maxLine);
+      display.sizer.style.minWidth = Math.max(0, width + 3 + scrollerCutOff) + "px";
+      display.maxLineChanged = false;
+      var maxScrollLeft = Math.max(0, display.sizer.offsetLeft + display.sizer.offsetWidth - display.scroller.clientWidth);
+      if (maxScrollLeft < doc.scrollLeft && !op.updateScrollPos)
+        setScrollLeft(cm, Math.min(display.scroller.scrollLeft, maxScrollLeft), true);
+    }
+    var newScrollPos, updated;
+    if (op.updateScrollPos) {
+      newScrollPos = op.updateScrollPos;
+    } else if (op.selectionChanged && display.scroller.clientHeight) { // don't rescroll if not visible
+      var coords = cursorCoords(cm, doc.sel.head);
+      newScrollPos = calculateScrollPos(cm, coords.left, coords.top, coords.left, coords.bottom);
+    }
+    if (op.changes.length || op.forceUpdate || newScrollPos && newScrollPos.scrollTop != null) {
+      updated = updateDisplay(cm, op.changes, newScrollPos && newScrollPos.scrollTop, op.forceUpdate);
+      if (cm.display.scroller.offsetHeight) cm.doc.scrollTop = cm.display.scroller.scrollTop;
+    }
+    if (!updated && op.selectionChanged) updateSelection(cm);
+    if (op.updateScrollPos) {
+      display.scroller.scrollTop = display.scrollbarV.scrollTop = doc.scrollTop = newScrollPos.scrollTop;
+      display.scroller.scrollLeft = display.scrollbarH.scrollLeft = doc.scrollLeft = newScrollPos.scrollLeft;
+      alignHorizontally(cm);
+      if (op.scrollToPos)
+        scrollPosIntoView(cm, clipPos(cm.doc, op.scrollToPos), op.scrollToPosMargin);
+    } else if (newScrollPos) {
+      scrollCursorIntoView(cm);
+    }
+    if (op.selectionChanged) restartBlink(cm);
+
+    if (cm.state.focused && op.updateInput)
+      resetInput(cm, op.userSelChange);
+
+    var hidden = op.maybeHiddenMarkers, unhidden = op.maybeUnhiddenMarkers;
+    if (hidden) for (var i = 0; i < hidden.length; ++i)
+      if (!hidden[i].lines.length) signal(hidden[i], "hide");
+    if (unhidden) for (var i = 0; i < unhidden.length; ++i)
+      if (unhidden[i].lines.length) signal(unhidden[i], "unhide");
+
+    var delayed;
+    if (!--delayedCallbackDepth) {
+      delayed = delayedCallbacks;
+      delayedCallbacks = null;
+    }
+    if (op.textChanged)
+      signal(cm, "change", cm, op.textChanged);
+    if (op.cursorActivity) signal(cm, "cursorActivity", cm);
+    if (delayed) for (var i = 0; i < delayed.length; ++i) delayed[i]();
+  }
+
+  // Wraps a function in an operation. Returns the wrapped function.
+  function operation(cm1, f) {
+    return function() {
+      var cm = cm1 || this, withOp = !cm.curOp;
+      if (withOp) startOperation(cm);
+      try { var result = f.apply(cm, arguments); }
+      finally { if (withOp) endOperation(cm); }
+      return result;
+    };
+  }
+  function docOperation(f) {
+    return function() {
+      var withOp = this.cm && !this.cm.curOp, result;
+      if (withOp) startOperation(this.cm);
+      try { result = f.apply(this, arguments); }
+      finally { if (withOp) endOperation(this.cm); }
+      return result;
+    };
+  }
+  function runInOp(cm, f) {
+    var withOp = !cm.curOp, result;
+    if (withOp) startOperation(cm);
+    try { result = f(); }
+    finally { if (withOp) endOperation(cm); }
+    return result;
+  }
+
+  function regChange(cm, from, to, lendiff) {
+    if (from == null) from = cm.doc.first;
+    if (to == null) to = cm.doc.first + cm.doc.size;
+    cm.curOp.changes.push({from: from, to: to, diff: lendiff});
+  }
+
+  // INPUT HANDLING
+
+  function slowPoll(cm) {
+    if (cm.display.pollingFast) return;
+    cm.display.poll.set(cm.options.pollInterval, function() {
+      readInput(cm);
+      if (cm.state.focused) slowPoll(cm);
+    });
+  }
+
+  function fastPoll(cm) {
+    var missed = false;
+    cm.display.pollingFast = true;
+    function p() {
+      var changed = readInput(cm);
+      if (!changed && !missed) {missed = true; cm.display.poll.set(60, p);}
+      else {cm.display.pollingFast = false; slowPoll(cm);}
+    }
+    cm.display.poll.set(20, p);
+  }
+
+  // prevInput is a hack to work with IME. If we reset the textarea
+  // on every change, that breaks IME. So we look for changes
+  // compared to the previous content instead. (Modern browsers have
+  // events that indicate IME taking place, but these are not widely
+  // supported or compatible enough yet to rely on.)
+  function readInput(cm) {
+    var input = cm.display.input, prevInput = cm.display.prevInput, doc = cm.doc, sel = doc.sel;
+    if (!cm.state.focused || hasSelection(input) || isReadOnly(cm) || cm.state.disableInput) return false;
+    if (cm.state.pasteIncoming && cm.state.fakedLastChar) {
+      input.value = input.value.substring(0, input.value.length - 1);
+      cm.state.fakedLastChar = false;
+    }
+    var text = input.value;
+    if (text == prevInput && posEq(sel.from, sel.to)) return false;
+    if (ie && !ie_lt9 && cm.display.inputHasSelection === text) {
+      resetInput(cm, true);
+      return false;
+    }
+
+    var withOp = !cm.curOp;
+    if (withOp) startOperation(cm);
+    sel.shift = false;
+    var same = 0, l = Math.min(prevInput.length, text.length);
+    while (same < l && prevInput.charCodeAt(same) == text.charCodeAt(same)) ++same;
+    var from = sel.from, to = sel.to;
+    if (same < prevInput.length)
+      from = Pos(from.line, from.ch - (prevInput.length - same));
+    else if (cm.state.overwrite && posEq(from, to) && !cm.state.pasteIncoming)
+      to = Pos(to.line, Math.min(getLine(doc, to.line).text.length, to.ch + (text.length - same)));
+
+    var updateInput = cm.curOp.updateInput;
+    var changeEvent = {from: from, to: to, text: splitLines(text.slice(same)),
+                       origin: cm.state.pasteIncoming ? "paste" : "+input"};
+    makeChange(cm.doc, changeEvent, "end");
+    cm.curOp.updateInput = updateInput;
+    signalLater(cm, "inputRead", cm, changeEvent);
+
+    if (text.length > 1000 || text.indexOf("\n") > -1) input.value = cm.display.prevInput = "";
+    else cm.display.prevInput = text;
+    if (withOp) endOperation(cm);
+    cm.state.pasteIncoming = false;
+    return true;
+  }
+
+  function resetInput(cm, user) {
+    var minimal, selected, doc = cm.doc;
+    if (!posEq(doc.sel.from, doc.sel.to)) {
+      cm.display.prevInput = "";
+      minimal = hasCopyEvent &&
+        (doc.sel.to.line - doc.sel.from.line > 100 || (selected = cm.getSelection()).length > 1000);
+      var content = minimal ? "-" : selected || cm.getSelection();
+      cm.display.input.value = content;
+      if (cm.state.focused) selectInput(cm.display.input);
+      if (ie && !ie_lt9) cm.display.inputHasSelection = content;
+    } else if (user) {
+      cm.display.prevInput = cm.display.input.value = "";
+      if (ie && !ie_lt9) cm.display.inputHasSelection = null;
+    }
+    cm.display.inaccurateSelection = minimal;
+  }
+
+  function focusInput(cm) {
+    if (cm.options.readOnly != "nocursor" && (!mobile || document.activeElement != cm.display.input))
+      cm.display.input.focus();
+  }
+
+  function isReadOnly(cm) {
+    return cm.options.readOnly || cm.doc.cantEdit;
+  }
+
+  // EVENT HANDLERS
+
+  function registerEventHandlers(cm) {
+    var d = cm.display;
+    on(d.scroller, "mousedown", operation(cm, onMouseDown));
+    if (ie)
+      on(d.scroller, "dblclick", operation(cm, function(e) {
+        if (signalDOMEvent(cm, e)) return;
+        var pos = posFromMouse(cm, e);
+        if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) return;
+        e_preventDefault(e);
+        var word = findWordAt(getLine(cm.doc, pos.line).text, pos);
+        extendSelection(cm.doc, word.from, word.to);
+      }));
+    else
+      on(d.scroller, "dblclick", function(e) { signalDOMEvent(cm, e) || e_preventDefault(e); });
+    on(d.lineSpace, "selectstart", function(e) {
+      if (!eventInWidget(d, e)) e_preventDefault(e);
+    });
+    // Gecko browsers fire contextmenu *after* opening the menu, at
+    // which point we can't mess with it anymore. Context menu is
+    // handled in onMouseDown for Gecko.
+    if (!captureMiddleClick) on(d.scroller, "contextmenu", function(e) {onContextMenu(cm, e);});
+
+    on(d.scroller, "scroll", function() {
+      if (d.scroller.clientHeight) {
+        setScrollTop(cm, d.scroller.scrollTop);
+        setScrollLeft(cm, d.scroller.scrollLeft, true);
+        signal(cm, "scroll", cm);
+      }
+    });
+    on(d.scrollbarV, "scroll", function() {
+      if (d.scroller.clientHeight) setScrollTop(cm, d.scrollbarV.scrollTop);
+    });
+    on(d.scrollbarH, "scroll", function() {
+      if (d.scroller.clientHeight) setScrollLeft(cm, d.scrollbarH.scrollLeft);
+    });
+
+    on(d.scroller, "mousewheel", function(e){onScrollWheel(cm, e);});
+    on(d.scroller, "DOMMouseScroll", function(e){onScrollWheel(cm, e);});
+
+    function reFocus() { if (cm.state.focused) setTimeout(bind(focusInput, cm), 0); }
+    on(d.scrollbarH, "mousedown", reFocus);
+    on(d.scrollbarV, "mousedown", reFocus);
+    // Prevent wrapper from ever scrolling
+    on(d.wrapper, "scroll", function() { d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; });
+
+    var resizeTimer;
+    function onResize() {
+      if (resizeTimer == null) resizeTimer = setTimeout(function() {
+        resizeTimer = null;
+        // Might be a text scaling operation, clear size caches.
+        d.cachedCharWidth = d.cachedTextHeight = knownScrollbarWidth = null;
+        clearCaches(cm);
+        runInOp(cm, bind(regChange, cm));
+      }, 100);
+    }
+    on(window, "resize", onResize);
+    // Above handler holds on to the editor and its data structures.
+    // Here we poll to unregister it when the editor is no longer in
+    // the document, so that it can be garbage-collected.
+    function unregister() {
+      for (var p = d.wrapper.parentNode; p && p != document.body; p = p.parentNode) {}
+      if (p) setTimeout(unregister, 5000);
+      else off(window, "resize", onResize);
+    }
+    setTimeout(unregister, 5000);
+
+    on(d.input, "keyup", operation(cm, function(e) {
+      if (signalDOMEvent(cm, e) || cm.options.onKeyEvent && cm.options.onKeyEvent(cm, addStop(e))) return;
+      if (e.keyCode == 16) cm.doc.sel.shift = false;
+    }));
+    on(d.input, "input", bind(fastPoll, cm));
+    on(d.input, "keydown", operation(cm, onKeyDown));
+    on(d.input, "keypress", operation(cm, onKeyPress));
+    on(d.input, "focus", bind(onFocus, cm));
+    on(d.input, "blur", bind(onBlur, cm));
+
+    function drag_(e) {
+      if (signalDOMEvent(cm, e) || cm.options.onDragEvent && cm.options.onDragEvent(cm, addStop(e))) return;
+      e_stop(e);
+    }
+    if (cm.options.dragDrop) {
+      on(d.scroller, "dragstart", function(e){onDragStart(cm, e);});
+      on(d.scroller, "dragenter", drag_);
+      on(d.scroller, "dragover", drag_);
+      on(d.scroller, "drop", operation(cm, onDrop));
+    }
+    on(d.scroller, "paste", function(e) {
+      if (eventInWidget(d, e)) return;
+      focusInput(cm);
+      fastPoll(cm);
+    });
+    on(d.input, "paste", function() {
+      // Workaround for webkit bug https://bugs.webkit.org/show_bug.cgi?id=90206
+      // Add a char to the end of textarea before paste occur so that
+      // selection doesn't span to the end of textarea.
+      if (webkit && !cm.state.fakedLastChar && !(new Date - cm.state.lastMiddleDown < 200)) {
+        var start = d.input.selectionStart, end = d.input.selectionEnd;
+        d.input.value += "$";
+        d.input.selectionStart = start;
+        d.input.selectionEnd = end;
+        cm.state.fakedLastChar = true;
+      }
+      cm.state.pasteIncoming = true;
+      fastPoll(cm);
+    });
+
+    function prepareCopy() {
+      if (d.inaccurateSelection) {
+        d.prevInput = "";
+        d.inaccurateSelection = false;
+        d.input.value = cm.getSelection();
+        selectInput(d.input);
+      }
+    }
+    on(d.input, "cut", prepareCopy);
+    on(d.input, "copy", prepareCopy);
+
+    // Needed to handle Tab key in KHTML
+    if (khtml) on(d.sizer, "mouseup", function() {
+        if (document.activeElement == d.input) d.input.blur();
+        focusInput(cm);
+    });
+  }
+
+  function eventInWidget(display, e) {
+    for (var n = e_target(e); n != display.wrapper; n = n.parentNode) {
+      if (!n || n.ignoreEvents || n.parentNode == display.sizer && n != display.mover) return true;
+    }
+  }
+
+  function posFromMouse(cm, e, liberal) {
+    var display = cm.display;
+    if (!liberal) {
+      var target = e_target(e);
+      if (target == display.scrollbarH || target == display.scrollbarH.firstChild ||
+          target == display.scrollbarV || target == display.scrollbarV.firstChild ||
+          target == display.scrollbarFiller || target == display.gutterFiller) return null;
+    }
+    var x, y, space = getRect(display.lineSpace);
+    // Fails unpredictably on IE[67] when mouse is dragged around quickly.
+    try { x = e.clientX; y = e.clientY; } catch (e) { return null; }
+    return coordsChar(cm, x - space.left, y - space.top);
+  }
+
+  var lastClick, lastDoubleClick;
+  function onMouseDown(e) {
+    if (signalDOMEvent(this, e)) return;
+    var cm = this, display = cm.display, doc = cm.doc, sel = doc.sel;
+    sel.shift = e.shiftKey;
+
+    if (eventInWidget(display, e)) {
+      if (!webkit) {
+        display.scroller.draggable = false;
+        setTimeout(function(){display.scroller.draggable = true;}, 100);
+      }
+      return;
+    }
+    if (clickInGutter(cm, e)) return;
+    var start = posFromMouse(cm, e);
+
+    switch (e_button(e)) {
+    case 3:
+      if (captureMiddleClick) onContextMenu.call(cm, cm, e);
+      return;
+    case 2:
+      if (webkit) cm.state.lastMiddleDown = +new Date;
+      if (start) extendSelection(cm.doc, start);
+      setTimeout(bind(focusInput, cm), 20);
+      e_preventDefault(e);
+      return;
+    }
+    // For button 1, if it was clicked inside the editor
+    // (posFromMouse returning non-null), we have to adjust the
+    // selection.
+    if (!start) {if (e_target(e) == display.scroller) e_preventDefault(e); return;}
+
+    if (!cm.state.focused) onFocus(cm);
+
+    var now = +new Date, type = "single";
+    if (lastDoubleClick && lastDoubleClick.time > now - 400 && posEq(lastDoubleClick.pos, start)) {
+      type = "triple";
+      e_preventDefault(e);
+      setTimeout(bind(focusInput, cm), 20);
+      selectLine(cm, start.line);
+    } else if (lastClick && lastClick.time > now - 400 && posEq(lastClick.pos, start)) {
+      type = "double";
+      lastDoubleClick = {time: now, pos: start};
+      e_preventDefault(e);
+      var word = findWordAt(getLine(doc, start.line).text, start);
+      extendSelection(cm.doc, word.from, word.to);
+    } else { lastClick = {time: now, pos: start}; }
+
+    var last = start;
+    if (cm.options.dragDrop && dragAndDrop && !isReadOnly(cm) && !posEq(sel.from, sel.to) &&
+        !posLess(start, sel.from) && !posLess(sel.to, start) && type == "single") {
+      var dragEnd = operation(cm, function(e2) {
+        if (webkit) display.scroller.draggable = false;
+        cm.state.draggingText = false;
+        off(document, "mouseup", dragEnd);
+        off(display.scroller, "drop", dragEnd);
+        if (Math.abs(e.clientX - e2.clientX) + Math.abs(e.clientY - e2.clientY) < 10) {
+          e_preventDefault(e2);
+          extendSelection(cm.doc, start);
+          focusInput(cm);
+        }
+      });
+      // Let the drag handler handle this.
+      if (webkit) display.scroller.draggable = true;
+      cm.state.draggingText = dragEnd;
+      // IE's approach to draggable
+      if (display.scroller.dragDrop) display.scroller.dragDrop();
+      on(document, "mouseup", dragEnd);
+      on(display.scroller, "drop", dragEnd);
+      return;
+    }
+    e_preventDefault(e);
+    if (type == "single") extendSelection(cm.doc, clipPos(doc, start));
+
+    var startstart = sel.from, startend = sel.to, lastPos = start;
+
+    function doSelect(cur) {
+      if (posEq(lastPos, cur)) return;
+      lastPos = cur;
+
+      if (type == "single") {
+        extendSelection(cm.doc, clipPos(doc, start), cur);
+        return;
+      }
+
+      startstart = clipPos(doc, startstart);
+      startend = clipPos(doc, startend);
+      if (type == "double") {
+        var word = findWordAt(getLine(doc, cur.line).text, cur);
+        if (posLess(cur, startstart)) extendSelection(cm.doc, word.from, startend);
+        else extendSelection(cm.doc, startstart, word.to);
+      } else if (type == "triple") {
+        if (posLess(cur, startstart)) extendSelection(cm.doc, startend, clipPos(doc, Pos(cur.line, 0)));
+        else extendSelection(cm.doc, startstart, clipPos(doc, Pos(cur.line + 1, 0)));
+      }
+    }
+
+    var editorSize = getRect(display.wrapper);
+    // Used to ensure timeout re-tries don't fire when another extend
+    // happened in the meantime (clearTimeout isn't reliable -- at
+    // least on Chrome, the timeouts still happen even when cleared,
+    // if the clear happens after their scheduled firing time).
+    var counter = 0;
+
+    function extend(e) {
+      var curCount = ++counter;
+      var cur = posFromMouse(cm, e, true);
+      if (!cur) return;
+      if (!posEq(cur, last)) {
+        if (!cm.state.focused) onFocus(cm);
+        last = cur;
+        doSelect(cur);
+        var visible = visibleLines(display, doc);
+        if (cur.line >= visible.to || cur.line < visible.from)
+          setTimeout(operation(cm, function(){if (counter == curCount) extend(e);}), 150);
+      } else {
+        var outside = e.clientY < editorSize.top ? -20 : e.clientY > editorSize.bottom ? 20 : 0;
+        if (outside) setTimeout(operation(cm, function() {
+          if (counter != curCount) return;
+          display.scroller.scrollTop += outside;
+          extend(e);
+        }), 50);
+      }
+    }
+
+    function done(e) {
+      counter = Infinity;
+      e_preventDefault(e);
+      focusInput(cm);
+      off(document, "mousemove", move);
+      off(document, "mouseup", up);
+    }
+
+    var move = operation(cm, function(e) {
+      if (!ie && !e_button(e)) done(e);
+      else extend(e);
+    });
+    var up = operation(cm, done);
+    on(document, "mousemove", move);
+    on(document, "mouseup", up);
+  }
+
+  function clickInGutter(cm, e) {
+    var display = cm.display;
+    try { var mX = e.clientX, mY = e.clientY; }
+    catch(e) { return false; }
+
+    if (mX >= Math.floor(getRect(display.gutters).right)) return false;
+    e_preventDefault(e);
+    if (!hasHandler(cm, "gutterClick")) return true;
+
+    var lineBox = getRect(display.lineDiv);
+    if (mY > lineBox.bottom) return true;
+    mY -= lineBox.top - display.viewOffset;
+
+    for (var i = 0; i < cm.options.gutters.length; ++i) {
+      var g = display.gutters.childNodes[i];
+      if (g && getRect(g).right >= mX) {
+        var line = lineAtHeight(cm.doc, mY);
+        var gutter = cm.options.gutters[i];
+        signalLater(cm, "gutterClick", cm, line, gutter, e);
+        break;
+      }
+    }
+    return true;
+  }
+
+  // Kludge to work around strange IE behavior where it'll sometimes
+  // re-fire a series of drag-related events right after the drop (#1551)
+  var lastDrop = 0;
+
+  function onDrop(e) {
+    var cm = this;
+    if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e) || (cm.options.onDragEvent && cm.options.onDragEvent(cm, addStop(e))))
+      return;
+    e_preventDefault(e);
+    if (ie) lastDrop = +new Date;
+    var pos = posFromMouse(cm, e, true), files = e.dataTransfer.files;
+    if (!pos || isReadOnly(cm)) return;
+    if (files && files.length && window.FileReader && window.File) {
+      var n = files.length, text = Array(n), read = 0;
+      var loadFile = function(file, i) {
+        var reader = new FileReader;
+        reader.onload = function() {
+          text[i] = reader.result;
+          if (++read == n) {
+            pos = clipPos(cm.doc, pos);
+            makeChange(cm.doc, {from: pos, to: pos, text: splitLines(text.join("\n")), origin: "paste"}, "around");
+          }
+        };
+        reader.readAsText(file);
+      };
+      for (var i = 0; i < n; ++i) loadFile(files[i], i);
+    } else {
+      // Don't do a replace if the drop happened inside of the selected text.
+      if (cm.state.draggingText && !(posLess(pos, cm.doc.sel.from) || posLess(cm.doc.sel.to, pos))) {
+        cm.state.draggingText(e);
+        // Ensure the editor is re-focused
+        setTimeout(bind(focusInput, cm), 20);
+        return;
+      }
+      try {
+        var text = e.dataTransfer.getData("Text");
+        if (text) {
+          var curFrom = cm.doc.sel.from, curTo = cm.doc.sel.to;
+          setSelection(cm.doc, pos, pos);
+          if (cm.state.draggingText) replaceRange(cm.doc, "", curFrom, curTo, "paste");
+          cm.replaceSelection(text, null, "paste");
+          focusInput(cm);
+          onFocus(cm);
+        }
+      }
+      catch(e){}
+    }
+  }
+
+  function onDragStart(cm, e) {
+    if (ie && (!cm.state.draggingText || +new Date - lastDrop < 100)) { e_stop(e); return; }
+    if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e)) return;
+
+    var txt = cm.getSelection();
+    e.dataTransfer.setData("Text", txt);
+
+    // Use dummy image instead of default browsers image.
+    // Recent Safari (~6.0.2) have a tendency to segfault when this happens, so we don't do it there.
+    if (e.dataTransfer.setDragImage && !safari) {
+      var img = elt("img", null, null, "position: fixed; left: 0; top: 0;");
+      if (opera) {
+        img.width = img.height = 1;
+        cm.display.wrapper.appendChild(img);
+        // Force a relayout, or Opera won't use our image for some obscure reason
+        img._top = img.offsetTop;
+      }
+      e.dataTransfer.setDragImage(img, 0, 0);
+      if (opera) img.parentNode.removeChild(img);
+    }
+  }
+
+  function setScrollTop(cm, val) {
+    if (Math.abs(cm.doc.scrollTop - val) < 2) return;
+    cm.doc.scrollTop = val;
+    if (!gecko) updateDisplay(cm, [], val);
+    if (cm.display.scroller.scrollTop != val) cm.display.scroller.scrollTop = val;
+    if (cm.display.scrollbarV.scrollTop != val) cm.display.scrollbarV.scrollTop = val;
+    if (gecko) updateDisplay(cm, []);
+    startWorker(cm, 100);
+  }
+  function setScrollLeft(cm, val, isScroller) {
+    if (isScroller ? val == cm.doc.scrollLeft : Math.abs(cm.doc.scrollLeft - val) < 2) return;
+    val = Math.min(val, cm.display.scroller.scrollWidth - cm.display.scroller.clientWidth);
+    cm.doc.scrollLeft = val;
+    alignHorizontally(cm);
+    if (cm.display.scroller.scrollLeft != val) cm.display.scroller.scrollLeft = val;
+    if (cm.display.scrollbarH.scrollLeft != val) cm.display.scrollbarH.scrollLeft = val;
+  }
+
+  // Since the delta values reported on mouse wheel events are
+  // unstandardized between browsers and even browser versions, and
+  // generally horribly unpredictable, this code starts by measuring
+  // the scroll effect that the first few mouse wheel events have,
+  // and, from that, detects the way it can convert deltas to pixel
+  // offsets afterwards.
+  //
+  // The reason we want to know the amount a wheel event will scroll
+  // is that it gives us a chance to update the display before the
+  // actual scrolling happens, reducing flickering.
+
+  var wheelSamples = 0, wheelPixelsPerUnit = null;
+  // Fill in a browser-detected starting value on browsers where we
+  // know one. These don't have to be accurate -- the result of them
+  // being wrong would just be a slight flicker on the first wheel
+  // scroll (if it is large enough).
+  if (ie) wheelPixelsPerUnit = -.53;
+  else if (gecko) wheelPixelsPerUnit = 15;
+  else if (chrome) wheelPixelsPerUnit = -.7;
+  else if (safari) wheelPixelsPerUnit = -1/3;
+
+  function onScrollWheel(cm, e) {
+    var dx = e.wheelDeltaX, dy = e.wheelDeltaY;
+    if (dx == null && e.detail && e.axis == e.HORIZONTAL_AXIS) dx = e.detail;
+    if (dy == null && e.detail && e.axis == e.VERTICAL_AXIS) dy = e.detail;
+    else if (dy == null) dy = e.wheelDelta;
+
+    var display = cm.display, scroll = display.scroller;
+    // Quit if there's nothing to scroll here
+    if (!(dx && scroll.scrollWidth > scroll.clientWidth ||
+          dy && scroll.scrollHeight > scroll.clientHeight)) return;
+
+    // Webkit browsers on OS X abort momentum scrolls when the target
+    // of the scroll event is removed from the scrollable element.
+    // This hack (see related code in patchDisplay) makes sure the
+    // element is kept around.
+    if (dy && mac && webkit) {
+      for (var cur = e.target; cur != scroll; cur = cur.parentNode) {
+        if (cur.lineObj) {
+          cm.display.currentWheelTarget = cur;
+          break;
+        }
+      }
+    }
+
+    // On some browsers, horizontal scrolling will cause redraws to
+    // happen before the gutter has been realigned, causing it to
+    // wriggle around in a most unseemly way. When we have an
+    // estimated pixels/delta value, we just handle horizontal
+    // scrolling entirely here. It'll be slightly off from native, but
+    // better than glitching out.
+    if (dx && !gecko && !opera && wheelPixelsPerUnit != null) {
+      if (dy)
+        setScrollTop(cm, Math.max(0, Math.min(scroll.scrollTop + dy * wheelPixelsPerUnit, scroll.scrollHeight - scroll.clientHeight)));
+      setScrollLeft(cm, Math.max(0, Math.min(scroll.scrollLeft + dx * wheelPixelsPerUnit, scroll.scrollWidth - scroll.clientWidth)));
+      e_preventDefault(e);
+      display.wheelStartX = null; // Abort measurement, if in progress
+      return;
+    }
+
+    if (dy && wheelPixelsPerUnit != null) {
+      var pixels = dy * wheelPixelsPerUnit;
+      var top = cm.doc.scrollTop, bot = top + display.wrapper.clientHeight;
+      if (pixels < 0) top = Math.max(0, top + pixels - 50);
+      else bot = Math.min(cm.doc.height, bot + pixels + 50);
+      updateDisplay(cm, [], {top: top, bottom: bot});
+    }
+
+    if (wheelSamples < 20) {
+      if (display.wheelStartX == null) {
+        display.wheelStartX = scroll.scrollLeft; display.wheelStartY = scroll.scrollTop;
+        display.wheelDX = dx; display.wheelDY = dy;
+        setTimeout(function() {
+          if (display.wheelStartX == null) return;
+          var movedX = scroll.scrollLeft - display.wheelStartX;
+          var movedY = scroll.scrollTop - display.wheelStartY;
+          var sample = (movedY && display.wheelDY && movedY / display.wheelDY) ||
+            (movedX && display.wheelDX && movedX / display.wheelDX);
+          display.wheelStartX = display.wheelStartY = null;
+          if (!sample) return;
+          wheelPixelsPerUnit = (wheelPixelsPerUnit * wheelSamples + sample) / (wheelSamples + 1);
+          ++wheelSamples;
+        }, 200);
+      } else {
+        display.wheelDX += dx; display.wheelDY += dy;
+      }
+    }
+  }
+
+  function doHandleBinding(cm, bound, dropShift) {
+    if (typeof bound == "string") {
+      bound = commands[bound];
+      if (!bound) return false;
+    }
+    // Ensure previous input has been read, so that the handler sees a
+    // consistent view of the document
+    if (cm.display.pollingFast && readInput(cm)) cm.display.pollingFast = false;
+    var doc = cm.doc, prevShift = doc.sel.shift, done = false;
+    try {
+      if (isReadOnly(cm)) cm.state.suppressEdits = true;
+      if (dropShift) doc.sel.shift = false;
+      done = bound(cm) != Pass;
+    } finally {
+      doc.sel.shift = prevShift;
+      cm.state.suppressEdits = false;
+    }
+    return done;
+  }
+
+  function allKeyMaps(cm) {
+    var maps = cm.state.keyMaps.slice(0);
+    if (cm.options.extraKeys) maps.push(cm.options.extraKeys);
+    maps.push(cm.options.keyMap);
+    return maps;
+  }
+
+  var maybeTransition;
+  function handleKeyBinding(cm, e) {
+    // Handle auto keymap transitions
+    var startMap = getKeyMap(cm.options.keyMap), next = startMap.auto;
+    clearTimeout(maybeTransition);
+    if (next && !isModifierKey(e)) maybeTransition = setTimeout(function() {
+      if (getKeyMap(cm.options.keyMap) == startMap) {
+        cm.options.keyMap = (next.call ? next.call(null, cm) : next);
+        keyMapChanged(cm);
+      }
+    }, 50);
+
+    var name = keyName(e, true), handled = false;
+    if (!name) return false;
+    var keymaps = allKeyMaps(cm);
+
+    if (e.shiftKey) {
+      // First try to resolve full name (including 'Shift-'). Failing
+      // that, see if there is a cursor-motion command (starting with
+      // 'go') bound to the keyname without 'Shift-'.
+      handled = lookupKey("Shift-" + name, keymaps, function(b) {return doHandleBinding(cm, b, true);})
+             || lookupKey(name, keymaps, function(b) {
+                  if (typeof b == "string" ? /^go[A-Z]/.test(b) : b.motion)
+                    return doHandleBinding(cm, b);
+                });
+    } else {
+      handled = lookupKey(name, keymaps, function(b) { return doHandleBinding(cm, b); });
+    }
+
+    if (handled) {
+      e_preventDefault(e);
+      restartBlink(cm);
+      if (ie_lt9) { e.oldKeyCode = e.keyCode; e.keyCode = 0; }
+      signalLater(cm, "keyHandled", cm, name, e);
+    }
+    return handled;
+  }
+
+  function handleCharBinding(cm, e, ch) {
+    var handled = lookupKey("'" + ch + "'", allKeyMaps(cm),
+                            function(b) { return doHandleBinding(cm, b, true); });
+    if (handled) {
+      e_preventDefault(e);
+      restartBlink(cm);
+      signalLater(cm, "keyHandled", cm, "'" + ch + "'", e);
+    }
+    return handled;
+  }
+
+  var lastStoppedKey = null;
+  function onKeyDown(e) {
+    var cm = this;
+    if (!cm.state.focused) onFocus(cm);
+    if (signalDOMEvent(cm, e) || cm.options.onKeyEvent && cm.options.onKeyEvent(cm, addStop(e))) return;
+    if (ie && e.keyCode == 27) e.returnValue = false;
+    var code = e.keyCode;
+    // IE does strange things with escape.
+    cm.doc.sel.shift = code == 16 || e.shiftKey;
+    // First give onKeyEvent option a chance to handle this.
+    var handled = handleKeyBinding(cm, e);
+    if (opera) {
+      lastStoppedKey = handled ? code : null;
+      // Opera has no cut event... we try to at least catch the key combo
+      if (!handled && code == 88 && !hasCopyEvent && (mac ? e.metaKey : e.ctrlKey))
+        cm.replaceSelection("");
+    }
+  }
+
+  function onKeyPress(e) {
+    var cm = this;
+    if (signalDOMEvent(cm, e) || cm.options.onKeyEvent && cm.options.onKeyEvent(cm, addStop(e))) return;
+    var keyCode = e.keyCode, charCode = e.charCode;
+    if (opera && keyCode == lastStoppedKey) {lastStoppedKey = null; e_preventDefault(e); return;}
+    if (((opera && (!e.which || e.which < 10)) || khtml) && handleKeyBinding(cm, e)) return;
+    var ch = String.fromCharCode(charCode == null ? keyCode : charCode);
+    if (this.options.electricChars && this.doc.mode.electricChars &&
+        this.options.smartIndent && !isReadOnly(this) &&
+        this.doc.mode.electricChars.indexOf(ch) > -1)
+      setTimeout(operation(cm, function() {indentLine(cm, cm.doc.sel.to.line, "smart");}), 75);
+    if (handleCharBinding(cm, e, ch)) return;
+    if (ie && !ie_lt9) cm.display.inputHasSelection = null;
+    fastPoll(cm);
+  }
+
+  function onFocus(cm) {
+    if (cm.options.readOnly == "nocursor") return;
+    if (!cm.state.focused) {
+      signal(cm, "focus", cm);
+      cm.state.focused = true;
+      if (cm.display.wrapper.className.search(/\bCodeMirror-focused\b/) == -1)
+        cm.display.wrapper.className += " CodeMirror-focused";
+      if (!cm.curOp) {
+        resetInput(cm, true);
+        if (webkit) setTimeout(bind(resetInput, 

<TRUNCATED>

[065/100] [abbrv] git commit: making some thing easier to what's necessary to implement MARMOTTA-482 without modifying the core code

Posted by wi...@apache.org.
making some thing easier to what's necessary to implement MARMOTTA-482 without modifying the core code


Project: http://git-wip-us.apache.org/repos/asf/marmotta/repo
Commit: http://git-wip-us.apache.org/repos/asf/marmotta/commit/e3c9fe61
Tree: http://git-wip-us.apache.org/repos/asf/marmotta/tree/e3c9fe61
Diff: http://git-wip-us.apache.org/repos/asf/marmotta/diff/e3c9fe61

Branch: refs/heads/ldp
Commit: e3c9fe6146492b4c7fe577f10071359ce671a12b
Parents: 68d815e
Author: Sergio Fernández <wi...@apache.org>
Authored: Tue Apr 8 16:27:56 2014 +0200
Committer: Sergio Fernández <wi...@apache.org>
Committed: Tue Apr 8 16:27:56 2014 +0200

----------------------------------------------------------------------
 .../core/api/templating/TemplatingService.java  |  7 +-
 .../templating/TemplatingServiceImpl.java       | 98 ++++++++++----------
 2 files changed, 54 insertions(+), 51 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/marmotta/blob/e3c9fe61/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/templating/TemplatingService.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/templating/TemplatingService.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/templating/TemplatingService.java
index c930222..cc7347b 100644
--- a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/templating/TemplatingService.java
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/templating/TemplatingService.java
@@ -39,8 +39,11 @@ public interface TemplatingService {
     public final static String DEFAULT_REST_FILE = "overview-index.html";
     
     final static String ADMIN_TPL = "admin.ftl";
-    
+
+    @Deprecated
     final static String ERROR_404_TPL = "404.ftl";
+
+    final static String ERROR_TPL = "error.ftl";
     
     final static String RDF_HTML_TPL = "rdfhtml.ftl";
     
@@ -48,7 +51,7 @@ public interface TemplatingService {
     
     static final String DEFAULT_STYLE = "blue";
 
-    public final static String DEFAULT_WEBSERVICE_TITLE = "Webservice";
+    final static String DEFAULT_WEBSERVICE_TITLE = "Webservice";
     
     void initDataModel();
     

http://git-wip-us.apache.org/repos/asf/marmotta/blob/e3c9fe61/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/templating/TemplatingServiceImpl.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/templating/TemplatingServiceImpl.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/templating/TemplatingServiceImpl.java
index 231326f..d1eda73 100644
--- a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/templating/TemplatingServiceImpl.java
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/templating/TemplatingServiceImpl.java
@@ -45,14 +45,14 @@ import org.slf4j.LoggerFactory;
 
 /**
  * Template Service Implementation
- * 
+ *
  * @author Sergio Fernández
  */
 @ApplicationScoped
 public class TemplatingServiceImpl implements TemplatingService {
-	
-	private Map<String,String> common; 
-	
+
+    private Map<String, String> common;
+
     @Inject
     private ConfigurationService configurationService;
 
@@ -63,13 +63,13 @@ public class TemplatingServiceImpl implements TemplatingService {
 
     private File templateDir;
 
-	public TemplatingServiceImpl() {
-		super();
-		common = new HashMap<String,String>();
-	}
+    public TemplatingServiceImpl() {
+        super();
+        common = new HashMap<String, String>();
+    }
 
-	@PostConstruct
-	public void initDataModel() {
+    @PostConstruct
+    public void initDataModel() {
         Preconditions.checkState(startupService.isHostStarted());
 
         String project = configurationService.getStringConfiguration("kiwi.pages.project", DEFAULT_PROJECT);
@@ -77,34 +77,35 @@ public class TemplatingServiceImpl implements TemplatingService {
         common.put("DEFAULT_STYLE", configurationService.getStringConfiguration("kiwi.pages.style_path", DEFAULT_STYLE));
         common.put("SERVER_URL", configurationService.getServerUri());
         common.put("BASIC_URL", configurationService.getBaseUri());
-        common.put("LOGO", configurationService.getStringConfiguration("kiwi.pages.project."+project+".logo", project+".png"));
-        common.put("FOOTER", configurationService.getStringConfiguration("kiwi.pages.project."+project+".footer", "(footer not properly configured for project "+project+")"));
+        common.put("LOGO", configurationService.getStringConfiguration("kiwi.pages.project." + project + ".logo", project + ".png"));
+        common.put("FOOTER", configurationService.getStringConfiguration("kiwi.pages.project." + project + ".footer", "(footer not properly configured for project " + project + ")"));
 
         templateDir = new File(configurationService.getHome(), TemplatingService.PATH);
 
         if (!templateDir.exists()) templateDir.mkdirs();
 
-	}
+    }
 
     private void loadTemplateFromClasspath(String templateName, Class<?> clazz) {
         final String src = TemplatingService.PATH + templateName;
-        final File dT = new File(templateDir, templateName);
-        if (!dT.exists()) {
+        final File tpl = new File(templateDir, templateName);
+        if (!tpl.exists()) {
             try {
                 log.info("template {} not found in {}, copying fallback...", templateName, templateDir.getAbsolutePath());
-                final InputStream str = clazz.getResourceAsStream(src);
-                if (str == null) {
+                final InputStream in = clazz.getResourceAsStream(src);
+                if (in == null) {
                     throw new IOException("Resource " + src + " not found in ClassLoader (" + clazz + ")");
                 }
-                FileUtils.copyInputStreamToFile(str, dT);
+                FileUtils.copyInputStreamToFile(in, tpl);
             } catch (IOException e) {
                 log.error("Could not load template from classpath, templating might react weird!", e);
             }
         }
     }
-    
+
     /**
      * Update the data model in case an important value has changed
+     *
      * @param event
      */
     public void configurationChangedEvent(@Observes ConfigurationChangedEvent event) {
@@ -115,14 +116,14 @@ public class TemplatingServiceImpl implements TemplatingService {
             initDataModel();
         }
     }
-	
-	@Override
-    public  Configuration getConfiguration() {
+
+    @Override
+    public Configuration getConfiguration() {
         return getConfiguration(TemplatingServiceImpl.class);
     }
 
-	@Override
-    public  Configuration getConfiguration(Class<?> cls) {
+    @Override
+    public Configuration getConfiguration(Class<?> cls) {
         Configuration cfg = new Configuration();
         cfg.setDefaultEncoding("utf-8");
         cfg.setURLEscapingCharset("utf-8");
@@ -136,52 +137,51 @@ public class TemplatingServiceImpl implements TemplatingService {
     }
 
 
-
     @Override
     public Template getTemplate(String name) throws IOException {
         // make sure template exists
         loadTemplateFromClasspath(name, TemplatingServiceImpl.class);
-        
+
         return getConfiguration().getTemplate(name);
     }
-	
+
     @Override
     public Template getTemplate(Class<?> cls, String name) throws IOException {
         // make sure template exists
         loadTemplateFromClasspath(name, cls);
-        
+
         return getConfiguration(cls).getTemplate(name);
     }
-	
-	@Override
-	public String process(String name) throws IOException, TemplateException {
-		return process(name, new HashMap<String, Object>());
-	}
-
-	@Override
-	public String process(String name, Map<String, Object> data) throws IOException, TemplateException {
+
+    @Override
+    public String process(String name) throws IOException, TemplateException {
+        return process(name, new HashMap<String, Object>());
+    }
+
+    @Override
+    public String process(String name, Map<String, Object> data) throws IOException, TemplateException {
         OutputStream os = new ByteArrayOutputStream();
         Writer writer = new BufferedWriter(new OutputStreamWriter(os));
         process(name, data, writer);
         return os.toString();
-	}
+    }
 
-	@Override
-	public void process(String name, Writer writer) throws IOException, TemplateException {
-		process(name, new HashMap<String, Object>(), writer);
-	}
+    @Override
+    public void process(String name, Writer writer) throws IOException, TemplateException {
+        process(name, new HashMap<String, Object>(), writer);
+    }
 
-	@Override
-	public void process(String name, Map<String, Object> data, Writer writer) throws IOException, TemplateException {
-		process(TemplatingServiceImpl.class, name, data, writer);
-	}
+    @Override
+    public void process(String name, Map<String, Object> data, Writer writer) throws IOException, TemplateException {
+        process(TemplatingServiceImpl.class, name, data, writer);
+    }
 
-	@Override
-	public void process(Class<?> cls, String name, Map<String, Object> data, Writer writer) throws IOException, TemplateException {
+    @Override
+    public void process(Class<?> cls, String name, Map<String, Object> data, Writer writer) throws IOException, TemplateException {
         Template tpl = getTemplate(cls, name);
         data.putAll(common);
         tpl.process(data, writer);
         writer.flush();
-	}
-    
+    }
+
 }


[042/100] [abbrv] [partial] Reverting the erroneous merge by Sebastian according to the instructions in INFRA-6876

Posted by wi...@apache.org.
http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/AbstractFacadingTest.java
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/AbstractFacadingTest.java b/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/AbstractFacadingTest.java
index 04762b4..befedc2 100644
--- a/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/AbstractFacadingTest.java
+++ b/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/AbstractFacadingTest.java
@@ -14,17 +14,19 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.apache.marmotta.commons.sesame.facading;
 
+import java.io.IOException;
+
+import org.apache.marmotta.kiwi.persistence.h2.H2Dialect;
+import org.apache.marmotta.kiwi.sail.KiWiStore;
 import org.junit.After;
 import org.junit.Before;
 import org.openrdf.repository.Repository;
 import org.openrdf.repository.RepositoryException;
 import org.openrdf.repository.sail.SailRepository;
 import org.openrdf.rio.RDFParseException;
-import org.openrdf.sail.memory.MemoryStore;
-
-import java.io.IOException;
 
 public abstract class AbstractFacadingTest {
 
@@ -32,7 +34,13 @@ public abstract class AbstractFacadingTest {
 
     @Before
     public void setup() throws RepositoryException, IOException, RDFParseException {
-        repositoryRDF = new SailRepository(new MemoryStore());
+        // jdbc:h2:mem;MVCC=true;DB_CLOSE_ON_EXIT=FALSE;DB_CLOSE_DELAY=10
+        repositoryRDF = new SailRepository(
+                new KiWiStore(
+                        "kiwiTest",
+                        "jdbc:h2:mem:facading;MVCC=true;DB_CLOSE_ON_EXIT=TRUE;DB_CLOSE_DELAY=10",
+                        "", "", new H2Dialect(),
+                        "http://example.com/ctx/default", "http://example.com/ctx/inferred"));
         repositoryRDF.initialize();
     }
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/builder/FacadingPredicateBuilderTest.java
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/builder/FacadingPredicateBuilderTest.java b/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/builder/FacadingPredicateBuilderTest.java
index c9515cb..88e043b 100644
--- a/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/builder/FacadingPredicateBuilderTest.java
+++ b/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/builder/FacadingPredicateBuilderTest.java
@@ -14,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.apache.marmotta.commons.sesame.facading.builder;
 
 import static org.hamcrest.CoreMatchers.allOf;
@@ -49,6 +50,7 @@ public class FacadingPredicateBuilderTest extends AbstractFacadingTest {
         super.setup();
 
         connection = repositoryRDF.getConnection();
+        connection.begin();
         facading = FacadingFactory.createFacading(connection);
     }
 
@@ -90,7 +92,7 @@ public class FacadingPredicateBuilderTest extends AbstractFacadingTest {
     @After
     public void tearDown() throws RepositoryException {
         if (connection != null) {
-            connection.rollback();
+            connection.commit();
             connection.close();
         }
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/builder/model/ExampleFacade.java
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/builder/model/ExampleFacade.java b/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/builder/model/ExampleFacade.java
index 186c9ba..632edce 100644
--- a/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/builder/model/ExampleFacade.java
+++ b/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/builder/model/ExampleFacade.java
@@ -14,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.apache.marmotta.commons.sesame.facading.builder.model;
 
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/builder/model/ExamplePropBuilder.java
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/builder/model/ExamplePropBuilder.java b/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/builder/model/ExamplePropBuilder.java
index 0caf2c7..89baca4 100644
--- a/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/builder/model/ExamplePropBuilder.java
+++ b/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/builder/model/ExamplePropBuilder.java
@@ -14,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.apache.marmotta.commons.sesame.facading.builder.model;
 
 import org.apache.marmotta.commons.sesame.facading.model.AbstractNamespacePropBuilder;

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/collections/CollectionFacadingTest.java
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/collections/CollectionFacadingTest.java b/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/collections/CollectionFacadingTest.java
index ef143dd..bebe041 100644
--- a/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/collections/CollectionFacadingTest.java
+++ b/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/collections/CollectionFacadingTest.java
@@ -14,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.apache.marmotta.commons.sesame.facading.collections;
 
 import static org.hamcrest.CoreMatchers.hasItems;
@@ -39,20 +40,22 @@ public class CollectionFacadingTest extends AbstractFacadingTest {
 
     @Test
     public void testCollectionFacading() throws RepositoryException {
-        final RepositoryConnection connection = repositoryRDF.getConnection();
 
         final Random rnd = new Random();
         final Date a, b, c, d, e, now;
-        now = new Date();
+        now = new Date(60000*(System.currentTimeMillis()/60000L));
+
         // Start 10Yrs back;
-        final int tenYrsInSecs = 10 * 365 * 24 * 60 * 60;
-        a = new Date(now.getTime() - tenYrsInSecs * 1000L);
-        b = new Date(a.getTime() + rnd.nextInt(tenYrsInSecs) * 1000L);
-        c = new Date(a.getTime() + rnd.nextInt(tenYrsInSecs) * 1000L);
-        d = new Date(a.getTime() + rnd.nextInt(tenYrsInSecs) * 1000L);
-        e = new Date(a.getTime() + rnd.nextInt(tenYrsInSecs) * 1000L);
+        final int tenYrsInMin = 10 * 365 * 24 * 60;
+        a = new Date(now.getTime() - tenYrsInMin * 60000L);
+        b = new Date(a.getTime() + rnd.nextInt(tenYrsInMin) * 60000L);
+        c = new Date(a.getTime() + rnd.nextInt(tenYrsInMin) * 60000L);
+        d = new Date(a.getTime() + rnd.nextInt(tenYrsInMin) * 60000L);
+        e = new Date(a.getTime() + rnd.nextInt(tenYrsInMin) * 60000L);
 
+        final RepositoryConnection connection = repositoryRDF.getConnection();
         try {
+            connection.begin();
             final Facading facading = FacadingFactory.createFacading(connection);
 
             URI uri = connection.getValueFactory().createURI("http://www.example.com/rdf/test/collections");
@@ -70,6 +73,8 @@ public class CollectionFacadingTest extends AbstractFacadingTest {
 
             facade.deleteDates();
             Assert.assertEquals(facade.getDates().size(), 0);
+            
+            connection.commit();
         } finally {
             connection.close();
         }
@@ -83,6 +88,7 @@ public class CollectionFacadingTest extends AbstractFacadingTest {
 
         try {
             final Facading facading = FacadingFactory.createFacading(connection);
+            connection.begin();
 
             URI uri = connection.getValueFactory().createURI("http://www.example.com/rdf/test/document");
             CollectionFacade facade = facading.createFacade(uri, CollectionFacade.class);

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/collections/model/CollectionFacade.java
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/collections/model/CollectionFacade.java b/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/collections/model/CollectionFacade.java
index 5980e17..72fdf8a 100644
--- a/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/collections/model/CollectionFacade.java
+++ b/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/collections/model/CollectionFacade.java
@@ -14,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.apache.marmotta.commons.sesame.facading.collections.model;
 
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/concurrent/ConcurrentFacadingTest.java
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/concurrent/ConcurrentFacadingTest.java b/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/concurrent/ConcurrentFacadingTest.java
new file mode 100644
index 0000000..241f5f3
--- /dev/null
+++ b/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/concurrent/ConcurrentFacadingTest.java
@@ -0,0 +1,198 @@
+/*
+ * 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.commons.sesame.facading.concurrent;
+
+import java.util.ConcurrentModificationException;
+import java.util.UUID;
+
+import org.apache.marmotta.commons.sesame.facading.AbstractFacadingTest;
+import org.apache.marmotta.commons.sesame.facading.FacadingFactory;
+import org.apache.marmotta.commons.sesame.facading.api.Facading;
+import org.apache.marmotta.commons.sesame.facading.concurrent.model.FooFacade;
+import org.apache.marmotta.commons.sesame.facading.concurrent.model.TypeFacade;
+import org.apache.marmotta.commons.sesame.repository.ResourceUtils;
+import org.apache.marmotta.commons.vocabulary.DCTERMS;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Ignore;
+import org.junit.Test;
+import org.openrdf.model.URI;
+import org.openrdf.model.vocabulary.RDF;
+import org.openrdf.repository.RepositoryConnection;
+import org.openrdf.repository.RepositoryException;
+
+public class ConcurrentFacadingTest extends AbstractFacadingTest {
+
+    private URI subject;
+
+    @Before
+    public void init() {
+        subject = repositoryRDF.getValueFactory().createURI("http://example.com/rdf/" + UUID.randomUUID().toString());
+    }
+
+    @Test
+    public void testParallelConnections() throws RepositoryException {
+        final URI type = repositoryRDF.getValueFactory().createURI(DCTERMS.Agent.stringValue()+"#", UUID.randomUUID().toString());
+        final RepositoryConnection cX = repositoryRDF.getConnection(),
+                cO = repositoryRDF.getConnection();
+        try {
+            cX.begin();
+            cO.begin();
+
+            cX.add(subject, RDF.TYPE, type);
+            Assert.assertTrue (cX.hasStatement(subject, RDF.TYPE, type, false));
+            Assert.assertFalse(cO.hasStatement(subject, RDF.TYPE, type, false));
+
+            cX.commit();
+            Assert.assertTrue(cO.hasStatement(subject, RDF.TYPE, type, false));
+
+            cO.commit();
+        } finally {
+            if (cX.isActive()) cX.rollback();
+            if (cO.isActive()) cO.rollback();
+            cX.close();
+            cO.close();
+        }
+    }
+
+    @Test
+    @Ignore("currently fails for H2 database because of transaction locking")
+    public void testParallelFacading() throws RepositoryException {
+        final RepositoryConnection fc = repositoryRDF.getConnection();
+        try {
+            fc.begin();
+            final Facading facading = FacadingFactory.createFacading(fc);
+
+            final FooFacade ff = facading.createFacade(subject, FooFacade.class);
+
+            Assert.assertNull(ff.getString());
+            final String v = UUID.randomUUID().toString(); 
+            ff.setString(v);
+            Assert.assertEquals(v, ff.getString());
+
+            final RepositoryConnection fc2 = repositoryRDF.getConnection();
+            try {
+                fc2.begin();
+
+                final Facading f2 = FacadingFactory.createFacading(fc2);
+                Assert.assertNull(f2.createFacade(subject, FooFacade.class).getString());
+
+                fc2.commit();
+            } finally {
+                if (fc2.isActive()) fc2.rollback();
+                fc2.close();
+            }
+
+            fc.commit();
+
+            final RepositoryConnection fc3 = repositoryRDF.getConnection();
+            try {
+                fc3.begin();
+
+                final Facading f3 = FacadingFactory.createFacading(fc3);
+                Assert.assertEquals(v, f3.createFacade(subject, FooFacade.class).getString());
+
+                fc3.commit();
+            } finally {
+                if (fc3.isActive()) fc3.rollback();
+                fc3.close();
+            }
+        } finally {
+            if (fc.isActive()) fc.rollback();
+            fc.close();
+        }
+    }
+
+    /**
+     * Test for MARMOTTA-236
+     * @throws RepositoryException
+     */
+    @Test
+    public void testParallelFacadingType() throws RepositoryException {
+        final RepositoryConnection mainCon = repositoryRDF.getConnection();
+        try {
+            mainCon.begin();
+            Assert.assertFalse(ResourceUtils.hasType(mainCon, subject, TypeFacade.TYPE));
+            
+            final Facading facading = FacadingFactory.createFacading(mainCon);
+            Assert.assertFalse(facading.isFacadeable(subject, TypeFacade.class));
+            Assert.assertFalse(ResourceUtils.hasType(mainCon, subject, TypeFacade.TYPE));
+
+
+            final TypeFacade ff = facading.createFacade(subject, TypeFacade.class);
+            Assert.assertTrue(facading.isFacadeable(subject, TypeFacade.class));
+            Assert.assertTrue(ResourceUtils.hasType(mainCon, subject, TypeFacade.TYPE));
+
+            Assert.assertNull(ff.getTitle());
+            final String v = UUID.randomUUID().toString(); 
+            ff.setTitle(v);
+            Assert.assertEquals(v, ff.getTitle());
+            Assert.assertTrue(ResourceUtils.hasType(mainCon, subject, TypeFacade.TYPE));
+            Assert.assertTrue(facading.isFacadeable(subject, TypeFacade.class));
+
+            { // before-commit
+                final RepositoryConnection subCon_1 = repositoryRDF.getConnection();
+                try {
+                    subCon_1.begin();
+                    Assert.assertFalse(ResourceUtils.hasType(subCon_1, subject, TypeFacade.TYPE));
+
+                    final Facading f_1 = FacadingFactory.createFacading(subCon_1);
+                    Assert.assertFalse(f_1.isFacadeable(subject, TypeFacade.class));
+
+                    final TypeFacade tf_1 = f_1.createFacade(subject, TypeFacade.class);
+                    Assert.assertNull(tf_1.getTitle());
+                    Assert.assertTrue(f_1.isFacadeable(subject, TypeFacade.class));
+                    Assert.assertTrue(ResourceUtils.hasType(subCon_1, subject, TypeFacade.TYPE));
+
+                    subCon_1.rollback();
+                } finally {
+                    if (subCon_1.isActive()) subCon_1.rollback();
+                    subCon_1.close();
+                }
+            }
+
+            mainCon.commit();
+
+            { // after-commit
+                final RepositoryConnection subCon_2 = repositoryRDF.getConnection();
+                try {
+                    subCon_2.begin();
+                    Assert.assertTrue(ResourceUtils.hasType(subCon_2, subject, TypeFacade.TYPE));
+
+                    final Facading f_2 = FacadingFactory.createFacading(subCon_2);
+                    Assert.assertTrue(f_2.isFacadeable(subject, TypeFacade.class));
+
+                    Assert.assertEquals(v, f_2.createFacade(subject, TypeFacade.class).getTitle());
+                    Assert.assertTrue(ResourceUtils.hasType(subCon_2, subject, TypeFacade.TYPE));
+                    Assert.assertTrue(f_2.isFacadeable(subject, TypeFacade.class));
+
+                    subCon_2.commit();
+                } finally {
+                    if (subCon_2.isActive()) subCon_2.rollback();
+                    subCon_2.close();
+                }
+            }
+        } catch (ConcurrentModificationException ex) {
+            // do nothing, H2 locking
+        } finally {
+            if (mainCon.isActive()) mainCon.rollback();
+            mainCon.close();
+        }
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/concurrent/model/FooFacade.java
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/concurrent/model/FooFacade.java b/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/concurrent/model/FooFacade.java
new file mode 100644
index 0000000..095f6fe
--- /dev/null
+++ b/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/concurrent/model/FooFacade.java
@@ -0,0 +1,30 @@
+/*
+ * 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.commons.sesame.facading.concurrent.model;
+
+import org.apache.marmotta.commons.sesame.facading.annotations.RDF;
+import org.apache.marmotta.commons.sesame.facading.model.Facade;
+import org.openrdf.model.vocabulary.DCTERMS;
+
+public interface FooFacade extends Facade {
+    
+    @RDF(DCTERMS.NAMESPACE + "string")
+    public void setString(String string);
+    public String getString();
+
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/concurrent/model/TypeFacade.java
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/concurrent/model/TypeFacade.java b/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/concurrent/model/TypeFacade.java
new file mode 100644
index 0000000..d08404a
--- /dev/null
+++ b/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/concurrent/model/TypeFacade.java
@@ -0,0 +1,34 @@
+/*
+ * 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.commons.sesame.facading.concurrent.model;
+
+import org.apache.marmotta.commons.sesame.facading.annotations.RDF;
+import org.apache.marmotta.commons.sesame.facading.annotations.RDFType;
+import org.apache.marmotta.commons.sesame.facading.model.Facade;
+
+@RDFType(TypeFacade.TYPE)
+public interface TypeFacade extends Facade {
+
+    public static final String TITLE = "http://foo.bar/title";
+    public static final String TYPE = "http://foo.bar/Type";
+
+    @RDF(TITLE)
+    String getTitle();
+    void setTitle(String title);
+
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/foaf/FacadingFoafTest.java
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/foaf/FacadingFoafTest.java b/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/foaf/FacadingFoafTest.java
index 646d3c1..9d1442e 100644
--- a/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/foaf/FacadingFoafTest.java
+++ b/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/foaf/FacadingFoafTest.java
@@ -14,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.apache.marmotta.commons.sesame.facading.foaf;
 
 import static org.hamcrest.CoreMatchers.allOf;

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/foaf/model/OnlineAccount.java
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/foaf/model/OnlineAccount.java b/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/foaf/model/OnlineAccount.java
index d1d316a..12cd744 100644
--- a/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/foaf/model/OnlineAccount.java
+++ b/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/foaf/model/OnlineAccount.java
@@ -14,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.apache.marmotta.commons.sesame.facading.foaf.model;
 
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/foaf/model/Person.java
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/foaf/model/Person.java b/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/foaf/model/Person.java
index c6298c1..9328f75 100644
--- a/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/foaf/model/Person.java
+++ b/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/foaf/model/Person.java
@@ -14,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.apache.marmotta.commons.sesame.facading.foaf.model;
 
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/locale/LocaleFacadingTest.java
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/locale/LocaleFacadingTest.java b/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/locale/LocaleFacadingTest.java
index 5932471..6dc860e 100644
--- a/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/locale/LocaleFacadingTest.java
+++ b/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/locale/LocaleFacadingTest.java
@@ -14,8 +14,10 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.apache.marmotta.commons.sesame.facading.locale;
 
+import java.util.Locale;
 
 import static org.hamcrest.CoreMatchers.anyOf;
 import static org.hamcrest.CoreMatchers.is;
@@ -23,7 +25,6 @@ import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertThat;
 
-
 import org.apache.marmotta.commons.sesame.facading.AbstractFacadingTest;
 import org.apache.marmotta.commons.sesame.facading.FacadingFactory;
 import org.apache.marmotta.commons.sesame.facading.api.Facading;
@@ -33,13 +34,11 @@ import org.openrdf.model.URI;
 import org.openrdf.repository.RepositoryConnection;
 import org.openrdf.repository.RepositoryException;
 
-import java.util.Locale;
-
 public class LocaleFacadingTest extends AbstractFacadingTest {
 
     @Test
     public void testWithLocale() throws RepositoryException {
-        final Locale de = Locale.GERMAN, en = Locale.ENGLISH, fr = Locale.FRENCH, none = new Locale("none");
+        final Locale de = Locale.GERMAN, en = Locale.ENGLISH, fr = Locale.FRENCH, none = new Locale("xx", "none");
 
         final String lbl = "Label",
                 lbl_de = lbl + ": " + de.toString(),
@@ -49,6 +48,7 @@ public class LocaleFacadingTest extends AbstractFacadingTest {
 
         final RepositoryConnection connection = repositoryRDF.getConnection();
         try {
+            connection.begin();
             final Facading facading = FacadingFactory.createFacading(connection);
 
             final URI uri = connection.getValueFactory().createURI("http://www.example.com/rdf/test/locale");
@@ -101,6 +101,7 @@ public class LocaleFacadingTest extends AbstractFacadingTest {
             assertNull(f.getLabel(fr));
             assertNull(f.getLabel(none));
 
+            connection.commit();
         } finally {
             connection.close();
         }

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/locale/model/LocaleFacade.java
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/locale/model/LocaleFacade.java b/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/locale/model/LocaleFacade.java
index 1db7621..953fb02 100644
--- a/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/locale/model/LocaleFacade.java
+++ b/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/locale/model/LocaleFacade.java
@@ -14,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.apache.marmotta.commons.sesame.facading.locale.model;
 
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/primitive/BoxedFacadingTest.java
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/primitive/BoxedFacadingTest.java b/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/primitive/BoxedFacadingTest.java
new file mode 100644
index 0000000..5efc18a
--- /dev/null
+++ b/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/primitive/BoxedFacadingTest.java
@@ -0,0 +1,157 @@
+/*
+ * 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.commons.sesame.facading.primitive;
+
+import java.util.Date;
+import java.util.Locale;
+import java.util.Random;
+import java.util.UUID;
+
+import org.apache.marmotta.commons.sesame.facading.AbstractFacadingTest;
+import org.apache.marmotta.commons.sesame.facading.FacadingFactory;
+import org.apache.marmotta.commons.sesame.facading.api.Facading;
+import org.apache.marmotta.commons.sesame.facading.primitive.model.Boxed;
+import org.junit.After;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+import org.openrdf.model.URI;
+import org.openrdf.repository.RepositoryConnection;
+import org.openrdf.repository.RepositoryException;
+
+public class BoxedFacadingTest extends AbstractFacadingTest {
+
+    private URI subject;
+    private Random random;
+    private RepositoryConnection facadingConnection;
+    private Boxed boxed;
+
+    @Before
+    public void before() throws Exception {
+        subject = repositoryRDF.getValueFactory().createURI("urn:", UUID.randomUUID().toString());
+        random = new Random();
+
+        facadingConnection = repositoryRDF.getConnection();
+        facadingConnection.begin();
+        final Facading factory = FacadingFactory.createFacading(facadingConnection);
+        boxed = factory.createFacade(subject, Boxed.class);
+    }
+
+    @After
+    public void after() throws Exception {
+        if (facadingConnection != null) {
+            if (facadingConnection.isActive()) facadingConnection.rollback();
+            facadingConnection.close();
+        }
+    }
+    
+    @Test
+    public void testString() throws RepositoryException {
+        final String string = UUID.randomUUID().toString();
+
+        Assert.assertNull(boxed.getString());
+        boxed.setString(string);
+        Assert.assertEquals(string, boxed.getString());
+    }
+
+    @Test
+    public void testInteger() {
+        final Integer i = new Integer(random.nextInt());
+        
+        Assert.assertEquals(new Integer(0), boxed.getInteger());
+        boxed.setInteger(i);
+        Assert.assertEquals(i, boxed.getInteger());
+    }
+
+    @Test
+    public void testLong() {
+        final Long l = new Long(random.nextLong());
+        
+        Assert.assertEquals(new Long(0), boxed.getLong());
+        boxed.setLong(l);
+        Assert.assertEquals(l, boxed.getLong());
+    }
+
+    @Test
+    public void testFloat() {
+        final Float f = new Float(random.nextFloat());
+        
+        Assert.assertEquals(0f, boxed.getFloat().floatValue(), 10e-9);
+        boxed.setFloat(f);
+        Assert.assertEquals(f, boxed.getFloat().floatValue(), 10e-9);
+    }
+
+    @Test
+    public void testDouble() {
+        final Double d = new Double(random.nextDouble());
+        
+        Assert.assertEquals(0d, boxed.getDouble().doubleValue(), 10e-12);
+        boxed.setDouble(d);
+        Assert.assertEquals(d, boxed.getDouble().doubleValue(), 10e-12);
+    }
+
+    @Test
+    public void testCharacter() {
+        final Character c = new Character((char) random.nextInt(255));
+        
+        Assert.assertNull(boxed.getCharacter());
+        boxed.setCharacter(c);
+        Assert.assertEquals(c, boxed.getCharacter());
+    }
+
+    @Test
+    public void testByte() {
+        final Byte b = new Byte((byte) random.nextInt(Byte.MAX_VALUE));
+                
+        Assert.assertEquals(new Byte((byte)0), boxed.getByte());
+        boxed.setByte(b);
+        Assert.assertEquals(b, boxed.getByte());
+    }
+
+    @Test
+    public void testBoolean() {
+        Assert.assertFalse(boxed.getBoolean());
+        boxed.setBoolean(Boolean.FALSE);
+        Assert.assertFalse(boxed.getBoolean());
+        boxed.setBoolean(Boolean.TRUE);
+        Assert.assertTrue(boxed.getBoolean());
+    }
+
+    @Test
+    public void testLocale() {
+        Assert.assertNull(boxed.getLocale());
+        
+        for (Locale l: Locale.getAvailableLocales()) {
+            boxed.setLocale(l);
+            //Assert.assertEquals(l, boxed.getLocale());
+            Assert.assertEquals(l.getDisplayLanguage(), boxed.getLocale().getDisplayLanguage());
+        }
+    }
+
+    @Test
+    public void testGetDate() {
+        /* Dates are stored with seconds-precision */
+        final Date d = new Date(1000*((random.nextLong()%System.currentTimeMillis())/1000));
+        
+        Assert.assertNull(boxed.getDate());
+        boxed.setDate(d);
+        Assert.assertEquals(d, boxed.getDate());
+    }
+
+
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/primitive/PrimitiveFacadingTest.java
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/primitive/PrimitiveFacadingTest.java b/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/primitive/PrimitiveFacadingTest.java
new file mode 100644
index 0000000..1d1d060
--- /dev/null
+++ b/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/primitive/PrimitiveFacadingTest.java
@@ -0,0 +1,130 @@
+/*
+ * 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.commons.sesame.facading.primitive;
+
+import java.util.Random;
+import java.util.UUID;
+
+import org.apache.marmotta.commons.sesame.facading.AbstractFacadingTest;
+import org.apache.marmotta.commons.sesame.facading.FacadingFactory;
+import org.apache.marmotta.commons.sesame.facading.api.Facading;
+import org.apache.marmotta.commons.sesame.facading.primitive.model.Primitive;
+import org.junit.After;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+import org.openrdf.model.URI;
+import org.openrdf.repository.RepositoryConnection;
+import org.openrdf.repository.RepositoryException;
+
+public class PrimitiveFacadingTest extends AbstractFacadingTest {
+
+    private static final int ITERATIONS = 2500;
+    
+    private URI subject;
+    private Random random;
+    private RepositoryConnection facadingConnection;
+    private Primitive primitive;
+
+    @Before
+    public void before() throws Exception {
+        subject = repositoryRDF.getValueFactory().createURI("urn:", UUID.randomUUID().toString());
+        random = new Random();
+
+        facadingConnection = repositoryRDF.getConnection();
+        facadingConnection.begin();
+        final Facading factory = FacadingFactory.createFacading(facadingConnection);
+        primitive = factory.createFacade(subject, Primitive.class);
+
+    }
+
+    @After
+    public void after() throws RepositoryException {
+        if (facadingConnection != null) {
+            if (facadingConnection.isActive()) facadingConnection.rollback();
+            facadingConnection.close();
+        }
+    }
+
+    @Test
+    public void testInt() {
+
+        for (int j =0; j < ITERATIONS; j++) {
+            Assert.assertEquals(0, primitive.getInt());
+        }
+        final int i = random.nextInt();
+        primitive.setInt(i);
+        Assert.assertEquals(i, primitive.getInt());
+    }
+    
+    @Test
+    public void testByte() {
+        final byte b = (byte) random.nextInt(Byte.MAX_VALUE);
+        
+        Assert.assertEquals(0, primitive.getByte());
+        primitive.setByte(b);
+        Assert.assertEquals(b, primitive.getByte());
+    }
+
+    @Test
+    public void testFloat() {
+        final float f = random.nextFloat();
+        
+        Assert.assertEquals(0f, primitive.getFloat(), 10e-9);
+        primitive.setFloat(f);
+        Assert.assertEquals(f, primitive.getFloat(), 10e-9);
+    }
+
+    @Test
+    public void testDouble() {
+        final double d = random.nextDouble();
+        
+        Assert.assertEquals(0d, primitive.getDouble(), 10e-12);
+        primitive.setDouble(d);
+        Assert.assertEquals(d, primitive.getDouble(), 10e-12);
+    }
+
+    @Test
+    public void testLong() {
+        final long l = random.nextLong();
+        
+        Assert.assertEquals(0l, primitive.getLong());
+        primitive.setLong(l);
+        Assert.assertEquals(l, primitive.getLong());
+    }
+
+ 
+    @Test
+    public void testGetBoolean() {
+        Assert.assertFalse(primitive.getBoolean());
+        primitive.setBoolean(false);
+        Assert.assertFalse(primitive.getBoolean());
+        primitive.setBoolean(true);
+        Assert.assertTrue(primitive.getBoolean());
+    }
+
+    @Test
+    public void testGetChar() {
+        final char c = (char) random.nextInt(255);
+        
+        Assert.assertEquals(0, primitive.getChar());
+        primitive.setChar(c);
+        Assert.assertEquals(c, primitive.getChar());
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/primitive/model/Boxed.java
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/primitive/model/Boxed.java b/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/primitive/model/Boxed.java
new file mode 100644
index 0000000..f540689
--- /dev/null
+++ b/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/primitive/model/Boxed.java
@@ -0,0 +1,51 @@
+/*
+ * 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.commons.sesame.facading.primitive.model;
+
+import java.util.Date;
+import java.util.Locale;
+
+import org.apache.marmotta.commons.sesame.facading.annotations.RDFPropertyBuilder;
+import org.apache.marmotta.commons.sesame.facading.model.Facade;
+
+@RDFPropertyBuilder(PropBuilder.class)
+public interface Boxed extends Facade {
+
+    public Integer getInteger();
+    public void setInteger(Integer integer);
+    public Long getLong();
+    public void setLong(Long l);
+    public Float getFloat();
+    public void setFloat(Float f);
+    public Double getDouble();
+    public void setDouble(Double d);
+    public Character getCharacter();
+    public void setCharacter(Character character);
+    public Byte getByte();
+    public void setByte(Byte b);
+    public Boolean getBoolean();
+    public void setBoolean(Boolean b);
+    public Locale getLocale();
+    public void setLocale(Locale locale);
+    public String getString();
+    public void setString(String string);
+    public Date getDate();
+    public void setDate(Date date);
+    
+    
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/primitive/model/Primitive.java
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/primitive/model/Primitive.java b/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/primitive/model/Primitive.java
new file mode 100644
index 0000000..05647c9
--- /dev/null
+++ b/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/primitive/model/Primitive.java
@@ -0,0 +1,47 @@
+/*
+ * 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.commons.sesame.facading.primitive.model;
+
+import org.apache.marmotta.commons.sesame.facading.annotations.RDFPropertyBuilder;
+import org.apache.marmotta.commons.sesame.facading.model.Facade;
+
+@RDFPropertyBuilder(PropBuilder.class)
+public interface Primitive extends Facade {
+
+    public int getInt();
+    public void setInt(int i);
+    
+    public float getFloat();
+    public void setFloat(float f);
+    
+    public double getDouble();
+    public void setDouble(double d);
+    
+    public long getLong();
+    public void setLong(long l);
+    
+    public boolean getBoolean();
+    public void setBoolean(boolean b);
+    
+    public char getChar();
+    public void setChar(char c);
+    
+    public byte getByte();
+    public void setByte(byte b);
+    
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/primitive/model/PropBuilder.java
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/primitive/model/PropBuilder.java b/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/primitive/model/PropBuilder.java
new file mode 100644
index 0000000..98bfc3e
--- /dev/null
+++ b/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/primitive/model/PropBuilder.java
@@ -0,0 +1,29 @@
+/*
+ * 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.commons.sesame.facading.primitive.model;
+
+import org.apache.marmotta.commons.sesame.facading.model.AbstractNamespacePropBuilder;
+
+public class PropBuilder extends AbstractNamespacePropBuilder {
+
+    @Override
+    protected String getNamespace() {
+        return "http://persistence.text/prop#";
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-facading/src/test/resources/logback.xml
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-facading/src/test/resources/logback.xml b/commons/sesame-tools-facading/src/test/resources/logback.xml
index 1bfecff..864df3a 100644
--- a/commons/sesame-tools-facading/src/test/resources/logback.xml
+++ b/commons/sesame-tools-facading/src/test/resources/logback.xml
@@ -21,6 +21,7 @@
             <pattern>%d{HH:mm:ss.SSS} %highlight(%level) %cyan(%logger{15}) - %m%n</pattern>
         </encoder>
     </appender>
+    <logger name="org.apache.marmotta.commons.sesame.facading.concurrent.model" level="TRACE" />
     <root level="${root-level:-INFO}">
         <appender-ref ref="CONSOLE"/>
     </root>

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-api/pom.xml
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-api/pom.xml b/commons/sesame-tools-rio-api/pom.xml
index 18c3eee..475ae41 100644
--- a/commons/sesame-tools-rio-api/pom.xml
+++ b/commons/sesame-tools-rio-api/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/marmotta/blob/582abb5b/commons/sesame-tools-rio-ical/pom.xml
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-ical/pom.xml b/commons/sesame-tools-rio-ical/pom.xml
index 3414eed..8ec3e73 100644
--- a/commons/sesame-tools-rio-ical/pom.xml
+++ b/commons/sesame-tools-rio-ical/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/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/pom.xml
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/pom.xml b/commons/sesame-tools-rio-jsonld/pom.xml
deleted file mode 100644
index 028556c..0000000
--- a/commons/sesame-tools-rio-jsonld/pom.xml
+++ /dev/null
@@ -1,164 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-   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.
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-    <modelVersion>4.0.0</modelVersion>
-
-    <parent>
-        <groupId>org.apache.marmotta</groupId>
-        <artifactId>marmotta-parent</artifactId>
-        <version>3.1.0-incubating-SNAPSHOT</version>
-        <relativePath>../../parent</relativePath>
-    </parent>
-
-    <name>Sesame I/O: JSON/LD</name>
-    <artifactId>sesame-tools-rio-jsonld</artifactId>
-    <packaging>jar</packaging>
-
-    <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>org.apache.marmotta</groupId>
-            <artifactId>sesame-tools-rio-api</artifactId>
-        </dependency>
-
-        <dependency>
-            <groupId>org.slf4j</groupId>
-            <artifactId>slf4j-api</artifactId>
-        </dependency>
-
-        <dependency>
-            <groupId>org.codehaus.jackson</groupId>
-            <artifactId>jackson-core-asl</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.codehaus.jackson</groupId>
-            <artifactId>jackson-mapper-asl</artifactId>
-        </dependency>
-
-        <dependency>
-            <groupId>com.google.guava</groupId>
-            <artifactId>guava</artifactId>
-        </dependency>
-
-        <dependency>
-            <groupId>org.openrdf.sesame</groupId>
-            <artifactId>sesame-model</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.openrdf.sesame</groupId>
-            <artifactId>sesame-rio-api</artifactId>
-        </dependency>
-        
-        <dependency>
-            <groupId>org.openrdf.sesame</groupId>
-            <artifactId>sesame-query</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.openrdf.sesame</groupId>
-            <artifactId>sesame-queryparser-api</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.openrdf.sesame</groupId>
-            <artifactId>sesame-queryparser-sparql</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.openrdf.sesame</groupId>
-            <artifactId>sesame-queryalgebra-model</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.openrdf.sesame</groupId>
-            <artifactId>sesame-queryalgebra-evaluation</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.openrdf.sesame</groupId>
-            <artifactId>sesame-sail-memory</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.openrdf.sesame</groupId>
-            <artifactId>sesame-repository-sail</artifactId>
-            <scope>test</scope>
-        </dependency>
-
-        <dependency>
-            <groupId>commons-io</groupId>
-            <artifactId>commons-io</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>junit</groupId>
-            <artifactId>junit</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>ch.qos.logback</groupId>
-            <artifactId>logback-classic</artifactId>
-            <scope>test</scope>
-        </dependency>
-    </dependencies>
-</project>

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/ext/java/de/dfki/km/json/JSONUtils.java
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/ext/java/de/dfki/km/json/JSONUtils.java b/commons/sesame-tools-rio-jsonld/src/ext/java/de/dfki/km/json/JSONUtils.java
deleted file mode 100644
index 4be1f99..0000000
--- a/commons/sesame-tools-rio-jsonld/src/ext/java/de/dfki/km/json/JSONUtils.java
+++ /dev/null
@@ -1,208 +0,0 @@
-package de.dfki.km.json;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.Reader;
-import java.io.StringWriter;
-import java.io.Writer;
-import java.util.List;
-import java.util.Map;
-
-import org.codehaus.jackson.JsonGenerationException;
-import org.codehaus.jackson.JsonGenerator;
-import org.codehaus.jackson.JsonLocation;
-import org.codehaus.jackson.JsonParseException;
-import org.codehaus.jackson.map.JsonMappingException;
-import org.codehaus.jackson.map.ObjectMapper;
-import org.codehaus.jackson.map.ObjectWriter;
-
-/**
- * A bunch of functions to make loading JSON easy
- * 
- * @author tristan
- * 
- */
-public class JSONUtils {
-    public static Object fromString(String jsonString) throws JsonParseException, JsonMappingException {
-        ObjectMapper objectMapper = new ObjectMapper();
-        Object rval = null;
-        if (jsonString.trim().startsWith("[")) {
-            try {
-                rval = objectMapper.readValue(jsonString, List.class);
-            } catch (IOException e) {
-                // TODO: what?
-                if (e instanceof JsonParseException) {
-                    throw (JsonParseException) e;
-                } else if (e instanceof JsonMappingException) {
-                    throw (JsonMappingException) e;
-                } else {
-                    // TODO: Auto-generated catch block
-                    e.printStackTrace();
-                }
-            }
-        } else if (jsonString.trim().startsWith("{")) {
-            try {
-                rval = objectMapper.readValue(jsonString, Map.class);
-            } catch (IOException e) {
-                if (e instanceof JsonParseException) {
-                    throw (JsonParseException) e;
-                } else if (e instanceof JsonMappingException) {
-                    throw (JsonMappingException) e;
-                } else {
-                    // TODO: Auto-generated catch block
-                    e.printStackTrace();
-                }
-            }
-        } else if (jsonString.trim().startsWith("\"")) {
-            try {
-                rval = objectMapper.readValue(jsonString, String.class);
-            } catch (IOException e) {
-                if (e instanceof JsonParseException) {
-                    throw (JsonParseException) e;
-                } else if (e instanceof JsonMappingException) {
-                    throw (JsonMappingException) e;
-                } else {
-                    // TODO: Auto-generated catch block
-                    e.printStackTrace();
-                }
-            }
-        } else if (jsonString.trim().equals("true") || (jsonString.trim().equals("false"))) {
-            try {
-                rval = objectMapper.readValue(jsonString, Boolean.class);
-            } catch (IOException e) {
-                if (e instanceof JsonParseException) {
-                    throw (JsonParseException) e;
-                } else if (e instanceof JsonMappingException) {
-                    throw (JsonMappingException) e;
-                } else {
-                    // TODO: Auto-generated catch block
-                    e.printStackTrace();
-                }
-            }
-        } else if (jsonString.trim().matches("[0-9.e+-]+")) {
-            try {
-                rval = objectMapper.readValue(jsonString, Number.class);
-            } catch (IOException e) {
-                if (e instanceof JsonParseException) {
-                    throw (JsonParseException) e;
-                } else if (e instanceof JsonMappingException) {
-                    throw (JsonMappingException) e;
-                } else {
-                    // TODO: Auto-generated catch block
-                    e.printStackTrace();
-                }
-            }
-        } else if (jsonString.trim().equals("null")) {
-            rval = null;
-        } else {
-            throw new JsonParseException("document doesn't start with a valid json element", new JsonLocation("\""
-                    + jsonString.substring(0, Math.min(jsonString.length(), 100)) + "...\"", 0, 1, 0));
-        }
-        return rval;
-    }
-
-    public static Object fromReader(Reader r) throws IOException {
-        StringBuffer sb = new StringBuffer();
-        int b;
-        while ((b = r.read()) != -1) {
-            sb.append((char) b);
-        }
-        return fromString(sb.toString());
-    }
-
-    public static void write(Writer w, Object jsonObject) throws JsonGenerationException, JsonMappingException, IOException {
-        ObjectMapper objectMapper = new ObjectMapper();
-        objectMapper.getJsonFactory().disable(JsonGenerator.Feature.AUTO_CLOSE_TARGET);
-        objectMapper.writeValue(w, jsonObject);
-    }
-
-    public static void writePrettyPrint(Writer w, Object jsonObject) throws JsonGenerationException, JsonMappingException, IOException {
-        ObjectMapper objectMapper = new ObjectMapper();
-        objectMapper.getJsonFactory().disable(JsonGenerator.Feature.AUTO_CLOSE_TARGET);
-        ObjectWriter objectWriter = objectMapper.writerWithDefaultPrettyPrinter();
-        
-        objectWriter.writeValue(w, jsonObject);
-    }
-
-    public static Object fromInputStream(InputStream content) throws IOException {
-        return fromInputStream(content, "UTF-8"); // no readers from
-                                                  // inputstreams w.o.
-                                                  // encoding!!
-    }
-
-    public static Object fromInputStream(InputStream content, String enc) throws IOException {
-        return fromReader(new BufferedReader(new InputStreamReader(content, enc)));
-    }
-
-    public static String toPrettyString(Object obj) {
-        StringWriter sw = new StringWriter();
-        try {
-            writePrettyPrint(sw, obj);
-        } catch (Exception e) {
-            // TODO Is this really possible with stringwriter?
-            // I think it's only there because of the interface
-            // however, if so... well, we have to do something!
-            // it seems weird for toString to throw an IOException
-        }
-        return sw.toString();
-    }
-
-    public static String toString(Object obj) { // throws
-                                                // JsonGenerationException,
-                                                // JsonMappingException {
-        StringWriter sw = new StringWriter();
-        try {
-            write(sw, obj);
-        } catch (Exception e) {
-            // TODO Is this really possible with stringwriter?
-            // I think it's only there because of the interface
-            // however, if so... well, we have to do something!
-            // it seems weird for toString to throw an IOException
-        }
-        return sw.toString();
-    }
-
-    public static boolean equals(Object v1, Object v2) {
-        boolean rval = true;
-        // TODO Auto-generated method stub
-        if (v1 instanceof List && v2 instanceof List) {
-            if (((List) v1).size() != ((List) v2).size()) {
-                rval = false;
-            } else {
-                // TODO: should the order of things in the list matter?
-                for (int i = 0; i < ((List<Object>) v1).size() && rval == true; i++) {
-                    rval = equals(((List<Object>) v1).get(i), ((List<Object>) v2).get(i));
-                }
-            }
-        } else if (v1 instanceof Number && v2 instanceof Number) {
-            // TODO: this is VERY sketchy
-            double n1 = ((Number) v1).doubleValue();
-            double n2 = ((Number) v2).doubleValue();
-
-            rval = n1 == n2;
-        } else if (v1 instanceof String && v2 instanceof String) {
-            rval = ((String) v1).equals((String) v2);
-        } else if (v1 instanceof Map && v2 instanceof Map) {
-            if (((Map) v1).size() != ((Map) v2).size()) {
-                rval = false;
-            } else {
-                for (Object k1 : ((Map) v1).keySet()) {
-                    rval = ((Map) v2).containsKey(k1) ? equals(((Map) v1).get(k1), ((Map) v2).get(k1)) : false;
-                    if (rval != true) {
-                        break;
-                    }
-                }
-            }
-        } else if (v1 instanceof Boolean && v2 instanceof Boolean) {
-            rval = v1 == v2;
-        } else if (v1 != null && v2 != null) {
-            rval = v1.equals(v2);
-        } else {
-            rval = v1 == v2;
-        }
-
-        return rval;
-    }
-}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/ext/java/de/dfki/km/json/jsonld/JSONLDConsts.java
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/ext/java/de/dfki/km/json/jsonld/JSONLDConsts.java b/commons/sesame-tools-rio-jsonld/src/ext/java/de/dfki/km/json/jsonld/JSONLDConsts.java
deleted file mode 100644
index a280194..0000000
--- a/commons/sesame-tools-rio-jsonld/src/ext/java/de/dfki/km/json/jsonld/JSONLDConsts.java
+++ /dev/null
@@ -1,17 +0,0 @@
-package de.dfki.km.json.jsonld;
-
-public class JSONLDConsts {
-
-    public static final String RDF_SYNTAX_NS = "http://www.w3.org/1999/02/22-rdf-syntax-ns#";
-    public static final String RDF_SCHEMA_NS = "http://www.w3.org/2000/01/rdf-schema#";
-    public static final String XSD_NS = "http://www.w3.org/2001/XMLSchema#";
-
-    public static final String XSD_ANYTYPE = XSD_NS + "anyType";
-    public static final String XSD_BOOLEAN = XSD_NS + "boolean";
-    public static final String XSD_DOUBLE = XSD_NS + "double";
-    public static final String XSD_INTEGER = XSD_NS + "integer";
-    public static final String XSD_ANYURI = XSD_NS + "anyURI";
-    public static final String XSD_STRING = XSD_NS + "string";
-
-    public static final String RDF_TYPE = RDF_SYNTAX_NS + "type";
-}


[098/100] [abbrv] git commit: MARMOTTA-508: preliminar integration of the official ldp test suite

Posted by wi...@apache.org.
MARMOTTA-508: preliminar integration of the official ldp test suite


Project: http://git-wip-us.apache.org/repos/asf/marmotta/repo
Commit: http://git-wip-us.apache.org/repos/asf/marmotta/commit/bfbc30cc
Tree: http://git-wip-us.apache.org/repos/asf/marmotta/tree/bfbc30cc
Diff: http://git-wip-us.apache.org/repos/asf/marmotta/diff/bfbc30cc

Branch: refs/heads/ldp
Commit: bfbc30cc8dcae322b02ac3ae0a72ee38ec6ca25e
Parents: 14e522d
Author: Sergio Fernández <wi...@apache.org>
Authored: Thu Jun 12 20:03:57 2014 +0200
Committer: Sergio Fernández <wi...@apache.org>
Committed: Thu Jun 12 20:03:57 2014 +0200

----------------------------------------------------------------------
 platform/marmotta-ldp/pom.xml                   |  6 ++
 .../marmotta/platform/ldp/LdpTestSuite.java     | 75 ++++++++++++++++++++
 2 files changed, 81 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/marmotta/blob/bfbc30cc/platform/marmotta-ldp/pom.xml
----------------------------------------------------------------------
diff --git a/platform/marmotta-ldp/pom.xml b/platform/marmotta-ldp/pom.xml
index fcc3879..451630c 100644
--- a/platform/marmotta-ldp/pom.xml
+++ b/platform/marmotta-ldp/pom.xml
@@ -270,6 +270,12 @@
             <artifactId>sesame-sail-memory</artifactId>
             <scope>test</scope>
         </dependency>
+        <dependency>
+            <groupId>org.w3</groupId>
+            <artifactId>ldp-testsuite</artifactId>
+            <version>1.0.0-SNAPSHOT</version>
+            <scope>test</scope>
+        </dependency>
 
     </dependencies>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/bfbc30cc/platform/marmotta-ldp/src/test/java/org/apache/marmotta/platform/ldp/LdpTestSuite.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-ldp/src/test/java/org/apache/marmotta/platform/ldp/LdpTestSuite.java b/platform/marmotta-ldp/src/test/java/org/apache/marmotta/platform/ldp/LdpTestSuite.java
new file mode 100644
index 0000000..08cd51f
--- /dev/null
+++ b/platform/marmotta-ldp/src/test/java/org/apache/marmotta/platform/ldp/LdpTestSuite.java
@@ -0,0 +1,75 @@
+/*
+ * 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.platform.ldp;
+
+import com.jayway.restassured.RestAssured;
+import org.apache.marmotta.platform.core.test.base.JettyMarmotta;
+import org.apache.marmotta.platform.ldp.webservices.LdpWebService;
+import org.junit.AfterClass;
+import org.junit.Assert;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.ws.rs.core.UriBuilder;
+import java.io.IOException;
+import java.net.URISyntaxException;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * LDP Test Suite runner
+ *
+ * @author Sergio Fernández
+ */
+public class LdpTestSuite {
+
+    private static Logger log = LoggerFactory.getLogger(LdpTestSuite.class);
+
+    private static JettyMarmotta marmotta;
+
+    private static String baseUrl;
+
+    @BeforeClass
+    public static void setup() throws URISyntaxException, IOException {
+        marmotta = new JettyMarmotta("/marmotta", LdpWebService.class);
+        RestAssured.baseURI = "http://localhost";
+        RestAssured.port = marmotta.getPort();
+        RestAssured.basePath = marmotta.getContext();
+        baseUrl = UriBuilder.fromUri("http://localhost").port(marmotta.getPort()).path(marmotta.getContext()).build().toString();
+    }
+
+    @AfterClass
+    public static void shutdown() {
+        marmotta.shutdown();
+        marmotta = null;
+    }
+
+    @Test
+    public void testSuite() {
+        Map<String, String> options = new HashMap<>();
+        options.put("server", baseUrl);
+        options.put("basic", null);
+        options.put("non-rdf", null);
+        org.w3.ldp.testsuite.LdpTestSuite testSuite = new org.w3.ldp.testsuite.LdpTestSuite(options);
+        testSuite.run();
+        Assert.assertEquals(0, testSuite.getStatus());
+    }
+
+}


[099/100] [abbrv] git commit: code cleanup

Posted by wi...@apache.org.
code cleanup


Project: http://git-wip-us.apache.org/repos/asf/marmotta/repo
Commit: http://git-wip-us.apache.org/repos/asf/marmotta/commit/e0834f68
Tree: http://git-wip-us.apache.org/repos/asf/marmotta/tree/e0834f68
Diff: http://git-wip-us.apache.org/repos/asf/marmotta/diff/e0834f68

Branch: refs/heads/ldp
Commit: e0834f68832efdbecdbd2ba782d47a79e307ceeb
Parents: bfbc30c
Author: Sergio Fernández <wi...@apache.org>
Authored: Thu Jun 12 20:12:03 2014 +0200
Committer: Sergio Fernández <wi...@apache.org>
Committed: Thu Jun 12 20:12:03 2014 +0200

----------------------------------------------------------------------
 .../marmotta/platform/ldp/webservices/LdpWebService.java  | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/marmotta/blob/e0834f68/platform/marmotta-ldp/src/main/java/org/apache/marmotta/platform/ldp/webservices/LdpWebService.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-ldp/src/main/java/org/apache/marmotta/platform/ldp/webservices/LdpWebService.java b/platform/marmotta-ldp/src/main/java/org/apache/marmotta/platform/ldp/webservices/LdpWebService.java
index 81dedf1..2dc8cf8 100644
--- a/platform/marmotta-ldp/src/main/java/org/apache/marmotta/platform/ldp/webservices/LdpWebService.java
+++ b/platform/marmotta-ldp/src/main/java/org/apache/marmotta/platform/ldp/webservices/LdpWebService.java
@@ -110,17 +110,11 @@ public class LdpWebService {
                 log.trace("{} exists, continuing", resource);
             }
 
-            // TODO: Proper content negotiation
-
             final RDFFormat format;
             if (type.isWildcardType()) { // No explicit Accept Header
-                if (ldpService.isRdfSourceResource(conn, resource)) {
-                    format = RDFFormat.TURTLE;
-                } else {
-                    format = null;
-                }
+                format = ( ldpService.isRdfSourceResource(conn, resource) ? RDFFormat.TURTLE : null );
             } else {
-                format = Rio.getWriterFormatForMIMEType(LdpUtils.getMimeType(type), null);
+                format = Rio.getWriterFormatForMIMEType(LdpUtils.getMimeType(type), RDFFormat.TURTLE);
             }
 
             if (format == null) {


[041/100] [abbrv] [partial] Reverting the erroneous merge by Sebastian according to the instructions in INFRA-6876

Posted by wi...@apache.org.
http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/ext/java/de/dfki/km/json/jsonld/JSONLDProcessor.java
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/ext/java/de/dfki/km/json/jsonld/JSONLDProcessor.java b/commons/sesame-tools-rio-jsonld/src/ext/java/de/dfki/km/json/jsonld/JSONLDProcessor.java
deleted file mode 100644
index 3d0074e..0000000
--- a/commons/sesame-tools-rio-jsonld/src/ext/java/de/dfki/km/json/jsonld/JSONLDProcessor.java
+++ /dev/null
@@ -1,1386 +0,0 @@
-package de.dfki.km.json.jsonld;
-
-import java.text.DecimalFormat;
-import java.text.DecimalFormatSymbols;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Locale;
-import java.util.Map;
-import java.util.Set;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import de.dfki.km.json.jsonld.JSONLDUtils.NameGenerator;
-
-public class JSONLDProcessor {
-
-    private static final Logger LOG = LoggerFactory.getLogger(JSONLDProcessor.class);
-    private NameGenerator ngtmp;
-
-    private Set<String> ignoredKeywords = new HashSet<String>();
-
-    /**
-     * Tells the processor to skip over the key specified by keyword any time it encounters it. Objects under this key will not be manipulated by any of the
-     * processor functions and no triples will be created using it.
-     * 
-     * @param keyword
-     *            The name of the key this processor should ignore.
-     */
-    public void ignoreKeyword(String keyword) {
-        ignoredKeywords.add(keyword);
-    }
-
-    private Map<String, Object> edges;
-    private Map<String, Object> subjects;
-    private Map<String, Object> renamed;
-    private Map<String, Object> serializations;
-    private NameGenerator ngc14n;
-
-    public Object expand(Object input) {
-        return expand(new HashMap<String, Object>(), null, input);
-    }
-
-    private Object expand(Map<String, Object> ctx, Object property, Object value) {
-        Object rval = null;
-        if (value == null) {
-            return null;
-        } else if (property == null && value instanceof String) {
-            rval = JSONLDUtils.expandTerm(ctx, (String) value);// , null));
-        } else if (value instanceof List) {
-            rval = new ArrayList<Object>();
-            for (Object i : (List) value) {
-                ((List) rval).add(expand(ctx, property, i));
-            }
-        } else if (value instanceof Map) {
-            rval = new HashMap<String, Object>();
-            if (((Map<String, Object>) value).containsKey("@context")) {
-                try {
-                    ctx = JSONLDUtils.mergeContexts((Map<String, Object>) ctx, (Map<String, Object>) ((Map<String, Object>) value).get("@context"));
-                } catch (Exception e) {
-                    // unable to merge contexts
-                    // TODO: this should probably just throw back to the calling
-                    // function
-                    e.printStackTrace();
-                    return null;
-                }
-            }
-
-            rval = new HashMap<String, Object>();
-            for (String key : ((Map<String, Object>) value).keySet()) {
-                if ("@embed".equals(key) || "@explicit".equals(key) || "@default".equals(key) || "@omitDefault".equals(key) || ignoredKeywords.contains(key)) {
-                    JSONLDUtils.setProperty((Map<String, Object>) rval, key, JSONLDUtils.clone(((Map<String, Object>) value).get(key)));
-                } else if (!"@context".equals(key)) {
-                    JSONLDUtils.setProperty((Map<String, Object>) rval, JSONLDUtils.expandTerm(ctx, key),
-                            expand(ctx, key, ((Map<String, Object>) value).get(key)));
-                }
-            }
-        } else {
-            // do type coercion
-            String coerce = JSONLDUtils.getCoercionType(ctx, (String) property);// ,
-                                                                                // null);
-            Map<String, String> keywords = JSONLDUtils.getKeywords(ctx);
-
-            // automatic coercion for basic JSON types
-            if (coerce == null) {
-                if (value instanceof Boolean) {
-                    coerce = JSONLDConsts.XSD_BOOLEAN;
-                } else if (value instanceof Integer) {
-                    coerce = JSONLDConsts.XSD_INTEGER;
-                } else if (value instanceof Double) {
-                    coerce = JSONLDConsts.XSD_DOUBLE;
-                }
-            }
-
-            // special-case expand @id and @type (skips '@id' expansion)
-            if (property.equals("@id") || property.equals(keywords.get("@id")) || property.equals("@type") || property.equals(keywords.get("@type"))) {
-                rval = JSONLDUtils.expandTerm(ctx, (String) value);
-            }
-            // coerce to appropriate type
-            else if (coerce != null) {
-                rval = new HashMap<String, Object>();
-
-                if (coerce.equals("@id")) {
-                    // expand IRI
-                    ((Map<String, Object>) rval).put("@id", JSONLDUtils.expandTerm(ctx, (String) value)); // ,
-                                                                                                          // null));
-                } else {
-                    ((Map<String, Object>) rval).put("@type", coerce);
-                    if (coerce.equals(JSONLDConsts.XSD_DOUBLE)) {
-                        DecimalFormat decimalFormat = new DecimalFormat("0.000000E0", new DecimalFormatSymbols(Locale.US));
-                        Double v = null;
-                        if (value instanceof String) {
-                            v = Double.parseDouble((String) value);
-                        } else if (value instanceof Integer) {
-                            // TODO: what is this? really?
-                            v = new Double(1.0 * (Integer) value);
-                        } else {
-                            v = (Double) value;
-                        }
-                        String dec = decimalFormat.format(v);
-                        Pattern p = Pattern.compile("(-?[0-9\\.]+)E((?:-*))([0-9]+)");
-                        Matcher matcher = p.matcher(dec);
-                        matcher.find();
-                        String sign = matcher.group(2);
-                        if ("".equals(sign)) {
-                            sign = "+";
-                        }
-                        value = matcher.group(1) + "e" + sign + (matcher.group(3).length() > 1 ? matcher.group(3) : "0" + matcher.group(3));
-                    } else {
-                        value = value.toString();
-                    }
-                    ((Map<String, Object>) rval).put("@value", value);
-                }
-            } else {
-                // nothing to coerce
-                rval = value.toString();
-            }
-        }
-
-        return rval;
-    }
-
-    // TODO: note that in the spec, input is the first input, but in the ref
-    // impl, context is.
-    // using context here first because it matches everything else
-    public Object compact(Object context, Object input) {
-
-        Object rval = null;
-
-        Map<String, Object> ctx;
-        if (context == null) {
-            ctx = new HashMap<String, Object>();
-        } else if (context instanceof Map) {
-            ctx = (Map<String, Object>) JSONLDUtils.clone(context);
-        } else if (context instanceof List) {
-            ctx = (Map<String, Object>) JSONLDUtils.mergeContexts(new HashMap<String, Object>(), context);
-        } else {
-            // TODO: are there any reasons that ctx shouldn't be a map?
-            throw new RuntimeException("non-map or list contexts not yes supported");
-        }
-
-        input = expand(input);
-
-        Map<String, Object> ctxOut = new HashMap<String, Object>();
-        Object out = compact(ctx, null, input, ctxOut);
-        rval = out;
-
-        if (ctxOut.size() > 0) {
-            rval = new HashMap<String, Object>();
-            ((Map<String, Object>) rval).put("@context", ctxOut);
-            if (out instanceof List) {
-                ((Map<String, Object>) rval).put(JSONLDUtils.getKeywords(ctxOut).get("@id"), out);
-            } else {
-                for (String key : ((Map<String, Object>) out).keySet()) {
-                    ((Map<String, Object>) rval).put(key, ((Map<String, Object>) out).get(key));
-                }
-            }
-        }
-
-        return rval;
-    }
-
-    /*
-     * TODO: this throws runtime exception. need to look at doing something more sane.
-     */
-    public Object compact(Map<String, Object> ctx, Object property, Object value, Map<String, Object> usedCtx) {
-
-        Object rval = null;
-        Map<String, String> keywords = JSONLDUtils.getKeywords(ctx);
-
-        if (value == null) {
-            rval = null;
-            // TODO: used ctx stuff may actually be handy here
-            JSONLDUtils.getCoercionType(ctx, (String) property, usedCtx);
-        } else if (value instanceof List) {
-            // recursively add compacted values to array
-            rval = new ArrayList<Object>();
-            for (Object o : (List<Object>) value) {
-                ((List) rval).add(compact(ctx, property, o, usedCtx));
-            }
-        } else if (value instanceof Map && ((Map) value).containsKey("@id") && ((Map) value).get("@id") instanceof List) {
-            // graph literal/disjoint graph
-            rval = new HashMap<String, Object>();
-            ((Map<String, Object>) rval).put(keywords.get("@id"), compact(ctx, property, ((Map) value).get("@id"), usedCtx));
-        } else if (JSONLDUtils.isSubject(value)) { // recurse if value is a
-                                                   // subject
-            // recursively handle sub-properties that aren't a sub-context
-            rval = new HashMap<String, Object>();
-            for (String key : ((Map<String, Object>) value).keySet()) {
-                if (!"@context".equals(((Map<String, Object>) value).get(key))) {
-                    // set object to compacted property, only overwrite existing
-                    // properties if the property actually compacted
-                    String p = JSONLDUtils.compactIRI(ctx, key, usedCtx);
-                    if (!(key.equals(p)) || !((Map<String, Object>) rval).containsKey(p)) {
-                        ((Map<String, Object>) rval).put(p, compact(ctx, key, ((Map<String, Object>) value).get(key), usedCtx));
-                    }
-                }
-            }
-        } else {
-            // get coerce type
-            String coerce = JSONLDUtils.getCoercionType(ctx, (String) property, usedCtx);
-
-            // get type from value, to ensure coercion is valid
-            String type = null;
-            if (value instanceof Map) {
-                // type coercion can only occur if language is not specified
-                if (!((Map) value).containsKey("@language")) {
-                    // type must match coerce type if specified
-                    if (((Map) value).containsKey("@type")) {
-                        type = (String) ((Map<String, Object>) value).get("@type");
-                    } else if (((Map) value).containsKey("@id")) { // type is ID
-                                                                   // (IRI)
-                        type = "@id";
-                    } else { // can be coerced to any type
-                        type = coerce;
-                    }
-                }
-            } else if (value instanceof String) {
-                // type can be coerced to anything
-                type = coerce;
-            }
-
-            // types that can be auto-coerced from a JSON-builtin
-            if (coerce == null && (JSONLDConsts.XSD_BOOLEAN.equals(type) || JSONLDConsts.XSD_INTEGER.equals(type) || JSONLDConsts.XSD_DOUBLE.equals(type))) {
-                coerce = type;
-            }
-
-            // do reverse type-coercion
-            if (coerce != null) {
-                // type is only None if a language was specified, which is an
-                // error if type coercion is specified
-                if (type == null) {
-                    throw new RuntimeException("Cannot coerce type when a language is " + "specified. The language information would be lost.");
-                } else if (!type.equals(coerce)) {
-                    // if the value type does not match the coerce type, it is
-                    // an error
-                    throw new RuntimeException("Cannot coerce type because the type does not match.");
-                } else {
-                    // do reverse type-coercion
-                    if (value instanceof Map) {
-                        if (((Map) value).containsKey("@id")) {
-                            rval = ((Map) value).get("@id");
-                        } else if (((Map) value).containsKey("@value")) {
-                            rval = ((Map) value).get("@value");
-                        }
-                    } else {
-                        rval = value;
-                    }
-
-                    // do basic JSON types conversion
-                    if (JSONLDConsts.XSD_BOOLEAN.equals(coerce)) {
-                        // TODO: this is a bit mad (and probably not exhaustive)
-                        if (rval instanceof String) {
-                            rval = "true".equals(rval);
-                        } else if (rval instanceof Integer) {
-                            rval = ((Integer) rval) != 0;
-                        } else if (rval instanceof Double) {
-                            rval = ((Double) rval) != 0.0;
-                        } else if (rval instanceof Long) {
-                            rval = ((Long) rval) != 0L;
-                        } else if (rval instanceof Float) {
-                            rval = ((Float) rval) != 0.0f;
-                        } else if (rval instanceof Short) {
-                            rval = ((Short) rval) != 0;
-                        } else if (!(rval instanceof Boolean)) {
-                            rval = false;
-                        }
-                    } else if (JSONLDConsts.XSD_DOUBLE.equals(coerce)) {
-                        if (rval instanceof String) {
-                            rval = Double.parseDouble((String) rval);
-                        } else if (rval instanceof Number) {
-                            rval = ((Number) rval).doubleValue();
-                        }
-                    } else if (JSONLDConsts.XSD_INTEGER.equals(coerce)) {
-                        if (rval instanceof String) {
-                            rval = Integer.parseInt((String) rval);
-                        } else if (rval instanceof Number) {
-                            rval = ((Number) rval).intValue();
-                        }
-                    }
-                }
-            } else if (value instanceof Map) {
-                // no type-coercion, just change keywords/copy value
-                rval = new HashMap<String, Object>();
-                for (String key : ((Map<String, Object>) value).keySet()) {
-                    ((Map<String, Object>) rval).put(keywords.get(key), ((Map) value).get(key));
-                }
-            } else {
-                rval = JSONLDUtils.clone(value);
-            }
-
-            if ("@id".equals(type)) {
-                // compact IRI
-                if (rval instanceof Map) {
-                    ((Map) rval).put(keywords.get("@id"), JSONLDUtils.compactIRI(ctx, (String) ((Map<String, Object>) rval).get(keywords.get("@id")), usedCtx));
-                } else {
-                    rval = JSONLDUtils.compactIRI(ctx, (String) rval, usedCtx);
-                }
-            }
-        }
-        return rval;
-    }
-
-    public Object frame(Object input, Object frame) {
-        return frame(input, frame, null);
-    }
-
-    public Object frame(Object input, Object frame, Map options) {
-        Object rval = null;
-
-        input = normalize(input);
-
-        Object ctx = null;
-
-        if (frame instanceof Map && ((Map) frame).containsKey("@context")) {
-            ctx = JSONLDUtils.clone(((Map) frame).get("@context"));
-            frame = expand(frame);
-        } else if (frame instanceof List) {
-            if (((List) frame).size() > 0) {
-                Object f0 = ((List) frame).get(0);
-                if (f0 instanceof Map && ((Map) f0).containsKey("@context")) {
-                    ctx = JSONLDUtils.clone(((Map) f0).get("@context"));
-                }
-
-                List tmp = new ArrayList();
-                for (Object f : (List) frame) {
-                    tmp.add(expand(f));
-                }
-                frame = tmp;
-            }
-        }
-
-        Map defaultOptions = new HashMap();
-        Map tmpopts = new HashMap();
-        tmpopts.put("embedOn", true);
-        tmpopts.put("explicitOn", false);
-        tmpopts.put("omitDefaultOn", false);
-        defaultOptions.put("defaults", tmpopts);
-
-        // TODO: merge in options from input
-        options = defaultOptions;
-
-        Map subjects = new HashMap();
-        for (Object i : (List) input) {
-            subjects.put(((Map) i).get("@id"), i);
-        }
-
-        rval = JSONLDUtils.frame(subjects, (List) input, frame, new HashMap(), false, null, null, options);
-
-        if (ctx != null && rval != null) {
-            if (rval instanceof List) {
-                List tmp = (List) rval;
-                rval = new ArrayList();
-                for (Object i : tmp) {
-                    ((List) rval).add(compact(ctx, i));
-                }
-            } else {
-                rval = compact(ctx, rval);
-            }
-        }
-
-        return rval;
-    }
-
-    public List<? extends Map<String, Object>> normalize(Object input) {
-        // because the expanded output of items from the onlinebox are the same
-        // as the normalized version
-        // (just inside a list) i'm going to skip implementing the normalize
-        // function for now.
-        // TODO: implement this properly as if data is really to be imported
-        // into the OB with this method
-        // this will be needed (mainly for identifying embedded items)
-        List<Map<String, Object>> rval = new ArrayList<Map<String, Object>>();
-
-        if (input != null) {
-
-            Object expanded = expand(new HashMap<String, Object>(), null, input);
-
-            nameBlankNodes(expanded);
-
-            Map<String, Object> subjects = new HashMap<String, Object>();
-            try {
-                flatten(null, null, expanded, subjects);
-            } catch (Exception e) {
-                // TODO: This should probably be thrown back to the caller
-                e.printStackTrace();
-                LOG.error("flatten failed!");
-                return null;
-            }
-
-            for (String key : subjects.keySet()) {
-                Map<String, Object> s = (Map<String, Object>) subjects.get(key);
-                // TODO: in javascript the keys are sorted and added back into
-                // the array
-                // in alphabetical order. however in HashMaps, this order isn't
-                // kept
-                rval.add(s);
-            }
-
-            canonicalizeBlankNodes(rval);
-
-            // sort the output
-            Collections.sort(rval, new Comparator<Map<String, Object>>() {
-                public int compare(Map<String, Object> a, Map<String, Object> b) {
-                    return JSONLDUtils.compare(a.get("@id"), b.get("@id"));
-                }
-            });
-        }
-
-        return rval;
-    }
-
-    /**
-     * 
-     * 
-     * @return a list of objects returned by tripleCallback
-     */
-    public void triples(Object input, JSONLDTripleCallback tripleCallback) {
-        Object normalized = normalize(input);
-
-        if (tripleCallback == null) {
-            // TODO: make default triple callback
-        }
-
-        List<Object> rval = new ArrayList<Object>();
-        for (Map<String, Object> e : (List<Map<String, Object>>) normalized) {
-            String s = (String) e.get("@id");
-
-            for (String p : e.keySet()) {
-                Object obj = e.get(p);
-
-                // don't generate a triple for the @id or any keys that should
-                // be ignored
-                if (p.equals("@id") || ignoredKeywords.contains(p)) {
-                    continue;
-                } else if (p.equals("@type")) {
-                    p = JSONLDConsts.RDF_SYNTAX_NS + "type";
-                }
-
-                if (!(obj instanceof List)) {
-                    List<Object> tmp = new ArrayList<Object>();
-                    tmp.add(obj);
-                    obj = tmp;
-                }
-                for (Object o : (List<Object>) obj) {
-                    if (o instanceof String) {
-                        // type is a special case where the uri isn't expanded
-                        // out into an object
-                        if (p.toString().equals(JSONLDConsts.RDF_SYNTAX_NS + "type")) {
-                            tripleCallback.triple(s, p, o.toString());
-                        } else {
-                            tripleCallback.triple(s, p, (String) o, JSONLDConsts.XSD_STRING, null);
-                        }
-                    } else if (o instanceof Map) {
-                        if (((Map) o).containsKey("@value")) {
-                            if (((Map) o).containsKey("@type")) {
-                                String datatypeURI = (String) ((Map) o).get("@type");
-                                String value = (String) ((Map) o).get("@value");
-                                tripleCallback.triple(s, p, value, datatypeURI, null);
-                            } else if (((Map) o).containsKey("@language")) {
-                                tripleCallback.triple(s, p, (String) ((Map) o).get("@value"), JSONLDConsts.XSD_STRING, (String) ((Map) o).get("@language"));
-                            } else {
-                                tripleCallback.triple(s, p, (String) ((Map) o).get("@value"), JSONLDConsts.XSD_STRING, null);
-                            }
-                        } else if (((Map) o).containsKey("@id")) {
-                            tripleCallback.triple(s, p, (String) ((Map) o).get("@id"));
-                        } else {
-                            // TODO: have i missed anything?
-                            return;
-                        }
-                    }
-                }
-            }
-        }
-    }
-
-    /*
-     * public Object simplify(Map input) { return simplify(input, new HashMap()); }
-     */
-
-    public static void generateSimplifyContext(Object input, Map<String, Object> ctx) {
-        if (input instanceof List) {
-            for (Object o : (List) input) {
-                generateSimplifyContext(o, ctx);
-            }
-        } else if (input instanceof Map) {
-            Map<String, Object> o = (Map<String, Object>) input;
-            for (String key : o.keySet()) {
-                Object val = o.get(key);
-                if (key.matches("^https?://.+$")) {
-                    int idx = key.lastIndexOf('#');
-                    if (idx < 0) {
-                        idx = key.lastIndexOf('/');
-                    }
-                    String skey = key.substring(idx + 1);
-                    Object keyval = key;
-                    if (val instanceof Map) {
-                        if (((Map) val).containsKey("@id")) {
-                            Map tmp = new HashMap();
-                            tmp.put("@type", "@id");
-                            tmp.put("@id", key);
-                            keyval = tmp;
-                        }
-                    }
-                    while (true) {
-                        // check if the key is already in the frame ctx
-                        if (ctx.containsKey(skey)) {
-                            // if so, check if the values are the same
-                            if (ctx.get(skey).equals(keyval)) {
-                                // if they are, skip adding this
-                                break;
-                            }
-                            // if not, add a _ to the simple key and try again
-                            skey += "_";
-                        } else {
-                            ctx.put(skey, keyval);
-                            break;
-                        }
-                    }
-                }
-                if (val instanceof Map || val instanceof List) {
-                    generateSimplifyContext(val, ctx);
-                }
-            }
-        }
-    }
-
-    /**
-     * automatically builds a frame which attempts to simplify the keys and values as much as possible
-     * 
-     * NOTE: this is experimental and only built for specific conditions
-     * 
-     * @param input
-     * @return
-     */
-    public Object simplify(Map input) {
-
-        Map<String, Object> origCtx = (Map<String, Object>) input.get("@context");
-        Object expanded = expand(input);
-        Map<String, Object> framectx = new HashMap<String, Object>();
-
-        generateSimplifyContext(expanded, framectx);
-
-        if (origCtx != null) {
-            framectx = JSONLDUtils.mergeContexts(origCtx, framectx);
-        }
-
-        return compact(framectx, expanded);
-    }
-
-    private Map<String, Object> nestCore(Map<String, Object> rootObj, Map<String, Map<String, Object>> otherObjs) {
-        Map<String, Object> rval = new HashMap<String, Object>();
-        for (String key : rootObj.keySet()) {
-            Object val = rootObj.get(key);
-            if (ignoredKeywords.contains(key)) {
-            	rval.put(key, val);
-            } else if (val instanceof List) {
-                List<Object> lv = new ArrayList<Object>();
-                for (Map<String, Object> o : (List<Map<String, Object>>) val) {
-                    lv.add(nestCore(o, otherObjs));
-                }
-                rval.put(key, lv);
-            } else if (val instanceof Map) {
-                // TODO: should this be true as well? ((Map) val).size() == 1
-                if (((Map) val).containsKey("@id") && otherObjs.containsKey(((Map) val).get("@id"))) {
-                    rval.put(key, otherObjs.get(((Map) val).get("@id")));
-                } else {
-                    rval.put(key, nestCore((Map<String, Object>) val, otherObjs));
-                }
-            } else {
-                rval.put(key, val);
-            }
-        }
-        return rval;
-    }
-
-    /**
-     * expands all the objects in the input list, and nests all the non-root object lists
-     * into the root object, resulting in a single object
-     * 
-     * TODO: i'm not sure if the way i'm keeping the original context is what i really want 
-     * 
-     * @param input
-     * @param rootObjId
-     * @return
-     */
-    public Object nest(List<Map<String, Object>> input, String rootObjId) {
-        Map<String, Object> rootObj = null;
-        Map<String, Object> rootObjCtx = null;
-        Map<String, Map<String, Object>> otherObjs = new HashMap<String, Map<String, Object>>();
-        // find the root object and build a map of the non-root objects mapped by id
-        for (Map<String, Object> item : input) {
-            if (item.containsKey("@id")) {
-                if (rootObjId.equals(item.get("@id"))) {
-                    rootObjCtx = (Map<String, Object>) item.get("@context");
-                    rootObj = (Map<String, Object>) expand(item);
-                } else {
-                    //Map<String, Object> clone = (Map<String, Object>) JSONLDUtils.clone(item);
-                    //clone.remove("@id");
-                    otherObjs.put((String) item.get("@id"), (Map<String, Object>) expand(item));
-                }
-            }
-        }
-
-        if (rootObj == null) {
-            // no object matching the root object found, should probably return an error actually
-            // TODO: throw runtimeexception when the rest of the library is updated
-            return input;
-        }
-
-        // this nests all the elements in the input once (not including the root object)
-        Map<String, Map<String, Object>> nestedOthers = new HashMap<String, Map<String, Object>>();
-        for (String key : otherObjs.keySet()) {
-            Map<String, Object> val = otherObjs.get(key);
-            nestedOthers.put(key, nestCore(val, otherObjs));
-        }
-        // nests the root object with the nested other objects
-        Map<String, Object> rval = nestCore(rootObj, nestedOthers);
-
-        // compact the results with the original root object's context
-        return compact(rootObjCtx != null ? rootObjCtx : new HashMap<String, Object>(), rval);
-    }
-
-    public void nameBlankNodes(Object input) {
-        JSONLDUtils.NameGenerator ng = new JSONLDUtils.NameGenerator("tmp");
-        this.ngtmp = ng;
-
-        // Map<String,Object> subjects = new HashMap<String, Object>();
-        subjects = new HashMap<String, Object>();
-        List<Map<String, Object>> bnodes = new ArrayList<Map<String, Object>>();
-
-        collectSubjects(input, subjects, bnodes);
-
-        for (Map<String, Object> bnode : bnodes) {
-            if (!bnode.containsKey("@id")) {
-                while (subjects.containsKey(ng.next()))
-                    ;
-                ((Map<String, Object>) bnode).put("@id", ng.current());
-                subjects.put(ng.current(), bnode);
-            }
-        }
-    }
-
-    private void flatten(Object parent, String parentProperty, Object value, Map<String, Object> subjects) throws Exception {
-
-        Object flattened = null;
-
-        if (value == null) {
-            // drop null values
-        } else if (value instanceof List) {
-            for (Object v : (List<Object>) value) {
-                flatten(parent, parentProperty, v, subjects);
-            }
-        } else if (value instanceof Map) {
-            Map<String, Object> mapVal = (Map<String, Object>) value;
-            if (mapVal.containsKey("@value") || "@type".equals(parentProperty)) {
-                // already-expanded value
-                flattened = JSONLDUtils.clone(value);
-            } else if (mapVal.get("@id") instanceof List) {
-                // graph literal/disjoint graph
-                if (parent != null) {
-                    // cannot flatten embedded graph literals
-                    throw new Exception("Embedded graph literals cannot be flattened");
-                }
-
-                // top-level graph literal
-                for (Object key : (List<Object>) mapVal.get("@id")) {
-                    if (!ignoredKeywords.contains(key)) {
-                        flatten(parent, parentProperty, key, subjects);
-                    }
-                }
-            } else { // regular subject
-                // create of fetch existing subject
-                Object subject;
-                if (subjects.containsKey(mapVal.get("@id"))) {
-                    subject = subjects.get(mapVal.get("@id"));
-                } else {
-                    subject = new HashMap<String, Object>();
-                    ((Map<String, Object>) subject).put("@id", mapVal.get("@id"));
-                    subjects.put((String) mapVal.get("@id"), subject);
-                }
-                flattened = new HashMap<String, Object>();
-                ((Map<String, Object>) flattened).put("@id", ((Map<String, Object>) subject).get("@id"));
-
-                for (String key : mapVal.keySet()) {
-                    Object v = mapVal.get(key);
-
-                    if (ignoredKeywords.contains(key)) {
-                        ((Map<String, Object>) subject).put(key, v);
-                    } else if (v != null && !"@id".equals(key)) {
-                        if (((Map<String, Object>) subject).containsKey(key)) {
-                            if (!(((Map<String, Object>) subject).get(key) instanceof List)) {
-                                Object tmp = ((Map<String, Object>) subject).get(key);
-                                List<Object> lst = new ArrayList<Object>();
-                                lst.add(tmp);
-                                ((Map<String, Object>) subject).put(key, lst);
-                            }
-                        } else {
-                            List<Object> lst = new ArrayList<Object>();
-                            ((Map<String, Object>) subject).put(key, lst);
-                        }
-
-                        flatten(((Map<String, Object>) subject).get(key), key, v, subjects);
-                        if (((List<Object>) ((Map<String, Object>) subject).get(key)).size() == 1) {
-                            // convert subject[key] to a single object if there
-                            // is only one object in the list
-                            ((Map<String, Object>) subject).put(key, ((List<Object>) ((Map<String, Object>) subject).get(key)).get(0));
-                        }
-                    }
-                }
-            }
-        } else {
-            // string value
-            flattened = value;
-        }
-
-        if (flattened != null && parent != null) {
-            if (parent instanceof List) {
-                boolean duplicate = false;
-                for (Object e : (List<Object>) parent) {
-                    if (JSONLDUtils.compareObjects(e, flattened) == 0) {
-                        duplicate = true;
-                        break;
-                    }
-                }
-                if (!duplicate) {
-                    ((List<Object>) parent).add(flattened);
-                }
-            } else {
-                ((Map<String, Object>) parent).put(parentProperty, flattened);
-            }
-        }
-    }
-
-    private void collectEdges() {
-        Map<String, Object> refs = (Map<String, Object>) this.edges.get("refs");
-        Map<String, Object> props = (Map<String, Object>) this.edges.get("props");
-
-        for (String iri : this.subjects.keySet()) {
-            Map<String, Object> subject = (Map<String, Object>) this.subjects.get(iri);
-            for (String key : subject.keySet()) {
-                if (!key.equals("@id") && !ignoredKeywords.contains(key)) {
-                    Object object = subject.get(key);
-                    List<Object> tmp = null;
-                    if (object instanceof List) {
-                        tmp = (List<Object>) object;
-                    } else {
-                        tmp = new ArrayList<Object>();
-                        tmp.add(object);
-                    }
-                    for (Object o : tmp) {
-                        if (o instanceof Map && ((Map) o).containsKey("@id") && this.subjects.containsKey(((Map) o).get("@id"))) {
-                            Object objIri = ((Map<String, Object>) o).get("@id");
-                            Map<String, Object> tmp1 = new HashMap<String, Object>();
-                            tmp1.put("s", iri);
-                            tmp1.put("p", key);
-                            ((Map<String, List>) refs.get(objIri)).get("all").add(tmp1);
-                            tmp1 = new HashMap<String, Object>();
-                            tmp1.put("s", objIri);
-                            tmp1.put("p", key);
-                            ((Map<String, List>) props.get(iri)).get("all").add(tmp1);
-                        }
-                    }
-                }
-            }
-        }
-
-        Comparator<Object> edgesCmp = new Comparator<Object>() {
-            public int compare(Object a, Object b) {
-                return compareEdges(a, b);
-            }
-        };
-
-        for (String iri : refs.keySet()) {
-            List<Object> all = (List<Object>) ((Map<String, Object>) refs.get(iri)).get("all");
-            Collections.sort(all, edgesCmp);
-            List<Object> bnodes = new ArrayList<Object>();
-            for (Object edge : all) {
-                if (JSONLDUtils.isBlankNodeIri(((Map<String, Object>) edge).get("s"))) {
-                    bnodes.add(edge);
-                }
-            }
-            ((Map<String, Object>) refs.get(iri)).put("bnodes", bnodes);
-        }
-        for (String iri : props.keySet()) {
-            List<Object> all = (List<Object>) ((Map<String, Object>) props.get(iri)).get("all");
-            Collections.sort(all, edgesCmp);
-            List<Object> bnodes = new ArrayList<Object>();
-            for (Object edge : all) {
-                if (JSONLDUtils.isBlankNodeIri(((Map<String, Object>) edge).get("s"))) {
-                    bnodes.add(edge);
-                }
-            }
-            ((Map<String, Object>) props.get(iri)).put("bnodes", bnodes);
-        }
-
-    }
-
-    public void canonicalizeBlankNodes(List<Map<String, Object>> input) {
-
-        this.renamed = new HashMap<String, Object>();
-        this.serializations = new HashMap<String, Object>();
-        this.edges = new HashMap<String, Object>();
-        edges.put("refs", new HashMap<String, Object>());
-        edges.put("props", new HashMap<String, Object>());
-
-        this.subjects = new HashMap<String, Object>();
-        List<Map<String, Object>> bnodes = new ArrayList<Map<String, Object>>();
-
-        for (Map<String, Object> s : input) {
-            String iri = (String) s.get("@id");
-            subjects.put(iri, s);
-            Map<String, Object> refs = (Map<String, Object>) edges.get("refs");
-            Map<String, List> tmp = new HashMap<String, List>();
-            tmp.put("all", new ArrayList<Object>());
-            tmp.put("bnodes", new ArrayList<Object>());
-            refs.put(iri, tmp);
-            Map<String, Object> props = (Map<String, Object>) edges.get("props");
-            tmp = new HashMap<String, List>();
-            tmp.put("all", new ArrayList<Object>());
-            tmp.put("bnodes", new ArrayList<Object>());
-            props.put(iri, tmp);
-
-            if (JSONLDUtils.isBlankNodeIri(iri)) {
-                bnodes.add(s);
-            }
-        }
-
-        collectEdges();
-
-        this.ngc14n = new NameGenerator("c14n");
-        NameGenerator c14n = this.ngc14n;
-        NameGenerator ngTmp = this.ngtmp;
-
-        for (Map<String, Object> bnode : bnodes) {
-            String iri = (String) bnode.get("@id");
-            if (c14n.inNamespace(iri)) {
-                while (subjects.containsKey(ngTmp.next()))
-                    ;
-                renameBlankNode(bnode, ngTmp.current());
-                iri = (String) bnode.get("@id");
-            }
-            Map<String, Object> tmp = new HashMap<String, Object>();
-            tmp.put("props", null);
-            tmp.put("refs", null);
-            serializations.put(iri, tmp);
-        }
-
-        Comparator<Map<String, Object>> bnodeSort = new Comparator<Map<String, Object>>() {
-            private JSONLDProcessor processor;
-
-            public Comparator<Map<String, Object>> setProcessor(JSONLDProcessor p) {
-                processor = p;
-                return this;
-            }
-
-            public int compare(Map<String, Object> a, Map<String, Object> b) {
-                int rval = processor.deepCompareBlankNodes(a, b);
-                return rval;
-            }
-        }.setProcessor(this);
-
-        // keep sorting and naming blank nodes until they are all named
-        boolean resort = true;
-        while (bnodes.size() > 0) {
-
-            if (resort) {
-                resort = false;
-                Collections.sort(bnodes, bnodeSort);
-            }
-
-            Map<String, Object> bnode = bnodes.get(0);
-            bnodes.remove(0);
-            String iri = (String) bnode.get("@id");
-            resort = serializations.containsKey(iri) && ((Map<String, Object>) serializations.get(iri)).get("props") != null;
-            Map<String, Object> mapping = null;
-            for (String dir : new String[] { "props", "refs" }) {
-                // if no serialization has been computed, name only the first
-                // node
-                if (serializations.containsKey(iri) && ((Map<String, Object>) serializations.get(iri)).containsKey(dir)
-                        && ((Map<String, Object>) serializations.get(iri)).get(dir) != null) {
-                    mapping = (Map<String, Object>) ((Map<String, Object>) ((Map<String, Object>) serializations.get(iri)).get(dir)).get("m");
-                } else {
-                    mapping = new HashMap<String, Object>();
-                    mapping.put(iri, "s1");
-                }
-
-                // TODO: sort keys by value to name them in order
-                List<String> keys = new ArrayList<String>(mapping.keySet());
-                Collections.sort(keys, new Comparator<String>() {
-                    private Map<String, Object> mapping;
-
-                    public Comparator<String> setMapping(Map<String, Object> m) {
-                        this.mapping = m;
-                        return this;
-                    }
-
-                    public int compare(String a, String b) {
-                        return JSONLDUtils.compare(this.mapping.get(a), this.mapping.get(b));
-                    }
-                }.setMapping(mapping));
-
-                // name bnodes in mapping
-                List<String> renamed = new ArrayList<String>();
-                for (String iriK : keys) {
-                    if (!c14n.inNamespace(iri) && subjects.containsKey(iriK)) {
-                        renameBlankNode((Map<String, Object>) subjects.get(iriK), c14n.next());
-                        renamed.add(iriK);
-                    }
-                }
-
-                // only keep non-canonically named bnodes
-                List<Map<String, Object>> tmp = bnodes;
-                bnodes = new ArrayList<Map<String, Object>>();
-                for (Map<String, Object> b : tmp) {
-                    String iriB = (String) b.get("@id");
-                    if (!c14n.inNamespace(iriB)) {
-                        for (Object i2 : renamed) {
-                            if (markSerializationDirty(iriB, i2, dir)) {
-                                resort = true;
-                            }
-                        }
-                        bnodes.add(b);
-                    }
-                }
-            }
-        }
-
-        for (String key : ((Map<String, Object>) edges.get("props")).keySet()) {
-            if (((List<Object>) ((Map<String, Object>) ((Map<String, Object>) edges.get("props")).get(key)).get("bnodes")).size() > 0) {
-                Map<String, Object> bnode = (Map<String, Object>) subjects.get(key);
-                for (String p : bnode.keySet()) {
-                    if (!p.startsWith("@") && bnode.get(p) instanceof List) {
-                        Collections.sort((List<Object>) bnode.get(p), new Comparator<Object>() {
-                            public int compare(Object o1, Object o2) {
-                                return JSONLDUtils.compareObjects(o1, o2);
-                            }
-
-                        });
-                    }
-                }
-
-            }
-        }
-
-    }
-
-    private boolean markSerializationDirty(String iri, Object changed, String dir) {
-        boolean rval = false;
-        Object s = serializations.get(iri);
-        if (((Map<String, Object>) s).containsKey(dir) && ((Map<String, Object>) s).get(dir) != null
-                && ((Map<String, Object>) ((Map<String, Object>) ((Map<String, Object>) s).get(dir)).get("m")).containsKey(changed)) {
-            ((Map<String, Object>) s).put(dir, null);
-            rval = true;
-        }
-        return rval;
-    }
-
-    private void renameBlankNode(Map<String, Object> b, String id) {
-
-        String old = (String) b.get("@id");
-        b.put("@id", id);
-
-        subjects.put(id, subjects.get(old));
-        subjects.remove(old);
-
-        // update reference and property lists
-        ((Map<String, Object>) edges.get("refs")).put(id, ((Map<String, Object>) edges.get("refs")).get(old));
-        ((Map<String, Object>) edges.get("props")).put(id, ((Map<String, Object>) edges.get("props")).get(old));
-        ((Map<String, Object>) edges.get("refs")).remove(old);
-        ((Map<String, Object>) edges.get("props")).remove(old);
-
-        // update references to this bnode
-        List<Map<String, Object>> refs = (List<Map<String, Object>>) ((Map<String, Object>) ((Map<String, Object>) edges.get("refs")).get(id)).get("all");
-        for (Map<String, Object> i : refs) {
-            String iri = (String) i.get("s");
-            if (iri.equals(old)) {
-                iri = id;
-            }
-            Map<String, Object> ref = (Map<String, Object>) subjects.get(iri);
-            List<Map<String, Object>> props = (List<Map<String, Object>>) ((Map<String, Object>) ((Map<String, Object>) edges.get("props")).get(iri))
-                    .get("all");
-            for (Map<String, Object> i2 : props) {
-                if (old.equals(i2.get("s"))) {
-                    i2.put("s", id);
-                    String p = (String) i2.get("p");
-                    List<Object> tmp = null;
-                    if (ref.get(p) instanceof Map) {
-                        tmp = new ArrayList<Object>();
-                        tmp.add(ref.get(p));
-                    } else if (ref.get(p) instanceof List) {
-                        tmp = (List<Object>) ref.get(p);
-                    } else {
-                        tmp = new ArrayList<Object>();
-                    }
-
-                    for (Object n : tmp) {
-                        if (n instanceof Map && ((Map) n).containsKey("@id") && old.equals(((Map<String, Object>) n).get("@id"))) {
-                            ((Map<String, Object>) n).put("@id", id);
-                        }
-                    }
-                }
-            }
-        }
-
-        // update references from this bnode
-        List<Map<String, Object>> props = (List<Map<String, Object>>) ((Map<String, Object>) ((Map<String, Object>) edges.get("props")).get(id)).get("all");
-        for (Map<String, Object> i : props) {
-            String iri = (String) i.get("s");
-            refs = (List<Map<String, Object>>) ((Map<String, Object>) ((Map<String, Object>) edges.get("refs")).get(iri)).get("all");
-            for (Map<String, Object> r : refs) {
-                if (old.equals(r.get("s"))) {
-                    r.put("s", id);
-                }
-            }
-        }
-    }
-
-    private int deepCompareBlankNodes(Map<String, Object> a, Map<String, Object> b) {
-        int rval = 0;
-
-        String iriA = (String) a.get("@id");
-        String iriB = (String) b.get("@id");
-
-        if (iriA.equals(iriB)) {
-            rval = 0;
-        } else {
-            // try a shallow compare first
-            rval = shallowCompareBlankNodes(a, b);
-
-            if (rval == 0) {
-                // deep compare is needed
-                String[] dirs = new String[] { "props", "refs" };
-                for (int i = 0; rval == 0 && i < dirs.length; i++) {
-                    String dir = dirs[i];
-                    Map<String, Object> sA = (Map<String, Object>) serializations.get(iriA);
-                    Map<String, Object> sB = (Map<String, Object>) serializations.get(iriB);
-                    if (sA.get(dir) == null) {
-                        MappingBuilder mb = new MappingBuilder();
-                        if (dir.equals("refs")) {
-                            mb.mapping = (Map<String, String>) JSONLDUtils.clone(((Map<String, Object>) sA.get("props")).get("m"));
-                            mb.count = mb.mapping.size() + 1;
-                        }
-                        serializeBlankNode(sA, iriA, mb, dir);
-                    }
-                    if (sB.get(dir) == null) {
-                        MappingBuilder mb = new MappingBuilder();
-                        if (dir.equals("refs")) {
-                            mb.mapping = (Map<String, String>) JSONLDUtils.clone(((Map<String, Object>) sB.get("props")).get("m"));
-                            mb.count = mb.mapping.size() + 1;
-                        }
-                        serializeBlankNode(sB, iriB, mb, dir);
-                    }
-
-                    rval = JSONLDUtils.compare(((Map<String, Object>) sA.get(dir)).get("s"), ((Map<String, Object>) sB.get(dir)).get("s"));
-                }
-            }
-        }
-
-        return rval;
-    }
-
-    private void serializeBlankNode(Map<String, Object> s, String iri, MappingBuilder mb, String dir) {
-        if (!(mb.processed.containsKey(iri))) {
-            mb.processed.put(iri, true);
-            String siri = mb.mapNode(iri);
-
-            MappingBuilder original = mb.copy();
-
-            List<Object> adj = (List<Object>) ((Map<String, Object>) ((Map<String, Object>) edges.get(dir)).get(iri)).get("bnodes");
-            Map<String, Object> mapped = new HashMap<String, Object>();
-            List<Object> notMapped = new ArrayList<Object>();
-
-            for (Object i : adj) {
-                if (mb.mapping.containsKey(((Map<String, Object>) i).get("s"))) {
-                    mapped.put(mb.mapping.get(((Map<String, Object>) i).get("s")), ((Map<String, Object>) i).get("s"));
-                } else {
-                    notMapped.add(i);
-                }
-            }
-
-            int combos = Math.max(1, notMapped.size());
-            for (int i = 0; i < combos; ++i) {
-                MappingBuilder m = (i == 0) ? mb : original.copy();
-                serializeCombos(s, iri, siri, mb, dir, mapped, notMapped);
-            }
-        }
-    }
-
-    private void serializeCombos(Map<String, Object> s, String iri, String siri, MappingBuilder mb, String dir, Map<String, Object> mapped,
-            List<Object> notMapped) {
-        if (notMapped.size() > 0) {
-            mapped = (Map<String, Object>) JSONLDUtils.clone(mapped);
-            mapped.put(mb.mapNode((String) ((Map<String, Object>) notMapped.get(0)).get("s")), ((Map<String, Object>) notMapped.get(0)).get("s"));
-
-            MappingBuilder original = mb.copy();
-            notMapped.remove(0);
-
-            int rotations = Math.max(1, notMapped.size());
-            for (int r = 0; r < rotations; ++r) {
-                MappingBuilder m = (r == 0) ? mb : original.copy();
-                serializeCombos(s, iri, siri, m, dir, mapped, notMapped);
-                JSONLDUtils.rotate(notMapped);
-            }
-        } else {
-            List<String> keys = new ArrayList<String>(mapped.keySet());
-            Collections.sort(keys);
-            Map<String, Object> tmp = new HashMap<String, Object>();
-            tmp.put("i", iri);
-            tmp.put("k", keys);
-            tmp.put("m", mapped);
-            mb.adj.put(siri, tmp);
-            mb.serialize(this.subjects, this.edges);
-
-            if (s.get(dir) == null || JSONLDUtils.compareSerializations(mb.s, (String) ((Map<String, Object>) s.get(dir)).get("s")) <= 0) {
-                for (String k : keys) {
-                    serializeBlankNode(s, (String) mapped.get(k), mb, dir);
-                }
-
-                mb.serialize(this.subjects, this.edges);
-                if (s.get(dir) == null || JSONLDUtils.compareSerializations(mb.s, (String) ((Map<String, Object>) s.get(dir)).get("s")) <= 0
-                        && mb.s.length() >= ((String) ((Map<String, Object>) s.get(dir)).get("s")).length()) {
-                    tmp = new HashMap<String, Object>();
-                    tmp.put("s", mb.s);
-                    tmp.put("m", mb.mapping);
-                    s.put(dir, tmp);
-                }
-            }
-        }
-    }
-
-    private int shallowCompareBlankNodes(Map<String, Object> a, Map<String, Object> b) {
-        int rval = 0;
-
-        List<String> pA = new ArrayList<String>();
-        pA.addAll(a.keySet());
-        List<String> pB = new ArrayList<String>();
-        pB.addAll(b.keySet());
-
-        rval = JSONLDUtils.compare(pA.size(), pB.size());
-
-        if (rval == 0) {
-            Collections.sort(pA);
-            Collections.sort(pB);
-            rval = JSONLDUtils.compare(pA, pB);
-        }
-
-        if (rval == 0) {
-            rval = JSONLDUtils.compareBlankNodeObjects(a, b);
-        }
-
-        if (rval == 0) {
-            List<Object> edgesA = (List<Object>) ((Map<String, Object>) ((Map<String, Object>) edges.get("refs")).get(a.get("@id"))).get("all");
-            List<Object> edgesB = (List<Object>) ((Map<String, Object>) ((Map<String, Object>) edges.get("refs")).get(b.get("@id"))).get("all");
-            rval = JSONLDUtils.compare(edgesA.size(), edgesB.size());
-
-            if (rval == 0) {
-                for (int i = 0; i < edgesA.size() && rval == 0; ++i) {
-                    rval = compareEdges(edgesA.get(i), edgesB.get(i));
-                }
-            }
-        }
-
-        return rval;
-    }
-
-    private int compareEdges(Object a, Object b) {
-        int rval = 0;
-
-        boolean bnodeA = JSONLDUtils.isBlankNodeIri(((Map<String, Object>) a).get("s"));
-        boolean bnodeB = JSONLDUtils.isBlankNodeIri(((Map<String, Object>) b).get("s"));
-        JSONLDUtils.NameGenerator c14n = ngc14n;
-
-        if (bnodeA != bnodeB) {
-            rval = bnodeA ? 1 : -1;
-        } else {
-
-            if (!bnodeA) {
-                rval = JSONLDUtils.compare(((Map<String, Object>) a).get("s"), ((Map<String, Object>) b).get("s"));
-            }
-            if (rval == 0) {
-                rval = JSONLDUtils.compare(((Map<String, Object>) a).get("p"), ((Map<String, Object>) b).get("p"));
-            }
-
-            if (rval == 0 && c14n != null) {
-                boolean c14nA = c14n.inNamespace((String) ((Map<String, Object>) a).get("s"));
-                boolean c14nB = c14n.inNamespace((String) ((Map<String, Object>) b).get("s"));
-
-                if (c14nA != c14nB) {
-                    rval = c14nA ? 1 : -1;
-                } else if (c14nA) {
-                    rval = JSONLDUtils.compare(((Map<String, Object>) a).get("s"), ((Map<String, Object>) b).get("s"));
-                }
-
-            }
-
-        }
-
-        return rval;
-    }
-
-    private void collectSubjects(Object input, Map<String, Object> subjects, List<Map<String, Object>> bnodes) {
-        if (input == null) {
-            return;
-        } else if (input instanceof List) {
-            for (Object o : (List<Object>) input) {
-                collectSubjects(o, subjects, bnodes);
-            }
-        } else if (input instanceof Map) {
-            if (((Map<String, Object>) input).containsKey("@id")) {
-                Object id = ((Map<String, Object>) input).get("@id");
-                if (id instanceof List) {
-                    // graph literal
-                    collectSubjects(id, subjects, bnodes);
-                } else if (JSONLDUtils.isSubject(input)) {
-                    // named subject
-                    subjects.put((String) id, input);
-                }
-
-            } else if (JSONLDUtils.isBlankNode(input)) {
-                bnodes.add((Map<String, Object>) input);
-            }
-
-            for (String key : ((Map<String, Object>) input).keySet()) {
-                if (!ignoredKeywords.contains(key)) {
-                    collectSubjects(((Map<String, Object>) input).get(key), subjects, bnodes);
-                }
-            }
-        }
-    }
-
-    /**
-     * TODO: this whole thing should probably be optimized
-     * 
-     * why doesn't Java make using maps and lists easy?!?!?!??!?
-     * 
-     * @author tristan
-     * 
-     */
-    private class MappingBuilder {
-
-        public MappingBuilder() {
-            this.count = 1;
-            this.processed = new HashMap<String, Boolean>();
-            this.mapping = new HashMap<String, String>();
-            this.adj = new HashMap<String, Object>();
-
-            // this.keyStack = [{ keys: ['s1'], idx: 0 }];
-            this.keyStack = new ArrayList<Object>();
-            Map<String, Object> t1 = new HashMap<String, Object>();
-            List<String> t2 = new ArrayList<String>();
-            t2.add("s1");
-            t1.put("keys", t2);
-            t1.put("idx", 0);
-            keyStack.add(t1);
-            this.done = new HashMap<String, Boolean>();
-            this.s = "";
-        }
-
-        public HashMap<String, Boolean> done;
-        public ArrayList<Object> keyStack;
-        public String s;
-        public Map<String, Object> adj;
-        public Map<String, Boolean> processed;
-        public int count;
-        public Map<String, String> mapping;
-
-        /**
-         * Maps the next name to the given bnode IRI if the bnode IRI isn't already in the mapping. If the given bnode IRI is canonical, then it will be given a
-         * shortened form of the same name.
-         * 
-         * @param iri
-         *            the blank node IRI to map the next name to.
-         * 
-         * @return the mapped name.
-         */
-        public String mapNode(String iri) {
-            if (!this.mapping.containsKey(iri)) {
-                if (iri.startsWith("_:c14n")) {
-                    this.mapping.put(iri, "c" + iri.substring(6));
-                } else {
-                    this.mapping.put(iri, "s" + this.count);
-                    this.count += 1;
-                }
-            }
-            return this.mapping.get(iri);
-        }
-
-        public void serialize(Map<String, Object> subjects, Map<String, Object> edges) {
-            if (this.keyStack.size() > 0) {
-                Map<String, Object> next = (Map<String, Object>) this.keyStack.remove(this.keyStack.size() - 1);
-                // for (; (Integer)next.get("idx") < ((List<String>)
-                // next.get("keys")).size(); next.put("idx",
-                // (Integer)next.get("idx")+1)) {
-                while ((Integer) next.get("idx") < ((List<String>) next.get("keys")).size()) {
-                    String k = ((List<String>) next.get("keys")).get((Integer) next.get("idx"));
-                    if (!this.adj.containsKey(k)) {
-                        this.keyStack.add(next);
-                        break;
-                    }
-                    next.put("idx", (Integer) next.get("idx") + 1);
-
-                    if (this.done.containsKey(k)) {
-                        this.s += "_" + k;
-                    } else {
-                        this.done.put(k, true);
-
-                        String s = k;
-                        Map<String, Object> adj = (Map<String, Object>) this.adj.get(k);
-                        String iri = (String) adj.get("i");
-                        if (subjects.containsKey(iri)) {
-                            Map<String, Object> b = (Map<String, Object>) subjects.get(iri);
-                            s += "[" + JSONLDUtils.serializeProperties(b) + "]";
-
-                            Boolean first = true;
-                            s += "[";
-                            List<Map<String, Object>> refs = (List<Map<String, Object>>) ((Map<String, Object>) ((Map<String, Object>) edges.get("refs"))
-                                    .get(iri)).get("all");
-                            for (Map<String, Object> r : refs) {
-                                if (first) {
-                                    first = false;
-                                } else {
-                                    s += "|";
-                                }
-                                s += "<" + r.get("p") + ">";
-                                s += JSONLDUtils.isBlankNodeIri(r.get("s")) ? "_:" : ("<" + r.get("s") + ">");
-                            }
-                            s += "]";
-                        }
-
-                        for (String o : (List<String>) adj.get("k")) {
-                            s += o;
-                        }
-                        this.s += s;
-                        Map<String, Object> tmp = new HashMap<String, Object>();
-                        tmp.put("keys", adj.get("k"));
-                        tmp.put("idx", 0);
-                        this.keyStack.add(tmp);
-                        this.serialize(subjects, edges);
-                    }
-                }
-            }
-        }
-
-        public MappingBuilder copy() {
-            MappingBuilder rval = new MappingBuilder();
-            rval.count = this.count;
-            rval.processed = (Map<String, Boolean>) JSONLDUtils.clone(this.processed);
-            rval.mapping = (Map<String, String>) JSONLDUtils.clone(this.mapping);
-            rval.adj = (Map<String, Object>) JSONLDUtils.clone(this.adj);
-            rval.keyStack = (ArrayList<Object>) JSONLDUtils.clone(this.keyStack);
-            rval.done = (HashMap<String, Boolean>) JSONLDUtils.clone(this.done);
-
-            rval.s = this.s;
-            return rval;
-        }
-
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/ext/java/de/dfki/km/json/jsonld/JSONLDSerializer.java
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/ext/java/de/dfki/km/json/jsonld/JSONLDSerializer.java b/commons/sesame-tools-rio-jsonld/src/ext/java/de/dfki/km/json/jsonld/JSONLDSerializer.java
deleted file mode 100644
index 5935071..0000000
--- a/commons/sesame-tools-rio-jsonld/src/ext/java/de/dfki/km/json/jsonld/JSONLDSerializer.java
+++ /dev/null
@@ -1,241 +0,0 @@
-package de.dfki.km.json.jsonld;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.io.Writer;
-
-import de.dfki.km.json.JSONUtils;
-
-/**
- * TODO:
- * 
- * @author tristan
- * 
- */
-public class JSONLDSerializer {
-
-    private Map<String, Map<String, Object>> _subjects;
-    private Map<String, Object> _context;
-
-    JSONLDUtils.NameGenerator _ng;
-    Map<String, String> _bns;
-
-    public JSONLDSerializer() {
-        reset();
-    }
-
-    /**
-     * Resets the Serializer. Call this if you want to reuse the serializer for a different document
-     */
-    public void reset() {
-        _subjects = new HashMap<String, Map<String, Object>>();
-        _context = new HashMap<String, Object>();
-        _context.put("rdf", JSONLDConsts.RDF_SYNTAX_NS);
-        _context.put("rdfs", JSONLDConsts.RDF_SCHEMA_NS);
-        _context.put("xsd", JSONLDConsts.XSD_NS);
-
-        _ng = new JSONLDUtils.NameGenerator("bn");
-        _bns = new HashMap<String, String>();
-    }
-
-    // some helper functions for extended classes
-    protected Map<String, Object> getSubject(String subjURI) {
-        return _subjects.get(subjURI);
-    }
-
-    protected void setSubject(String subjURI, Map<String, Object> subj) {
-        _subjects.put(subjURI, subj);
-    }
-
-    protected String getNameForBlankNode(String node) {
-        if (!_bns.containsKey(node)) {
-            _bns.put(node, _ng.next());
-        }
-        return _bns.get(node);
-    }
-
-    /**
-     * internal function to avoid repetition of code
-     * 
-     * @param s
-     * @param p
-     * @param value
-     */
-    private void triple(String s, String p, Object value) {
-        // get the cached object for this subject
-        Map<String, Object> subj = _subjects.get(s);
-        if (subj == null) {
-            // if no cached object exists, create one.
-            subj = new HashMap<String, Object>();
-            _subjects.put(s, subj);
-
-            // since this is the first time we're encountering this subject, add
-            // it's @id key
-            subj.put("@id", s);
-        }
-
-        // check for @type predicate
-        if (JSONLDConsts.RDF_TYPE.equals(p)) {
-            p = "@type";
-            // type doesn't need to be (TODO: should it not be?) in an object
-            if (value instanceof Map) {
-                if (((Map) value).containsKey("@id")) {
-                    value = ((Map) value).get("@id");
-                } else if (((Map) value).containsKey("@value")) {
-                    // this is a weird case, which probably shouldn't happen
-                    // but i'll account for it anyway.
-                    value = ((Map) value).get("@value");
-                } // otherwise it's a string, leave it as such (TODO: it should
-                  // never be a list, but perhaps we should make sure)
-            }
-        }
-
-        Object oldval = subj.get(p);
-        // check if an existing value is present for this predicate
-        if (oldval != null) {
-            // if so, make the value a list (if it isn't already) and add the
-            // new value to the end of the list
-            // TODO: what if the value itself is a list, is this even possible?
-            if (oldval instanceof List) {
-                ((List) oldval).add(value);
-                value = oldval;
-            } else {
-                List<Object> tmp = new ArrayList<Object>();
-                tmp.add(oldval);
-                tmp.add(value);
-                value = tmp;
-            }
-        }
-        // add the new value to the cache object
-        subj.put(p, value);
-    }
-
-    /**
-     * Call this to add a literal to the JSON-LD document
-     * 
-     * @param s
-     *            the subjuct URI
-     * @param p
-     *            the predicate URI
-     * @param value
-     *            the literal value as a string
-     * @param datatype
-     *            the datatype URI (if null, a plain literal is assumed)
-     * @param language
-     *            the language (may be null, or an empty string)
-     */
-    public void triple(String s, String p, String value, String datatype, String language) {
-
-        Object val;
-        if (datatype == null || JSONLDConsts.XSD_STRING.equals(datatype)) {
-            if (language == null || "".equals(language)) {
-                val = value;
-            } else {
-                val = new HashMap<String, Object>();
-                ((Map<String, Object>) val).put("@value", value);
-                ((Map<String, Object>) val).put("@language", language);
-            }
-        } else {
-            // compact the datatype (will return the same thing if no prefix has
-            // been set for the uri)
-            // datatype = JSONLDUtils.compactIRI(_context, datatype); NOTE:
-            // going to leave this up to the user
-            val = new HashMap<String, Object>();
-            ((Map<String, Object>) val).put("@value", value);
-            ((Map<String, Object>) val).put("@type", datatype);
-        }
-
-        triple(s, p, val);
-    }
-
-    /**
-     * Call this to add a new object,predicate,object relation to the JSON-LD document
-     * 
-     * @param s
-     *            the subject URI
-     * @param p
-     *            the predicate URI
-     * @param o
-     *            the object URI
-     */
-    public void triple(String s, String p, String o) {
-        Map<String, Object> val = new HashMap<String, Object>();
-        val.put("@id", o);
-
-        // TODO: should we check if this object exists in the _subjects list and
-        // add it if it doesn't?
-        // this seems to be what the python rdflib serializer does, but it seems
-        // redundant.
-        triple(s, p, (Object) val);
-    }
-
-    public void setPrefix(String fullUri, String prefix) {
-        _context.put(prefix, fullUri);
-    }
-
-    /**
-     * Builds the JSON-LD document based on the currently stored triples, compacting the URIs based on the stored context.
-     * 
-     * @return A Map representing the JSON-LD document.
-     */
-    public Object asObject() {
-        JSONLDProcessor p = new JSONLDProcessor();
-
-        // go through the list of subjects that were built, compact them based
-        // of the current context
-        // then add them to a subjects list
-        List<Object> subjects = new ArrayList<Object>();
-        for (Map<String, Object> subj : _subjects.values()) {
-            subj = (Map<String, Object>) p.compact(_context, subj);
-            subjects.add(subj);
-        }
-
-        if (subjects.size() == 1) {
-            // if there is only one subject, make the base object this object
-            Map<String, Object> rval = new HashMap<String, Object>();
-            rval = (Map<String, Object>) subjects.get(0);
-            rval.put("@context", _context);
-            return rval;
-        } else {
-            return subjects;
-        }
-    }
-
-    public void toWriter(Writer writer) {
-        try {
-            JSONUtils.writePrettyPrint(writer, asObject());
-        }
-        catch (Exception e) {
-            e.printStackTrace();
-        }
-    }
-
-    /**
-     * 
-     * @return A String representing the JSON-LD document.
-     */
-    public String asString() {
-        return asString(false);
-    }
-
-    /**
-     * Returns a formated String representing the JSON-LD document using PrettyPrint writer.
-     * @return A String representing the JSON-LD document.
-     */
-    public String asString(boolean prettyPrint) {
-        // TODO: catching the exceptions here and returning JSON with the error
-        // messages may not
-        // be the best idea
-        try {
-            if (!prettyPrint)
-                return JSONUtils.toString(asObject());
-            else
-                return JSONUtils.toPrettyString(asObject());
-        } catch (Exception e) {
-            return "{\"error\":\"" + e.getLocalizedMessage() + "\"}";
-        }
-    }    
-
-}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/ext/java/de/dfki/km/json/jsonld/JSONLDTripleCallback.java
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/ext/java/de/dfki/km/json/jsonld/JSONLDTripleCallback.java b/commons/sesame-tools-rio-jsonld/src/ext/java/de/dfki/km/json/jsonld/JSONLDTripleCallback.java
deleted file mode 100644
index e332492..0000000
--- a/commons/sesame-tools-rio-jsonld/src/ext/java/de/dfki/km/json/jsonld/JSONLDTripleCallback.java
+++ /dev/null
@@ -1,34 +0,0 @@
-package de.dfki.km.json.jsonld;
-
-public interface JSONLDTripleCallback {
-    /**
-     * Construct a triple with three URIs.
-     * 
-     * @param s
-     *            The Subject URI
-     * @param p
-     *            The Predicate URI
-     * @param o
-     *            The Object URI
-     * @return The generated triple, or null to force triple generation to stop
-     */
-    void triple(String s, String p, String o);
-
-    /**
-     * Constructs a triple with a Literal object, which may or may not contain a
-     * language and/or a datatype.
-     * 
-     * @param s
-     *            The Subject URI
-     * @param p
-     *            The Predicate URI
-     * @param value
-     *            The literal value
-     * @param datatype
-     *            The literal datatype
-     * @param language
-     *            The literal language (NOTE: may be null if not specified!)
-     * @return The generated triple, or null to force triple generation to stop
-     */
-    void triple(String s, String p, String value, String datatype, String language);
-}


[093/100] [abbrv] git commit: [maven-release-plugin] prepare release 3.2.1

Posted by wi...@apache.org.
[maven-release-plugin] prepare release 3.2.1


Project: http://git-wip-us.apache.org/repos/asf/marmotta/repo
Commit: http://git-wip-us.apache.org/repos/asf/marmotta/commit/1d73c3bc
Tree: http://git-wip-us.apache.org/repos/asf/marmotta/tree/1d73c3bc
Diff: http://git-wip-us.apache.org/repos/asf/marmotta/diff/1d73c3bc

Branch: refs/heads/ldp
Commit: 1d73c3bc51286cae15bb4ca2a9a2c8f8c7e10cc8
Parents: 9198e97
Author: Jakob Frank <ja...@salzburgresearch.at>
Authored: Mon May 19 15:32:33 2014 +0200
Committer: Jakob Frank <ja...@salzburgresearch.at>
Committed: Mon May 19 15:32:33 2014 +0200

----------------------------------------------------------------------
 build/archetypes/marmotta-archetype-module/pom.xml               | 2 +-
 build/archetypes/marmotta-archetype-webapp/pom.xml               | 2 +-
 build/archetypes/pom.xml                                         | 2 +-
 build/checkstyle-resources/pom.xml                               | 2 +-
 build/dependency-resource-supplement/pom.xml                     | 2 +-
 build/plugins/buildinfo-maven-plugin/pom.xml                     | 2 +-
 build/plugins/marmotta-maven-plugin/pom.xml                      | 2 +-
 build/plugins/pom.xml                                            | 2 +-
 build/plugins/refpack-maven-plugin/pom.xml                       | 2 +-
 build/plugins/repocheck-maven-plugin/pom.xml                     | 2 +-
 build/pom.xml                                                    | 2 +-
 client/marmotta-client-java/pom.xml                              | 2 +-
 client/marmotta-client-js/pom.xml                                | 2 +-
 client/pom.xml                                                   | 2 +-
 commons/marmotta-commons/pom.xml                                 | 2 +-
 commons/marmotta-sesame-tools/marmotta-model-vocabs/pom.xml      | 2 +-
 commons/marmotta-sesame-tools/marmotta-rio-api/pom.xml           | 2 +-
 commons/marmotta-sesame-tools/marmotta-rio-ical/pom.xml          | 2 +-
 commons/marmotta-sesame-tools/marmotta-rio-rss/pom.xml           | 2 +-
 commons/marmotta-sesame-tools/marmotta-rio-vcard/pom.xml         | 2 +-
 commons/marmotta-sesame-tools/marmotta-sail-contextaware/pom.xml | 2 +-
 commons/marmotta-sesame-tools/marmotta-sail-transactions/pom.xml | 2 +-
 commons/marmotta-sesame-tools/marmotta-sesame-matchers/pom.xml   | 2 +-
 commons/marmotta-sesame-tools/marmotta-util-facading/pom.xml     | 2 +-
 commons/marmotta-sesame-tools/marmotta-util-filter/pom.xml       | 2 +-
 commons/marmotta-sesame-tools/marmotta-util-rdfpatch/pom.xml     | 2 +-
 commons/marmotta-sesame-tools/marmotta-util-tripletable/pom.xml  | 2 +-
 commons/marmotta-sesame-tools/pom.xml                            | 2 +-
 commons/pom.xml                                                  | 2 +-
 extras/pom.xml                                                   | 2 +-
 extras/webjars/codemirror/pom.xml                                | 2 +-
 extras/webjars/pom.xml                                           | 2 +-
 extras/webjars/strftime/pom.xml                                  | 2 +-
 launchers/marmotta-installer/pom.xml                             | 2 +-
 launchers/marmotta-splash/pom.xml                                | 2 +-
 launchers/marmotta-webapp/pom.xml                                | 2 +-
 launchers/pom.xml                                                | 2 +-
 libraries/kiwi/kiwi-caching-ehcache/pom.xml                      | 2 +-
 libraries/kiwi/kiwi-caching-hazelcast/pom.xml                    | 2 +-
 libraries/kiwi/kiwi-caching-infinispan/pom.xml                   | 2 +-
 libraries/kiwi/kiwi-loader/pom.xml                               | 2 +-
 libraries/kiwi/kiwi-reasoner/pom.xml                             | 2 +-
 libraries/kiwi/kiwi-sparql/pom.xml                               | 2 +-
 libraries/kiwi/kiwi-triplestore/pom.xml                          | 2 +-
 libraries/kiwi/kiwi-versioning/pom.xml                           | 2 +-
 libraries/kiwi/pom.xml                                           | 2 +-
 libraries/ldcache/ldcache-api/pom.xml                            | 2 +-
 libraries/ldcache/ldcache-backend-file/pom.xml                   | 2 +-
 libraries/ldcache/ldcache-backend-infinispan/pom.xml             | 2 +-
 libraries/ldcache/ldcache-backend-kiwi/pom.xml                   | 2 +-
 libraries/ldcache/ldcache-core/pom.xml                           | 2 +-
 libraries/ldcache/ldcache-sail-generic/pom.xml                   | 2 +-
 libraries/ldcache/ldcache-sail-kiwi/pom.xml                      | 2 +-
 libraries/ldcache/pom.xml                                        | 2 +-
 libraries/ldclient/ldclient-api/pom.xml                          | 2 +-
 libraries/ldclient/ldclient-core/pom.xml                         | 2 +-
 libraries/ldclient/ldclient-provider-facebook/pom.xml            | 2 +-
 libraries/ldclient/ldclient-provider-freebase/pom.xml            | 2 +-
 libraries/ldclient/ldclient-provider-html/pom.xml                | 2 +-
 libraries/ldclient/ldclient-provider-ldap/pom.xml                | 2 +-
 libraries/ldclient/ldclient-provider-mediawiki/pom.xml           | 2 +-
 libraries/ldclient/ldclient-provider-phpbb/pom.xml               | 2 +-
 libraries/ldclient/ldclient-provider-rdf/pom.xml                 | 2 +-
 libraries/ldclient/ldclient-provider-rdfa/pom.xml                | 2 +-
 libraries/ldclient/ldclient-provider-vimeo/pom.xml               | 2 +-
 libraries/ldclient/ldclient-provider-xml/pom.xml                 | 2 +-
 libraries/ldclient/ldclient-provider-youtube/pom.xml             | 2 +-
 libraries/ldclient/pom.xml                                       | 2 +-
 libraries/ldpath/ldpath-api/pom.xml                              | 2 +-
 libraries/ldpath/ldpath-backend-file/pom.xml                     | 2 +-
 libraries/ldpath/ldpath-backend-jena/pom.xml                     | 2 +-
 libraries/ldpath/ldpath-backend-linkeddata/pom.xml               | 2 +-
 libraries/ldpath/ldpath-backend-sesame/pom.xml                   | 2 +-
 libraries/ldpath/ldpath-core-bundle/pom.xml                      | 2 +-
 libraries/ldpath/ldpath-core/pom.xml                             | 2 +-
 libraries/ldpath/ldpath-functions-collections/pom.xml            | 2 +-
 libraries/ldpath/ldpath-functions-date/pom.xml                   | 2 +-
 libraries/ldpath/ldpath-functions-html/pom.xml                   | 2 +-
 libraries/ldpath/ldpath-functions-math/pom.xml                   | 2 +-
 libraries/ldpath/ldpath-functions-text/pom.xml                   | 2 +-
 libraries/ldpath/ldpath-functions-xml/pom.xml                    | 2 +-
 libraries/ldpath/ldpath-template-linkeddata/pom.xml              | 2 +-
 libraries/ldpath/ldpath-template/pom.xml                         | 2 +-
 libraries/ldpath/pom.xml                                         | 2 +-
 libraries/pom.xml                                                | 2 +-
 loader/marmotta-loader-berkeley/pom.xml                          | 2 +-
 loader/marmotta-loader-core/pom.xml                              | 2 +-
 loader/marmotta-loader-hbase/pom.xml                             | 2 +-
 loader/marmotta-loader-kiwi/pom.xml                              | 2 +-
 loader/marmotta-loader-titan/pom.xml                             | 2 +-
 loader/pom.xml                                                   | 2 +-
 parent/pom.xml                                                   | 4 ++--
 platform/backends/marmotta-backend-kiwi/pom.xml                  | 2 +-
 platform/backends/marmotta-backend-memory/pom.xml                | 2 +-
 platform/backends/marmotta-backend-native/pom.xml                | 2 +-
 platform/backends/marmotta-backend-titan/pom.xml                 | 2 +-
 platform/backends/pom.xml                                        | 2 +-
 platform/ldcache/marmotta-ldcache-common/pom.xml                 | 2 +-
 platform/ldcache/marmotta-ldcache-file/pom.xml                   | 2 +-
 platform/ldcache/marmotta-ldcache-kiwi/pom.xml                   | 2 +-
 platform/ldcache/pom.xml                                         | 2 +-
 platform/marmotta-core/pom.xml                                   | 2 +-
 platform/marmotta-ldp/pom.xml                                    | 2 +-
 platform/marmotta-ldpath/pom.xml                                 | 2 +-
 platform/marmotta-reasoner-kiwi/pom.xml                          | 2 +-
 platform/marmotta-security/pom.xml                               | 2 +-
 platform/marmotta-sparql/pom.xml                                 | 2 +-
 platform/marmotta-user/pom.xml                                   | 2 +-
 platform/marmotta-versioning-common/pom.xml                      | 2 +-
 platform/marmotta-versioning-kiwi/pom.xml                        | 2 +-
 platform/marmotta-zookeeper/pom.xml                              | 2 +-
 platform/pom.xml                                                 | 2 +-
 pom.xml                                                          | 4 ++--
 113 files changed, 115 insertions(+), 115 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/marmotta/blob/1d73c3bc/build/archetypes/marmotta-archetype-module/pom.xml
----------------------------------------------------------------------
diff --git a/build/archetypes/marmotta-archetype-module/pom.xml b/build/archetypes/marmotta-archetype-module/pom.xml
index f7837dd..9ccdb2f 100644
--- a/build/archetypes/marmotta-archetype-module/pom.xml
+++ b/build/archetypes/marmotta-archetype-module/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.1-SNAPSHOT</version>
+        <version>3.2.1</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/1d73c3bc/build/archetypes/marmotta-archetype-webapp/pom.xml
----------------------------------------------------------------------
diff --git a/build/archetypes/marmotta-archetype-webapp/pom.xml b/build/archetypes/marmotta-archetype-webapp/pom.xml
index c8746ea..10ae72f 100644
--- a/build/archetypes/marmotta-archetype-webapp/pom.xml
+++ b/build/archetypes/marmotta-archetype-webapp/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.1-SNAPSHOT</version>
+        <version>3.2.1</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/1d73c3bc/build/archetypes/pom.xml
----------------------------------------------------------------------
diff --git a/build/archetypes/pom.xml b/build/archetypes/pom.xml
index 5a97e23..29fe6c4 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.2.1-SNAPSHOT</version>
+        <version>3.2.1</version>
         <relativePath>../../parent</relativePath>
     </parent>
     <artifactId>archetypes-reactor</artifactId>

http://git-wip-us.apache.org/repos/asf/marmotta/blob/1d73c3bc/build/checkstyle-resources/pom.xml
----------------------------------------------------------------------
diff --git a/build/checkstyle-resources/pom.xml b/build/checkstyle-resources/pom.xml
index 9d1142e..4054b45 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.2.1-SNAPSHOT</version>
+        <version>3.2.1</version>
         <relativePath>../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/1d73c3bc/build/dependency-resource-supplement/pom.xml
----------------------------------------------------------------------
diff --git a/build/dependency-resource-supplement/pom.xml b/build/dependency-resource-supplement/pom.xml
index c196b30..97bc226 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.2.1-SNAPSHOT</version>
+        <version>3.2.1</version>
         <relativePath>../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/1d73c3bc/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 72bc6e1..367d02d 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.2.1-SNAPSHOT</version>
+        <version>3.2.1</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/1d73c3bc/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 bf4e780..56438ad 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.2.1-SNAPSHOT</version>
+        <version>3.2.1</version>
         <relativePath>../</relativePath>
         <artifactId>plugins-reactor</artifactId>
     </parent>

http://git-wip-us.apache.org/repos/asf/marmotta/blob/1d73c3bc/build/plugins/pom.xml
----------------------------------------------------------------------
diff --git a/build/plugins/pom.xml b/build/plugins/pom.xml
index defe211..609055a 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.2.1-SNAPSHOT</version>
+        <version>3.2.1</version>
         <relativePath>../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/1d73c3bc/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 eb55da8..56e15cf 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.2.1-SNAPSHOT</version>
+        <version>3.2.1</version>
         <artifactId>plugins-reactor</artifactId>
         <relativePath>../</relativePath>
     </parent>

http://git-wip-us.apache.org/repos/asf/marmotta/blob/1d73c3bc/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 f34c78e..f284455 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.2.1-SNAPSHOT</version>
+        <version>3.2.1</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/marmotta/blob/1d73c3bc/build/pom.xml
----------------------------------------------------------------------
diff --git a/build/pom.xml b/build/pom.xml
index 79c197e..9b80a83 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.2.1-SNAPSHOT</version>
+        <version>3.2.1</version>
         <relativePath>../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/1d73c3bc/client/marmotta-client-java/pom.xml
----------------------------------------------------------------------
diff --git a/client/marmotta-client-java/pom.xml b/client/marmotta-client-java/pom.xml
index 8ab5e99..fa7c651 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.2.1-SNAPSHOT</version>
+        <version>3.2.1</version>
         <relativePath>../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/1d73c3bc/client/marmotta-client-js/pom.xml
----------------------------------------------------------------------
diff --git a/client/marmotta-client-js/pom.xml b/client/marmotta-client-js/pom.xml
index b87d0cc..1663948 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.2.1-SNAPSHOT</version>
+        <version>3.2.1</version>
         <relativePath>../../parent/pom.xml</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/1d73c3bc/client/pom.xml
----------------------------------------------------------------------
diff --git a/client/pom.xml b/client/pom.xml
index cd02ecf..d4156a6 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.2.1-SNAPSHOT</version>
+        <version>3.2.1</version>
         <relativePath>../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/1d73c3bc/commons/marmotta-commons/pom.xml
----------------------------------------------------------------------
diff --git a/commons/marmotta-commons/pom.xml b/commons/marmotta-commons/pom.xml
index fcf9408..5bb4d63 100644
--- a/commons/marmotta-commons/pom.xml
+++ b/commons/marmotta-commons/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.1-SNAPSHOT</version>
+        <version>3.2.1</version>
         <relativePath>../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/1d73c3bc/commons/marmotta-sesame-tools/marmotta-model-vocabs/pom.xml
----------------------------------------------------------------------
diff --git a/commons/marmotta-sesame-tools/marmotta-model-vocabs/pom.xml b/commons/marmotta-sesame-tools/marmotta-model-vocabs/pom.xml
index d1875e8..3d18da6 100644
--- a/commons/marmotta-sesame-tools/marmotta-model-vocabs/pom.xml
+++ b/commons/marmotta-sesame-tools/marmotta-model-vocabs/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.1-SNAPSHOT</version>
+        <version>3.2.1</version>
         <relativePath>../../../parent/</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/1d73c3bc/commons/marmotta-sesame-tools/marmotta-rio-api/pom.xml
----------------------------------------------------------------------
diff --git a/commons/marmotta-sesame-tools/marmotta-rio-api/pom.xml b/commons/marmotta-sesame-tools/marmotta-rio-api/pom.xml
index 0ac6929..947234a 100644
--- a/commons/marmotta-sesame-tools/marmotta-rio-api/pom.xml
+++ b/commons/marmotta-sesame-tools/marmotta-rio-api/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.1-SNAPSHOT</version>
+        <version>3.2.1</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/1d73c3bc/commons/marmotta-sesame-tools/marmotta-rio-ical/pom.xml
----------------------------------------------------------------------
diff --git a/commons/marmotta-sesame-tools/marmotta-rio-ical/pom.xml b/commons/marmotta-sesame-tools/marmotta-rio-ical/pom.xml
index fde58e5..53952d3 100644
--- a/commons/marmotta-sesame-tools/marmotta-rio-ical/pom.xml
+++ b/commons/marmotta-sesame-tools/marmotta-rio-ical/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.1-SNAPSHOT</version>
+        <version>3.2.1</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/1d73c3bc/commons/marmotta-sesame-tools/marmotta-rio-rss/pom.xml
----------------------------------------------------------------------
diff --git a/commons/marmotta-sesame-tools/marmotta-rio-rss/pom.xml b/commons/marmotta-sesame-tools/marmotta-rio-rss/pom.xml
index 723ed9c..fa5ebbb 100644
--- a/commons/marmotta-sesame-tools/marmotta-rio-rss/pom.xml
+++ b/commons/marmotta-sesame-tools/marmotta-rio-rss/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.1-SNAPSHOT</version>
+        <version>3.2.1</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/1d73c3bc/commons/marmotta-sesame-tools/marmotta-rio-vcard/pom.xml
----------------------------------------------------------------------
diff --git a/commons/marmotta-sesame-tools/marmotta-rio-vcard/pom.xml b/commons/marmotta-sesame-tools/marmotta-rio-vcard/pom.xml
index 8701992..f3dabec 100644
--- a/commons/marmotta-sesame-tools/marmotta-rio-vcard/pom.xml
+++ b/commons/marmotta-sesame-tools/marmotta-rio-vcard/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.1-SNAPSHOT</version>
+        <version>3.2.1</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/1d73c3bc/commons/marmotta-sesame-tools/marmotta-sail-contextaware/pom.xml
----------------------------------------------------------------------
diff --git a/commons/marmotta-sesame-tools/marmotta-sail-contextaware/pom.xml b/commons/marmotta-sesame-tools/marmotta-sail-contextaware/pom.xml
index d67a722..4bd6bc1 100644
--- a/commons/marmotta-sesame-tools/marmotta-sail-contextaware/pom.xml
+++ b/commons/marmotta-sesame-tools/marmotta-sail-contextaware/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.1-SNAPSHOT</version>
+        <version>3.2.1</version>
         <relativePath>../../../parent/</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/1d73c3bc/commons/marmotta-sesame-tools/marmotta-sail-transactions/pom.xml
----------------------------------------------------------------------
diff --git a/commons/marmotta-sesame-tools/marmotta-sail-transactions/pom.xml b/commons/marmotta-sesame-tools/marmotta-sail-transactions/pom.xml
index 0c47b6f..53e3632 100644
--- a/commons/marmotta-sesame-tools/marmotta-sail-transactions/pom.xml
+++ b/commons/marmotta-sesame-tools/marmotta-sail-transactions/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.1-SNAPSHOT</version>
+        <version>3.2.1</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/1d73c3bc/commons/marmotta-sesame-tools/marmotta-sesame-matchers/pom.xml
----------------------------------------------------------------------
diff --git a/commons/marmotta-sesame-tools/marmotta-sesame-matchers/pom.xml b/commons/marmotta-sesame-tools/marmotta-sesame-matchers/pom.xml
index 3cf3e49..c9a28bb 100644
--- a/commons/marmotta-sesame-tools/marmotta-sesame-matchers/pom.xml
+++ b/commons/marmotta-sesame-tools/marmotta-sesame-matchers/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.1-SNAPSHOT</version>
+        <version>3.2.1</version>
         <relativePath>../../../parent/</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/1d73c3bc/commons/marmotta-sesame-tools/marmotta-util-facading/pom.xml
----------------------------------------------------------------------
diff --git a/commons/marmotta-sesame-tools/marmotta-util-facading/pom.xml b/commons/marmotta-sesame-tools/marmotta-util-facading/pom.xml
index f63c62e..8ec41fd 100644
--- a/commons/marmotta-sesame-tools/marmotta-util-facading/pom.xml
+++ b/commons/marmotta-sesame-tools/marmotta-util-facading/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.1-SNAPSHOT</version>
+        <version>3.2.1</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/1d73c3bc/commons/marmotta-sesame-tools/marmotta-util-filter/pom.xml
----------------------------------------------------------------------
diff --git a/commons/marmotta-sesame-tools/marmotta-util-filter/pom.xml b/commons/marmotta-sesame-tools/marmotta-util-filter/pom.xml
index fa498f4..e54378e 100644
--- a/commons/marmotta-sesame-tools/marmotta-util-filter/pom.xml
+++ b/commons/marmotta-sesame-tools/marmotta-util-filter/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.1-SNAPSHOT</version>
+        <version>3.2.1</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/1d73c3bc/commons/marmotta-sesame-tools/marmotta-util-rdfpatch/pom.xml
----------------------------------------------------------------------
diff --git a/commons/marmotta-sesame-tools/marmotta-util-rdfpatch/pom.xml b/commons/marmotta-sesame-tools/marmotta-util-rdfpatch/pom.xml
index 78ead76..aa113fe 100644
--- a/commons/marmotta-sesame-tools/marmotta-util-rdfpatch/pom.xml
+++ b/commons/marmotta-sesame-tools/marmotta-util-rdfpatch/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.1-SNAPSHOT</version>
+        <version>3.2.1</version>
         <relativePath>../../../parent/</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/1d73c3bc/commons/marmotta-sesame-tools/marmotta-util-tripletable/pom.xml
----------------------------------------------------------------------
diff --git a/commons/marmotta-sesame-tools/marmotta-util-tripletable/pom.xml b/commons/marmotta-sesame-tools/marmotta-util-tripletable/pom.xml
index 4244ffb..ca56670 100644
--- a/commons/marmotta-sesame-tools/marmotta-util-tripletable/pom.xml
+++ b/commons/marmotta-sesame-tools/marmotta-util-tripletable/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.1-SNAPSHOT</version>
+        <version>3.2.1</version>
         <relativePath>../../../parent/</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/1d73c3bc/commons/marmotta-sesame-tools/pom.xml
----------------------------------------------------------------------
diff --git a/commons/marmotta-sesame-tools/pom.xml b/commons/marmotta-sesame-tools/pom.xml
index 3b09b0e..44bcf09 100644
--- a/commons/marmotta-sesame-tools/pom.xml
+++ b/commons/marmotta-sesame-tools/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.1-SNAPSHOT</version>
+        <version>3.2.1</version>
         <relativePath>../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/1d73c3bc/commons/pom.xml
----------------------------------------------------------------------
diff --git a/commons/pom.xml b/commons/pom.xml
index fde1685..1e5acd0 100644
--- a/commons/pom.xml
+++ b/commons/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.1-SNAPSHOT</version>
+        <version>3.2.1</version>
         <relativePath>../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/1d73c3bc/extras/pom.xml
----------------------------------------------------------------------
diff --git a/extras/pom.xml b/extras/pom.xml
index 22a5689..482e6e8 100644
--- a/extras/pom.xml
+++ b/extras/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.1-SNAPSHOT</version>
+        <version>3.2.1</version>
         <relativePath>../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/1d73c3bc/extras/webjars/codemirror/pom.xml
----------------------------------------------------------------------
diff --git a/extras/webjars/codemirror/pom.xml b/extras/webjars/codemirror/pom.xml
index efa0269..8ee6c20 100644
--- a/extras/webjars/codemirror/pom.xml
+++ b/extras/webjars/codemirror/pom.xml
@@ -22,7 +22,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.1-SNAPSHOT</version>
+        <version>3.2.1</version>
         <relativePath>../../../parent/</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/1d73c3bc/extras/webjars/pom.xml
----------------------------------------------------------------------
diff --git a/extras/webjars/pom.xml b/extras/webjars/pom.xml
index d6082af..75433b0 100644
--- a/extras/webjars/pom.xml
+++ b/extras/webjars/pom.xml
@@ -22,7 +22,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.1-SNAPSHOT</version>
+        <version>3.2.1</version>
         <relativePath>../../parent/</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/1d73c3bc/extras/webjars/strftime/pom.xml
----------------------------------------------------------------------
diff --git a/extras/webjars/strftime/pom.xml b/extras/webjars/strftime/pom.xml
index 0aecf93..0ede4c0 100644
--- a/extras/webjars/strftime/pom.xml
+++ b/extras/webjars/strftime/pom.xml
@@ -22,7 +22,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.1-SNAPSHOT</version>
+        <version>3.2.1</version>
         <relativePath>../../../parent/</relativePath> 
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/1d73c3bc/launchers/marmotta-installer/pom.xml
----------------------------------------------------------------------
diff --git a/launchers/marmotta-installer/pom.xml b/launchers/marmotta-installer/pom.xml
index 6b3c498..399f975 100644
--- a/launchers/marmotta-installer/pom.xml
+++ b/launchers/marmotta-installer/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.1-SNAPSHOT</version>
+        <version>3.2.1</version>
         <relativePath>../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/1d73c3bc/launchers/marmotta-splash/pom.xml
----------------------------------------------------------------------
diff --git a/launchers/marmotta-splash/pom.xml b/launchers/marmotta-splash/pom.xml
index c1bb640..a091d37 100644
--- a/launchers/marmotta-splash/pom.xml
+++ b/launchers/marmotta-splash/pom.xml
@@ -22,7 +22,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.1-SNAPSHOT</version>
+        <version>3.2.1</version>
         <relativePath>../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/1d73c3bc/launchers/marmotta-webapp/pom.xml
----------------------------------------------------------------------
diff --git a/launchers/marmotta-webapp/pom.xml b/launchers/marmotta-webapp/pom.xml
index 8bde6bf..716f195 100644
--- a/launchers/marmotta-webapp/pom.xml
+++ b/launchers/marmotta-webapp/pom.xml
@@ -22,7 +22,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.1-SNAPSHOT</version>
+        <version>3.2.1</version>
         <relativePath>../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/1d73c3bc/launchers/pom.xml
----------------------------------------------------------------------
diff --git a/launchers/pom.xml b/launchers/pom.xml
index f6ca912..433d2b8 100644
--- a/launchers/pom.xml
+++ b/launchers/pom.xml
@@ -22,7 +22,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.1-SNAPSHOT</version>
+        <version>3.2.1</version>
         <relativePath>../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/1d73c3bc/libraries/kiwi/kiwi-caching-ehcache/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-caching-ehcache/pom.xml b/libraries/kiwi/kiwi-caching-ehcache/pom.xml
index daad581..0c26243 100644
--- a/libraries/kiwi/kiwi-caching-ehcache/pom.xml
+++ b/libraries/kiwi/kiwi-caching-ehcache/pom.xml
@@ -22,7 +22,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>kiwi-parent</artifactId>
-        <version>3.2.1-SNAPSHOT</version>
+        <version>3.2.1</version>
     </parent>
 
     <artifactId>kiwi-caching-ehcache</artifactId>

http://git-wip-us.apache.org/repos/asf/marmotta/blob/1d73c3bc/libraries/kiwi/kiwi-caching-hazelcast/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-caching-hazelcast/pom.xml b/libraries/kiwi/kiwi-caching-hazelcast/pom.xml
index 8a6654a..7981896 100644
--- a/libraries/kiwi/kiwi-caching-hazelcast/pom.xml
+++ b/libraries/kiwi/kiwi-caching-hazelcast/pom.xml
@@ -22,7 +22,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>kiwi-parent</artifactId>
-        <version>3.2.1-SNAPSHOT</version>
+        <version>3.2.1</version>
     </parent>
 
     <artifactId>kiwi-caching-hazelcast</artifactId>

http://git-wip-us.apache.org/repos/asf/marmotta/blob/1d73c3bc/libraries/kiwi/kiwi-caching-infinispan/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-caching-infinispan/pom.xml b/libraries/kiwi/kiwi-caching-infinispan/pom.xml
index 0353ec4..662d569 100644
--- a/libraries/kiwi/kiwi-caching-infinispan/pom.xml
+++ b/libraries/kiwi/kiwi-caching-infinispan/pom.xml
@@ -22,7 +22,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>kiwi-parent</artifactId>
-        <version>3.2.1-SNAPSHOT</version>
+        <version>3.2.1</version>
         <relativePath>../</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/1d73c3bc/libraries/kiwi/kiwi-loader/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-loader/pom.xml b/libraries/kiwi/kiwi-loader/pom.xml
index b153749..a9c1520 100644
--- a/libraries/kiwi/kiwi-loader/pom.xml
+++ b/libraries/kiwi/kiwi-loader/pom.xml
@@ -14,7 +14,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>kiwi-parent</artifactId>
-        <version>3.2.1-SNAPSHOT</version>
+        <version>3.2.1</version>
     </parent>
 
     <artifactId>kiwi-loader</artifactId>

http://git-wip-us.apache.org/repos/asf/marmotta/blob/1d73c3bc/libraries/kiwi/kiwi-reasoner/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-reasoner/pom.xml b/libraries/kiwi/kiwi-reasoner/pom.xml
index 7618c45..d9ccc0f 100644
--- a/libraries/kiwi/kiwi-reasoner/pom.xml
+++ b/libraries/kiwi/kiwi-reasoner/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>kiwi-parent</artifactId>
-        <version>3.2.1-SNAPSHOT</version>
+        <version>3.2.1</version>
         <relativePath>../</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/1d73c3bc/libraries/kiwi/kiwi-sparql/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-sparql/pom.xml b/libraries/kiwi/kiwi-sparql/pom.xml
index 097b13d..8a775c2 100644
--- a/libraries/kiwi/kiwi-sparql/pom.xml
+++ b/libraries/kiwi/kiwi-sparql/pom.xml
@@ -22,7 +22,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>kiwi-parent</artifactId>
-        <version>3.2.1-SNAPSHOT</version>
+        <version>3.2.1</version>
         <relativePath>../</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/1d73c3bc/libraries/kiwi/kiwi-triplestore/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-triplestore/pom.xml b/libraries/kiwi/kiwi-triplestore/pom.xml
index ae484e6..9320204 100644
--- a/libraries/kiwi/kiwi-triplestore/pom.xml
+++ b/libraries/kiwi/kiwi-triplestore/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>kiwi-parent</artifactId>
-        <version>3.2.1-SNAPSHOT</version>
+        <version>3.2.1</version>
         <relativePath>../</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/1d73c3bc/libraries/kiwi/kiwi-versioning/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-versioning/pom.xml b/libraries/kiwi/kiwi-versioning/pom.xml
index 4c553ea..2c8c68a 100644
--- a/libraries/kiwi/kiwi-versioning/pom.xml
+++ b/libraries/kiwi/kiwi-versioning/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>kiwi-parent</artifactId>
-        <version>3.2.1-SNAPSHOT</version>
+        <version>3.2.1</version>
         <relativePath>../</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/1d73c3bc/libraries/kiwi/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/kiwi/pom.xml b/libraries/kiwi/pom.xml
index 72dcfdd..08f6dbd 100644
--- a/libraries/kiwi/pom.xml
+++ b/libraries/kiwi/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.1-SNAPSHOT</version>
+        <version>3.2.1</version>
         <relativePath>../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/1d73c3bc/libraries/ldcache/ldcache-api/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldcache/ldcache-api/pom.xml b/libraries/ldcache/ldcache-api/pom.xml
index cc946a5..93fe849 100644
--- a/libraries/ldcache/ldcache-api/pom.xml
+++ b/libraries/ldcache/ldcache-api/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.1-SNAPSHOT</version>
+        <version>3.2.1</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/1d73c3bc/libraries/ldcache/ldcache-backend-file/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldcache/ldcache-backend-file/pom.xml b/libraries/ldcache/ldcache-backend-file/pom.xml
index 15e8541..c48539d 100644
--- a/libraries/ldcache/ldcache-backend-file/pom.xml
+++ b/libraries/ldcache/ldcache-backend-file/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.1-SNAPSHOT</version>
+        <version>3.2.1</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/1d73c3bc/libraries/ldcache/ldcache-backend-infinispan/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldcache/ldcache-backend-infinispan/pom.xml b/libraries/ldcache/ldcache-backend-infinispan/pom.xml
index 4951001..13cc6fe 100644
--- a/libraries/ldcache/ldcache-backend-infinispan/pom.xml
+++ b/libraries/ldcache/ldcache-backend-infinispan/pom.xml
@@ -22,7 +22,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.1-SNAPSHOT</version>
+        <version>3.2.1</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/1d73c3bc/libraries/ldcache/ldcache-backend-kiwi/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldcache/ldcache-backend-kiwi/pom.xml b/libraries/ldcache/ldcache-backend-kiwi/pom.xml
index 1dec33b..6436eff 100644
--- a/libraries/ldcache/ldcache-backend-kiwi/pom.xml
+++ b/libraries/ldcache/ldcache-backend-kiwi/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.1-SNAPSHOT</version>
+        <version>3.2.1</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/1d73c3bc/libraries/ldcache/ldcache-core/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldcache/ldcache-core/pom.xml b/libraries/ldcache/ldcache-core/pom.xml
index cccd997..8d3b787 100644
--- a/libraries/ldcache/ldcache-core/pom.xml
+++ b/libraries/ldcache/ldcache-core/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.1-SNAPSHOT</version>
+        <version>3.2.1</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/1d73c3bc/libraries/ldcache/ldcache-sail-generic/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldcache/ldcache-sail-generic/pom.xml b/libraries/ldcache/ldcache-sail-generic/pom.xml
index d955031..d89fb99 100644
--- a/libraries/ldcache/ldcache-sail-generic/pom.xml
+++ b/libraries/ldcache/ldcache-sail-generic/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.1-SNAPSHOT</version>
+        <version>3.2.1</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/1d73c3bc/libraries/ldcache/ldcache-sail-kiwi/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldcache/ldcache-sail-kiwi/pom.xml b/libraries/ldcache/ldcache-sail-kiwi/pom.xml
index cceac09..cf9ff7c 100644
--- a/libraries/ldcache/ldcache-sail-kiwi/pom.xml
+++ b/libraries/ldcache/ldcache-sail-kiwi/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.1-SNAPSHOT</version>
+        <version>3.2.1</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/1d73c3bc/libraries/ldcache/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldcache/pom.xml b/libraries/ldcache/pom.xml
index eb1489b..b8f505a 100644
--- a/libraries/ldcache/pom.xml
+++ b/libraries/ldcache/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.1-SNAPSHOT</version>
+        <version>3.2.1</version>
         <relativePath>../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/1d73c3bc/libraries/ldclient/ldclient-api/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldclient/ldclient-api/pom.xml b/libraries/ldclient/ldclient-api/pom.xml
index ce4b3e0..9ed8fc6 100644
--- a/libraries/ldclient/ldclient-api/pom.xml
+++ b/libraries/ldclient/ldclient-api/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.1-SNAPSHOT</version>
+        <version>3.2.1</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/1d73c3bc/libraries/ldclient/ldclient-core/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldclient/ldclient-core/pom.xml b/libraries/ldclient/ldclient-core/pom.xml
index 4e02d86..c8e58d4 100644
--- a/libraries/ldclient/ldclient-core/pom.xml
+++ b/libraries/ldclient/ldclient-core/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.1-SNAPSHOT</version>
+        <version>3.2.1</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/1d73c3bc/libraries/ldclient/ldclient-provider-facebook/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldclient/ldclient-provider-facebook/pom.xml b/libraries/ldclient/ldclient-provider-facebook/pom.xml
index e3258b8..b8941b2 100644
--- a/libraries/ldclient/ldclient-provider-facebook/pom.xml
+++ b/libraries/ldclient/ldclient-provider-facebook/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.1-SNAPSHOT</version>
+        <version>3.2.1</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/1d73c3bc/libraries/ldclient/ldclient-provider-freebase/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldclient/ldclient-provider-freebase/pom.xml b/libraries/ldclient/ldclient-provider-freebase/pom.xml
index ecc3fec..eb9c6a9 100644
--- a/libraries/ldclient/ldclient-provider-freebase/pom.xml
+++ b/libraries/ldclient/ldclient-provider-freebase/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.1-SNAPSHOT</version>
+        <version>3.2.1</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/1d73c3bc/libraries/ldclient/ldclient-provider-html/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldclient/ldclient-provider-html/pom.xml b/libraries/ldclient/ldclient-provider-html/pom.xml
index 59bd397..b53497a 100644
--- a/libraries/ldclient/ldclient-provider-html/pom.xml
+++ b/libraries/ldclient/ldclient-provider-html/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.1-SNAPSHOT</version>
+        <version>3.2.1</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/1d73c3bc/libraries/ldclient/ldclient-provider-ldap/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldclient/ldclient-provider-ldap/pom.xml b/libraries/ldclient/ldclient-provider-ldap/pom.xml
index be76f60..4624400 100644
--- a/libraries/ldclient/ldclient-provider-ldap/pom.xml
+++ b/libraries/ldclient/ldclient-provider-ldap/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.1-SNAPSHOT</version>
+        <version>3.2.1</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/1d73c3bc/libraries/ldclient/ldclient-provider-mediawiki/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldclient/ldclient-provider-mediawiki/pom.xml b/libraries/ldclient/ldclient-provider-mediawiki/pom.xml
index 911c09c..981c089 100644
--- a/libraries/ldclient/ldclient-provider-mediawiki/pom.xml
+++ b/libraries/ldclient/ldclient-provider-mediawiki/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.1-SNAPSHOT</version>
+        <version>3.2.1</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/1d73c3bc/libraries/ldclient/ldclient-provider-phpbb/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldclient/ldclient-provider-phpbb/pom.xml b/libraries/ldclient/ldclient-provider-phpbb/pom.xml
index 25307bd..9fb7778 100644
--- a/libraries/ldclient/ldclient-provider-phpbb/pom.xml
+++ b/libraries/ldclient/ldclient-provider-phpbb/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.1-SNAPSHOT</version>
+        <version>3.2.1</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/1d73c3bc/libraries/ldclient/ldclient-provider-rdf/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldclient/ldclient-provider-rdf/pom.xml b/libraries/ldclient/ldclient-provider-rdf/pom.xml
index 20fb2a4..1138940 100644
--- a/libraries/ldclient/ldclient-provider-rdf/pom.xml
+++ b/libraries/ldclient/ldclient-provider-rdf/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.1-SNAPSHOT</version>
+        <version>3.2.1</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/1d73c3bc/libraries/ldclient/ldclient-provider-rdfa/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldclient/ldclient-provider-rdfa/pom.xml b/libraries/ldclient/ldclient-provider-rdfa/pom.xml
index 4a1b4fb..ec0f04e 100644
--- a/libraries/ldclient/ldclient-provider-rdfa/pom.xml
+++ b/libraries/ldclient/ldclient-provider-rdfa/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.1-SNAPSHOT</version>
+        <version>3.2.1</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/1d73c3bc/libraries/ldclient/ldclient-provider-vimeo/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldclient/ldclient-provider-vimeo/pom.xml b/libraries/ldclient/ldclient-provider-vimeo/pom.xml
index 41b9aa9..73ea125 100644
--- a/libraries/ldclient/ldclient-provider-vimeo/pom.xml
+++ b/libraries/ldclient/ldclient-provider-vimeo/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.1-SNAPSHOT</version>
+        <version>3.2.1</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/1d73c3bc/libraries/ldclient/ldclient-provider-xml/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldclient/ldclient-provider-xml/pom.xml b/libraries/ldclient/ldclient-provider-xml/pom.xml
index 3f23cae..084aa5f 100644
--- a/libraries/ldclient/ldclient-provider-xml/pom.xml
+++ b/libraries/ldclient/ldclient-provider-xml/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.1-SNAPSHOT</version>
+        <version>3.2.1</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/1d73c3bc/libraries/ldclient/ldclient-provider-youtube/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldclient/ldclient-provider-youtube/pom.xml b/libraries/ldclient/ldclient-provider-youtube/pom.xml
index 13e25f7..d08221d 100644
--- a/libraries/ldclient/ldclient-provider-youtube/pom.xml
+++ b/libraries/ldclient/ldclient-provider-youtube/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.1-SNAPSHOT</version>
+        <version>3.2.1</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/1d73c3bc/libraries/ldclient/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldclient/pom.xml b/libraries/ldclient/pom.xml
index 05b191c..6d9b56d 100644
--- a/libraries/ldclient/pom.xml
+++ b/libraries/ldclient/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.1-SNAPSHOT</version>
+        <version>3.2.1</version>
         <relativePath>../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/1d73c3bc/libraries/ldpath/ldpath-api/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-api/pom.xml b/libraries/ldpath/ldpath-api/pom.xml
index e2078ff..5b94dd7 100644
--- a/libraries/ldpath/ldpath-api/pom.xml
+++ b/libraries/ldpath/ldpath-api/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.1-SNAPSHOT</version>
+        <version>3.2.1</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/1d73c3bc/libraries/ldpath/ldpath-backend-file/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-backend-file/pom.xml b/libraries/ldpath/ldpath-backend-file/pom.xml
index d27ba07..2ba936b 100644
--- a/libraries/ldpath/ldpath-backend-file/pom.xml
+++ b/libraries/ldpath/ldpath-backend-file/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.1-SNAPSHOT</version>
+        <version>3.2.1</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/1d73c3bc/libraries/ldpath/ldpath-backend-jena/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-backend-jena/pom.xml b/libraries/ldpath/ldpath-backend-jena/pom.xml
index 14d5cf8..83edba8 100644
--- a/libraries/ldpath/ldpath-backend-jena/pom.xml
+++ b/libraries/ldpath/ldpath-backend-jena/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.1-SNAPSHOT</version>
+        <version>3.2.1</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/1d73c3bc/libraries/ldpath/ldpath-backend-linkeddata/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-backend-linkeddata/pom.xml b/libraries/ldpath/ldpath-backend-linkeddata/pom.xml
index e0856e3..c92be8a 100644
--- a/libraries/ldpath/ldpath-backend-linkeddata/pom.xml
+++ b/libraries/ldpath/ldpath-backend-linkeddata/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.1-SNAPSHOT</version>
+        <version>3.2.1</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/1d73c3bc/libraries/ldpath/ldpath-backend-sesame/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-backend-sesame/pom.xml b/libraries/ldpath/ldpath-backend-sesame/pom.xml
index 3caf49c..4a74966 100644
--- a/libraries/ldpath/ldpath-backend-sesame/pom.xml
+++ b/libraries/ldpath/ldpath-backend-sesame/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.1-SNAPSHOT</version>
+        <version>3.2.1</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/1d73c3bc/libraries/ldpath/ldpath-core-bundle/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-core-bundle/pom.xml b/libraries/ldpath/ldpath-core-bundle/pom.xml
index 60dbe58..b948773 100644
--- a/libraries/ldpath/ldpath-core-bundle/pom.xml
+++ b/libraries/ldpath/ldpath-core-bundle/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.1-SNAPSHOT</version>
+        <version>3.2.1</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/1d73c3bc/libraries/ldpath/ldpath-core/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-core/pom.xml b/libraries/ldpath/ldpath-core/pom.xml
index 6734af7..17a9a79 100644
--- a/libraries/ldpath/ldpath-core/pom.xml
+++ b/libraries/ldpath/ldpath-core/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.1-SNAPSHOT</version>
+        <version>3.2.1</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/1d73c3bc/libraries/ldpath/ldpath-functions-collections/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-functions-collections/pom.xml b/libraries/ldpath/ldpath-functions-collections/pom.xml
index b15e780..af7876c 100644
--- a/libraries/ldpath/ldpath-functions-collections/pom.xml
+++ b/libraries/ldpath/ldpath-functions-collections/pom.xml
@@ -20,7 +20,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.1-SNAPSHOT</version>
+        <version>3.2.1</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/1d73c3bc/libraries/ldpath/ldpath-functions-date/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-functions-date/pom.xml b/libraries/ldpath/ldpath-functions-date/pom.xml
index 39efd42..7c1507f 100644
--- a/libraries/ldpath/ldpath-functions-date/pom.xml
+++ b/libraries/ldpath/ldpath-functions-date/pom.xml
@@ -20,7 +20,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.1-SNAPSHOT</version>
+        <version>3.2.1</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/1d73c3bc/libraries/ldpath/ldpath-functions-html/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-functions-html/pom.xml b/libraries/ldpath/ldpath-functions-html/pom.xml
index 8740d79..75e78d6 100644
--- a/libraries/ldpath/ldpath-functions-html/pom.xml
+++ b/libraries/ldpath/ldpath-functions-html/pom.xml
@@ -19,7 +19,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.1-SNAPSHOT</version>
+        <version>3.2.1</version>
         <relativePath>../../../parent</relativePath>
     </parent>
     <modelVersion>4.0.0</modelVersion>

http://git-wip-us.apache.org/repos/asf/marmotta/blob/1d73c3bc/libraries/ldpath/ldpath-functions-math/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-functions-math/pom.xml b/libraries/ldpath/ldpath-functions-math/pom.xml
index 0c13dba..d75da9f 100644
--- a/libraries/ldpath/ldpath-functions-math/pom.xml
+++ b/libraries/ldpath/ldpath-functions-math/pom.xml
@@ -20,7 +20,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.1-SNAPSHOT</version>
+        <version>3.2.1</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/1d73c3bc/libraries/ldpath/ldpath-functions-text/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-functions-text/pom.xml b/libraries/ldpath/ldpath-functions-text/pom.xml
index 59d1be7..ba98443 100644
--- a/libraries/ldpath/ldpath-functions-text/pom.xml
+++ b/libraries/ldpath/ldpath-functions-text/pom.xml
@@ -20,7 +20,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.1-SNAPSHOT</version>
+        <version>3.2.1</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/1d73c3bc/libraries/ldpath/ldpath-functions-xml/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-functions-xml/pom.xml b/libraries/ldpath/ldpath-functions-xml/pom.xml
index 91b76a2..5307922 100644
--- a/libraries/ldpath/ldpath-functions-xml/pom.xml
+++ b/libraries/ldpath/ldpath-functions-xml/pom.xml
@@ -19,7 +19,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.1-SNAPSHOT</version>
+        <version>3.2.1</version>
         <relativePath>../../../parent</relativePath>
     </parent>
     <modelVersion>4.0.0</modelVersion>

http://git-wip-us.apache.org/repos/asf/marmotta/blob/1d73c3bc/libraries/ldpath/ldpath-template-linkeddata/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-template-linkeddata/pom.xml b/libraries/ldpath/ldpath-template-linkeddata/pom.xml
index 5e6b622..ff0129c 100644
--- a/libraries/ldpath/ldpath-template-linkeddata/pom.xml
+++ b/libraries/ldpath/ldpath-template-linkeddata/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.1-SNAPSHOT</version>
+        <version>3.2.1</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/1d73c3bc/libraries/ldpath/ldpath-template/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-template/pom.xml b/libraries/ldpath/ldpath-template/pom.xml
index 82b9137..fdc05db 100644
--- a/libraries/ldpath/ldpath-template/pom.xml
+++ b/libraries/ldpath/ldpath-template/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.1-SNAPSHOT</version>
+        <version>3.2.1</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/1d73c3bc/libraries/ldpath/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldpath/pom.xml b/libraries/ldpath/pom.xml
index 5477b95..98c5ff5 100644
--- a/libraries/ldpath/pom.xml
+++ b/libraries/ldpath/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.1-SNAPSHOT</version>
+        <version>3.2.1</version>
         <relativePath>../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/1d73c3bc/libraries/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/pom.xml b/libraries/pom.xml
index 63c8a90..119ee8d 100644
--- a/libraries/pom.xml
+++ b/libraries/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.1-SNAPSHOT</version>
+        <version>3.2.1</version>
         <relativePath>../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/1d73c3bc/loader/marmotta-loader-berkeley/pom.xml
----------------------------------------------------------------------
diff --git a/loader/marmotta-loader-berkeley/pom.xml b/loader/marmotta-loader-berkeley/pom.xml
index 0aaf517..0c4cfa6 100644
--- a/loader/marmotta-loader-berkeley/pom.xml
+++ b/loader/marmotta-loader-berkeley/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.1-SNAPSHOT</version>
+        <version>3.2.1</version>
         <relativePath>../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/1d73c3bc/loader/marmotta-loader-core/pom.xml
----------------------------------------------------------------------
diff --git a/loader/marmotta-loader-core/pom.xml b/loader/marmotta-loader-core/pom.xml
index 052c5c2..cc0f682 100644
--- a/loader/marmotta-loader-core/pom.xml
+++ b/loader/marmotta-loader-core/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.1-SNAPSHOT</version>
+        <version>3.2.1</version>
         <relativePath>../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/1d73c3bc/loader/marmotta-loader-hbase/pom.xml
----------------------------------------------------------------------
diff --git a/loader/marmotta-loader-hbase/pom.xml b/loader/marmotta-loader-hbase/pom.xml
index 7660308..819c0d9 100644
--- a/loader/marmotta-loader-hbase/pom.xml
+++ b/loader/marmotta-loader-hbase/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.1-SNAPSHOT</version>
+        <version>3.2.1</version>
         <relativePath>../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/1d73c3bc/loader/marmotta-loader-kiwi/pom.xml
----------------------------------------------------------------------
diff --git a/loader/marmotta-loader-kiwi/pom.xml b/loader/marmotta-loader-kiwi/pom.xml
index 25ce923..c6e77fc 100644
--- a/loader/marmotta-loader-kiwi/pom.xml
+++ b/loader/marmotta-loader-kiwi/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.1-SNAPSHOT</version>
+        <version>3.2.1</version>
         <relativePath>../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/1d73c3bc/loader/marmotta-loader-titan/pom.xml
----------------------------------------------------------------------
diff --git a/loader/marmotta-loader-titan/pom.xml b/loader/marmotta-loader-titan/pom.xml
index c01d0ee..1db8587 100644
--- a/loader/marmotta-loader-titan/pom.xml
+++ b/loader/marmotta-loader-titan/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.1-SNAPSHOT</version>
+        <version>3.2.1</version>
         <relativePath>../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/1d73c3bc/loader/pom.xml
----------------------------------------------------------------------
diff --git a/loader/pom.xml b/loader/pom.xml
index 7315b43..8340bf6 100644
--- a/loader/pom.xml
+++ b/loader/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.1-SNAPSHOT</version>
+        <version>3.2.1</version>
         <relativePath>../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/1d73c3bc/parent/pom.xml
----------------------------------------------------------------------
diff --git a/parent/pom.xml b/parent/pom.xml
index 36ee34f..2e85ead 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -29,7 +29,7 @@
     <groupId>org.apache.marmotta</groupId>
     <artifactId>marmotta-parent</artifactId>
     <packaging>pom</packaging>
-    <version>3.2.1-SNAPSHOT</version>
+    <version>3.2.1</version>
 
     <name>Apache Marmotta Parent</name>
     <description>Parent POM for the Apache Marmotta project</description>
@@ -1783,6 +1783,6 @@
 -->
 
   <scm>
-    <tag>3.2.0</tag>
+    <tag>3.2.1</tag>
   </scm>
 </project>

http://git-wip-us.apache.org/repos/asf/marmotta/blob/1d73c3bc/platform/backends/marmotta-backend-kiwi/pom.xml
----------------------------------------------------------------------
diff --git a/platform/backends/marmotta-backend-kiwi/pom.xml b/platform/backends/marmotta-backend-kiwi/pom.xml
index 9252f61..9ae9734 100644
--- a/platform/backends/marmotta-backend-kiwi/pom.xml
+++ b/platform/backends/marmotta-backend-kiwi/pom.xml
@@ -22,7 +22,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.1-SNAPSHOT</version>
+        <version>3.2.1</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/1d73c3bc/platform/backends/marmotta-backend-memory/pom.xml
----------------------------------------------------------------------
diff --git a/platform/backends/marmotta-backend-memory/pom.xml b/platform/backends/marmotta-backend-memory/pom.xml
index 76d85d6..80f4d6b 100644
--- a/platform/backends/marmotta-backend-memory/pom.xml
+++ b/platform/backends/marmotta-backend-memory/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.1-SNAPSHOT</version>
+        <version>3.2.1</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/1d73c3bc/platform/backends/marmotta-backend-native/pom.xml
----------------------------------------------------------------------
diff --git a/platform/backends/marmotta-backend-native/pom.xml b/platform/backends/marmotta-backend-native/pom.xml
index 313eeb3..d02ff49 100644
--- a/platform/backends/marmotta-backend-native/pom.xml
+++ b/platform/backends/marmotta-backend-native/pom.xml
@@ -22,7 +22,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.1-SNAPSHOT</version>
+        <version>3.2.1</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/1d73c3bc/platform/backends/marmotta-backend-titan/pom.xml
----------------------------------------------------------------------
diff --git a/platform/backends/marmotta-backend-titan/pom.xml b/platform/backends/marmotta-backend-titan/pom.xml
index b75e1cf..962971b 100644
--- a/platform/backends/marmotta-backend-titan/pom.xml
+++ b/platform/backends/marmotta-backend-titan/pom.xml
@@ -22,7 +22,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.1-SNAPSHOT</version>
+        <version>3.2.1</version>
         <relativePath>../../../parent/pom.xml</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/1d73c3bc/platform/backends/pom.xml
----------------------------------------------------------------------
diff --git a/platform/backends/pom.xml b/platform/backends/pom.xml
index 37214e9..ebbce17 100644
--- a/platform/backends/pom.xml
+++ b/platform/backends/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.1-SNAPSHOT</version>
+        <version>3.2.1</version>
         <relativePath>../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/1d73c3bc/platform/ldcache/marmotta-ldcache-common/pom.xml
----------------------------------------------------------------------
diff --git a/platform/ldcache/marmotta-ldcache-common/pom.xml b/platform/ldcache/marmotta-ldcache-common/pom.xml
index d1155fb..4a6b0c3 100644
--- a/platform/ldcache/marmotta-ldcache-common/pom.xml
+++ b/platform/ldcache/marmotta-ldcache-common/pom.xml
@@ -22,7 +22,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.1-SNAPSHOT</version>
+        <version>3.2.1</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/1d73c3bc/platform/ldcache/marmotta-ldcache-file/pom.xml
----------------------------------------------------------------------
diff --git a/platform/ldcache/marmotta-ldcache-file/pom.xml b/platform/ldcache/marmotta-ldcache-file/pom.xml
index ec53907..8f2c859 100644
--- a/platform/ldcache/marmotta-ldcache-file/pom.xml
+++ b/platform/ldcache/marmotta-ldcache-file/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.1-SNAPSHOT</version>
+        <version>3.2.1</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/1d73c3bc/platform/ldcache/marmotta-ldcache-kiwi/pom.xml
----------------------------------------------------------------------
diff --git a/platform/ldcache/marmotta-ldcache-kiwi/pom.xml b/platform/ldcache/marmotta-ldcache-kiwi/pom.xml
index 234101b..62d528e 100644
--- a/platform/ldcache/marmotta-ldcache-kiwi/pom.xml
+++ b/platform/ldcache/marmotta-ldcache-kiwi/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.1-SNAPSHOT</version>
+        <version>3.2.1</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/1d73c3bc/platform/ldcache/pom.xml
----------------------------------------------------------------------
diff --git a/platform/ldcache/pom.xml b/platform/ldcache/pom.xml
index b6244f3..54ce7f2 100644
--- a/platform/ldcache/pom.xml
+++ b/platform/ldcache/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.1-SNAPSHOT</version>
+        <version>3.2.1</version>
         <relativePath>../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/1d73c3bc/platform/marmotta-core/pom.xml
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/pom.xml b/platform/marmotta-core/pom.xml
index 827c806..588722d 100644
--- a/platform/marmotta-core/pom.xml
+++ b/platform/marmotta-core/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.1-SNAPSHOT</version>
+        <version>3.2.1</version>
         <relativePath>../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/1d73c3bc/platform/marmotta-ldp/pom.xml
----------------------------------------------------------------------
diff --git a/platform/marmotta-ldp/pom.xml b/platform/marmotta-ldp/pom.xml
index 698254f..ad5dc01 100644
--- a/platform/marmotta-ldp/pom.xml
+++ b/platform/marmotta-ldp/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.1-SNAPSHOT</version>
+        <version>3.2.1</version>
         <relativePath>../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/1d73c3bc/platform/marmotta-ldpath/pom.xml
----------------------------------------------------------------------
diff --git a/platform/marmotta-ldpath/pom.xml b/platform/marmotta-ldpath/pom.xml
index 4309626..d7ecea6 100644
--- a/platform/marmotta-ldpath/pom.xml
+++ b/platform/marmotta-ldpath/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.1-SNAPSHOT</version>
+        <version>3.2.1</version>
         <relativePath>../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/1d73c3bc/platform/marmotta-reasoner-kiwi/pom.xml
----------------------------------------------------------------------
diff --git a/platform/marmotta-reasoner-kiwi/pom.xml b/platform/marmotta-reasoner-kiwi/pom.xml
index be9c4d0..ffc79c2 100644
--- a/platform/marmotta-reasoner-kiwi/pom.xml
+++ b/platform/marmotta-reasoner-kiwi/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.1-SNAPSHOT</version>
+        <version>3.2.1</version>
         <relativePath>../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/1d73c3bc/platform/marmotta-security/pom.xml
----------------------------------------------------------------------
diff --git a/platform/marmotta-security/pom.xml b/platform/marmotta-security/pom.xml
index 8afaeb7..f1b59d6 100644
--- a/platform/marmotta-security/pom.xml
+++ b/platform/marmotta-security/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.1-SNAPSHOT</version>
+        <version>3.2.1</version>
         <relativePath>../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/1d73c3bc/platform/marmotta-sparql/pom.xml
----------------------------------------------------------------------
diff --git a/platform/marmotta-sparql/pom.xml b/platform/marmotta-sparql/pom.xml
index 95e29fa..e7d04a6 100644
--- a/platform/marmotta-sparql/pom.xml
+++ b/platform/marmotta-sparql/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.1-SNAPSHOT</version>
+        <version>3.2.1</version>
         <relativePath>../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/1d73c3bc/platform/marmotta-user/pom.xml
----------------------------------------------------------------------
diff --git a/platform/marmotta-user/pom.xml b/platform/marmotta-user/pom.xml
index 28b76d7..07c86a5 100644
--- a/platform/marmotta-user/pom.xml
+++ b/platform/marmotta-user/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.1-SNAPSHOT</version>
+        <version>3.2.1</version>
         <relativePath>../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/1d73c3bc/platform/marmotta-versioning-common/pom.xml
----------------------------------------------------------------------
diff --git a/platform/marmotta-versioning-common/pom.xml b/platform/marmotta-versioning-common/pom.xml
index e0926a4..f9ab438 100644
--- a/platform/marmotta-versioning-common/pom.xml
+++ b/platform/marmotta-versioning-common/pom.xml
@@ -22,7 +22,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.1-SNAPSHOT</version>
+        <version>3.2.1</version>
         <relativePath>../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/1d73c3bc/platform/marmotta-versioning-kiwi/pom.xml
----------------------------------------------------------------------
diff --git a/platform/marmotta-versioning-kiwi/pom.xml b/platform/marmotta-versioning-kiwi/pom.xml
index 30999bb..a4be524 100644
--- a/platform/marmotta-versioning-kiwi/pom.xml
+++ b/platform/marmotta-versioning-kiwi/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.1-SNAPSHOT</version>
+        <version>3.2.1</version>
         <relativePath>../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/1d73c3bc/platform/marmotta-zookeeper/pom.xml
----------------------------------------------------------------------
diff --git a/platform/marmotta-zookeeper/pom.xml b/platform/marmotta-zookeeper/pom.xml
index 94a591e..b316fca 100644
--- a/platform/marmotta-zookeeper/pom.xml
+++ b/platform/marmotta-zookeeper/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.1-SNAPSHOT</version>
+        <version>3.2.1</version>
         <relativePath>../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/1d73c3bc/platform/pom.xml
----------------------------------------------------------------------
diff --git a/platform/pom.xml b/platform/pom.xml
index 06f1008..ec603ed 100644
--- a/platform/pom.xml
+++ b/platform/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.1-SNAPSHOT</version>
+        <version>3.2.1</version>
         <relativePath>../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/1d73c3bc/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 807f48d..aa54015 100644
--- a/pom.xml
+++ b/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.1-SNAPSHOT</version>
+        <version>3.2.1</version>
         <relativePath>parent</relativePath>
     </parent>
 
@@ -118,7 +118,7 @@
         <url>https://git-wip-us.apache.org/repos/asf/marmotta.git</url>
         <connection>scm:git:https://git-wip-us.apache.org/repos/asf/marmotta.git</connection>
         <developerConnection>scm:git:https://git-wip-us.apache.org/repos/asf/marmotta.git</developerConnection>
-        <tag>3.2.0</tag>
+        <tag>3.2.1</tag>
     </scm>
 
     <issueManagement>


[010/100] [abbrv] [partial] Reverting the erroneous merge by Sebastian according to the instructions in INFRA-6876

Posted by wi...@apache.org.
http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-functions-math/src/test/java/org/apache/marmotta/ldpath/model/functions/math/MathFunctionTest.java
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-functions-math/src/test/java/org/apache/marmotta/ldpath/model/functions/math/MathFunctionTest.java b/libraries/ldpath/ldpath-functions-math/src/test/java/org/apache/marmotta/ldpath/model/functions/math/MathFunctionTest.java
index 1696341..0018de9 100644
--- a/libraries/ldpath/ldpath-functions-math/src/test/java/org/apache/marmotta/ldpath/model/functions/math/MathFunctionTest.java
+++ b/libraries/ldpath/ldpath-functions-math/src/test/java/org/apache/marmotta/ldpath/model/functions/math/MathFunctionTest.java
@@ -22,7 +22,7 @@ import java.util.Random;
 
 import org.apache.marmotta.ldpath.model.fields.FieldMapping;
 import org.apache.marmotta.ldpath.parser.ParseException;
-import org.apache.marmotta.ldpath.parser.RdfPathParser;
+import org.apache.marmotta.ldpath.parser.LdPathParser;
 import org.apache.marmotta.ldpath.test.AbstractTestBase;
 import org.hamcrest.CoreMatchers;
 import org.junit.Assert;
@@ -100,7 +100,7 @@ public class MathFunctionTest extends AbstractTestBase {
             dMin = Math.min(dMin, dData[i]);
         }
 
-        final RdfPathParser<Value> intParser = createParserFromString("fn:min(<" + iProp.stringValue() + ">) :: xsd:int");
+        final LdPathParser<Value> intParser = createParserFromString("fn:min(<" + iProp.stringValue() + ">) :: xsd:int");
         final FieldMapping<Object, Value> intRule = intParser.parseRule(NSS);
         final Collection<Object> intResult = intRule.getValues(backend, subject);
 
@@ -109,7 +109,7 @@ public class MathFunctionTest extends AbstractTestBase {
         Assert.assertTrue("Integer (type)", intNext instanceof Integer);
         Assert.assertEquals("Integer (result)", iMin, intNext);
 
-        final RdfPathParser<Value> longParser = createParserFromString("fn:min(<" + lProp.stringValue() + ">) :: xsd:long");
+        final LdPathParser<Value> longParser = createParserFromString("fn:min(<" + lProp.stringValue() + ">) :: xsd:long");
         final FieldMapping<Object, Value> longRule = longParser.parseRule(NSS);
         final Collection<Object> longResult = longRule.getValues(backend, subject);
 
@@ -118,7 +118,7 @@ public class MathFunctionTest extends AbstractTestBase {
         Assert.assertTrue("Long (type)", longNext instanceof Long);
         Assert.assertEquals("Long (result)", lMin, longNext);
 
-        final RdfPathParser<Value> floatParser = createParserFromString("fn:min(<" + fProp.stringValue() + ">) :: xsd:float");
+        final LdPathParser<Value> floatParser = createParserFromString("fn:min(<" + fProp.stringValue() + ">) :: xsd:float");
         final FieldMapping<Object, Value> floatRule = floatParser.parseRule(NSS);
         final Collection<Object> floatResult = floatRule.getValues(backend, subject);
 
@@ -127,7 +127,7 @@ public class MathFunctionTest extends AbstractTestBase {
         Assert.assertTrue("Float (type)", floatNext instanceof Float);
         Assert.assertEquals("Float (result)", fMin, floatNext);
 
-        final RdfPathParser<Value> doubleParser = createParserFromString("fn:min(<" + dProp.stringValue() + ">) :: xsd:double");
+        final LdPathParser<Value> doubleParser = createParserFromString("fn:min(<" + dProp.stringValue() + ">) :: xsd:double");
         final FieldMapping<Object, Value> doubleRule = doubleParser.parseRule(NSS);
         final Collection<Object> doubleResult = doubleRule.getValues(backend, subject);
 
@@ -150,7 +150,7 @@ public class MathFunctionTest extends AbstractTestBase {
             dMax = Math.max(dMax, dData[i]);
         }
 
-        final RdfPathParser<Value> intParser = createParserFromString("fn:max(<" + iProp.stringValue() + ">) :: xsd:int");
+        final LdPathParser<Value> intParser = createParserFromString("fn:max(<" + iProp.stringValue() + ">) :: xsd:int");
         final FieldMapping<Object, Value> intRule = intParser.parseRule(NSS);
         final Collection<Object> intResult = intRule.getValues(backend, subject);
 
@@ -159,7 +159,7 @@ public class MathFunctionTest extends AbstractTestBase {
         Assert.assertTrue("Integer (type)", intNext instanceof Integer);
         Assert.assertEquals("Integer (result)", iMax, intNext);
 
-        final RdfPathParser<Value> longParser = createParserFromString("fn:max(<" + lProp.stringValue() + ">) :: xsd:long");
+        final LdPathParser<Value> longParser = createParserFromString("fn:max(<" + lProp.stringValue() + ">) :: xsd:long");
         final FieldMapping<Object, Value> longRule = longParser.parseRule(NSS);
         final Collection<Object> longResult = longRule.getValues(backend, subject);
 
@@ -168,7 +168,7 @@ public class MathFunctionTest extends AbstractTestBase {
         Assert.assertTrue("Long (type)", longNext instanceof Long);
         Assert.assertEquals("Long (result)", lMax, longNext);
 
-        final RdfPathParser<Value> floatParser = createParserFromString("fn:max(<" + fProp.stringValue() + ">) :: xsd:float");
+        final LdPathParser<Value> floatParser = createParserFromString("fn:max(<" + fProp.stringValue() + ">) :: xsd:float");
         final FieldMapping<Object, Value> floatRule = floatParser.parseRule(NSS);
         final Collection<Object> floatResult = floatRule.getValues(backend, subject);
 
@@ -177,7 +177,7 @@ public class MathFunctionTest extends AbstractTestBase {
         Assert.assertTrue("Float (type)", floatNext instanceof Float);
         Assert.assertEquals("Float (result)", fMax, floatNext);
 
-        final RdfPathParser<Value> doubleParser = createParserFromString("fn:max(<" + dProp.stringValue() + ">) :: xsd:double");
+        final LdPathParser<Value> doubleParser = createParserFromString("fn:max(<" + dProp.stringValue() + ">) :: xsd:double");
         final FieldMapping<Object, Value> doubleRule = doubleParser.parseRule(NSS);
         final Collection<Object> doubleResult = doubleRule.getValues(backend, subject);
 
@@ -196,7 +196,7 @@ public class MathFunctionTest extends AbstractTestBase {
             dMin = Math.min(dMin, dData[i]);
         }
 
-        final RdfPathParser<Value> floatParser = createParserFromString("fn:round(<" + fProp.stringValue() + ">) :: xsd:int");
+        final LdPathParser<Value> floatParser = createParserFromString("fn:round(<" + fProp.stringValue() + ">) :: xsd:int");
         final FieldMapping<Object, Value> floatRule = floatParser.parseRule(NSS);
         final Collection<Object> floatResult = floatRule.getValues(backend, subject);
 
@@ -205,7 +205,7 @@ public class MathFunctionTest extends AbstractTestBase {
             Assert.assertThat("round[Float] (result)", floatResult, CoreMatchers.hasItem(Math.round(element)));
         }
 
-        final RdfPathParser<Value> doubleParser = createParserFromString("fn:round(<" + dProp.stringValue() + ">) :: xsd:long");
+        final LdPathParser<Value> doubleParser = createParserFromString("fn:round(<" + dProp.stringValue() + ">) :: xsd:long");
         final FieldMapping<Object, Value> doubleRule = doubleParser.parseRule(NSS);
         final Collection<Object> doubleResult = doubleRule.getValues(backend, subject);
 
@@ -230,7 +230,7 @@ public class MathFunctionTest extends AbstractTestBase {
             dSum += dData[i];
         }
 
-        final RdfPathParser<Value> intParser = createParserFromString("fn:sum(<" + iProp.stringValue() + ">) :: xsd:int");
+        final LdPathParser<Value> intParser = createParserFromString("fn:sum(<" + iProp.stringValue() + ">) :: xsd:int");
         final FieldMapping<Object, Value> intRule = intParser.parseRule(NSS);
         final Collection<Object> intResult = intRule.getValues(backend, subject);
 
@@ -239,7 +239,7 @@ public class MathFunctionTest extends AbstractTestBase {
         Assert.assertTrue("Integer (type)", intNext instanceof Integer);
         Assert.assertEquals("Integer (result)", iSum, intNext);
 
-        final RdfPathParser<Value> longParser = createParserFromString("fn:sum(<" + lProp.stringValue() + ">) :: xsd:long");
+        final LdPathParser<Value> longParser = createParserFromString("fn:sum(<" + lProp.stringValue() + ">) :: xsd:long");
         final FieldMapping<Object, Value> longRule = longParser.parseRule(NSS);
         final Collection<Object> longResult = longRule.getValues(backend, subject);
 
@@ -248,7 +248,7 @@ public class MathFunctionTest extends AbstractTestBase {
         Assert.assertTrue("Long (type)", longNext instanceof Long);
         Assert.assertEquals("Long (result)", lSum, longNext);
 
-        final RdfPathParser<Value> floatParser = createParserFromString("fn:sum(<" + fProp.stringValue() + ">) :: xsd:float");
+        final LdPathParser<Value> floatParser = createParserFromString("fn:sum(<" + fProp.stringValue() + ">) :: xsd:float");
         final FieldMapping<Object, Value> floatRule = floatParser.parseRule(NSS);
         final Collection<Object> floatResult = floatRule.getValues(backend, subject);
 
@@ -257,7 +257,7 @@ public class MathFunctionTest extends AbstractTestBase {
         Assert.assertTrue("Float (type)", floatNext instanceof Float);
         Assert.assertEquals("Float (result)", fSum, floatNext);
 
-        final RdfPathParser<Value> doubleParser = createParserFromString("fn:sum(<" + dProp.stringValue() + ">) :: xsd:double");
+        final LdPathParser<Value> doubleParser = createParserFromString("fn:sum(<" + dProp.stringValue() + ">) :: xsd:double");
         final FieldMapping<Object, Value> doubleRule = doubleParser.parseRule(NSS);
         final Collection<Object> doubleResult = doubleRule.getValues(backend, subject);
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-functions-text/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-functions-text/pom.xml b/libraries/ldpath/ldpath-functions-text/pom.xml
index b8052fa..42823a3 100644
--- a/libraries/ldpath/ldpath-functions-text/pom.xml
+++ b/libraries/ldpath/ldpath-functions-text/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>
 
@@ -68,6 +68,27 @@
     </dependencies>
 
     <build>
+        <pluginManagement>
+            <plugins>
+                <plugin> <!-- generate JRebel Configuration -->
+                    <groupId>org.zeroturnaround</groupId>
+                    <artifactId>jrebel-maven-plugin</artifactId>
+                    <executions>
+                        <execution>
+                            <id>generate-rebel-xml</id>
+                            <phase>process-resources</phase>
+                            <goals>
+                                <goal>generate</goal>
+                            </goals>
+                        </execution>
+                    </executions>
+                    <configuration>
+                        <relativePath>../../../</relativePath>
+                        <rootPath>$${rebel.root}</rootPath>
+                    </configuration>
+                </plugin>
+            </plugins>
+        </pluginManagement>
         <plugins>
             <plugin>
                 <groupId>org.apache.felix</groupId>

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-functions-text/src/main/java/org/apache/marmotta/ldpath/model/tests/functions/text/AbstractBinaryStringTest.java
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-functions-text/src/main/java/org/apache/marmotta/ldpath/model/tests/functions/text/AbstractBinaryStringTest.java b/libraries/ldpath/ldpath-functions-text/src/main/java/org/apache/marmotta/ldpath/model/tests/functions/text/AbstractBinaryStringTest.java
new file mode 100644
index 0000000..a873c0d
--- /dev/null
+++ b/libraries/ldpath/ldpath-functions-text/src/main/java/org/apache/marmotta/ldpath/model/tests/functions/text/AbstractBinaryStringTest.java
@@ -0,0 +1,59 @@
+/**
+ * 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.ldpath.model.tests.functions.text;
+
+import java.util.Collection;
+
+import com.google.common.collect.Collections2;
+
+/**
+ * Abstract base class for binary string tests.
+ * @author Jakob Frank <ja...@apache.org>
+ *
+ */
+public abstract class AbstractBinaryStringTest<Node> extends AbstractStringTest<Node> {
+
+    @Override
+    protected boolean test(AbstractStringTest<Node>.ToStringFunction toStringFunction, Collection<Node>... args) {
+        final Collection<Node> l = args[0], r = args[1];
+        
+        try {
+            for (String first: Collections2.transform(l, toStringFunction)) {
+                for (String second: Collections2.transform(r, toStringFunction)) {
+                    if (!test(first, second)) return false;
+                }
+            }
+            return true;
+        } catch (IllegalArgumentException e) {
+            return false;
+        }
+    }
+
+    /**
+     * Do the test.
+     * @param first the first (left) argument
+     * @param second the second (right) argument
+     */
+    protected abstract boolean test(String first, String second);
+    
+    @Override
+    protected final int getArgCount() {
+        return 2;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-functions-text/src/main/java/org/apache/marmotta/ldpath/model/tests/functions/text/AbstractStringTest.java
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-functions-text/src/main/java/org/apache/marmotta/ldpath/model/tests/functions/text/AbstractStringTest.java b/libraries/ldpath/ldpath-functions-text/src/main/java/org/apache/marmotta/ldpath/model/tests/functions/text/AbstractStringTest.java
new file mode 100644
index 0000000..306e78f
--- /dev/null
+++ b/libraries/ldpath/ldpath-functions-text/src/main/java/org/apache/marmotta/ldpath/model/tests/functions/text/AbstractStringTest.java
@@ -0,0 +1,101 @@
+/**
+ * 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.ldpath.model.tests.functions.text;
+
+import java.util.Collection;
+
+import org.apache.marmotta.ldpath.api.backend.RDFBackend;
+import org.apache.marmotta.ldpath.api.functions.TestFunction;
+import org.apache.marmotta.ldpath.model.transformers.StringTransformer;
+
+import com.google.common.base.Function;
+import com.google.common.collect.Collections2;
+
+/**
+ * Abstract base class for LDPath Test functions that work on the string representation of nodes.
+ * @author Jakob Frank <ja...@apache.org>
+ * @see TestFunction
+ */
+public abstract class AbstractStringTest<Node> extends TestFunction<Node> {
+
+    protected final StringTransformer<Node> transformer = new StringTransformer<Node>();
+
+    @Override
+    public Boolean apply(RDFBackend<Node> backend, Node context,
+            Collection<Node>... args) throws IllegalArgumentException {
+
+        if (args.length != getArgCount()) { throw new IllegalArgumentException(getLocalName() + " requires exactly " + getArgCount() + " arguments"); }
+
+        return test(new ToStringFunction(backend), args);
+    }
+
+    /**
+     * 
+     * @param toStringFunction
+     * @param args
+     */
+    protected abstract boolean test(ToStringFunction toStringFunction, Collection<Node>... args);
+
+    /**
+     * The signature of this functions (how to use it)
+     */
+    @Override
+    public String getSignature() {
+        return "fn:" + getLocalName() + "(" + getArgSignature() + ") :: Boolean";
+    }
+
+    private String getArgSignature() {
+        StringBuilder sb = new StringBuilder();
+        for (int i = 0; i < getArgCount(); i++) {
+            if (i > 0)
+                sb.append(", ");
+            sb.append("Node ").append('a' + i);
+        }
+        return sb.toString();
+    }
+
+    /**
+     * Number of (required) arguments this function accepts.
+     * @return
+     */
+    protected abstract int getArgCount();
+
+    /**
+     * A function for the guava-library to convert a node into a string based on
+     * the backend provided in the constructor.
+     * 
+     * @author Jakob Frank <ja...@apache.org>
+     * @see Collections2
+     * @see Function
+     */
+    protected class ToStringFunction implements Function<Node, String> {
+        private final RDFBackend<Node> backend;
+
+        /**
+         * @param backend the RDFBackend to use for transformation
+         */
+        public ToStringFunction(RDFBackend<Node> backend) {
+            this.backend = backend;
+        }
+
+        @Override
+        public String apply(Node n) {
+            return transformer.transform(backend, n, null);
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-functions-text/src/main/java/org/apache/marmotta/ldpath/model/tests/functions/text/StringContainsTest.java
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-functions-text/src/main/java/org/apache/marmotta/ldpath/model/tests/functions/text/StringContainsTest.java b/libraries/ldpath/ldpath-functions-text/src/main/java/org/apache/marmotta/ldpath/model/tests/functions/text/StringContainsTest.java
new file mode 100644
index 0000000..0714c3a
--- /dev/null
+++ b/libraries/ldpath/ldpath-functions-text/src/main/java/org/apache/marmotta/ldpath/model/tests/functions/text/StringContainsTest.java
@@ -0,0 +1,42 @@
+/**
+ * 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.ldpath.model.tests.functions.text;
+
+/**
+ * Check if one string is contained within an other.
+ * @author Jakob Frank <ja...@apache.org>
+ * @see String#contains(CharSequence)
+ */
+public class StringContainsTest<Node> extends AbstractBinaryStringTest<Node> {
+
+    @Override
+    public String getDescription() {
+        return "Checks if the first string contains the second";
+    }
+
+    @Override
+    protected boolean test(String first, String second) {
+        return first != null && second != null && first.contains(second);
+    }
+
+    @Override
+    public String getLocalName() {
+        return "contains";
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-functions-text/src/main/java/org/apache/marmotta/ldpath/model/tests/functions/text/StringEndsWithTest.java
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-functions-text/src/main/java/org/apache/marmotta/ldpath/model/tests/functions/text/StringEndsWithTest.java b/libraries/ldpath/ldpath-functions-text/src/main/java/org/apache/marmotta/ldpath/model/tests/functions/text/StringEndsWithTest.java
new file mode 100644
index 0000000..a7e64c8
--- /dev/null
+++ b/libraries/ldpath/ldpath-functions-text/src/main/java/org/apache/marmotta/ldpath/model/tests/functions/text/StringEndsWithTest.java
@@ -0,0 +1,44 @@
+/**
+ * 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.ldpath.model.tests.functions.text;
+
+import org.apache.marmotta.ldpath.model.tests.functions.text.AbstractBinaryStringTest;
+
+/**
+ * Check if one string ends with the other.
+ * @author Jakob Frank <ja...@apache.org>
+ * @see String#endsWith(String)
+ */
+public class StringEndsWithTest<Node> extends AbstractBinaryStringTest<Node> {
+
+    @Override
+    public String getDescription() {
+        return "Checks if the first string ends the second";
+    }
+
+    @Override
+    protected boolean test(String first, String second) {
+        return first != null && second != null && first.endsWith(second);
+    }
+
+    @Override
+    public String getLocalName() {
+        return "endsWith";
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-functions-text/src/main/java/org/apache/marmotta/ldpath/model/tests/functions/text/StringEqualsIC.java
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-functions-text/src/main/java/org/apache/marmotta/ldpath/model/tests/functions/text/StringEqualsIC.java b/libraries/ldpath/ldpath-functions-text/src/main/java/org/apache/marmotta/ldpath/model/tests/functions/text/StringEqualsIC.java
new file mode 100644
index 0000000..bd2e385
--- /dev/null
+++ b/libraries/ldpath/ldpath-functions-text/src/main/java/org/apache/marmotta/ldpath/model/tests/functions/text/StringEqualsIC.java
@@ -0,0 +1,42 @@
+/**
+ * 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.ldpath.model.tests.functions.text;
+
+/**
+ * Check two strings for equality, ignoring case considerations.
+ * @author Jakob Frank <ja...@apache.org>
+ * @see String#equalsIgnoreCase(String)
+ */
+public class StringEqualsIC<Node> extends AbstractBinaryStringTest<Node> {
+
+    @Override
+    public String getDescription() {
+        return "Checks the provided arguments for equality (string representation, ignoring case considerations)";
+    }
+
+    @Override
+    protected boolean test(String first, String second) {
+        return first==null?second==null:first.equalsIgnoreCase(second);
+    }
+
+    @Override
+    public String getLocalName() {
+        return "equalsIgnoreCase";
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-functions-text/src/main/java/org/apache/marmotta/ldpath/model/tests/functions/text/StringEqualsTest.java
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-functions-text/src/main/java/org/apache/marmotta/ldpath/model/tests/functions/text/StringEqualsTest.java b/libraries/ldpath/ldpath-functions-text/src/main/java/org/apache/marmotta/ldpath/model/tests/functions/text/StringEqualsTest.java
new file mode 100644
index 0000000..816704a
--- /dev/null
+++ b/libraries/ldpath/ldpath-functions-text/src/main/java/org/apache/marmotta/ldpath/model/tests/functions/text/StringEqualsTest.java
@@ -0,0 +1,42 @@
+/**
+ * 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.ldpath.model.tests.functions.text;
+
+/**
+ * Check two strings for equality.
+ * @author Jakob Frank <ja...@apache.org>
+ * @see String#equals(Object)
+ */
+public class StringEqualsTest<Node> extends AbstractBinaryStringTest<Node> {
+
+    @Override
+    public String getDescription() {
+        return "Checks the provided arguments for equality (string representation)";
+    }
+
+    @Override
+    protected boolean test(String first, String second) {
+        return first==null?second==null:first.equals(second);
+    }
+
+    @Override
+    public String getLocalName() {
+        return "equals";
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-functions-text/src/main/java/org/apache/marmotta/ldpath/model/tests/functions/text/StringIsEmptyTest.java
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-functions-text/src/main/java/org/apache/marmotta/ldpath/model/tests/functions/text/StringIsEmptyTest.java b/libraries/ldpath/ldpath-functions-text/src/main/java/org/apache/marmotta/ldpath/model/tests/functions/text/StringIsEmptyTest.java
new file mode 100644
index 0000000..aa2c421
--- /dev/null
+++ b/libraries/ldpath/ldpath-functions-text/src/main/java/org/apache/marmotta/ldpath/model/tests/functions/text/StringIsEmptyTest.java
@@ -0,0 +1,61 @@
+/**
+ * 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.ldpath.model.tests.functions.text;
+
+import java.util.Collection;
+
+import com.google.common.collect.Collections2;
+
+/**
+ * LDPath test function to check if the string representation of an node is empty.
+ * 
+ * @author Jakob Frank <ja...@apache.org>
+ *
+ */
+public class StringIsEmptyTest<Node> extends AbstractStringTest<Node> {
+
+    @Override
+    public String getDescription() {
+        return "Check if the string representation of the node is empty";
+    }
+
+    @Override
+    protected boolean test(AbstractStringTest<Node>.ToStringFunction toStringFunction, Collection<Node>... args) {
+        try {
+            for (String str: Collections2.transform(args[0], toStringFunction)) {
+                if (!str.isEmpty()) return false;
+            }
+            
+            return true;
+        } catch (IllegalArgumentException e) {
+            return false;
+        }
+        
+    }
+
+    @Override
+    protected final int getArgCount() {
+        return 1;
+    }
+
+    @Override
+    public String getLocalName() {
+        return "isEmpty";
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-functions-text/src/main/java/org/apache/marmotta/ldpath/model/tests/functions/text/StringStartsWithTest.java
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-functions-text/src/main/java/org/apache/marmotta/ldpath/model/tests/functions/text/StringStartsWithTest.java b/libraries/ldpath/ldpath-functions-text/src/main/java/org/apache/marmotta/ldpath/model/tests/functions/text/StringStartsWithTest.java
new file mode 100644
index 0000000..a7f2ab8
--- /dev/null
+++ b/libraries/ldpath/ldpath-functions-text/src/main/java/org/apache/marmotta/ldpath/model/tests/functions/text/StringStartsWithTest.java
@@ -0,0 +1,44 @@
+/**
+ * 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.ldpath.model.tests.functions.text;
+
+import org.apache.marmotta.ldpath.model.tests.functions.text.AbstractBinaryStringTest;
+
+/**
+ * Check if one string starts with the other.
+ * @author Jakob Frank <ja...@apache.org>
+ * @see String#startsWith(String)
+ */
+public class StringStartsWithTest<Node> extends AbstractBinaryStringTest<Node> {
+
+    @Override
+    public String getDescription() {
+        return "Checks if the first string starts the second";
+    }
+
+    @Override
+    protected boolean test(String first, String second) {
+        return first != null && second != null && first.startsWith(second);
+    }
+
+    @Override
+    public String getLocalName() {
+        return "startsWith";
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-functions-text/src/main/resources/META-INF/services/org.apache.marmotta.ldpath.api.functions.TestFunction
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-functions-text/src/main/resources/META-INF/services/org.apache.marmotta.ldpath.api.functions.TestFunction b/libraries/ldpath/ldpath-functions-text/src/main/resources/META-INF/services/org.apache.marmotta.ldpath.api.functions.TestFunction
new file mode 100644
index 0000000..444c898
--- /dev/null
+++ b/libraries/ldpath/ldpath-functions-text/src/main/resources/META-INF/services/org.apache.marmotta.ldpath.api.functions.TestFunction
@@ -0,0 +1,6 @@
+org.apache.marmotta.ldpath.model.tests.functions.text.StringIsEmptyTest
+org.apache.marmotta.ldpath.model.tests.functions.text.StringEqualsTest
+org.apache.marmotta.ldpath.model.tests.functions.text.StringEqualsIC
+org.apache.marmotta.ldpath.model.tests.functions.text.StringContainsTest
+org.apache.marmotta.ldpath.model.tests.functions.text.StringStartsWithTest
+org.apache.marmotta.ldpath.model.tests.functions.text.StringEndsWithTest
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-functions-text/src/test/java/org/apache/marmotta/ldpath/model/tests/functions/text/StringTestTest.java
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-functions-text/src/test/java/org/apache/marmotta/ldpath/model/tests/functions/text/StringTestTest.java b/libraries/ldpath/ldpath-functions-text/src/test/java/org/apache/marmotta/ldpath/model/tests/functions/text/StringTestTest.java
new file mode 100644
index 0000000..2da31a7
--- /dev/null
+++ b/libraries/ldpath/ldpath-functions-text/src/test/java/org/apache/marmotta/ldpath/model/tests/functions/text/StringTestTest.java
@@ -0,0 +1,181 @@
+/**
+ * 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.ldpath.model.tests.functions.text;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.Random;
+import java.util.UUID;
+
+import org.apache.marmotta.ldpath.api.tests.NodeTest;
+import org.apache.marmotta.ldpath.parser.ParseException;
+import org.apache.marmotta.ldpath.parser.LdPathParser;
+import org.apache.marmotta.ldpath.test.AbstractTestBase;
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+import org.junit.runners.Parameterized.Parameter;
+import org.junit.runners.Parameterized.Parameters;
+import org.openrdf.model.URI;
+import org.openrdf.model.Value;
+import org.openrdf.model.ValueFactory;
+import org.openrdf.repository.sail.SailRepositoryConnection;
+
+@RunWith(Parameterized.class)
+public class StringTestTest extends AbstractTestBase {
+    
+    @Parameters(name = "Case-{index}")
+    public static List<String[]> data() {
+        return Arrays.asList(
+                new String[] { "Welcome to The Apache Software Foundation!" },
+                new String[] { "Apache Marmotta (incubator) is an Open Platform for Linked Data" }
+                );
+    }
+    private static Random rnd;
+    
+    @Parameter
+    public String text;
+    
+    private int textLen;
+    
+    private int testWindow;
+    
+    private String errSalt;
+    
+    private URI subject, predicate;
+
+    @BeforeClass
+    public static void setUpBeforeClass() throws Exception {
+        rnd = new Random();
+    }
+
+    @AfterClass
+    public static void tearDownAfterClass() throws Exception {
+    }
+
+    @Before
+    public void setUp() throws Exception {
+        textLen = text.length();
+        Assert.assertTrue(textLen > 4);
+        testWindow = 1+rnd.nextInt((textLen / 4));
+        
+        errSalt = UUID.randomUUID().toString();
+        
+        subject = repository.getValueFactory().createURI(ns("foo", UUID.randomUUID().toString()));
+        predicate = repository.getValueFactory().createURI(ns("foo", UUID.randomUUID().toString()));
+
+        final SailRepositoryConnection con = repository.getConnection();
+        try {
+            final ValueFactory vf = con.getValueFactory();
+
+            con.add(vf.createStatement(subject, predicate, vf.createLiteral(text)));
+
+            con.commit();
+        } finally {
+            con.close();
+        }
+    }
+
+    @After
+    public void tearDown() throws Exception {
+    }
+    
+    private boolean checkTest(String ldPathTest, URI context) throws ParseException {
+        final LdPathParser<Value> parser = createParserFromString(ldPathTest);
+        final NodeTest<Value> test = parser.parseTest(NSS);
+        return test.accept(backend, context, context);
+    }
+
+    @Test
+    public void testEquals() throws ParseException {
+        final String ldPath_T = String.format("fn:equals(<%s>, \"%s\")", predicate.stringValue(), text);
+        final String ldPath_F = String.format("fn:equals(<%s>, \"%s\")", predicate.stringValue(), errSalt);
+
+        Assert.assertTrue(checkTest(ldPath_T, subject));
+        Assert.assertFalse(checkTest(ldPath_F, subject));
+    }
+
+    @Test
+    public void testEqualsIgnoreCase() throws ParseException {
+        final String ldPath_T = String.format("fn:equalsIgnoreCase(<%s>, \"%s\")", predicate.stringValue(), text);
+        final String ldPath_T_LC = String.format("fn:equalsIgnoreCase(<%s>, \"%s\")", predicate.stringValue(), text.toLowerCase());
+        final String ldPath_T_UC = String.format("fn:equalsIgnoreCase(<%s>, \"%s\")", predicate.stringValue(), text.toUpperCase());
+
+        final String ldPath_F = String.format("fn:equalsIgnoreCase(<%s>, \"%s\")", predicate.stringValue(), errSalt);
+        final String ldPath_F_LC = String.format("fn:equalsIgnoreCase(<%s>, \"%s\")", predicate.stringValue(), errSalt.toLowerCase());
+        final String ldPath_F_UC = String.format("fn:equalsIgnoreCase(<%s>, \"%s\")", predicate.stringValue(), errSalt.toUpperCase());
+
+        Assert.assertTrue(checkTest(ldPath_T, subject));
+        Assert.assertTrue(checkTest(ldPath_T_LC, subject));
+        Assert.assertTrue(checkTest(ldPath_T_UC, subject));
+        
+        Assert.assertFalse(checkTest(ldPath_F, subject));
+        Assert.assertFalse(checkTest(ldPath_F_LC, subject));
+        Assert.assertFalse(checkTest(ldPath_F_UC, subject));
+    }
+
+    @Test
+    public void testContains() throws ParseException {
+        final String ldPath_T1 = String.format("fn:contains(<%s>, \"%s\")", predicate.stringValue(), text.substring(textLen/2-testWindow, textLen/2+testWindow));
+        final String ldPath_T2 = String.format("fn:contains(<%s>, \"%s\")", predicate.stringValue(), text.substring(textLen-testWindow));
+        final String ldPath_T3 = String.format("fn:contains(<%s>, \"%s\")", predicate.stringValue(), text.substring(0,testWindow));
+        final String ldPath_F = String.format("fn:contains(<%s>, \"%s\")", predicate.stringValue(), UUID.randomUUID().toString());
+
+        Assert.assertTrue(checkTest(ldPath_T1, subject));
+        Assert.assertTrue(checkTest(ldPath_T2, subject));
+        Assert.assertTrue(checkTest(ldPath_T3, subject));
+        Assert.assertFalse(checkTest(ldPath_F, subject));
+    }
+
+    @Test
+    public void testEndsWith() throws ParseException {
+        final String ldPath_S = String.format("fn:endsWith(<%s>, \"%s\")", predicate.stringValue(), text.substring(0,testWindow));
+        final String ldPath_M = String.format("fn:endsWith(<%s>, \"%s\")", predicate.stringValue(), text.substring(textLen/2-testWindow, textLen/2+testWindow));
+        final String ldPath_E = String.format("fn:endsWith(<%s>, \"%s\")", predicate.stringValue(), text.substring(textLen-testWindow));
+
+        Assert.assertFalse(checkTest(ldPath_S, subject));
+        Assert.assertFalse(checkTest(ldPath_M, subject));
+        Assert.assertTrue(checkTest(ldPath_E, subject));
+    }
+
+    @Test
+    public void testStartsWith() throws ParseException {
+        final String ldPath_S = String.format("fn:startsWith(<%s>, \"%s\")", predicate.stringValue(), text.substring(0,testWindow));
+        final String ldPath_M = String.format("fn:startsWith(<%s>, \"%s\")", predicate.stringValue(), text.substring(textLen/2-testWindow, textLen/2+testWindow));
+        final String ldPath_E = String.format("fn:startsWith(<%s>, \"%s\")", predicate.stringValue(), text.substring(textLen-testWindow));
+
+        Assert.assertTrue(checkTest(ldPath_S, subject));
+        Assert.assertFalse(checkTest(ldPath_M, subject));
+        Assert.assertFalse(checkTest(ldPath_E, subject));
+    }
+
+    @Test
+    public void testIsEmpty() throws ParseException {
+        final String ldPath_T = "fn:isEmpty(\"\")";
+        final String ldPath_F = String.format("fn:isEmpty(<%s>)", predicate.stringValue());
+        
+        Assert.assertTrue(checkTest(ldPath_T, subject));
+        Assert.assertFalse(checkTest(ldPath_F, subject));
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-functions-xml/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-functions-xml/pom.xml b/libraries/ldpath/ldpath-functions-xml/pom.xml
index 3adfd91..57a840d 100644
--- a/libraries/ldpath/ldpath-functions-xml/pom.xml
+++ b/libraries/ldpath/ldpath-functions-xml/pom.xml
@@ -19,7 +19,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>
     <modelVersion>4.0.0</modelVersion>
@@ -84,6 +84,27 @@
 
 
     <build>
+        <pluginManagement>
+            <plugins>
+                <plugin> <!-- generate JRebel Configuration -->
+                    <groupId>org.zeroturnaround</groupId>
+                    <artifactId>jrebel-maven-plugin</artifactId>
+                    <executions>
+                        <execution>
+                            <id>generate-rebel-xml</id>
+                            <phase>process-resources</phase>
+                            <goals>
+                                <goal>generate</goal>
+                            </goals>
+                        </execution>
+                    </executions>
+                    <configuration>
+                        <relativePath>../../../</relativePath>
+                        <rootPath>$${rebel.root}</rootPath>
+                    </configuration>
+                </plugin>
+            </plugins>
+        </pluginManagement>
         <plugins>
             <plugin>
                 <groupId>org.apache.felix</groupId>

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-functions-xml/src/test/java/org/apache/marmotta/ldpath/model/functions/xml/RemoveXmlTagsFunctionTest.java
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-functions-xml/src/test/java/org/apache/marmotta/ldpath/model/functions/xml/RemoveXmlTagsFunctionTest.java b/libraries/ldpath/ldpath-functions-xml/src/test/java/org/apache/marmotta/ldpath/model/functions/xml/RemoveXmlTagsFunctionTest.java
index b4b2e7c..070d22b 100644
--- a/libraries/ldpath/ldpath-functions-xml/src/test/java/org/apache/marmotta/ldpath/model/functions/xml/RemoveXmlTagsFunctionTest.java
+++ b/libraries/ldpath/ldpath-functions-xml/src/test/java/org/apache/marmotta/ldpath/model/functions/xml/RemoveXmlTagsFunctionTest.java
@@ -22,7 +22,7 @@ import java.util.Collection;
 
 import org.apache.marmotta.ldpath.model.fields.FieldMapping;
 import org.apache.marmotta.ldpath.parser.ParseException;
-import org.apache.marmotta.ldpath.parser.RdfPathParser;
+import org.apache.marmotta.ldpath.parser.LdPathParser;
 import org.apache.marmotta.ldpath.test.AbstractTestBase;
 import org.junit.Assert;
 import org.junit.Before;
@@ -47,7 +47,7 @@ public class RemoveXmlTagsFunctionTest extends AbstractTestBase {
 
         final URI context = repository.getValueFactory().createURI(NSS.get("ex") + "Text");
 
-        final RdfPathParser<Value> parser = createParserFromString("fn:removeTags(foo:formatted) :: xsd:string");
+        final LdPathParser<Value> parser = createParserFromString("fn:removeTags(foo:formatted) :: xsd:string");
         final FieldMapping<Object, Value> rule = parser.parseRule(NSS);
         final Collection<Object> values = rule.getValues(backend, context);
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-functions-xml/src/test/java/org/apache/marmotta/ldpath/model/functions/xml/XPathFunctionTest.java
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-functions-xml/src/test/java/org/apache/marmotta/ldpath/model/functions/xml/XPathFunctionTest.java b/libraries/ldpath/ldpath-functions-xml/src/test/java/org/apache/marmotta/ldpath/model/functions/xml/XPathFunctionTest.java
index 613d1ad..87eaa6c 100644
--- a/libraries/ldpath/ldpath-functions-xml/src/test/java/org/apache/marmotta/ldpath/model/functions/xml/XPathFunctionTest.java
+++ b/libraries/ldpath/ldpath-functions-xml/src/test/java/org/apache/marmotta/ldpath/model/functions/xml/XPathFunctionTest.java
@@ -24,7 +24,7 @@ import java.util.List;
 
 import org.apache.marmotta.ldpath.model.fields.FieldMapping;
 import org.apache.marmotta.ldpath.parser.ParseException;
-import org.apache.marmotta.ldpath.parser.RdfPathParser;
+import org.apache.marmotta.ldpath.parser.LdPathParser;
 import org.apache.marmotta.ldpath.test.AbstractTestBase;
 import org.junit.Assert;
 import org.junit.Before;
@@ -73,7 +73,7 @@ public class XPathFunctionTest extends AbstractTestBase {
     public void testXpathFunction() throws ParseException {
         final URI ctx = repository.getValueFactory().createURI(NSS.get("ex") + "Quiz");
 
-        final RdfPathParser<Value> parser = createParserFromString("fn:xpath(\"/quiz/question[" +
+        final LdPathParser<Value> parser = createParserFromString("fn:xpath(\"/quiz/question[" +
                 index +
                 "]/answers/answer[@correct='true']/text()\", foo:xml) :: xsd:string");
         final FieldMapping<Object, Value> rule = parser.parseRule(NSS);

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-template-linkeddata/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-template-linkeddata/pom.xml b/libraries/ldpath/ldpath-template-linkeddata/pom.xml
index df42569..d2a227d 100644
--- a/libraries/ldpath/ldpath-template-linkeddata/pom.xml
+++ b/libraries/ldpath/ldpath-template-linkeddata/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>
 
@@ -31,6 +31,27 @@
 
 
     <build>
+        <pluginManagement>
+            <plugins>
+                <plugin> <!-- generate JRebel Configuration -->
+                    <groupId>org.zeroturnaround</groupId>
+                    <artifactId>jrebel-maven-plugin</artifactId>
+                    <executions>
+                        <execution>
+                            <id>generate-rebel-xml</id>
+                            <phase>process-resources</phase>
+                            <goals>
+                                <goal>generate</goal>
+                            </goals>
+                        </execution>
+                    </executions>
+                    <configuration>
+                        <relativePath>../../../</relativePath>
+                        <rootPath>$${rebel.root}</rootPath>
+                    </configuration>
+                </plugin>
+            </plugins>
+        </pluginManagement>
         <plugins>
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-template/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-template/pom.xml b/libraries/ldpath/ldpath-template/pom.xml
index d7ea7da..a2f5a15 100644
--- a/libraries/ldpath/ldpath-template/pom.xml
+++ b/libraries/ldpath/ldpath-template/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>
 
@@ -50,6 +50,27 @@
 
 
     <build>
+        <pluginManagement>
+            <plugins>
+                <plugin> <!-- generate JRebel Configuration -->
+                    <groupId>org.zeroturnaround</groupId>
+                    <artifactId>jrebel-maven-plugin</artifactId>
+                    <executions>
+                        <execution>
+                            <id>generate-rebel-xml</id>
+                            <phase>process-resources</phase>
+                            <goals>
+                                <goal>generate</goal>
+                            </goals>
+                        </execution>
+                    </executions>
+                    <configuration>
+                        <relativePath>../../../</relativePath>
+                        <rootPath>$${rebel.root}</rootPath>
+                    </configuration>
+                </plugin>
+            </plugins>
+        </pluginManagement>
         <plugins>
             <plugin>
                 <groupId>org.apache.felix</groupId>

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-template/src/main/java/org/apache/marmotta/ldpath/template/engine/LDPathDirective.java
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-template/src/main/java/org/apache/marmotta/ldpath/template/engine/LDPathDirective.java b/libraries/ldpath/ldpath-template/src/main/java/org/apache/marmotta/ldpath/template/engine/LDPathDirective.java
index 78902e8..d5deeaa 100644
--- a/libraries/ldpath/ldpath-template/src/main/java/org/apache/marmotta/ldpath/template/engine/LDPathDirective.java
+++ b/libraries/ldpath/ldpath-template/src/main/java/org/apache/marmotta/ldpath/template/engine/LDPathDirective.java
@@ -116,8 +116,9 @@ public class LDPathDirective<Node> implements TemplateDirectiveModel {
      *
      * @throws java.io.IOException
      */
+    @SuppressWarnings("unchecked")
     @Override
-    public void execute(Environment env, Map params, TemplateModel[] loopVars, TemplateDirectiveBody body) throws TemplateException, IOException {
+    public void execute(Environment env, @SuppressWarnings("rawtypes") Map params, TemplateModel[] loopVars, TemplateDirectiveBody body) throws TemplateException, IOException {
         TemplateStackModel contextStack = (TemplateStackModel)env.getVariable("context");
         if(contextStack == null || contextStack.empty()) {
             throw new TemplateModelException("error; no context node available");
@@ -147,7 +148,7 @@ public class LDPathDirective<Node> implements TemplateDirectiveModel {
                 path = path + ":: xsd:string";
             }
             try {
-                Collection results = ldpath.pathTransform(context.getNode(),path,namespaces);
+                Collection<?> results = ldpath.pathTransform(context.getNode(),path,namespaces);
 
                 if(results.size() > 0) {
                     Object result = results.iterator().next();

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-template/src/main/java/org/apache/marmotta/ldpath/template/engine/NamespaceDirective.java
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-template/src/main/java/org/apache/marmotta/ldpath/template/engine/NamespaceDirective.java b/libraries/ldpath/ldpath-template/src/main/java/org/apache/marmotta/ldpath/template/engine/NamespaceDirective.java
index fc5ea85..a111963 100644
--- a/libraries/ldpath/ldpath-template/src/main/java/org/apache/marmotta/ldpath/template/engine/NamespaceDirective.java
+++ b/libraries/ldpath/ldpath-template/src/main/java/org/apache/marmotta/ldpath/template/engine/NamespaceDirective.java
@@ -70,6 +70,7 @@ public class NamespaceDirective implements TemplateDirectiveModel {
      *
      * @throws java.io.IOException
      */
+    @SuppressWarnings({ "unchecked", "rawtypes" })
     @Override
     public void execute(Environment env, Map params, TemplateModel[] loopVars, TemplateDirectiveBody body) throws TemplateException, IOException {
         TemplateWrapperModel<Map<String,String>> namespacesWrapped = (TemplateWrapperModel<Map<String,String>>)env.getGlobalVariable("namespaces");

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-template/src/main/java/org/apache/marmotta/ldpath/template/engine/TemplateEngine.java
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-template/src/main/java/org/apache/marmotta/ldpath/template/engine/TemplateEngine.java b/libraries/ldpath/ldpath-template/src/main/java/org/apache/marmotta/ldpath/template/engine/TemplateEngine.java
index d99d542..a10534e 100644
--- a/libraries/ldpath/ldpath-template/src/main/java/org/apache/marmotta/ldpath/template/engine/TemplateEngine.java
+++ b/libraries/ldpath/ldpath-template/src/main/java/org/apache/marmotta/ldpath/template/engine/TemplateEngine.java
@@ -28,7 +28,6 @@ import java.io.IOException;
 import java.io.Writer;
 import java.util.HashMap;
 import java.util.Map;
-import java.util.Set;
 
 import org.apache.marmotta.ldpath.api.backend.RDFBackend;
 import org.apache.marmotta.ldpath.template.model.freemarker.TemplateNodeModel;
@@ -52,6 +51,7 @@ public class TemplateEngine<Node> {
         this.backend = backend;
 
         freemarker = new Configuration();
+        freemarker.setDefaultEncoding("utf-8");
         freemarker.setObjectWrapper(new DefaultObjectWrapper());
 
 
@@ -77,7 +77,7 @@ public class TemplateEngine<Node> {
         freemarker.setServletContextForTemplateLoading(sctxt, path);
     }
 
-    public void setClassForTemplateLoading(Class clazz, String pathPrefix) {
+    public void setClassForTemplateLoading(Class<?> clazz, String pathPrefix) {
         freemarker.setClassForTemplateLoading(clazz, pathPrefix);
     }
 
@@ -109,26 +109,26 @@ public class TemplateEngine<Node> {
      * @throws IOException
      * @throws TemplateException
      */
-    public void processFileTemplate(Node context, String templateName, Map initialEnv,  Writer out) throws IOException, TemplateException {
+    public void processFileTemplate(Node context, String templateName, Map<String, ?> initialEnv,  Writer out) throws IOException, TemplateException {
         processTemplate(context,freemarker.getTemplate(templateName),initialEnv,out);
     }
 
 
-    private void processTemplate(Node context, Template template, Map initialEnv, Writer out) throws IOException, TemplateException {
-        Map root = new HashMap();
+    private void processTemplate(Node context, Template template, Map<String, ?> initialEnv, Writer out) throws IOException, TemplateException {
+        Map<String, Object> root = new HashMap<>();
 
         if(initialEnv != null) {
-            for(Map.Entry entry : (Set<Map.Entry>) initialEnv.entrySet()) {
+            for(Map.Entry<String, ?> entry : initialEnv.entrySet()) {
                 root.put(entry.getKey(), entry.getValue());
             }
         }
 
         root.put("namespace", new NamespaceDirective());
-        root.put("evalLDPath",new LDPathMethod(backend));
-        root.put("ldpath",new LDPathDirective(backend));
+        root.put("evalLDPath",new LDPathMethod<>(backend));
+        root.put("ldpath",new LDPathDirective<>(backend));
 
         TemplateStackModel contexts = new TemplateStackModel();
-        contexts.push(new TemplateNodeModel(context,backend));
+        contexts.push(new TemplateNodeModel<>(context,backend));
         root.put("context",contexts);
 
         template.process(root,out);

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-template/src/main/java/org/apache/marmotta/ldpath/template/model/freemarker/TemplateNodeModel.java
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-template/src/main/java/org/apache/marmotta/ldpath/template/model/freemarker/TemplateNodeModel.java b/libraries/ldpath/ldpath-template/src/main/java/org/apache/marmotta/ldpath/template/model/freemarker/TemplateNodeModel.java
index 91fc21c..6d369fa 100644
--- a/libraries/ldpath/ldpath-template/src/main/java/org/apache/marmotta/ldpath/template/model/freemarker/TemplateNodeModel.java
+++ b/libraries/ldpath/ldpath-template/src/main/java/org/apache/marmotta/ldpath/template/model/freemarker/TemplateNodeModel.java
@@ -105,7 +105,7 @@ public class TemplateNodeModel<Node> implements TemplateModel, TemplateHashModel
      *         class.
      */
     @Override
-    public Object getAdaptedObject(Class hint) {
+    public Object getAdaptedObject(@SuppressWarnings("rawtypes") Class hint) {
         return node;
     }
 }

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-template/src/main/java/org/apache/marmotta/ldpath/template/model/freemarker/TemplateWrapperModel.java
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-template/src/main/java/org/apache/marmotta/ldpath/template/model/freemarker/TemplateWrapperModel.java b/libraries/ldpath/ldpath-template/src/main/java/org/apache/marmotta/ldpath/template/model/freemarker/TemplateWrapperModel.java
index 90b066f..2f24609 100644
--- a/libraries/ldpath/ldpath-template/src/main/java/org/apache/marmotta/ldpath/template/model/freemarker/TemplateWrapperModel.java
+++ b/libraries/ldpath/ldpath-template/src/main/java/org/apache/marmotta/ldpath/template/model/freemarker/TemplateWrapperModel.java
@@ -50,7 +50,7 @@ public class TemplateWrapperModel<T> implements AdapterTemplateModel {
      *         class.
      */
     @Override
-    public T getAdaptedObject(Class hint) {
+    public T getAdaptedObject(@SuppressWarnings("rawtypes") Class hint) {
         return object;
     }
 }

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-template/src/main/java/org/apache/marmotta/ldpath/template/model/transformers/TemplateBooleanTransformer.java
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-template/src/main/java/org/apache/marmotta/ldpath/template/model/transformers/TemplateBooleanTransformer.java b/libraries/ldpath/ldpath-template/src/main/java/org/apache/marmotta/ldpath/template/model/transformers/TemplateBooleanTransformer.java
index b6df026..551da4e 100644
--- a/libraries/ldpath/ldpath-template/src/main/java/org/apache/marmotta/ldpath/template/model/transformers/TemplateBooleanTransformer.java
+++ b/libraries/ldpath/ldpath-template/src/main/java/org/apache/marmotta/ldpath/template/model/transformers/TemplateBooleanTransformer.java
@@ -17,7 +17,7 @@
  */
 package org.apache.marmotta.ldpath.template.model.transformers;
 
-import org.apache.marmotta.ldpath.api.backend.NodeBackend;
+import org.apache.marmotta.ldpath.api.backend.RDFBackend;
 import org.apache.marmotta.ldpath.api.transformers.NodeTransformer;
 import org.apache.marmotta.ldpath.model.transformers.BooleanTransformer;
 
@@ -45,12 +45,14 @@ public class TemplateBooleanTransformer<Node> implements NodeTransformer<Templat
      * carrying out the transformation.
      *
      *
+     *
+     * @param nodeRDFBackend
      * @param node
      * @param configuration
      * @return
      */
     @Override
-    public TemplateBooleanModel transform(final NodeBackend<Node> nodeRDFBackend, final Node node, final Map<String, String> configuration) throws IllegalArgumentException {
+    public TemplateBooleanModel transform(final RDFBackend<Node> nodeRDFBackend, final Node node, final Map<String, String> configuration) throws IllegalArgumentException {
         return new TemplateBooleanModel() {
             @Override
             public boolean getAsBoolean() throws TemplateModelException {

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-template/src/main/java/org/apache/marmotta/ldpath/template/model/transformers/TemplateDateTransformer.java
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-template/src/main/java/org/apache/marmotta/ldpath/template/model/transformers/TemplateDateTransformer.java b/libraries/ldpath/ldpath-template/src/main/java/org/apache/marmotta/ldpath/template/model/transformers/TemplateDateTransformer.java
index 57f0a70..d934994 100644
--- a/libraries/ldpath/ldpath-template/src/main/java/org/apache/marmotta/ldpath/template/model/transformers/TemplateDateTransformer.java
+++ b/libraries/ldpath/ldpath-template/src/main/java/org/apache/marmotta/ldpath/template/model/transformers/TemplateDateTransformer.java
@@ -23,7 +23,7 @@ import freemarker.template.TemplateModelException;
 import java.util.Date;
 import java.util.Map;
 
-import org.apache.marmotta.ldpath.api.backend.NodeBackend;
+import org.apache.marmotta.ldpath.api.backend.RDFBackend;
 import org.apache.marmotta.ldpath.api.transformers.NodeTransformer;
 import org.apache.marmotta.ldpath.model.transformers.DateTimeTransformer;
 
@@ -52,12 +52,14 @@ public class TemplateDateTransformer<Node> implements NodeTransformer<TemplateDa
      * carrying out the transformation.
      *
      *
+     *
+     * @param nodeRDFBackend
      * @param node
      * @param configuration
      * @return
      */
     @Override
-    public TemplateDateModel transform(final NodeBackend<Node> nodeRDFBackend, final Node node, final Map<String, String> configuration) throws IllegalArgumentException {
+    public TemplateDateModel transform(final RDFBackend<Node> nodeRDFBackend, final Node node, final Map<String, String> configuration) throws IllegalArgumentException {
         return new TemplateDateModel() {
             @Override
             public Date getAsDate() throws TemplateModelException {

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-template/src/main/java/org/apache/marmotta/ldpath/template/model/transformers/TemplateDoubleTransformer.java
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-template/src/main/java/org/apache/marmotta/ldpath/template/model/transformers/TemplateDoubleTransformer.java b/libraries/ldpath/ldpath-template/src/main/java/org/apache/marmotta/ldpath/template/model/transformers/TemplateDoubleTransformer.java
index 594ea93..f5ffddb 100644
--- a/libraries/ldpath/ldpath-template/src/main/java/org/apache/marmotta/ldpath/template/model/transformers/TemplateDoubleTransformer.java
+++ b/libraries/ldpath/ldpath-template/src/main/java/org/apache/marmotta/ldpath/template/model/transformers/TemplateDoubleTransformer.java
@@ -17,7 +17,7 @@
  */
 package org.apache.marmotta.ldpath.template.model.transformers;
 
-import org.apache.marmotta.ldpath.api.backend.NodeBackend;
+import org.apache.marmotta.ldpath.api.backend.RDFBackend;
 import org.apache.marmotta.ldpath.api.transformers.NodeTransformer;
 import org.apache.marmotta.ldpath.model.transformers.DoubleTransformer;
 
@@ -47,12 +47,14 @@ public class TemplateDoubleTransformer<Node> implements NodeTransformer<Template
      * carrying out the transformation.
      *
      *
+     *
+     * @param nodeRDFBackend
      * @param node
      * @param configuration
      * @return
      */
     @Override
-    public TemplateNumberModel transform(final NodeBackend<Node> nodeRDFBackend, final Node node, final Map<String, String> configuration) throws IllegalArgumentException {
+    public TemplateNumberModel transform(final RDFBackend<Node> nodeRDFBackend, final Node node, final Map<String, String> configuration) throws IllegalArgumentException {
         return new TemplateNumberModel() {
             @Override
             public Number getAsNumber() throws TemplateModelException {

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-template/src/main/java/org/apache/marmotta/ldpath/template/model/transformers/TemplateFloatTransformer.java
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-template/src/main/java/org/apache/marmotta/ldpath/template/model/transformers/TemplateFloatTransformer.java b/libraries/ldpath/ldpath-template/src/main/java/org/apache/marmotta/ldpath/template/model/transformers/TemplateFloatTransformer.java
index d8d2c2a..bc3e206 100644
--- a/libraries/ldpath/ldpath-template/src/main/java/org/apache/marmotta/ldpath/template/model/transformers/TemplateFloatTransformer.java
+++ b/libraries/ldpath/ldpath-template/src/main/java/org/apache/marmotta/ldpath/template/model/transformers/TemplateFloatTransformer.java
@@ -17,7 +17,7 @@
  */
 package org.apache.marmotta.ldpath.template.model.transformers;
 
-import org.apache.marmotta.ldpath.api.backend.NodeBackend;
+import org.apache.marmotta.ldpath.api.backend.RDFBackend;
 import org.apache.marmotta.ldpath.api.transformers.NodeTransformer;
 import org.apache.marmotta.ldpath.model.transformers.FloatTransformer;
 
@@ -45,12 +45,14 @@ public class TemplateFloatTransformer<Node> implements NodeTransformer<TemplateN
      * carrying out the transformation.
      *
      *
+     *
+     * @param nodeRDFBackend
      * @param node
      * @param configuration
      * @return
      */
     @Override
-    public TemplateNumberModel transform(final NodeBackend<Node> nodeRDFBackend, final Node node, final Map<String, String> configuration) throws IllegalArgumentException {
+    public TemplateNumberModel transform(final RDFBackend<Node> nodeRDFBackend, final Node node, final Map<String, String> configuration) throws IllegalArgumentException {
         return new TemplateNumberModel() {
             @Override
             public Number getAsNumber() throws TemplateModelException {

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-template/src/main/java/org/apache/marmotta/ldpath/template/model/transformers/TemplateIntegerTransformer.java
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-template/src/main/java/org/apache/marmotta/ldpath/template/model/transformers/TemplateIntegerTransformer.java b/libraries/ldpath/ldpath-template/src/main/java/org/apache/marmotta/ldpath/template/model/transformers/TemplateIntegerTransformer.java
index 5df8bd6..760ce99 100644
--- a/libraries/ldpath/ldpath-template/src/main/java/org/apache/marmotta/ldpath/template/model/transformers/TemplateIntegerTransformer.java
+++ b/libraries/ldpath/ldpath-template/src/main/java/org/apache/marmotta/ldpath/template/model/transformers/TemplateIntegerTransformer.java
@@ -17,7 +17,7 @@
  */
 package org.apache.marmotta.ldpath.template.model.transformers;
 
-import org.apache.marmotta.ldpath.api.backend.NodeBackend;
+import org.apache.marmotta.ldpath.api.backend.RDFBackend;
 import org.apache.marmotta.ldpath.api.transformers.NodeTransformer;
 import org.apache.marmotta.ldpath.model.transformers.IntTransformer;
 
@@ -45,12 +45,14 @@ public class TemplateIntegerTransformer<Node> implements NodeTransformer<Templat
      * carrying out the transformation.
      *
      *
+     *
+     * @param nodeRDFBackend
      * @param node
      * @param configuration
      * @return
      */
     @Override
-    public TemplateNumberModel transform(final NodeBackend<Node> nodeRDFBackend, final Node node, final Map<String, String> configuration) throws IllegalArgumentException {
+    public TemplateNumberModel transform(final RDFBackend<Node> nodeRDFBackend, final Node node, final Map<String, String> configuration) throws IllegalArgumentException {
         return new TemplateNumberModel() {
             @Override
             public Number getAsNumber() throws TemplateModelException {

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-template/src/main/java/org/apache/marmotta/ldpath/template/model/transformers/TemplateLongTransformer.java
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-template/src/main/java/org/apache/marmotta/ldpath/template/model/transformers/TemplateLongTransformer.java b/libraries/ldpath/ldpath-template/src/main/java/org/apache/marmotta/ldpath/template/model/transformers/TemplateLongTransformer.java
index 9fc20b0..8f12d36 100644
--- a/libraries/ldpath/ldpath-template/src/main/java/org/apache/marmotta/ldpath/template/model/transformers/TemplateLongTransformer.java
+++ b/libraries/ldpath/ldpath-template/src/main/java/org/apache/marmotta/ldpath/template/model/transformers/TemplateLongTransformer.java
@@ -17,7 +17,7 @@
  */
 package org.apache.marmotta.ldpath.template.model.transformers;
 
-import org.apache.marmotta.ldpath.api.backend.NodeBackend;
+import org.apache.marmotta.ldpath.api.backend.RDFBackend;
 import org.apache.marmotta.ldpath.api.transformers.NodeTransformer;
 import org.apache.marmotta.ldpath.model.transformers.LongTransformer;
 
@@ -33,10 +33,10 @@ import java.util.Map;
  */
 public class TemplateLongTransformer<Node> implements NodeTransformer<TemplateNumberModel,Node> {
 
-    private LongTransformer delegate;
+    private LongTransformer<Node> delegate;
 
     public TemplateLongTransformer() {
-        delegate = new LongTransformer();
+        delegate = new LongTransformer<>();
     }
 
     /**
@@ -45,12 +45,14 @@ public class TemplateLongTransformer<Node> implements NodeTransformer<TemplateNu
      * carrying out the transformation.
      *
      *
+     *
+     * @param nodeRDFBackend
      * @param node
      * @param configuration
      * @return
      */
     @Override
-    public TemplateNumberModel transform(final NodeBackend<Node> nodeRDFBackend, final Node node, final Map<String, String> configuration) throws IllegalArgumentException {
+    public TemplateNumberModel transform(final RDFBackend<Node> nodeRDFBackend, final Node node, final Map<String, String> configuration) throws IllegalArgumentException {
         return new TemplateNumberModel() {
             @Override
             public Number getAsNumber() throws TemplateModelException {

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-template/src/main/java/org/apache/marmotta/ldpath/template/model/transformers/TemplateScalarTransformer.java
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-template/src/main/java/org/apache/marmotta/ldpath/template/model/transformers/TemplateScalarTransformer.java b/libraries/ldpath/ldpath-template/src/main/java/org/apache/marmotta/ldpath/template/model/transformers/TemplateScalarTransformer.java
index 980a030..bc6d711 100644
--- a/libraries/ldpath/ldpath-template/src/main/java/org/apache/marmotta/ldpath/template/model/transformers/TemplateScalarTransformer.java
+++ b/libraries/ldpath/ldpath-template/src/main/java/org/apache/marmotta/ldpath/template/model/transformers/TemplateScalarTransformer.java
@@ -17,7 +17,7 @@
  */
 package org.apache.marmotta.ldpath.template.model.transformers;
 
-import org.apache.marmotta.ldpath.api.backend.NodeBackend;
+import org.apache.marmotta.ldpath.api.backend.RDFBackend;
 import org.apache.marmotta.ldpath.api.transformers.NodeTransformer;
 import org.apache.marmotta.ldpath.model.transformers.StringTransformer;
 
@@ -46,12 +46,14 @@ public class TemplateScalarTransformer<Node> implements NodeTransformer<Template
      * carrying out the transformation.
      *
      *
+     *
+     * @param nodeRDFBackend
      * @param node
      * @param configuration
      * @return
      */
     @Override
-    public TemplateScalarModel transform(final NodeBackend<Node> nodeRDFBackend, final Node node, final Map<String, String> configuration) throws IllegalArgumentException {
+    public TemplateScalarModel transform(final RDFBackend<Node> nodeRDFBackend, final Node node, final Map<String, String> configuration) throws IllegalArgumentException {
         return new TemplateScalarModel() {
             @Override
             public String getAsString() throws TemplateModelException {

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldpath/pom.xml b/libraries/ldpath/pom.xml
index 99568d2..42eaaa3 100644
--- a/libraries/ldpath/pom.xml
+++ b/libraries/ldpath/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/marmotta/blob/582abb5b/libraries/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/pom.xml b/libraries/pom.xml
index a3dbffd..9c1079c 100644
--- a/libraries/pom.xml
+++ b/libraries/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>
 


[043/100] [abbrv] [partial] Reverting the erroneous merge by Sebastian according to the instructions in INFRA-6876

Posted by wi...@apache.org.
http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/marmotta-commons/src/main/java/org/apache/marmotta/commons/util/DateUtils.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-commons/src/main/java/org/apache/marmotta/commons/util/DateUtils.java b/commons/marmotta-commons/src/main/java/org/apache/marmotta/commons/util/DateUtils.java
index d19f2a5..044cdb5 100644
--- a/commons/marmotta-commons/src/main/java/org/apache/marmotta/commons/util/DateUtils.java
+++ b/commons/marmotta-commons/src/main/java/org/apache/marmotta/commons/util/DateUtils.java
@@ -37,21 +37,15 @@ import java.util.TimeZone;
 public class DateUtils {
 
 
-    public static final SimpleDateFormat ISO8601FORMAT = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'");
+    public static final SimpleDateFormat ISO8601FORMAT = createDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'", "UTC");
 
-    public static final SimpleDateFormat ISO8601FORMAT_TIME = new SimpleDateFormat("HH:mm:ss.SSS'Z'");
-    public static final SimpleDateFormat ISO8601FORMAT_DATE  = new SimpleDateFormat("yyyy-MM-dd");
+    public static final SimpleDateFormat ISO8601FORMAT_TIME = createDateFormat("HH:mm:ss.SSS'Z'", "UTC");
+    public static final SimpleDateFormat ISO8601FORMAT_DATE  = createDateFormat("yyyy-MM-dd", "UTC");
 
-    public static final SimpleDateFormat FILENAME_FORMAT     = new SimpleDateFormat("yyyyMMdd-HHmmss");
+    public static final SimpleDateFormat FILENAME_FORMAT     = createDateFormat("yyyyMMdd-HHmmss", null);
 
 
-    public static final SimpleDateFormat GMTFORMAT = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss z", new DateFormatSymbols(Locale.US));
-    static {
-        ISO8601FORMAT.setTimeZone(TimeZone.getTimeZone("UTC"));
-        ISO8601FORMAT_TIME.setTimeZone(TimeZone.getTimeZone("UTC"));
-        ISO8601FORMAT_DATE.setTimeZone(TimeZone.getTimeZone("UTC"));
-        GMTFORMAT.setTimeZone(TimeZone.getTimeZone("GMT"));
-    }
+    public static final SimpleDateFormat GMTFORMAT = createDateFormat("EEE, dd MMM yyyy HH:mm:ss z", "GMT");
 
     /**
      * Some parsers will have the date as a ISO-8601 string
@@ -62,29 +56,36 @@ public class DateUtils {
      *  property.
      */
     private static final DateFormat[] iso8601InputFormats = new DateFormat[] {
-        // GMT
-        createDateFormat("EEE, dd MMM yyyy HH:mm:ss'Z'","GMT"),
-        GMTFORMAT,
 
         // yyyy-mm-ddThh...
-        createDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ",null),
-        createDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'", "UTF"),
+        ISO8601FORMAT,
+        createDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ", null),
+        createDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'", "UTC"),
         createDateFormat("yyyy-MM-dd'T'HH:mm:ssZ", null),    // With timezone
         createDateFormat("yyyy-MM-dd'T'HH:mm:ss", null),     // Without timezone
         // yyyy-mm-dd hh...
-        createDateFormat("yyyy-MM-dd' 'HH:mm:ss'Z'", "UTF"), // UTC/Zulu
+        createDateFormat("yyyy-MM-dd' 'HH:mm:ss'Z'", "UTC"), // UTC/Zulu
         createDateFormat("yyyy-MM-dd' 'HH:mm:ssZ", null),    // With timezone
         createDateFormat("yyyy-MM-dd' 'HH:mm:ss.SZ", null),    // With timezone
         createDateFormat("yyyy-MM-dd' 'HH:mm:ss", null),     // Without timezone
+        
+        // GMT
+        GMTFORMAT,
+        createDateFormat("EEE, dd MMM yyyy HH:mm:ss'Z'", "GMT"),
+        
+        // Some more date formats
         createDateFormat("EEE MMM dd HH:mm:ss z yyyy", null),     // Word documents
         createDateFormat("EEE MMM d HH:mm:ss z yyyy", null),     // Word documents
         createDateFormat("dd.MM.yyy' 'HH:mm:ss", null),     // German
         createDateFormat("dd.MM.yyy' 'HH:mm", null),     // German
+        
+        // SES-711 (see https://openrdf.atlassian.net/browse/SES-711)
+        ISO8601FORMAT_DATE,
     };
 
-    private static DateFormat createDateFormat(String format, String timezone) {
+    private static SimpleDateFormat createDateFormat(String format, String timezone) {
         SimpleDateFormat sdf =
-                new SimpleDateFormat(format, new DateFormatSymbols(Locale.US));
+                new SimpleDateFormat(format, DateFormatSymbols.getInstance(Locale.US));
         if (timezone != null) {
             sdf.setTimeZone(TimeZone.getTimeZone(timezone));
         }

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/marmotta-commons/src/main/java/org/apache/marmotta/commons/vocabulary/XSD.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-commons/src/main/java/org/apache/marmotta/commons/vocabulary/XSD.java b/commons/marmotta-commons/src/main/java/org/apache/marmotta/commons/vocabulary/XSD.java
new file mode 100644
index 0000000..4d42298
--- /dev/null
+++ b/commons/marmotta-commons/src/main/java/org/apache/marmotta/commons/vocabulary/XSD.java
@@ -0,0 +1,325 @@
+/*
+ * 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.commons.vocabulary;
+
+import org.openrdf.model.URI;
+import org.openrdf.model.ValueFactory;
+import org.openrdf.model.impl.ValueFactoryImpl;
+
+/**
+ * XSD Datatypes
+ */
+public class XSD {
+    public static final String NAMESPACE = "http://www.w3.org/2001/XMLSchema#";
+    public static final String PREFIX = "xsd";
+
+    /**
+     * {@code http://www.w3.org/2001/XMLSchema#anyURI}.
+     * <br>
+     * anyURI represents an Internationalized Resource Identifier Reference (IRI). An anyURI value can be absolute or relative and may have an optional fragment identifier (i.e. it may be an IRI Reference). This type should be used when the value fulfills the role of an IRI as defined in RFC 3987 or its successor(s) in the IETF Standards Track.
+     */
+    public static final URI AnyURI;
+
+    /**
+     * {@code http://www.w3.org/2001/XMLSchema#base64Binary}.
+     * <br>
+     * base64Binary represents arbitrary Base64-encoded binary data. For base64Binary data the entire binary stream is encoded using the Base64 Encoding defined in RFC 3548 which is derived from the encoding described in RFC 2045.
+     */
+    public static final URI Base64Binary;
+
+    /**
+     * {@code http://www.w3.org/2001/XMLSchema#boolean}.
+     * <br>
+     * boolean represents the values of two-valued logic.
+     */
+    public static final URI Boolean;
+
+    /**
+     * {@code http://www.w3.org/2001/XMLSchema#byte}.
+     * <br>
+     * byte is derived from short by setting the value of maxInclusive to be 127 and minInclusive to be -128. The base type of byte is short.
+     */
+    public static final URI Byte;
+
+    /**
+     * {@code http://www.w3.org/2001/XMLSchema#date}.
+     * <br>
+     * date represents top-open intervals of exactly one day in length on the timelines of dateTime beginning on the beginning moment of each day up to but not including the beginning moment of the next day). For non-timezoned values the top-open intervals disjointly cover the non-timezoned timeline one per day. For timezoned values the intervals begin at every minute and therefore overlap.
+     */
+    public static final URI Date;
+
+    /**
+     * {@code http://www.w3.org/2001/XMLSchema#dateTime}.
+     * <br>
+     * dateTime represents instants of time optionally marked with a particular time zone offset. Values representing the same instant but having different time zone offsets are equal but not identical.
+     */
+    public static final URI DateTime;
+
+    /**
+     * {@code http://www.w3.org/2001/XMLSchema#dateTimeStamp}.
+     * <br>
+     * The dateTimeStamp datatype is derived from dateTime by giving the value required to its explicitTimezone facet.
+     */
+    public static final URI DateTimeStamp;
+
+    /**
+     * {@code http://www.w3.org/2001/XMLSchema#dayTimeDuration}.
+     * <br>
+     * dayTimeDuration is a datatype derived from duration by restricting its lexical representations to instances of dayTimeDurationLexicalRep.
+     */
+    public static final URI DayTimeDuration;
+
+    /**
+     * {@code http://www.w3.org/2001/XMLSchema#decimal}.
+     * <br>
+     * decimal represents a subset of the real numbers which can be represented by decimal numerals. The value space of decimal is the set of numbers that can be obtained by dividing an integer by a non-negative power of ten i.e. expressible as i10n where i and n are integers and n0. Precision is not reflected in this value space; the number 2.0 is not distinct from the number 2.00. The order relation on decimal is the order relation on real numbers restricted to this subset.
+     */
+    public static final URI Decimal;
+
+    /**
+     * {@code http://www.w3.org/2001/XMLSchema#double}.
+     * <br>
+     * The double datatype is patterned after the IEEE double-precision 64-bit floating point datatype IEEE 754-2008.
+     */
+    public static final URI Double;
+
+    /**
+     * {@code http://www.w3.org/2001/XMLSchema#duration}.
+     * <br>
+     * duration is a datatype that represents durations of time.
+     */
+    public static final URI Duration;
+
+    /**
+     * {@code http://www.w3.org/2001/XMLSchema#float}.
+     * <br>
+     * The float datatype is patterned after the IEEE single-precision 32-bit floating point datatype IEEE 754-2008.
+     */
+    public static final URI Float;
+
+    /**
+     * {@code http://www.w3.org/2001/XMLSchema#gDay}.
+     * <br>
+     * gDay represents whole days within an arbitrary monthdays that recur at the same point in each (Gregorian) month.
+     */
+    public static final URI GDay;
+
+    /**
+     * {@code http://www.w3.org/2001/XMLSchema#gMonth}.
+     * <br>
+     * gMonth represents whole (Gregorian) months within an arbitrary yearmonths that recur at the same point in each year. It might be used for example to say what month annual Thanksgiving celebrations fall in different countries (--11 in the United States --10 in Canada and possibly other months in other countries).
+     */
+    public static final URI GMonth;
+
+    /**
+     * {@code http://www.w3.org/2001/XMLSchema#gMonthDay}.
+     * <br>
+     * gMonthDay represents whole calendar days that recur at the same point in each calendar year or that occur in some arbitrary calendar year. (Obviously days beyond 28 cannot occur in all Februaries; 29 is nonetheless permitted.)
+     */
+    public static final URI GMonthDay;
+
+    /**
+     * {@code http://www.w3.org/2001/XMLSchema#gYear}.
+     * <br>
+     * gYear represents Gregorian calendar years.
+     */
+    public static final URI GYear;
+
+    /**
+     * {@code http://www.w3.org/2001/XMLSchema#gYearMonth}.
+     * <br>
+     * gYearMonth represents specific whole Gregorian months in specific Gregorian years.
+     */
+    public static final URI GYearMonth;
+
+    /**
+     * {@code http://www.w3.org/2001/XMLSchema#hexBinary}.
+     * <br>
+     * hexBinary represents arbitrary hex-encoded binary data.
+     */
+    public static final URI HexBinary;
+
+    /**
+     * {@code http://www.w3.org/2001/XMLSchema#int}.
+     * <br>
+     * int is derived from long by setting the value of maxInclusive to be 2147483647 and minInclusive to be -2147483648. The base type of int is long.
+     */
+    public static final URI Int;
+
+    /**
+     * {@code http://www.w3.org/2001/XMLSchema#integer}.
+     * <br>
+     * integer is derived from decimal by fixing the value of fractionDigits to be 0 and disallowing the trailing decimal point. This results in the standard mathematical concept of the integer numbers. The value space of integer is the infinite set ...-2-1012.... The base type of integer is decimal.
+     */
+    public static final URI Integer;
+
+    /**
+     * {@code http://www.w3.org/2001/XMLSchema#language}.
+     * <br>
+     * language represents formal natural language identifiers as defined by BCP 47 (currently represented by RFC 4646 and RFC 4647) or its successor(s).
+     */
+    public static final URI Language;
+
+    /**
+     * {@code http://www.w3.org/2001/XMLSchema#long}.
+     * <br>
+     * long is derived from integer by setting the value of maxInclusive to be 9223372036854775807 and minInclusive to be -9223372036854775808. The base type of long is integer.
+     */
+    public static final URI Long;
+
+    /**
+     * {@code http://www.w3.org/2001/XMLSchema#negativeInteger}.
+     * <br>
+     * negativeInteger is derived from nonPositiveInteger by setting the value of maxInclusive to be -1. This results in the standard mathematical concept of the negative integers. The value space of negativeInteger is the infinite set ...-2-1. The base type of negativeInteger is nonPositiveInteger.
+     */
+    public static final URI NegativeInteger;
+
+    /**
+     * {@code http://www.w3.org/2001/XMLSchema#nonNegativeInteger}.
+     * <br>
+     * nonNegativeInteger is derived from integer by setting the value of minInclusive to be 0. This results in the standard mathematical concept of the non-negative integers. The value space of nonNegativeInteger is the infinite set 012.... The base type of nonNegativeInteger is integer.
+     */
+    public static final URI NonNegativeInteger;
+
+    /**
+     * {@code http://www.w3.org/2001/XMLSchema#nonPositiveInteger}.
+     * <br>
+     * nonPositiveInteger is derived from integer by setting the value of maxInclusive to be 0. This results in the standard mathematical concept of the non-positive integers. The value space of nonPositiveInteger is the infinite set ...-2-10. The base type of nonPositiveInteger is integer.
+     */
+    public static final URI NonPositiveInteger;
+
+    /**
+     * {@code http://www.w3.org/2001/XMLSchema#normalizedString}.
+     * <br>
+     * normalizedString represents white space normalized strings. The value space of normalizedString is the set of strings that do not contain the carriage return (#xD) line feed (#xA) nor tab (#x9) characters. The lexical space of normalizedString is the set of strings that do not contain the carriage return (#xD) line feed (#xA) nor tab (#x9) characters. The base type of normalizedString is string.
+     */
+    public static final URI NormalizedString;
+
+    /**
+     * {@code http://www.w3.org/2001/XMLSchema#positiveInteger}.
+     * <br>
+     * positiveInteger is derived from nonNegativeInteger by setting the value of minInclusive to be 1. This results in the standard mathematical concept of the positive integer numbers. The value space of positiveInteger is the infinite set 12.... The base type of positiveInteger is nonNegativeInteger.
+     */
+    public static final URI PositiveInteger;
+
+    /**
+     * {@code http://www.w3.org/2001/XMLSchema#short}.
+     * <br>
+     * short is derived from int by setting the value of maxInclusive to be 32767 and minInclusive to be -32768. The base type of short is int.
+     */
+    public static final URI Short;
+
+    /**
+     * {@code http://www.w3.org/2001/XMLSchema#string}.
+     * <br>
+     * The string datatype represents character strings in XML.
+     */
+    public static final URI String;
+
+    /**
+     * {@code http://www.w3.org/2001/XMLSchema#time}.
+     * <br>
+     * time represents instants of time that recur at the same point in each calendar day or that occur in some arbitrary calendar day.
+     */
+    public static final URI Time;
+
+    /**
+     * {@code http://www.w3.org/2001/XMLSchema#token}.
+     * <br>
+     * token represents tokenized strings. The value space of token is the set of strings that do not contain the carriage return (#xD) line feed (#xA) nor tab (#x9) characters that have no leading or trailing spaces (#x20) and that have no internal sequences of two or more spaces. The lexical space of token is the set of strings that do not contain the carriage return (#xD) line feed (#xA) nor tab (#x9) characters that have no leading or trailing spaces (#x20) and that have no internal sequences of two or more spaces. The base type of token is normalizedString.
+     */
+    public static final URI Token;
+
+    /**
+     * {@code http://www.w3.org/2001/XMLSchema#unsignedByte}.
+     * <br>
+     * unsignedByte is derived from unsignedShort by setting the value of maxInclusive to be 255. The base type of unsignedByte is unsignedShort.
+     */
+    public static final URI UnsignedByte;
+
+    /**
+     * {@code http://www.w3.org/2001/XMLSchema#unsignedInt}.
+     * <br>
+     * unsignedInt is derived from unsignedLong by setting the value of maxInclusive to be 4294967295. The base type of unsignedInt is unsignedLong.
+     */
+    public static final URI UnsignedInt;
+
+    /**
+     * {@code http://www.w3.org/2001/XMLSchema#unsignedLong}.
+     * <br>
+     * unsignedLong is derived from nonNegativeInteger by setting the value of maxInclusive to be 18446744073709551615. The base type of unsignedLong is nonNegativeInteger.
+     */
+    public static final URI UnsignedLong;
+
+    /**
+     * {@code http://www.w3.org/2001/XMLSchema#unsignedShort}.
+     * <br>
+     * unsignedShort is derived from unsignedInt by setting the value of maxInclusive to be 65535. The base type of unsignedShort is unsignedInt.
+     */
+    public static final URI UnsignedShort;
+
+    /**
+     * {@code http://www.w3.org/2001/XMLSchema#yearMonthDuration}.
+     * <br>
+     * yearMonthDuration is a datatype derived from duration by restricting its lexical representations to instances of yearMonthDurationLexicalRep.
+     */
+    public static final URI YearMonthDuration;
+
+
+    static {
+        final ValueFactory vf = ValueFactoryImpl.getInstance();
+
+        AnyURI = vf.createURI(NAMESPACE, "anyURI");
+        Base64Binary = vf.createURI(NAMESPACE, "base64Binary");
+        Boolean = vf.createURI(NAMESPACE, "boolean");
+        Byte = vf.createURI(NAMESPACE, "byte");
+        Date = vf.createURI(NAMESPACE, "date");
+        DateTime = vf.createURI(NAMESPACE, "dateTime");
+        DateTimeStamp = vf.createURI(NAMESPACE, "dateTimeStamp");
+        DayTimeDuration = vf.createURI(NAMESPACE, "dayTimeDuration");
+        Decimal = vf.createURI(NAMESPACE, "decimal");
+        Double = vf.createURI(NAMESPACE, "double");
+        Duration = vf.createURI(NAMESPACE, "duration");
+        Float = vf.createURI(NAMESPACE, "float");
+        GDay = vf.createURI(NAMESPACE, "gDay");
+        GMonth = vf.createURI(NAMESPACE, "gMonth");
+        GMonthDay = vf.createURI(NAMESPACE, "gMonthDay");
+        GYear = vf.createURI(NAMESPACE, "gYear");
+        GYearMonth = vf.createURI(NAMESPACE, "gYearMonth");
+        HexBinary = vf.createURI(NAMESPACE, "hexBinary");
+        Int = vf.createURI(NAMESPACE, "int");
+        Integer = vf.createURI(NAMESPACE, "integer");
+        Language = vf.createURI(NAMESPACE, "language");
+        Long = vf.createURI(NAMESPACE, "long");
+        NegativeInteger = vf.createURI(NAMESPACE, "negativeInteger");
+        NonNegativeInteger = vf.createURI(NAMESPACE, "nonNegativeInteger");
+        NonPositiveInteger = vf.createURI(NAMESPACE, "nonPositiveInteger");
+        NormalizedString = vf.createURI(NAMESPACE, "normalizedString");
+        PositiveInteger = vf.createURI(NAMESPACE, "positiveInteger");
+        Short = vf.createURI(NAMESPACE, "short");
+        String = vf.createURI(NAMESPACE, "string");
+        Time = vf.createURI(NAMESPACE, "time");
+        Token = vf.createURI(NAMESPACE, "token");
+        UnsignedByte = vf.createURI(NAMESPACE, "unsignedByte");
+        UnsignedInt = vf.createURI(NAMESPACE, "unsignedInt");
+        UnsignedLong = vf.createURI(NAMESPACE, "unsignedLong");
+        UnsignedShort = vf.createURI(NAMESPACE, "unsignedShort");
+        YearMonthDuration = vf.createURI(NAMESPACE, "yearMonthDuration");
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/marmotta-commons/src/main/resources/META-INF/LICENSE
----------------------------------------------------------------------
diff --git a/commons/marmotta-commons/src/main/resources/META-INF/LICENSE b/commons/marmotta-commons/src/main/resources/META-INF/LICENSE
new file mode 100644
index 0000000..8a179ca
--- /dev/null
+++ b/commons/marmotta-commons/src/main/resources/META-INF/LICENSE
@@ -0,0 +1,234 @@
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed 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.
+
+
+This module includes source code from the Javolution project, licensed under
+BSD license:
+
+   Javolution - Java(tm) Solution for Real-Time and Embedded Systems
+   Copyright (c) 2012, Javolution (http://javolution.org/)
+   All rights reserved.
+
+   Redistribution and use in source and binary forms, with or without
+   modification, are permitted provided that the following conditions are met:
+
+      1. Redistributions of source code must retain the above copyright
+         notice, this list of conditions and the following disclaimer.
+
+      2. Redistributions in binary form must reproduce the above copyright
+         notice, this list of conditions and the following disclaimer in the
+         documentation and/or other materials provided with the distribution.
+
+   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+   CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+   EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+   PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+   PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+   LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+   NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+   SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/marmotta-commons/src/main/resources/META-INF/NOTICE
----------------------------------------------------------------------
diff --git a/commons/marmotta-commons/src/main/resources/META-INF/NOTICE b/commons/marmotta-commons/src/main/resources/META-INF/NOTICE
new file mode 100644
index 0000000..06ee0eb
--- /dev/null
+++ b/commons/marmotta-commons/src/main/resources/META-INF/NOTICE
@@ -0,0 +1,18 @@
+Apache Marmotta Commons
+Copyright 2012-2013 The Apache Software Foundation
+
+This product includes software developed at
+The Apache Software Foundation (http://www.apache.org/).
+
+Portions of this software were originally based on the following:
+
+    Copyright 2008-2012 Salzburg Research Forschungsgesellschaft mbH
+
+These have been licensed to the Apache Software Foundation under a software grant.
+
+This product also includes some third-party source components:
+
+ * The module commons/marmotta-commons contains a modified and reduced version
+   of the Javolution library. Javolution has copyright (c) 2012, Javolution and
+   is licensed under BSD license. The original source code is available from
+   http://javolution.org

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/marmotta-commons/src/test/java/org/apache/marmotta/commons/collections/EquivalenceHashSet2Test.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-commons/src/test/java/org/apache/marmotta/commons/collections/EquivalenceHashSet2Test.java b/commons/marmotta-commons/src/test/java/org/apache/marmotta/commons/collections/EquivalenceHashSet2Test.java
new file mode 100644
index 0000000..185b0be
--- /dev/null
+++ b/commons/marmotta-commons/src/test/java/org/apache/marmotta/commons/collections/EquivalenceHashSet2Test.java
@@ -0,0 +1,62 @@
+/*
+ * 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.commons.collections;
+
+import com.google.common.base.Equivalence;
+import javolution.util.FastSet;
+import javolution.util.function.Equality;
+
+import java.util.Set;
+
+/**
+ * Add file description here!
+ *
+ * @author Sebastian Schaffert (sschaffert@apache.org)
+ */
+public class EquivalenceHashSet2Test extends EquivalenceHashSetTest {
+
+    @Override
+    public Set<String> createHashSet(final Equivalence<String> equivalence) {
+        return new FastSet<>(new Equality<String>() {
+            @Override
+            public int hashCodeOf(String object) {
+                return equivalence.hash(object);
+            }
+
+            @Override
+            public boolean areEqual(String left, String right) {
+                return equivalence.equivalent(left, right);
+            }
+
+            @Override
+            public int compare(String left, String right) {
+                return equivalence.hash(left) - equivalence.hash(right);
+            }
+
+            @Override
+            public int hashCode() {
+                return equivalence.hashCode();
+            }
+
+            @Override
+            public boolean equals(Object obj) {
+                return obj.hashCode() == hashCode();
+            }
+        });
+    }
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/marmotta-commons/src/test/java/org/apache/marmotta/commons/collections/EquivalenceHashSetTest.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-commons/src/test/java/org/apache/marmotta/commons/collections/EquivalenceHashSetTest.java b/commons/marmotta-commons/src/test/java/org/apache/marmotta/commons/collections/EquivalenceHashSetTest.java
new file mode 100644
index 0000000..a01813c
--- /dev/null
+++ b/commons/marmotta-commons/src/test/java/org/apache/marmotta/commons/collections/EquivalenceHashSetTest.java
@@ -0,0 +1,138 @@
+/*
+ * 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.commons.collections;
+
+import com.google.common.base.Equivalence;
+import org.junit.Assert;
+import org.junit.Test;
+
+import java.util.Set;
+
+/**
+ * Add file description here!
+ *
+ * @author Sebastian Schaffert (sschaffert@apache.org)
+ */
+public class EquivalenceHashSetTest {
+
+    // a simple equivalence function on strings, saying they are equal if their first character is the same
+    Equivalence<String> equivalence = new Equivalence<String>() {
+        @Override
+        protected boolean doEquivalent(String a, String b) {
+            return a.charAt(0) == b.charAt(0);
+        }
+
+        @Override
+        protected int doHash(String s) {
+            return s.charAt(0) * 31;
+        }
+    };
+
+    public Set<String> createHashSet(Equivalence<String> equivalence) {
+        return new EquivalenceHashSet<>(equivalence);
+    }
+
+    @Test
+    public void testEquivalence() {
+        Assert.assertTrue(equivalence.equivalent("abc","axy"));
+        Assert.assertFalse(equivalence.equivalent("abc", "xyz"));
+
+        Assert.assertTrue(equivalence.hash("abc") == equivalence.hash("axy"));
+        Assert.assertFalse(equivalence.hash("abc") == equivalence.hash("xyz"));
+    }
+
+    @Test
+    public void testSetContains() {
+        String a = "abc";
+        String b = "axy";
+        String c = "xyz";
+
+        Set<String> set = createHashSet(equivalence);
+        set.add(a);
+
+        // set should now also contain b (because first character the same)
+        Assert.assertTrue(set.contains(b));
+
+        set.add(b);
+
+        // adding b should not change the set
+        Assert.assertEquals(1, set.size());
+
+        set.add(c);
+
+        Assert.assertEquals(2, set.size());
+
+    }
+
+
+    @Test
+    public void testSetEquals() {
+        String a1 = "abc";
+        String a2 = "axy";
+        String b1 = "bcd";
+        String b2 = "bxy";
+        String c1 = "cde";
+
+        Set<String> set1 = createHashSet(equivalence);
+        Set<String> set2 = createHashSet(equivalence);
+
+        // test empty sets
+        Assert.assertEquals(set1,set2);
+
+        set1.add(a1);
+        set1.add(b1);
+
+        set2.add(b2);
+        set2.add(a2);
+
+
+        Assert.assertEquals(2, set1.size());
+        Assert.assertEquals(2, set2.size());
+
+
+        // test sets with elements, insertion order different
+        Assert.assertEquals(set1,set2);
+        Assert.assertEquals(set1.hashCode(), set2.hashCode());
+
+        set1.add(c1);
+
+        Assert.assertNotEquals(set1,set2);
+        Assert.assertNotEquals(set1.hashCode(), set2.hashCode());
+
+
+    }
+
+    @Test
+    public void testIteration() {
+        String a = "abc";
+        String b = "axy";
+        String c = "xyz";
+
+        Set<String> set = createHashSet(equivalence);
+        set.add(a);
+        set.add(b);
+        set.add(c);
+
+        int count = 0;
+        for(String x : set) {
+            count++;
+        }
+        Assert.assertEquals(2,count);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/marmotta-commons/src/test/java/org/apache/marmotta/commons/sesame/model/LiteralCommonsTest.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-commons/src/test/java/org/apache/marmotta/commons/sesame/model/LiteralCommonsTest.java b/commons/marmotta-commons/src/test/java/org/apache/marmotta/commons/sesame/model/LiteralCommonsTest.java
index 9cad20a..4ac7a06 100644
--- a/commons/marmotta-commons/src/test/java/org/apache/marmotta/commons/sesame/model/LiteralCommonsTest.java
+++ b/commons/marmotta-commons/src/test/java/org/apache/marmotta/commons/sesame/model/LiteralCommonsTest.java
@@ -17,7 +17,7 @@
  */
 package org.apache.marmotta.commons.sesame.model;
 
-import org.apache.commons.lang.RandomStringUtils;
+import org.apache.commons.lang3.RandomStringUtils;
 import org.apache.marmotta.commons.sesame.model.LiteralCommons;
 import org.apache.marmotta.commons.sesame.model.Namespaces;
 import org.apache.marmotta.commons.util.DateUtils;
@@ -26,6 +26,8 @@ import org.junit.Test;
 import org.openrdf.model.Literal;
 import org.openrdf.model.URI;
 import org.openrdf.model.ValueFactory;
+import org.openrdf.model.vocabulary.RDF;
+import org.openrdf.model.vocabulary.XMLSchema;
 import org.openrdf.repository.Repository;
 import org.openrdf.repository.sail.SailRepository;
 import org.openrdf.sail.memory.MemoryStore;
@@ -101,37 +103,38 @@ public class LiteralCommonsTest {
     public void testGetXSDType() {
 
         // String
-        Assert.assertEquals(Namespaces.NS_XSD + "string" , LiteralCommons.getXSDType(String.class));
+        Assert.assertEquals(XMLSchema.STRING.stringValue() , LiteralCommons.getXSDType(String.class));
 
         // int and Integer
-        Assert.assertEquals(Namespaces.NS_XSD + "integer", LiteralCommons.getXSDType(int.class));
-        Assert.assertEquals(Namespaces.NS_XSD + "integer", LiteralCommons.getXSDType(Integer.class));
+        Assert.assertEquals(XMLSchema.INTEGER.stringValue(), LiteralCommons.getXSDType(int.class));
+        Assert.assertEquals(XMLSchema.INTEGER.stringValue(), LiteralCommons.getXSDType(Integer.class));
 
 
         // long and Long
-        Assert.assertEquals(Namespaces.NS_XSD + "long", LiteralCommons.getXSDType(long.class));
-        Assert.assertEquals(Namespaces.NS_XSD + "long", LiteralCommons.getXSDType(Long.class));
+        Assert.assertEquals(XMLSchema.LONG.stringValue(), LiteralCommons.getXSDType(long.class));
+        Assert.assertEquals(XMLSchema.LONG.stringValue(), LiteralCommons.getXSDType(Long.class));
 
         // double and Double
-        Assert.assertEquals(Namespaces.NS_XSD + "double", LiteralCommons.getXSDType(double.class));
-        Assert.assertEquals(Namespaces.NS_XSD + "double", LiteralCommons.getXSDType(Double.class));
+        Assert.assertEquals(XMLSchema.DOUBLE.stringValue(), LiteralCommons.getXSDType(double.class));
+        Assert.assertEquals(XMLSchema.DOUBLE.stringValue(), LiteralCommons.getXSDType(Double.class));
 
         // float and Float
-        Assert.assertEquals(Namespaces.NS_XSD + "float", LiteralCommons.getXSDType(float.class));
-        Assert.assertEquals(Namespaces.NS_XSD + "float", LiteralCommons.getXSDType(Float.class));
+        Assert.assertEquals(XMLSchema.FLOAT.stringValue(), LiteralCommons.getXSDType(float.class));
+        Assert.assertEquals(XMLSchema.FLOAT.stringValue(), LiteralCommons.getXSDType(Float.class));
 
 
         // boolean and Boolean
-        Assert.assertEquals(Namespaces.NS_XSD + "boolean", LiteralCommons.getXSDType(boolean.class));
-        Assert.assertEquals(Namespaces.NS_XSD + "boolean", LiteralCommons.getXSDType(Boolean.class));
+        Assert.assertEquals(XMLSchema.BOOLEAN.stringValue(), LiteralCommons.getXSDType(boolean.class));
+        Assert.assertEquals(XMLSchema.BOOLEAN.stringValue(), LiteralCommons.getXSDType(Boolean.class));
 
 
         // Date
-        Assert.assertEquals(Namespaces.NS_XSD + "dateTime", LiteralCommons.getXSDType(Date.class));
+        Assert.assertEquals(XMLSchema.DATETIME.stringValue(), LiteralCommons.getXSDType(Date.class));
 
     }
     
+    @Test
     public void testGetRDFLangStringType() throws Exception {
-    	Assert.assertEquals(Namespaces.NS_RDF+ "langString", LiteralCommons.getRDFLangStringType());
+    	Assert.assertEquals(RDF.LANGSTRING.stringValue(), LiteralCommons.getRDFLangStringType());
 	}
 }

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/marmotta-commons/src/test/java/org/apache/marmotta/commons/sesame/model/StatementCommonsTest.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-commons/src/test/java/org/apache/marmotta/commons/sesame/model/StatementCommonsTest.java b/commons/marmotta-commons/src/test/java/org/apache/marmotta/commons/sesame/model/StatementCommonsTest.java
new file mode 100644
index 0000000..5e286ba
--- /dev/null
+++ b/commons/marmotta-commons/src/test/java/org/apache/marmotta/commons/sesame/model/StatementCommonsTest.java
@@ -0,0 +1,225 @@
+/*
+ * 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.commons.sesame.model;
+
+import com.google.common.base.Equivalence;
+import org.apache.commons.lang3.RandomStringUtils;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+import org.openrdf.model.*;
+import org.openrdf.model.impl.ValueFactoryImpl;
+
+import java.util.*;
+
+/**
+ * Add file description here!
+ *
+ * @author Sebastian Schaffert (sschaffert@apache.org)
+ */
+public class StatementCommonsTest {
+
+    protected static Random rnd = new Random();
+
+
+    Statement stmt1, stmt2, stmt3, stmt4;
+
+    ValueFactory valueFactory;
+
+    @Before
+    public void setup() {
+        valueFactory = new ValueFactoryImpl();
+
+        Resource s1 = randomURI();
+        URI p1 = randomURI();
+        URI p2 = randomURI();
+        Value o1 = randomObject();
+        Resource c1 = randomURI();
+        Resource c2 = randomURI();
+
+
+        stmt1 = valueFactory.createStatement(s1,p1,o1,c1);
+        stmt2 = valueFactory.createStatement(s1,p1,o1,c2);
+        stmt3 = valueFactory.createStatement(s1,p2,o1,c1);
+        stmt4 = valueFactory.createStatement(s1,p1,o1,c1);
+    }
+
+
+    @Test
+    public void testTripleEquivalence() {
+        Equivalence<Statement> e = StatementCommons.tripleEquivalence();
+
+        Assert.assertTrue(e.equivalent(stmt1,stmt2));
+        Assert.assertTrue(e.equivalent(stmt1,stmt4));
+        Assert.assertFalse(e.equivalent(stmt1,stmt3));
+    }
+
+    @Test
+    public void testQuadrupleEquivalence() {
+        Equivalence<Statement> e = StatementCommons.tripleEquivalence();
+
+        Assert.assertTrue(e.equivalent(stmt1,stmt2));
+        Assert.assertTrue(e.equivalent(stmt1,stmt4));
+        Assert.assertFalse(e.equivalent(stmt1,stmt3));
+    }
+
+    @Test
+    public void testTripleSet() {
+        Set<Statement> set = StatementCommons.newTripleSet();
+
+        set.add(stmt1);
+
+        // triple 2 just has different context, so should be contained already
+        Assert.assertTrue(set.contains(stmt2));
+
+        // adding triple 2 should not change size
+        set.add(stmt2);
+
+        Assert.assertEquals(1,set.size());
+
+        // statement 3 is different, so not contained and size increased
+        Assert.assertFalse(set.contains(stmt3));
+
+        set.add(stmt3);
+
+        Assert.assertEquals(2,set.size());
+
+    }
+
+    @Test
+    public void testQuadrupleSet() {
+        Set<Statement> set = StatementCommons.newQuadrupleSet();
+
+        set.add(stmt1);
+
+        // triple 2 has different context, so should not be contained already
+        Assert.assertFalse(set.contains(stmt2));
+
+        // adding triple 2 should change size
+        set.add(stmt2);
+
+        Assert.assertEquals(2,set.size());
+
+        // statement 3 is different, so not contained and size increased
+        Assert.assertFalse(set.contains(stmt3));
+
+        set.add(stmt3);
+
+        Assert.assertEquals(3,set.size());
+
+    }
+
+
+    @Test
+    public void testTripleMap() {
+        Map<Statement, String> map = StatementCommons.newTripleMap();
+
+        String s1 = RandomStringUtils.random(8);
+        String s2 = RandomStringUtils.random(8);
+        String s3 = RandomStringUtils.random(8);
+
+        map.put(stmt1, s1);
+
+        // triple 2 just has different context, so should be contained already
+        Assert.assertEquals(s1, map.get(stmt2));
+
+        // adding triple 2 should not change size
+        map.put(stmt2,s2);
+
+        Assert.assertEquals(1, map.size());
+
+        // value now replaced?
+        Assert.assertEquals(s2, map.get(stmt1));
+
+        // statement 3 is different, so not contained and size increased
+        Assert.assertFalse(map.containsKey(stmt3));
+
+        map.put(stmt3,s3);
+
+        Assert.assertEquals(2, map.size());
+
+    }
+
+    @Test
+    public void testQuadrupleMap() {
+        Map<Statement, String> map = StatementCommons.newQuadrupleMap();
+
+        String s1 = RandomStringUtils.random(8);
+        String s2 = RandomStringUtils.random(8);
+        String s3 = RandomStringUtils.random(8);
+
+        map.put(stmt1, s1);
+
+        // triple 2 just has different context, so should be contained already
+        Assert.assertNotEquals(s1, map.get(stmt2));
+
+        // adding triple 2 should change size
+        map.put(stmt2,s2);
+
+        Assert.assertEquals(2, map.size());
+
+        // value not replaced?
+        Assert.assertEquals(s1, map.get(stmt1));
+
+        // statement 3 is different, so not contained and size increased
+        Assert.assertFalse(map.containsKey(stmt3));
+
+        map.put(stmt3,s3);
+
+        Assert.assertEquals(3, map.size());
+
+    }
+
+
+    /**
+     * Return a random URI, with a 10% chance of returning a URI that has already been used.
+     * @return
+     */
+    protected URI randomURI() {
+        URI resource = valueFactory.createURI("http://localhost/" + RandomStringUtils.randomAlphanumeric(8));
+        return resource;
+    }
+
+    /**
+     * Return a random RDF value, either a reused object (10% chance) or of any other kind.
+     * @return
+     */
+    protected Value randomObject() {
+        Value object;
+        switch(rnd.nextInt(6)) {
+            case 0: object = valueFactory.createURI("http://localhost/" + RandomStringUtils.randomAlphanumeric(8));
+                break;
+            case 1: object = valueFactory.createBNode();
+                break;
+            case 2: object = valueFactory.createLiteral(RandomStringUtils.randomAscii(40));
+                break;
+            case 3: object = valueFactory.createLiteral(rnd.nextInt());
+                break;
+            case 4: object = valueFactory.createLiteral(rnd.nextDouble());
+                break;
+            case 5: object = valueFactory.createLiteral(rnd.nextBoolean());
+                break;
+            default: object = valueFactory.createURI("http://localhost/" + RandomStringUtils.randomAlphanumeric(8));
+                break;
+
+        }
+        return object;
+
+
+    }
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/marmotta-commons/src/test/java/org/apache/marmotta/commons/util/DateUtilsTest.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-commons/src/test/java/org/apache/marmotta/commons/util/DateUtilsTest.java b/commons/marmotta-commons/src/test/java/org/apache/marmotta/commons/util/DateUtilsTest.java
new file mode 100644
index 0000000..53b52a2
--- /dev/null
+++ b/commons/marmotta-commons/src/test/java/org/apache/marmotta/commons/util/DateUtilsTest.java
@@ -0,0 +1,44 @@
+/**
+ * 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.commons.util;
+
+import java.util.Date;
+
+import org.junit.Assert;
+import org.junit.Test;
+
+/**
+ * Unit-Tests for {@link DateUtils}.
+ */
+public class DateUtilsTest {
+
+    @Test
+    public void testParseIso8601Date() {
+        // MARMOTTA-282
+        Date now = new Date(System.currentTimeMillis());
+        
+        Assert.assertEquals(now, DateUtils.parseDate(DateUtils.ISO8601FORMAT.format(now)));
+    }
+
+    @Test
+    public void testCalendarRoundTrip() {
+        Date now = new Date(System.currentTimeMillis());
+        Assert.assertEquals(now, DateUtils.getDate(DateUtils.getXMLCalendar(now)));
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/pom.xml
----------------------------------------------------------------------
diff --git a/commons/pom.xml b/commons/pom.xml
index 05b28bf..06ba1eb 100644
--- a/commons/pom.xml
+++ b/commons/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>
 
@@ -56,8 +56,6 @@
         <module>sesame-filter</module>
         <module>sesame-tools-rio-api</module>
         <module>sesame-tools-rio-ical</module>
-        <module>sesame-tools-rio-jsonld</module>
-        <module>sesame-tools-rio-rdfjson</module>
         <module>sesame-tools-rio-rss</module>
         <module>sesame-tools-rio-vcard</module>
         <module>sesame-tools-facading</module>

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-filter/pom.xml
----------------------------------------------------------------------
diff --git a/commons/sesame-filter/pom.xml b/commons/sesame-filter/pom.xml
index 10c433e..36be4ae 100644
--- a/commons/sesame-filter/pom.xml
+++ b/commons/sesame-filter/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>
 
@@ -94,8 +94,8 @@
             <scope>test</scope>
         </dependency>
         <dependency>
-            <groupId>commons-lang</groupId>
-            <artifactId>commons-lang</artifactId>
+            <groupId>org.apache.commons</groupId>
+            <artifactId>commons-lang3</artifactId>
             <scope>test</scope>
         </dependency>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-facading/pom.xml
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-facading/pom.xml b/commons/sesame-tools-facading/pom.xml
index 021b47a..9dfd8a5 100644
--- a/commons/sesame-tools-facading/pom.xml
+++ b/commons/sesame-tools-facading/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>
 
@@ -109,6 +109,17 @@
             <artifactId>slf4j-simple</artifactId>
             <scope>test</scope>
         </dependency>
+        <dependency>
+            <groupId>org.apache.marmotta</groupId>
+            <artifactId>kiwi-triplestore</artifactId>
+            <scope>test</scope>
+        </dependency>
+                <dependency>
+            <groupId>com.h2database</groupId>
+            <artifactId>h2</artifactId>
+            <scope>test</scope>
+        </dependency>
+        
     </dependencies>
 
 </project>

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-facading/src/main/java/org/apache/marmotta/commons/sesame/facading/impl/FacadingImpl.java
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-facading/src/main/java/org/apache/marmotta/commons/sesame/facading/impl/FacadingImpl.java b/commons/sesame-tools-facading/src/main/java/org/apache/marmotta/commons/sesame/facading/impl/FacadingImpl.java
index e10cd13..8cfba98 100644
--- a/commons/sesame-tools-facading/src/main/java/org/apache/marmotta/commons/sesame/facading/impl/FacadingImpl.java
+++ b/commons/sesame-tools-facading/src/main/java/org/apache/marmotta/commons/sesame/facading/impl/FacadingImpl.java
@@ -27,7 +27,6 @@ import org.apache.marmotta.commons.sesame.facading.annotations.RDFType;
 import org.apache.marmotta.commons.sesame.facading.api.Facading;
 import org.apache.marmotta.commons.sesame.facading.model.Facade;
 import org.apache.marmotta.commons.sesame.facading.util.FacadeUtils;
-import org.apache.marmotta.commons.sesame.model.Namespaces;
 import org.openrdf.model.Resource;
 import org.openrdf.model.URI;
 import org.openrdf.repository.RepositoryConnection;
@@ -38,18 +37,19 @@ import org.slf4j.LoggerFactory;
 
 /**
  * Offers methods for loading and proxying Facades. A {@link Facade} is an interface that defines a
- * Java object with convenient Java methods around a KiWiResource and makes it possible to use RDF
+ * Java object with convenient Java methods around a {@link Resource} and makes it possible to use RDF
  * properties like Java Bean properties from inside Java.
  * <p/>
- * The facading service is used by many other services, e.g. ContentItemService and TaggingService,
- * to provide access on a higher level than raw RDF resources.
- * 
- * 
+ * The facading service is to provide access on a higher level than raw RDF resources.
  * <p/>
- * User: Sebastian Schaffert
+ * @author Sebastian Schaffert <ss...@apache.org>
+ * @author Jakob Frank <ja...@apache.org>
  */
 public class FacadingImpl implements Facading {
 
+    private static final URI RDF_TYPE = org.openrdf.model.vocabulary.RDF.TYPE;
+
+
     private static Logger log = LoggerFactory.getLogger(FacadingImpl.class);
 
 
@@ -61,13 +61,13 @@ public class FacadingImpl implements Facading {
     }
 
     /**
-     * Create an instance of C that facades the resource given as argument using the {@link RDF} annotations provided
-     * to the getter or setter methods of Cto map to properties of the resource in the triple store.
+     * Create an instance of {@code C} that facades the resource given as argument using the {@link RDF} annotations provided
+     * to the getter or setter methods of {@code C} to map to properties of the resource in the triple store.
      *
      *
      * @param r    the resource to facade
      * @param type the facade type as a class
-     * @return
+     * @return a facading proxy of type {@code C}
      */
     @Override
     public <C extends Facade> C createFacade(Resource r, Class<C> type) {
@@ -76,57 +76,65 @@ public class FacadingImpl implements Facading {
         if(FacadeUtils.isFacadeAnnotationPresent(type, RDFContext.class)) {
             String s_context = FacadeUtils.getFacadeAnnotation(type,RDFContext.class).value();
             context = connection.getValueFactory().createURI(s_context);
+            log.debug("applying context {} for facade {} of {}", context, type.getSimpleName(), r);
         }
         return createFacade(r, type, context);
     }
 
     /**
-     * Create an instance of C that facades the resource given as argument using the {@link RDF} annotations provided
-     * to the getter or setter methods of Cto map to properties of the resource in the triple store.
+     * Create an instance of {@code C} that facades the resource given as argument using the {@link RDF} annotations provided
+     * to the getter or setter methods of {@code C} to map to properties of the resource in the triple store.
      * Additionally, it puts the facade into the given context, a present {@link RDFContext} annotation is ignored.
      * This is useful if the {@link RDFContext} annotation for Facades is not applicable,
      * e.g. if the context is dynamically generated.
-
-     *
      *
      * @param r       the resource to facade
      * @param type    the facade type as a class
      * @param context the context of the facade
-     * @return
+     * @return a facading proxy of type {@code C}
      */
     @Override
     public <C extends Facade> C createFacade(Resource r, Class<C> type, URI context) {
         if(r == null) {
+            log.trace("null facade for null resouce");
             return null;
-        } else if(type.isInterface()) {
+        } else 
             // if the interface is a Facade, we execute the query and then
             // create an invocation handler for each result to create proxy objects
-            if(FacadeUtils.isFacade(type)) {
+            if(type.isInterface() && FacadeUtils.isFacade(type)) {
                 try {
                     // support @RDFType annotation in facade
-                    if(FacadeUtils.isFacadeAnnotationPresent(type,RDFType.class)) {
-                        String[]        a_type = FacadeUtils.getFacadeAnnotation(type,RDFType.class).value();
+                    if(FacadeUtils.isFacadeAnnotationPresent(type, RDFType.class)) {
+                        if (!connection.isOpen()) { throw new IllegalStateException("the connection is already closed, cannot access triple-store."); }
+                        if (!connection.isActive()) { throw new IllegalStateException("no active transaction, cannot access triple-store."); }
+
+                        String[] a_type = FacadeUtils.getFacadeAnnotation(type, RDFType.class).value();
                         for(String s_type : a_type) {
-                            URI r_type = connection.getValueFactory().createURI(s_type);
-                            URI p_type = connection.getValueFactory().createURI(Namespaces.NS_RDF + "type");
-                            connection.add(r, p_type, r_type, context);
+                            final URI r_type = connection.getValueFactory().createURI(s_type);
+                            connection.add(r, RDF_TYPE, r_type, context);
+                            log.trace("added type {} to {} because of RDFType-Annotation", r_type, r);
+                            if(!connection.hasStatement(r, RDF_TYPE, r_type,true,context)) {
+                                log.error("error adding type for facade!");
+                            }
                         }
                     }
 
-                    FacadingInvocationHandler handler = new FacadingInvocationHandler(r,context,type,this,connection);
-                    return type.cast(Proxy.newProxyInstance(type.getClassLoader(),
-                            new Class[]{type},
-                            handler));
+                    FacadingInvocationHandler handler = new FacadingInvocationHandler(r, context, type, this, connection);
+                    if (log.isDebugEnabled()) {
+                        if (context != null) {
+                            log.debug("New Facading: {} delegating to {} (@{})", type.getSimpleName(), r, context);
+                        } else {
+                            log.debug("New Facading: {} delegating to {}", type.getSimpleName(), r);
+                        }
+                    }
+                    return type.cast(Proxy.newProxyInstance(type.getClassLoader(), new Class[]{type}, handler));
                 } catch (RepositoryException e) {
-                    log.error("error while accessing triple store",e);
+                    log.error("error while accessing triple store", e);
                     return null;
                 }
             } else {
                 throw new IllegalArgumentException("interface passed as parameter is not a Facade (" + type.getCanonicalName() + ")");
             }
-        } else {
-            throw new IllegalArgumentException("interface passed as parameter is not a Facade (" + type.getCanonicalName() + ")");
-        }
     }
 
     /**
@@ -145,6 +153,7 @@ public class FacadingImpl implements Facading {
         if(FacadeUtils.isFacadeAnnotationPresent(type, RDFContext.class)) {
             String s_context = FacadeUtils.getFacadeAnnotation(type,RDFContext.class).value();
             context = connection.getValueFactory().createURI(s_context);
+            log.debug("applying context {} for facade {} of {}", context, type.getSimpleName(), list);
         }
         return createFacade(list, type, context);
     }
@@ -161,11 +170,12 @@ public class FacadingImpl implements Facading {
      */
     @Override
     public <C extends Facade> Collection<C> createFacade(Collection<? extends Resource> list, Class<C> type, URI context) {
-        log.debug("createFacadeList: creating {} facade over {} content items",type.getName(),list.size());
+        log.trace("createFacadeList: creating {} facade over {} content items",type.getName(),list.size());
         LinkedList<C> result = new LinkedList<C>();
         if(type.isAnnotationPresent(RDFFilter.class)) {
             try {
-                final URI p_type = connection.getValueFactory().createURI(Namespaces.NS_RDF + "type");
+                if (!connection.isOpen()) { throw new IllegalStateException("the connection is already closed, cannot access triple-store."); }
+                if (!connection.isActive()) { throw new IllegalStateException("no active transaction, cannot access triple-store."); }
 
                 // if the RDFType annotation is present, filter out content items that are of the wrong type
                 LinkedList<URI> acceptable_types = new LinkedList<URI>();
@@ -181,9 +191,9 @@ public class FacadingImpl implements Facading {
                 for(Resource item : list) {
                     boolean accept = acceptable_types.size() == 0; // true for empty filter
                     for(URI rdf_type : acceptable_types) {
-                        if(connection.hasStatement(item, p_type, rdf_type, true)) {
+                        if(connection.hasStatement(item, RDF_TYPE, rdf_type, true)) {
                             accept = true;
-                            log.debug("accepting resource #0 because type matches (#1)",item.toString(),rdf_type.stringValue());
+                            log.trace("accepting resource {} because type matches ({})",item.toString(),rdf_type.stringValue());
                             break;
                         }
                     }
@@ -191,7 +201,7 @@ public class FacadingImpl implements Facading {
                         result.add(createFacade(item,type,context));
                     }
                 }
-                log.debug("createFacadeList: filtered #0 content items because they did not match the necessary criteria",list.size()-result.size());
+                log.debug("createFacadeList: filtered {} content items because they did not match the necessary criteria",list.size()-result.size());
             } catch (RepositoryException ex) {
                 log.error("error while accessing RDF repository",ex);
             }
@@ -248,18 +258,27 @@ public class FacadingImpl implements Facading {
     public <C extends Facade> boolean isFacadeable(Resource r, Class<C> type, URI context) {
         if (FacadeUtils.isFacadeAnnotationPresent(type, RDFType.class)) {
             try {
-                final URI p_type = connection.getValueFactory().createURI(Namespaces.NS_RDF + "type");
+                if (!connection.isOpen()) { throw new IllegalStateException("the connection is already closed, cannot access triple store."); }
+                if (!connection.isActive()) { throw new IllegalStateException("no active transaction, cannot access triple-store."); }
 
                 String[] rdfTypes = FacadeUtils.getFacadeAnnotation(type, RDFType.class).value();
                 boolean facadeable = true;
                 for (String s_type : rdfTypes) {
-                    facadeable &= connection.hasStatement(r, p_type, connection.getValueFactory().createURI(s_type), true, context);
+                    if(context != null) {
+                        facadeable &= connection.hasStatement(r, RDF_TYPE, connection.getValueFactory().createURI(s_type), true, context);
+                    } else {
+                        facadeable &= connection.hasStatement(r, RDF_TYPE, connection.getValueFactory().createURI(s_type), true);
+                    }
                 }
                 // also check for @RDFFilter
                 if (FacadeUtils.isFacadeAnnotationPresent(type, RDFFilter.class)) {
                     String[] filterTypes = FacadeUtils.getFacadeAnnotation(type, RDFFilter.class).value();
                     for (String s_type : filterTypes) {
-                        facadeable &= connection.hasStatement(r, p_type, connection.getValueFactory().createURI(s_type), true, context);
+                        if(context != null) {
+                            facadeable &= connection.hasStatement(r, RDF_TYPE, connection.getValueFactory().createURI(s_type), true, context);
+                        } else {
+                            facadeable &= connection.hasStatement(r, RDF_TYPE, connection.getValueFactory().createURI(s_type), true);
+                        }
                     }
                 }
                 return facadeable;

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-facading/src/main/java/org/apache/marmotta/commons/sesame/facading/impl/FacadingInvocationHandler.java
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-facading/src/main/java/org/apache/marmotta/commons/sesame/facading/impl/FacadingInvocationHandler.java b/commons/sesame-tools-facading/src/main/java/org/apache/marmotta/commons/sesame/facading/impl/FacadingInvocationHandler.java
index fb3fbcd..fb70791 100644
--- a/commons/sesame-tools-facading/src/main/java/org/apache/marmotta/commons/sesame/facading/impl/FacadingInvocationHandler.java
+++ b/commons/sesame-tools-facading/src/main/java/org/apache/marmotta/commons/sesame/facading/impl/FacadingInvocationHandler.java
@@ -49,7 +49,8 @@ import java.util.*;
  * implementation as parameter. Interfaces that make use of this invocation handler need to extend
  * the {@link Facade} interface.
  * 
- * @author Sebastian Schaffert
+ * @author Sebastian Schaffert <ss...@apache.org>
+ * @author Jakob Frank <ja...@apache.org>
  */
 class FacadingInvocationHandler implements InvocationHandler {
 
@@ -57,7 +58,7 @@ class FacadingInvocationHandler implements InvocationHandler {
         GET(false, 0, "get"),
         SET(true, 1, "set"),
         ADD(true, 1, "add"),
-        DEL(true, 0, "del", "delete", "remove"),
+        DEL(true, 0, "del", "delete", "remove", "rm"),
         HAS(false, 0, "has", "is");
 
 
@@ -129,7 +130,7 @@ class FacadingInvocationHandler implements InvocationHandler {
 
     private final HashMap<String, Object> fieldCache;
 
-    private Logger log = LoggerFactory.getLogger(FacadingInvocationHandler.class);
+    private final Logger log;
 
     /**
      * Indicates if the cache is used, by default is false.
@@ -137,6 +138,7 @@ class FacadingInvocationHandler implements InvocationHandler {
     private boolean useCache;
 
     public FacadingInvocationHandler(Resource item, URI context, Class<? extends Facade> facade, Facading facadingService, RepositoryConnection connection) {
+        this.log = LoggerFactory.getLogger(facade.getName() + "!" + this.getClass().getSimpleName() + "@" + item.stringValue());
         this.delegate = item;
         this.facadingService = facadingService;
         this.declaredFacade = facade;
@@ -224,7 +226,8 @@ class FacadingInvocationHandler implements InvocationHandler {
      */
     @Override
     public Object invoke(Object proxy, Method method, Object[] args) throws InstantiationException, IllegalAccessException, RepositoryException {
-        if (!connection.isOpen()) { throw new IllegalAccessException("the connection is already closed, cannot access proxy methods"); }
+        if (!connection.isOpen()) { throw new IllegalAccessException("the connection is already closed, cannot access proxy methods."); }
+        if (!connection.isActive()) { throw new IllegalAccessException("no active transaction, cannot access triple-store."); }
 
         // handle default methods:
         if (FacadingInvocationHelper.checkMethodSig(method, "hashCode")) {
@@ -470,13 +473,16 @@ class FacadingInvocationHandler implements InvocationHandler {
                 connection.remove((Resource) null, prop, delegate, context);
             } else if (!predicate.isInverse() && loc != null) {
                 final RepositoryResult<Statement> statements = connection.getStatements(delegate, prop, null, false, context);
-                while (statements.hasNext()) {
-                    final Statement s = statements.next();
-                    if (FacadingInvocationHelper.checkLocale(loc, s.getObject())) {
-                        connection.remove(s);
+                try {
+                    while (statements.hasNext()) {
+                        final Statement s = statements.next();
+                        if (FacadingInvocationHelper.checkLocale(loc, s.getObject())) {
+                            connection.remove(s);
+                        }
                     }
+                } finally {
+                    statements.close();
                 }
-                statements.close();
             } else if (predicate.isInverse() && loc != null) { throw new IllegalArgumentException("A combination of @RDFInverse and a Literal is not possible");
             }
         }
@@ -612,7 +618,7 @@ class FacadingInvocationHandler implements InvocationHandler {
                     final Collection<Object> result = FacadingInvocationHelper.createCollection(collectionType, Collections.<Object> emptyList());
                     final URI property = connection.getValueFactory().createURI(rdf_property);
 
-                    for (final String s : getProperties(entity, property, null, null)) {
+                    for (final String s : getProperties(entity, property, loc, context)) {
                         result.add(FacadeUtils.transformToBaseType(s, tCls));
                     }
 
@@ -643,7 +649,6 @@ class FacadingInvocationHandler implements InvocationHandler {
         URI property = connection.getValueFactory().createURI(rdf_property);
 
         RepositoryResult<Statement> triples = connection.getStatements(entity, property, null, false);
-
         try {
             if (triples.hasNext()) {
                 Statement triple = triples.next();
@@ -676,7 +681,6 @@ class FacadingInvocationHandler implements InvocationHandler {
         URI property = connection.getValueFactory().createURI(rdf_property);
 
         RepositoryResult<Statement> triples = connection.getStatements(null, property, entity, false);
-
         try {
             if (triples.hasNext()) {
                 Statement triple = triples.next();
@@ -705,19 +709,20 @@ class FacadingInvocationHandler implements InvocationHandler {
      * 
      */
     private <C> Set<C> queryOutgoingAll(Resource entity, String rdf_property, Class<C> returnType) throws RepositoryException {
-        URI property = connection.getValueFactory().createURI(rdf_property);
-
-        RepositoryResult<Statement> triples = connection.getStatements(entity, property, null, false);
-
-        Set<C> dupSet = new LinkedHashSet<C>();
+        final URI property = connection.getValueFactory().createURI(rdf_property);
 
-        while (triples.hasNext()) {
-            Statement triple = triples.next();
-            if (returnType.isInstance(triple.getObject())) {
-                dupSet.add(returnType.cast(triple.getObject()));
+        final Set<C> dupSet = new LinkedHashSet<C>();
+        final RepositoryResult<Statement> triples = connection.getStatements(entity, property, null, false);
+        try {
+            while (triples.hasNext()) {
+                Statement triple = triples.next();
+                if (returnType.isInstance(triple.getObject())) {
+                    dupSet.add(returnType.cast(triple.getObject()));
+                }
             }
+        } finally {
+            triples.close();
         }
-        triples.close();
 
         return dupSet;
 
@@ -730,20 +735,20 @@ class FacadingInvocationHandler implements InvocationHandler {
      * 
      */
     private <C> Set<C> queryIncomingAll(Resource entity, String rdf_property, Class<C> returnType) throws RepositoryException {
+        final URI property = connection.getValueFactory().createURI(rdf_property);
 
-        URI property = connection.getValueFactory().createURI(rdf_property);
-
-        RepositoryResult<Statement> triples = connection.getStatements(null, property, entity, false);
-
-        Set<C> dupSet = new LinkedHashSet<C>();
-
-        while (triples.hasNext()) {
-            Statement triple = triples.next();
-            if (returnType.isInstance(triple.getSubject())) {
-                dupSet.add(returnType.cast(triple.getSubject()));
+        final Set<C> dupSet = new LinkedHashSet<C>();
+        final RepositoryResult<Statement> triples = connection.getStatements(null, property, entity, false);
+        try {
+            while (triples.hasNext()) {
+                Statement triple = triples.next();
+                if (returnType.isInstance(triple.getSubject())) {
+                    dupSet.add(returnType.cast(triple.getSubject()));
+                }
             }
+        } finally {
+            triples.close();
         }
-        triples.close();
 
         return dupSet;
     }
@@ -769,23 +774,25 @@ class FacadingInvocationHandler implements InvocationHandler {
     }
 
     private Set<String> getProperties(Resource entity, URI property, Locale loc, URI context) throws RepositoryException {
-        String lang = loc == null ? null : loc.getLanguage().toLowerCase();
-
-        RepositoryResult<Statement> candidates = connection.getStatements(entity, property, null, false, context);
+        final String lang = loc == null ? null : loc.getLanguage().toLowerCase();
 
-        Set<String> values = new HashSet<String>();
-        while (candidates.hasNext()) {
-            Statement triple = candidates.next();
+        final Set<String> values = new HashSet<String>();
+        final RepositoryResult<Statement> candidates = connection.getStatements(entity, property, null, false, context);
+        try {
+            while (candidates.hasNext()) {
+                Statement triple = candidates.next();
 
-            if (triple.getObject() instanceof Literal) {
-                Literal l = (Literal) triple.getObject();
+                if (triple.getObject() instanceof Literal) {
+                    Literal l = (Literal) triple.getObject();
 
-                if (lang == null || lang.equals(l.getLanguage())) {
-                    values.add(l.stringValue());
+                    if (lang == null || lang.equals(l.getLanguage())) {
+                        values.add(l.stringValue());
+                    }
                 }
             }
+        } finally {
+            candidates.close();
         }
-        candidates.close();
 
         return values;
     }

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-facading/src/main/java/org/apache/marmotta/commons/sesame/facading/util/FacadeUtils.java
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-facading/src/main/java/org/apache/marmotta/commons/sesame/facading/util/FacadeUtils.java b/commons/sesame-tools-facading/src/main/java/org/apache/marmotta/commons/sesame/facading/util/FacadeUtils.java
index f5bf702..3c29da5 100644
--- a/commons/sesame-tools-facading/src/main/java/org/apache/marmotta/commons/sesame/facading/util/FacadeUtils.java
+++ b/commons/sesame-tools-facading/src/main/java/org/apache/marmotta/commons/sesame/facading/util/FacadeUtils.java
@@ -17,6 +17,7 @@
 package org.apache.marmotta.commons.sesame.facading.util;
 
 
+import org.apache.commons.lang3.LocaleUtils;
 import org.apache.marmotta.commons.sesame.facading.model.Facade;
 import org.apache.marmotta.commons.util.DateUtils;
 import org.openrdf.model.Resource;
@@ -295,40 +296,50 @@ public class FacadeUtils {
      * @return
      * @throws IllegalArgumentException
      */
+    @SuppressWarnings("unchecked")
     public static <T> T transformToBaseType(String value, Class<T> returnType) throws IllegalArgumentException {
         // transformation to appropriate primitive type
+        /*
+         * README: the "dirty" cast: "(T) x" instead of "returnType.cast(x)" is required since
+         * .cast does not work for primitive types (int, double, float, etc...).
+         * Somehow it results in a ClassCastException
+         */
         if(Integer.class.equals(returnType) || int.class.equals(returnType)) {
             if(value == null) {
-                return returnType.cast(0);
+                return (T)(Integer)(0);
             }
-            return returnType.cast(Integer.parseInt(value));
+            return (T)(Integer.decode(value));
         } else if(Long.class.equals(returnType) || long.class.equals(returnType)) {
             if(value == null) {
-                return returnType.cast(0L);
+                return (T)(Long)(0L);
             }
-            return returnType.cast(Long.parseLong(value));
+            return (T)(Long.decode(value));
         } else if(Double.class.equals(returnType) || double.class.equals(returnType)) {
             if(value == null) {
-                return returnType.cast(0.0);
+                return (T)(Double)(0.0);
             }
-            return returnType.cast(Double.parseDouble(value));
+            return (T)(Double.valueOf(value));
         } else if(Float.class.equals(returnType) || float.class.equals(returnType)) {
             if(value == null) {
-                return returnType.cast(0.0F);
+                return (T)(Float)(0.0F);
             }
-            return returnType.cast(Float.parseFloat(value));
+            return (T)(Float.valueOf(value));
         } else if(Byte.class.equals(returnType) || byte.class.equals(returnType)) {
             if(value == null) {
-                return returnType.cast((byte) 0);
+                return (T)(Byte)((byte) 0);
             }
-            return returnType.cast(Byte.parseByte(value));
+            return (T)(Byte.decode(value));
         } else if(Boolean.class.equals(returnType) || boolean.class.equals(returnType)) {
-            return returnType.cast(Boolean.parseBoolean(value));
+            return (T)(Boolean.valueOf(value));
         } else if(Character.class.equals(returnType) || char.class.equals(returnType)) {
             if(value == null) {
-                return null;
+                if (Character.class.equals(returnType)){
+                    return null;
+                } else {
+                    return (T) new Character((char) 0);
+                }
             } else if(value.length() > 0) {
-                return returnType.cast(value.charAt(0));
+                return (T)(Character)(value.charAt(0));
             } else {
                 return null;
             }
@@ -336,7 +347,7 @@ public class FacadeUtils {
             if(value == null) {
                 return null;
             } else {
-                return returnType.cast(new Locale(value));
+                return returnType.cast(LocaleUtils.toLocale(value));
             }
         } else if (Date.class.equals(returnType)) {
             if(value == null) {


[053/100] [abbrv] git commit: MARMOTTA-438: clanning

Posted by wi...@apache.org.
MARMOTTA-438: clanning


Project: http://git-wip-us.apache.org/repos/asf/marmotta/repo
Commit: http://git-wip-us.apache.org/repos/asf/marmotta/commit/00d37de4
Tree: http://git-wip-us.apache.org/repos/asf/marmotta/tree/00d37de4
Diff: http://git-wip-us.apache.org/repos/asf/marmotta/diff/00d37de4

Branch: refs/heads/ldp
Commit: 00d37de4c66c1fc014363c40088fd7de418c2241
Parents: e1f88ee
Author: Sergio Fernández <wi...@apache.org>
Authored: Mon Apr 7 09:48:53 2014 +0200
Committer: Sergio Fernández <wi...@apache.org>
Committed: Mon Apr 7 09:48:53 2014 +0200

----------------------------------------------------------------------
 .../marmotta/platform/ldp/testsuite/LdpManifestTest.java    | 2 +-
 .../marmotta/platform/ldp/testsuite/LdpTestCases.java       | 9 +--------
 .../marmotta/platform/ldp/testsuite/LdpTestCasesRunner.java | 3 +--
 .../marmotta/platform/ldp/testsuite/LdpTestCasesUtils.java  | 2 +-
 4 files changed, 4 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/marmotta/blob/00d37de4/platform/marmotta-ldp/src/test/java/org/apache/marmotta/platform/ldp/testsuite/LdpManifestTest.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-ldp/src/test/java/org/apache/marmotta/platform/ldp/testsuite/LdpManifestTest.java b/platform/marmotta-ldp/src/test/java/org/apache/marmotta/platform/ldp/testsuite/LdpManifestTest.java
index 2c9a4e6..b9102a4 100644
--- a/platform/marmotta-ldp/src/test/java/org/apache/marmotta/platform/ldp/testsuite/LdpManifestTest.java
+++ b/platform/marmotta-ldp/src/test/java/org/apache/marmotta/platform/ldp/testsuite/LdpManifestTest.java
@@ -40,7 +40,7 @@ public class LdpManifestTest {
 
     @Before
     public final void before() throws RepositoryException, RDFParseException, IOException {
-        String path = LdpTestCases.FILES_PATH + LdpTestCases.MANIFEST_CACHE + ".ttl";
+        String path = LdpTestCases.ROOT_PATH + LdpTestCases.MANIFEST_CACHE + ".ttl";
         repo = LdpTestCasesUtils.loadData(path, RDFFormat.TURTLE);
         Assume.assumeNotNull(repo);
     }

http://git-wip-us.apache.org/repos/asf/marmotta/blob/00d37de4/platform/marmotta-ldp/src/test/java/org/apache/marmotta/platform/ldp/testsuite/LdpTestCases.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-ldp/src/test/java/org/apache/marmotta/platform/ldp/testsuite/LdpTestCases.java b/platform/marmotta-ldp/src/test/java/org/apache/marmotta/platform/ldp/testsuite/LdpTestCases.java
index 6b6b939..ddffa8f 100644
--- a/platform/marmotta-ldp/src/test/java/org/apache/marmotta/platform/ldp/testsuite/LdpTestCases.java
+++ b/platform/marmotta-ldp/src/test/java/org/apache/marmotta/platform/ldp/testsuite/LdpTestCases.java
@@ -18,7 +18,6 @@
 package org.apache.marmotta.platform.ldp.testsuite;
 
 import com.jayway.restassured.RestAssured;
-import org.apache.commons.io.IOUtils;
 import org.apache.marmotta.platform.core.exception.io.MarmottaImportException;
 import org.apache.marmotta.platform.core.test.base.JettyMarmotta;
 import org.apache.marmotta.platform.ldp.webservices.LdpWebService;
@@ -41,7 +40,7 @@ import java.net.URISyntaxException;
 @RunWith(LdpTestCasesRunner.class)
 public class LdpTestCases {
 
-    public final static String FILES_PATH = "/testsuite/";
+    public final static String ROOT_PATH = "/testsuite/";
 
     public final static String BASE = "http://www.w3.org/TR/ldp-test-cases/";
 
@@ -53,8 +52,6 @@ public class LdpTestCases {
 
     private static String baseUrl;
 
-    private static String testResourceTTL;
-
     @BeforeClass
     public static void setup() throws MarmottaImportException, URISyntaxException, IOException {
         marmotta = new JettyMarmotta("/marmotta", LdpWebService.class);
@@ -62,9 +59,6 @@ public class LdpTestCases {
         RestAssured.port = marmotta.getPort();
         RestAssured.basePath = marmotta.getContext();
         baseUrl = UriBuilder.fromUri("http://localhost").port(marmotta.getPort()).path(marmotta.getContext()).build().toString();
-
-        //initialization
-        testResourceTTL = IOUtils.toString(LdpTestCases.class.getResourceAsStream("/test.ttl"), "utf8");
     }
 
     @Before
@@ -81,7 +75,6 @@ public class LdpTestCases {
     public static void shutdown() {
         //marmotta.shutdown();
         marmotta = null;
-        testResourceTTL = null;
     }
 
 }

http://git-wip-us.apache.org/repos/asf/marmotta/blob/00d37de4/platform/marmotta-ldp/src/test/java/org/apache/marmotta/platform/ldp/testsuite/LdpTestCasesRunner.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-ldp/src/test/java/org/apache/marmotta/platform/ldp/testsuite/LdpTestCasesRunner.java b/platform/marmotta-ldp/src/test/java/org/apache/marmotta/platform/ldp/testsuite/LdpTestCasesRunner.java
index 16f985b..31fee36 100644
--- a/platform/marmotta-ldp/src/test/java/org/apache/marmotta/platform/ldp/testsuite/LdpTestCasesRunner.java
+++ b/platform/marmotta-ldp/src/test/java/org/apache/marmotta/platform/ldp/testsuite/LdpTestCasesRunner.java
@@ -31,7 +31,6 @@ import org.slf4j.LoggerFactory;
 
 import java.io.IOException;
 import java.util.ArrayList;
-import java.util.Collections;
 import java.util.List;
 
 /**
@@ -50,7 +49,7 @@ public class LdpTestCasesRunner extends Suite {
     private static List<Runner> buildTestCasesFromManifest() {
         List<Runner> runners = new ArrayList<>();
 
-        String path = LdpTestCases.FILES_PATH + LdpTestCases.MANIFEST_CACHE + ".ttl";
+        String path = LdpTestCases.ROOT_PATH + LdpTestCases.MANIFEST_CACHE + ".ttl";
         try {
             Repository repo = LdpTestCasesUtils.loadData(path, RDFFormat.TURTLE);
             RepositoryConnection conn = repo.getConnection();

http://git-wip-us.apache.org/repos/asf/marmotta/blob/00d37de4/platform/marmotta-ldp/src/test/java/org/apache/marmotta/platform/ldp/testsuite/LdpTestCasesUtils.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-ldp/src/test/java/org/apache/marmotta/platform/ldp/testsuite/LdpTestCasesUtils.java b/platform/marmotta-ldp/src/test/java/org/apache/marmotta/platform/ldp/testsuite/LdpTestCasesUtils.java
index 97b7064..9270da7 100644
--- a/platform/marmotta-ldp/src/test/java/org/apache/marmotta/platform/ldp/testsuite/LdpTestCasesUtils.java
+++ b/platform/marmotta-ldp/src/test/java/org/apache/marmotta/platform/ldp/testsuite/LdpTestCasesUtils.java
@@ -83,7 +83,7 @@ public class LdpTestCasesUtils {
      * @see <a href="https://dvcs.w3.org/hg/ldpwg/raw-file/default/Test%20Cases/LDP%20Test%20Cases.html#h3_namespaces-used">Sec. 4.1 Namespaces used</a>
      */
     public static Map<String,String> getNormativeNamespaces() throws IOException {
-        String path = LdpTestCases.FILES_PATH + "namespaces.properties";
+        String path = LdpTestCases.ROOT_PATH + "namespaces.properties";
         Map<String,String> prefixes = new HashMap<>();
         Properties properties = new Properties();
         properties.load(LdpTestCasesUtils.class.getResourceAsStream(path));


[068/100] [abbrv] git commit: fixed dependency versions the archetypes

Posted by wi...@apache.org.
fixed dependency versions the archetypes


Project: http://git-wip-us.apache.org/repos/asf/marmotta/repo
Commit: http://git-wip-us.apache.org/repos/asf/marmotta/commit/48607580
Tree: http://git-wip-us.apache.org/repos/asf/marmotta/tree/48607580
Diff: http://git-wip-us.apache.org/repos/asf/marmotta/diff/48607580

Branch: refs/heads/ldp
Commit: 4860758068cd16f8fb453dd354111b2993c7e63a
Parents: 4483644
Author: Jakob Frank <ja...@apache.org>
Authored: Tue Apr 8 16:47:08 2014 +0200
Committer: Jakob Frank <ja...@apache.org>
Committed: Tue Apr 8 17:16:21 2014 +0200

----------------------------------------------------------------------
 .../marmotta-archetype-module/pom.xml           |  2 +-
 .../marmotta-archetype-webapp/pom.xml           | 22 ++++++++++----------
 2 files changed, 12 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/marmotta/blob/48607580/build/archetypes/marmotta-archetype-module/pom.xml
----------------------------------------------------------------------
diff --git a/build/archetypes/marmotta-archetype-module/pom.xml b/build/archetypes/marmotta-archetype-module/pom.xml
index f5301aa..94c15d1 100644
--- a/build/archetypes/marmotta-archetype-module/pom.xml
+++ b/build/archetypes/marmotta-archetype-module/pom.xml
@@ -124,7 +124,7 @@
         <dependency>
             <groupId>org.apache.marmotta</groupId>
             <artifactId>marmotta-core</artifactId>
-            <version>${marmottaVersion}</version>
+            <version>${project.version}</version>
             <scope>provided</scope>
         </dependency>
     </dependencies>

http://git-wip-us.apache.org/repos/asf/marmotta/blob/48607580/build/archetypes/marmotta-archetype-webapp/pom.xml
----------------------------------------------------------------------
diff --git a/build/archetypes/marmotta-archetype-webapp/pom.xml b/build/archetypes/marmotta-archetype-webapp/pom.xml
index 14aff1b..3a971a2 100644
--- a/build/archetypes/marmotta-archetype-webapp/pom.xml
+++ b/build/archetypes/marmotta-archetype-webapp/pom.xml
@@ -137,67 +137,67 @@
         <dependency>
             <groupId>org.apache.marmotta</groupId>
             <artifactId>marmotta-core</artifactId>
-            <version>${marmottaVersion}</version>
+            <version>${project.version}</version>
             <scope>provided</scope>
         </dependency>
         <dependency>
             <groupId>org.apache.marmotta</groupId>
             <artifactId>marmotta-sparql</artifactId>
-            <version>${marmottaVersion}</version>
+            <version>${project.version}</version>
             <scope>provided</scope>
         </dependency>
         <dependency>
             <groupId>org.apache.marmotta</groupId>
             <artifactId>marmotta-ldpath</artifactId>
-            <version>${marmottaVersion}</version>
+            <version>${project.version}</version>
             <scope>provided</scope>
         </dependency>
         <dependency>
             <groupId>org.apache.marmotta</groupId>
             <artifactId>marmotta-ldcache-common</artifactId>
-            <version>${marmottaVersion}</version>
+            <version>${project.version}</version>
             <scope>provided</scope>
         </dependency>
         <dependency>
             <groupId>org.apache.marmotta</groupId>
             <artifactId>marmotta-versioning-common</artifactId>
-            <version>${marmottaVersion}</version>
+            <version>${project.version}</version>
             <scope>provided</scope>
         </dependency>
         <dependency>
             <groupId>org.apache.marmotta</groupId>
             <artifactId>marmotta-user</artifactId>
-            <version>${marmottaVersion}</version>
+            <version>${project.version}</version>
             <scope>provided</scope>
         </dependency>
         <dependency>
             <groupId>org.apache.marmotta</groupId>
             <artifactId>marmotta-security</artifactId>
-            <version>${marmottaVersion}</version>
+            <version>${project.version}</version>
             <scope>provided</scope>
         </dependency>
         <dependency>
             <groupId>org.apache.marmotta</groupId>
             <artifactId>marmotta-backend-kiwi</artifactId>
-            <version>${marmottaVersion}</version>
+            <version>${project.version}</version>
             <scope>provided</scope>
         </dependency>
         <dependency>
             <groupId>org.apache.marmotta</groupId>
             <artifactId>marmotta-ldcache-kiwi</artifactId>
-            <version>${marmottaVersion}</version>
+            <version>${project.version}</version>
             <scope>provided</scope>
         </dependency>
         <dependency>
             <groupId>org.apache.marmotta</groupId>
             <artifactId>marmotta-reasoner-kiwi</artifactId>
-            <version>${marmottaVersion}</version>
+            <version>${project.version}</version>
             <scope>provided</scope>
         </dependency>
         <dependency>
             <groupId>org.apache.marmotta</groupId>
             <artifactId>marmotta-versioning-kiwi</artifactId>
-            <version>${marmottaVersion}</version>
+            <version>${project.version}</version>
             <scope>provided</scope>
         </dependency>
     </dependencies>


[086/100] [abbrv] git commit: moved to commons the quick (and dirty) trick to encode latin1 string from freebase

Posted by wi...@apache.org.
moved to commons the quick (and dirty) trick to encode latin1 string from freebase


Project: http://git-wip-us.apache.org/repos/asf/marmotta/repo
Commit: http://git-wip-us.apache.org/repos/asf/marmotta/commit/b00e935d
Tree: http://git-wip-us.apache.org/repos/asf/marmotta/tree/b00e935d
Diff: http://git-wip-us.apache.org/repos/asf/marmotta/diff/b00e935d

Branch: refs/heads/ldp
Commit: b00e935d0fce5944367ed6f41f8ae108e008edf3
Parents: c5f0d76
Author: Sergio Fernández <wi...@apache.org>
Authored: Thu Apr 24 20:16:07 2014 +0200
Committer: Sergio Fernández <wi...@apache.org>
Committed: Thu Apr 24 20:16:07 2014 +0200

----------------------------------------------------------------------
 .../marmotta/commons/util/StringUtils.java      | 40 ++++++++++++++++++++
 .../ldclient/ldclient-provider-freebase/pom.xml |  4 ++
 .../provider/freebase/FreebaseProvider.java     | 20 ++--------
 3 files changed, 47 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/marmotta/blob/b00e935d/commons/marmotta-commons/src/main/java/org/apache/marmotta/commons/util/StringUtils.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-commons/src/main/java/org/apache/marmotta/commons/util/StringUtils.java b/commons/marmotta-commons/src/main/java/org/apache/marmotta/commons/util/StringUtils.java
new file mode 100644
index 0000000..3e597c4
--- /dev/null
+++ b/commons/marmotta-commons/src/main/java/org/apache/marmotta/commons/util/StringUtils.java
@@ -0,0 +1,40 @@
+package org.apache.marmotta.commons.util;
+
+/**
+ * Some util string functions
+ *
+ * @author Sergio Fernández
+ */
+public class StringUtils {
+
+    private StringUtils() {
+
+    }
+
+    public static String fixLatin1(String str) {
+        //TODO: find a way to re-code properly the literal
+        //http://www.ic.unicamp.br/~stolfi/EXPORT/www/ISO-8859-1-Encoding.html
+        str = str.replaceAll("\\\\xe1", "á");
+        str = str.replaceAll("\\\\xe2", "â");
+        str = str.replaceAll("\\\\xe3", "ã");
+        str = str.replaceAll("\\\\xe4", "ä");
+        str = str.replaceAll("\\\\xe7", "ç");
+        str = str.replaceAll("\\\\xe8", "è");
+        str = str.replaceAll("\\\\xe9", "é");
+        str = str.replaceAll("\\\\xea", "ê");
+        str = str.replaceAll("\\\\xeb", "ë");
+        str = str.replaceAll("\\\\xed", "í");
+        str = str.replaceAll("\\\\xee", "î");
+        str = str.replaceAll("\\\\xef", "ï");
+        str = str.replaceAll("\\\\xf3", "ó");
+        str = str.replaceAll("\\\\xf4", "ô");
+        str = str.replaceAll("\\\\xf6", "ö");
+        str = str.replaceAll("\\\\xf9", "ù");
+        str = str.replaceAll("\\\\xfb", "û");
+        str = str.replaceAll("\\\\xfc", "ü");
+        str = str.replaceAll("\\\\xfa", "ú");
+        str = str.replaceAll("\\\\x", ""); //FIXME: wrong, wrong, wrong!
+        return str;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/b00e935d/libraries/ldclient/ldclient-provider-freebase/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldclient/ldclient-provider-freebase/pom.xml b/libraries/ldclient/ldclient-provider-freebase/pom.xml
index 39f9848..5cba92c 100644
--- a/libraries/ldclient/ldclient-provider-freebase/pom.xml
+++ b/libraries/ldclient/ldclient-provider-freebase/pom.xml
@@ -42,6 +42,10 @@
             <groupId>org.openrdf.sesame</groupId>
             <artifactId>sesame-rio-turtle</artifactId>
         </dependency>
+        <dependency>
+            <groupId>org.apache.marmotta</groupId>
+            <artifactId>marmotta-commons</artifactId>
+        </dependency>
 
         <dependency>
             <groupId>junit</groupId>

http://git-wip-us.apache.org/repos/asf/marmotta/blob/b00e935d/libraries/ldclient/ldclient-provider-freebase/src/main/java/org/apache/marmotta/ldclient/provider/freebase/FreebaseProvider.java
----------------------------------------------------------------------
diff --git a/libraries/ldclient/ldclient-provider-freebase/src/main/java/org/apache/marmotta/ldclient/provider/freebase/FreebaseProvider.java b/libraries/ldclient/ldclient-provider-freebase/src/main/java/org/apache/marmotta/ldclient/provider/freebase/FreebaseProvider.java
index ef3652b..fe39296 100644
--- a/libraries/ldclient/ldclient-provider-freebase/src/main/java/org/apache/marmotta/ldclient/provider/freebase/FreebaseProvider.java
+++ b/libraries/ldclient/ldclient-provider-freebase/src/main/java/org/apache/marmotta/ldclient/provider/freebase/FreebaseProvider.java
@@ -183,7 +183,7 @@ public class FreebaseProvider extends AbstractHttpProvider {
                             } else if (o.contains("\\u")) {
                                 o = StringEscapeUtils.unescapeJava(o);
                             } else if (o.contains("\\x")) {
-                                o = fixLatin1(o);
+                                o = org.apache.marmotta.commons.util.StringUtils.fixLatin1(o);
                             }
                             sb.append("    " + p + "    " + o + tripleMatcher.group(3));
                             sb.append("\n");
@@ -213,7 +213,7 @@ public class FreebaseProvider extends AbstractHttpProvider {
 
         //wrong charset
         if (literal.contains("\\x")) {
-            literal = fixLatin1(literal);
+            literal = org.apache.marmotta.commons.util.StringUtils.fixLatin1(literal);
         }
 
         //wrong unicode encoding
@@ -224,18 +224,4 @@ public class FreebaseProvider extends AbstractHttpProvider {
         return literal;
     }
 
-    private String fixLatin1(String str) {
-        //TODO: find a way to re-code properly the literal
-        //http://www.ic.unicamp.br/~stolfi/EXPORT/www/ISO-8859-1-Encoding.html
-        str = str.replaceAll("\\\\xe1", "á");
-        str = str.replaceAll("\\\\xe3", "ã");
-        str = str.replaceAll("\\\\xe7", "ç");
-        str = str.replaceAll("\\\\xe9", "é");
-        str = str.replaceAll("\\\\xed", "í");
-        str = str.replaceAll("\\\\xf3", "ó");
-        str = str.replaceAll("\\\\xfa", "ú");
-        str = str.replaceAll("\\\\x", ""); //FIXME: wrong, wrong, wrong!
-        return str;
-    }
-
-}
\ No newline at end of file
+}


[025/100] [abbrv] [partial] Reverting the erroneous merge by Sebastian according to the instructions in INFRA-6876

Posted by wi...@apache.org.
http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/extras/webjars/snorql/src/main/resources/snorql.js
----------------------------------------------------------------------
diff --git a/extras/webjars/snorql/src/main/resources/snorql.js b/extras/webjars/snorql/src/main/resources/snorql.js
new file mode 100755
index 0000000..b1346de
--- /dev/null
+++ b/extras/webjars/snorql/src/main/resources/snorql.js
@@ -0,0 +1,596 @@
+/*
+ * 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.
+ */
+var snorql = new Snorql();
+
+String.prototype.trim = function () {
+    return this.replace(/^\s*/, "").replace(/\s*$/, "");
+}
+
+String.prototype.startsWith = function(str) {
+	return (this.match("^"+str) == str);
+}
+
+function Snorql() {
+    // modify this._endpoint to point to your SPARQL endpoint
+    this._endpoint = _BASIC_URL + 'sparql/select';
+    // modify these to your liking
+    this._poweredByLink = 'http://marmotta.incubator.apache.org';
+    this._poweredByLabel = 'Snorql & Apache Marmotta';
+    this._enableNamedGraphs = false;
+
+    this._browserBase = null;
+    this._namespaces = {};
+    this._graph = null;
+    this._xsltDOM = null;
+
+    this.start = function() {
+        // TODO: Extract a QueryType class
+        this.setBrowserBase(document.location.href.replace(/\?.*/, ''));
+        this._displayEndpointURL();
+        //this._displayPoweredBy();
+        this.updateOutputMode();
+        var match = document.location.href.match(/\?(.*)/);
+        var queryString = match ? match[1] : '';
+        if (!queryString) {
+            document.getElementById('querytext').value = 'SELECT * WHERE {\n  ?s ?p ?o\n}\nLIMIT 10';
+            this._updateGraph(null, false);
+            return;
+        }
+        
+        var graph = queryString.match(/graph=([^&]*)/);
+        graph = graph ? decodeURIComponent(graph[1]) : null;
+        this._updateGraph(graph, false);
+        
+        var browse = queryString.match(/browse=([^&]*)/);
+        if (browse) {
+	        if (browse[1] == 'classes') {
+	            var resultTitle = 'List of all classes:';
+	            var query = 'SELECT DISTINCT ?class\n' +
+	                    'WHERE { [] a ?class }\n' +
+	                    'ORDER BY ?class';
+	        } else if (browse[1] == 'properties') {
+	            var resultTitle = 'List of all properties:';
+	            var query = 'SELECT DISTINCT ?property\n' +
+	                    'WHERE { [] ?property [] }\n' +
+	                    'ORDER BY ?property';
+	        } else if (browse[1] == 'graphs') {
+	            var resultTitle = 'List of all named graphs:';
+	            var query = 'SELECT DISTINCT ?namedgraph ?label\n' +
+	                    'WHERE {\n' +
+	                    '  GRAPH ?namedgraph { ?s ?p ?o }\n' +
+	                    '  OPTIONAL { ?namedgraph rdfs:label ?label }\n' +
+	                    '}\n' +
+	                    'ORDER BY ?namedgraph';
+	        }
+        }
+        
+        var properties = queryString.match(/property=([^&]*)/);
+        if (properties) {
+            var resultTitle = 'All uses of property ' + decodeURIComponent(properties[1]) + ':';
+            var query = 'SELECT DISTINCT ?resource ?value\n' +
+                    'WHERE { ?resource <' + decodeURIComponent(properties[1]) + '> ?value }\n' +
+                    'ORDER BY ?resource ?value';
+        }
+        
+        var classes = queryString.match(/class=([^&]*)/);
+        if (classes) {
+            var resultTitle = 'All instances of class ' + decodeURIComponent(classes[1]) + ':';
+            var query = 'SELECT DISTINCT ?instance\n' +
+                    'WHERE { ?instance a <' + decodeURIComponent(classes[1]) + '> }\n' +
+                    'ORDER BY ?instance';
+        }
+        
+        var describe = queryString.match(/describe=([^&]*)/);
+        if (describe) {
+            var resultTitle = 'Description of ' + decodeURIComponent(describe[1]) + ':';
+            var query = 'SELECT DISTINCT ?property ?hasValue ?isValueOf\n' +
+                    'WHERE {\n' +
+                    '  { <' + decodeURIComponent(describe[1]) + '> ?property ?hasValue }\n' +
+                    '  UNION\n' +
+                    '  { ?isValueOf ?property <' + decodeURIComponent(describe[1]) + '> }\n' +
+                    '}\n' +
+                    'ORDER BY (!BOUND(?hasValue)) ?property ?hasValue ?isValueOf';
+        }
+        
+        var queryMatch = queryString.match(/query=([^&]*)/);
+        if (queryMatch) {
+        	var resultTitle = 'SPARQL results:';
+        	var query = this._betterUnescape(queryMatch[1]);
+        
+        }
+        
+        var prefixes = this._getPrefixes();
+        if (queryString.match(/prefixes=/)) {
+        	prefixes = this._betterUnescape(queryString.match(/prefixes=([^&]*)/)[1]);
+        }
+        
+        var querytext = prefixes + " " + query;
+        document.getElementById('querytext').value = query;
+        this.displayBusyMessage();
+        var service = new SPARQL.Service(this._endpoint);
+        if (this._graph) {
+            service.addDefaultGraph(this._graph);
+        }
+
+        // AndyL changed MIME type and success callback depending on query form...
+        var dummy = this;
+
+   	    var exp = /^\s*(?:PREFIX\s+\w*:\s+<[^>]*>\s*)*(\w+)\s*.*/i;
+   	    var match = exp.exec(query);
+   	    if (match) {
+	        if (match[1].toUpperCase() == 'ASK') {
+	        	service.setOutput('boolean');
+	        	var successFunc = function(value) {
+	                dummy.displayBooleanResult(value, resultTitle);
+	            };
+	        } else if (match[1].toUpperCase() == 'CONSTRUCT' || match[1].toUpperCase() == 'DESCRIBE'){ // construct describe
+	    		service.setOutput('rdf'); // !json
+	    		var successFunc = function(model) {
+	                dummy.displayRDFResult(model, resultTitle);
+	            };
+	        } else {
+	        	service.setRequestHeader('Accept', 'application/sparql-results+json,*/*');
+	        	service.setOutput('json');
+	        	var successFunc = function(json) {
+	        		dummy.displayJSONResult(json, resultTitle);
+	        	};
+	        }
+   	    }
+
+        service.query(querytext, {
+            success: successFunc,
+            failure: function(report) {
+                var message = report.responseText.match(/<pre>([\s\S]*)<\/pre>/);
+                if (message) {
+                    dummy.displayErrorMessage(message[1]);
+                } else {
+                    dummy.displayErrorMessage(report.responseText);
+                }
+            }
+        });
+    }
+
+    this.setBrowserBase = function(url) {
+        this._browserBase = url;
+    }
+
+    this._displayEndpointURL = function() {
+    	var title = document.createElement("span");
+    	title.innerHTML = 'Querying <a href="' + this._endpoint + '">' + this._endpoint + '</a>';
+        this._display(title, 'title');
+        document.title = "Querying " + this._endpoint;
+    }
+
+    this._displayPoweredBy = function() {
+        $('poweredby').href = this._poweredByLink;
+        $('poweredby').update(this._poweredByLabel);
+    }
+
+    this.setNamespaces = function(namespaces) {
+        this._namespaces = namespaces;
+        var prefixes = this._getPrefixes();
+        document.getElementById('prefixes').value = prefixes;
+        this._display(document.createTextNode(prefixes), 'prefixestext');
+    }
+
+    this.switchToGraph = function(uri) {
+        this._updateGraph(uri, true);
+    }
+
+    this.switchToDefaultGraph = function() {
+        this._updateGraph(null, true);
+    }
+
+    this._updateGraph = function(uri, effect) {
+        if (!this._enableNamedGraphs) {
+            $('default-graph-section').hide();
+            $('named-graph-section').hide();
+            $('browse-named-graphs-link').hide();
+            return;
+        }
+        var changed = (uri != this._graph);
+        this._graph = uri;
+        var el = document.getElementById('graph-uri');
+        el.disabled = (this._graph == null);
+        el.value = this._graph;
+        if (this._graph == null) {
+            var show = 'default-graph-section';
+            var hide = 'named-graph-section';
+            $$('a.graph-link').each(function(link) {
+                match = link.href.match(/^(.*)[&?]graph=/);
+                if (match) link.href = match[1];
+            });
+        } else {
+            var show = 'named-graph-section';
+            var hide = 'default-graph-section';
+            $('selected-named-graph').update(this._graph);
+            var uri = this._graph;
+            $$('a.graph-link').each(function(link) {
+                match = link.href.match(/^(.*)[&?]graph=/);
+                if (!match) link.href = link.href + '&graph=' + uri;
+            });
+        }
+        $(hide).hide();
+        $(show).show();
+        if (effect && changed) {
+            new Effect.Highlight(show,
+                {startcolor: '#ffff00', endcolor: '#ccccff', resotrecolor: '#ccccff'});
+        }
+        $('graph-uri').disabled = (this._graph == null);
+        $('graph-uri').value = this._graph;
+    }
+
+    this.updateOutputMode = function() {
+        if (this._xsltDOM == null) {
+            this._xsltDOM = document.getElementById('xsltinput');
+        }
+        var el = document.getElementById('xsltcontainer');
+        while (el.childNodes.length > 0) {
+            el.removeChild(el.firstChild);
+        }
+        if (this._selectedOutputMode() == 'xslt') {
+            el.appendChild(this._xsltDOM);
+        }
+    }
+
+    this.resetQuery = function() {
+        document.location = this._browserBase;
+    }
+
+    this.submitQuery = function() {
+        var mode = this._selectedOutputMode();
+        if (mode == 'browse') {
+            document.getElementById('queryform').action = this._browserBase;
+        } else {
+            document.getElementById('queryform').action = this._endpoint;
+        }
+        document.getElementById('query').value = document.getElementById('querytext').value;
+        document.getElementById('jsonoutput').disabled = (mode != 'json');
+        if(mode == 'html') {
+           document.getElementById('jsonoutput').disabled = false;
+           document.getElementById('jsonoutput').value = 'html';
+        } else if(mode == 'csv') {
+            document.getElementById('jsonoutput').disabled = false;
+            document.getElementById('jsonoutput').value = 'csv';
+        } else if(mode == 'xml') {
+            document.getElementById('jsonoutput').disabled = false;
+            document.getElementById('jsonoutput').value = 'xml';
+        } else {
+           document.getElementById('jsonoutput').value = 'json';
+        }
+        document.getElementById('stylesheet').disabled = (mode != 'xslt' || !document.getElementById('xsltstylesheet').value);
+        if (mode == 'xslt') {
+            document.getElementById('stylesheet').value = document.getElementById('xsltstylesheet').value;
+        }
+        document.getElementById('queryform').submit();
+    }
+
+    this.displayBusyMessage = function() {
+        var busy = document.createElement('div');
+        busy.className = 'busy';
+        busy.appendChild(document.createTextNode('Executing query ...'));
+        this._display(busy, 'result');
+    }
+
+    this.displayErrorMessage = function(message) {
+        var pre = document.createElement('pre');
+        var json = JSON.parse(message);
+        if(json.message) {
+            pre.innerHTML = '<strong style="color: #ff0000">' + json.message; + "</strong>";
+        } else {
+            pre.innerHTML = message;
+        }
+        this._display(pre, 'result');
+    }
+
+    this.displayBooleanResult = function(value, resultTitle) {
+        var div = document.createElement('div');
+        var title = document.createElement('h2');
+        title.appendChild(document.createTextNode(resultTitle));
+        div.appendChild(title);
+        if (value)
+        	div.appendChild(document.createTextNode("TRUE"));
+        else
+        	div.appendChild(document.createTextNode("FALSE"));
+        this._display(div, 'result');
+        this._updateGraph(this._graph); // refresh links in new result
+    }
+    
+    this.displayRDFResult = function(model, resultTitle) {
+        var div = document.createElement('div');
+        var title = document.createElement('h2');
+        title.appendChild(document.createTextNode(resultTitle));
+        div.appendChild(title);
+        div.appendChild(new RDFXMLFormatter(model));
+        this._display(div, 'result');
+        this._updateGraph(this._graph); // refresh links in new result - necessary for boolean?
+    }
+
+    this.displayCSVResult = function(model, resultTitle) {
+        var div = document.createElement('div');
+        var title = document.createElement('h2');
+        title.appendChild(document.createTextNode(resultTitle));
+        div.appendChild(title);
+        div.appendChild(new RDFCSVFormatter(model));
+        this._display(div, 'result');
+        this._updateGraph(this._graph); // refresh links in new result - necessary for boolean?
+    }
+
+    this.displayJSONResult = function(json, resultTitle) {
+        var div = document.createElement('div');
+        var title = document.createElement('h2');
+        title.appendChild(document.createTextNode(resultTitle));
+        div.appendChild(title);
+        if (json.results.bindings.length == 0) {
+            var p = document.createElement('p');
+            p.className = 'empty';
+            p.appendChild(document.createTextNode('[no results]'));
+            div.appendChild(p);
+        } else {
+            div.appendChild(new SPARQLResultFormatter(json, this._namespaces).toDOM());
+        }
+        this._display(div, 'result');
+        this._updateGraph(this._graph); // refresh links in new result
+    }
+
+    this._display = function(node, whereID) {
+        var where = document.getElementById(whereID);
+        if(whereID=='result')where.style.display='block';
+        if (!where) {
+            alert('ID not found: ' + whereID);
+            return;
+        }
+        while (where.firstChild) {
+            where.removeChild(where.firstChild);
+        }
+        if (node == null) return;
+        where.appendChild(node);
+    }
+
+    this._selectedOutputMode = function() {
+        return document.getElementById('selectoutput').value;
+    }
+
+    this._getPrefixes = function() {
+        prefixes = '';
+        for (prefix in this._namespaces) {
+            var uri = this._namespaces[prefix];
+            prefixes = prefixes + 'PREFIX ' + prefix + ': <' + uri + '>\n';
+        }
+        return prefixes;
+    }
+
+    this._betterUnescape = function(s) {
+        return unescape(s.replace(/\+/g, ' '));
+    }
+}
+
+/*
+ * RDFXMLFormatter
+ * 
+ * maybe improve...
+ */
+function RDFXMLFormatter(string) {
+	var pre = document.createElement('pre');
+	pre.appendChild(document.createTextNode(string));
+	return pre;
+}
+
+function RDFCSVFormatter(string) {
+    var pre = document.createElement('pre');
+    pre.appendChild(document.createTextNode(string));
+    return pre;
+}
+
+
+/*
+===========================================================================
+SPARQLResultFormatter: Renders a SPARQL/JSON result set into an HTML table.
+
+var namespaces = { 'xsd': '', 'foaf': 'http://xmlns.com/foaf/0.1' };
+var formatter = new SPARQLResultFormatter(json, namespaces);
+var tableObject = formatter.toDOM();
+*/
+function SPARQLResultFormatter(json, namespaces) {
+    this._json = json;
+    this._variables = this._json.head.vars;
+    this._results = this._json.results.bindings;
+    this._namespaces = namespaces;
+
+    this.toDOM = function() {
+        var table = document.createElement('table');
+        table.className = 'queryresults';
+        table.appendChild(this._createTableHeader());
+        for (var i = 0; i < this._results.length; i++) {
+            table.appendChild(this._createTableRow(this._results[i], i));
+        }
+        return table;
+    }
+
+    // TODO: Refactor; non-standard link makers should be passed into the class by the caller
+    this._getLinkMaker = function(varName) {
+        if (varName == 'property') {
+            return function(uri) { return '?property=' + encodeURIComponent(uri); };
+        } else if (varName == 'class') {
+            return function(uri) { return '?class=' + encodeURIComponent(uri); };
+        } else {
+            return function(uri) { return '?describe=' + encodeURIComponent(uri); };
+        }
+    }
+
+    this._createTableHeader = function() {
+        var tr = document.createElement('tr');
+        var hasNamedGraph = false;
+        for (var i = 0; i < this._variables.length; i++) {
+            var th = document.createElement('th');
+            th.appendChild(document.createTextNode(this._variables[i]));
+            tr.appendChild(th);
+            if (this._variables[i] == 'namedgraph') {
+                hasNamedGraph = true;
+            }
+        }
+        if (hasNamedGraph) {
+            var th = document.createElement('th');
+            th.appendChild(document.createTextNode(' '));
+            tr.insertBefore(th, tr.firstChild);
+        }
+        return tr;
+    }
+
+    this._createTableRow = function(binding, rowNumber) {
+        var tr = document.createElement('tr');
+        if (rowNumber % 2) {
+            tr.className = 'odd';
+        } else {
+            tr.className = 'even';
+        }
+        var namedGraph = null;
+        for (var i = 0; i < this._variables.length; i++) {
+            var varName = this._variables[i];
+            td = document.createElement('td');
+            td.appendChild(this._formatNode(binding[varName], varName));
+            tr.appendChild(td);
+            if (this._variables[i] == 'namedgraph') {
+                namedGraph = binding[varName];
+            }
+        }
+        if (namedGraph) {
+            var link = document.createElement('a');
+            link.href = 'javascript:snorql.switchToGraph(\'' + namedGraph.value + '\')';
+            link.appendChild(document.createTextNode('Switch'));
+            var td = document.createElement('td');
+            td.appendChild(link);
+            tr.insertBefore(td, tr.firstChild);
+        }
+        return tr;
+    }
+
+    this._formatNode = function(node, varName) {
+        if (!node) {
+            return this._formatUnbound(node, varName);
+        }
+        if (node.type == 'uri') {
+            return this._formatURI(node, varName);
+        }
+        if (node.type == 'bnode') {
+            return this._formatBlankNode(node, varName);
+        }
+        if (node.type == 'literal') {
+            return this._formatPlainLiteral(node, varName);
+        }
+        if (node.type == 'typed-literal') {
+            return this._formatTypedLiteral(node, varName);
+        }
+        return document.createTextNode('???');
+    }
+
+    this._formatURI = function(node, varName) {
+        var span = document.createElement('span');
+        span.className = 'uri';
+        var a = document.createElement('a');
+        a.href = this._getLinkMaker(varName)(node.value);
+        a.title = '<' + node.value + '>';
+        a.className = 'graph-link';
+        var qname = this._toQName(node.value);
+        if (qname) {
+            a.appendChild(document.createTextNode(qname));
+            span.appendChild(a);
+        } else {
+            a.appendChild(document.createTextNode(node.value));
+            span.appendChild(document.createTextNode('<'));
+            span.appendChild(a);
+            span.appendChild(document.createTextNode('>'));
+        }
+        match = node.value.match(/^(https?|ftp|mailto|irc|gopher|news):/);
+        if (match) {
+            span.appendChild(document.createTextNode(' '));
+            var externalLink = document.createElement('a');
+            externalLink.href = node.value;
+            img = document.createElement('img');
+            img.src = 'link.png';
+            img.alt = '[' + match[1] + ']';
+            img.title = 'Go to URI directly';
+            externalLink.appendChild(img);
+            span.appendChild(externalLink);
+        }
+        return span;
+    }
+
+    this._formatPlainLiteral = function(node, varName) {
+        var text = '"' + node.value + '"';
+        if (node['xml:lang']) {
+            text += '@' + node['xml:lang'];
+        }
+        return document.createTextNode(text);
+    }
+
+    this._formatTypedLiteral = function(node, varName) {
+        var text = '"' + node.value + '"';
+        if (node.datatype) {
+            text += '^^' + this._toQNameOrURI(node.datatype);
+        }
+        if (this._isNumericXSDType(node.datatype)) {
+            var span = document.createElement('span');
+            span.title = text;
+            span.appendChild(document.createTextNode(node.value));
+            return span;
+        }
+        return document.createTextNode(text);
+    }
+
+    this._formatBlankNode = function(node, varName) {
+        return document.createTextNode('_:' + node.value);
+    }
+
+    this._formatUnbound = function(node, varName) {
+        var span = document.createElement('span');
+        span.className = 'unbound';
+        span.title = 'Unbound'
+        span.appendChild(document.createTextNode('-'));
+        return span;
+    }
+
+    this._toQName = function(uri) {
+        for (prefix in this._namespaces) {
+            var nsURI = this._namespaces[prefix];
+            if (uri.indexOf(nsURI) == 0) {
+                return prefix + ':' + uri.substring(nsURI.length);
+            }
+        }
+        return null;
+    }
+
+    this._toQNameOrURI = function(uri) {
+        var qName = this._toQName(uri);
+        return (qName == null) ? '<' + uri + '>' : qName;
+    }
+
+    this._isNumericXSDType = function(datatypeURI) {
+        for (i = 0; i < this._numericXSDTypes.length; i++) {
+            if (datatypeURI == this._xsdNamespace + this._numericXSDTypes[i]) {
+                return true;
+            }
+        }
+        return false;
+    }
+    this._xsdNamespace = 'http://www.w3.org/2001/XMLSchema#';
+    this._numericXSDTypes = ['long', 'decimal', 'float', 'double', 'int',
+        'short', 'byte', 'integer', 'nonPositiveInteger', 'negativeInteger',
+        'nonNegativeInteger', 'positiveInteger', 'unsignedLong',
+        'unsignedInt', 'unsignedShort', 'unsignedByte'];
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/extras/webjars/snorql/src/main/resources/sparql.js
----------------------------------------------------------------------
diff --git a/extras/webjars/snorql/src/main/resources/sparql.js b/extras/webjars/snorql/src/main/resources/sparql.js
new file mode 100755
index 0000000..2b34538
--- /dev/null
+++ b/extras/webjars/snorql/src/main/resources/sparql.js
@@ -0,0 +1,507 @@
+/*
+ * 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.
+ */
+/**********************************************************
+  Copyright (c) 2006, 2007
+    Lee Feigenbaum ( lee AT thefigtrees DOT net )
+	Elias Torres   ( elias AT torrez DOT us )
+    Wing Yung      ( wingerz AT gmail DOT com )
+  All rights reserved.
+
+	Permission is hereby granted, free of charge, to any person obtaining a copy of
+	this software and associated documentation files (the "Software"), to deal in
+	the Software without restriction, including without limitation the rights to
+	use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
+	of the Software, and to permit persons to whom the Software is furnished to do
+	so, subject to the following conditions:
+
+	The above copyright notice and this permission notice shall be included in all
+	copies or substantial portions of the Software.
+
+	THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+	IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+	FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+	AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+	LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+	OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+	SOFTWARE.
+**********************************************************/
+
+/**
+ * Example client interactions
+ *
+ 
+ 	var sparqler = new SPARQL.Service("http://sparql.org/sparql");
+	sparqler.addDefaultGraph("http://thefigtrees.net/lee/ldf-card"); // inherited by all (future) queries
+	sparqler.addNamedGraph("http://torrez.us/elias/foaf.rdf");
+	sparqler.setPrefix("foaf", "http://xmlns.com/foaf/0.1/"); // inherited by all (future) queries
+	sparqler.setPrefix("rdf", "http://xmlns.com/foaf/0.1/");
+	
+	sparqler.setRequestHeader("Authentication", "Basic: " + basicAuthString);
+	
+	//sparqler.wantOutputAs("application/json"); // for now we only do JSON
+
+	var query = sparqler.createQuery();
+	query.addDefualtGraph(...) query.addNamedGraph(...) query.setPrefix(...) query.setRequestHeader(...) // this query only
+
+	// query forms:
+
+	// passes standard JSON results object to success callback
+	query.setPrefix("ldf", "http://thefigtrees.net/lee/ldf-card#");
+	query.query("SELECT ?who ?mbox WHERE { ldf:LDF foaf:knows ?who . ?who foaf:mbox ?mbox }",
+		{failure: onFailure, success: function(json) { for (var x in json.head.vars) { ... } ...}}
+	);
+
+	// passes boolean value to success callback
+	query.ask("ASK ?person WHERE { ?person foaf:knows [ foaf:name "Dan Connolly" ] }",
+		{failure: onFailure, success: function(bool) { if (bool) ... }}
+	); 
+
+	// passes a single vector (array) of values representing a single column of results to success callback
+	query.setPrefix("ldf", "http://thefigtrees.net/lee/ldf-card#");
+	var addresses = query.selectValues("SELECT ?mbox WHERE { _:someone foaf:mbox ?mbox }",
+		{failure: onFailure, success: function(values) { for (var i = 0; i < values.length; i++) { ... values[i] ...} } }
+	); 
+
+	// passes a single value representing a single row of a single column (variable) to success callback
+	query.setPrefix("ldf", "http://thefigtrees.net/lee/ldf-card#");
+	var myAddress = query.selectSingleValue("SELECT ?mbox WHERE {ldf:LDF foaf:mbox ?mbox }",
+		{failure: onFailure, success: function(value) { alert("value is: " + value); } }
+	); 
+	
+	// shortcuts for all of the above (w/o ability to set any query-specific graphs or prefixes)
+	sparqler.query(...) sparqler.ask(...) sparqler.selectValues(...) sparqler.selectSingleValue(...)
+ 
+
+ */
+
+var SPARQL  = {}; // SPARQL namespace
+
+
+/**
+ * Both SPARQL service objects and SPARQL query objects receive one query utility method
+ * per entry in this dictionary. The key is the name of the method, and the value is a function
+ * that transforms the standard JSON output into a more useful form. The return value of a
+ * transformation function is passed into any 'success' callback function provided when the query
+ * is issued. The following transformations are included:
+ *   + query -- identity transform; returns the JSON structure unchanged
+ *   + ask -- for ASK queries; returns a boolean value indicating the answer to the query
+ *   + selectValues -- for SELECT queries with a single variable; returns an array containing
+ *       the answers to the query
+ *   + selectSingleValue -- for SELECT queries returning one column with one row; returns the
+ *       value in the first (and presumably, only) cell in the resultset
+ *   + selectValueArrays -- for SELECT queries returning independent columns; returns a hash
+ *       keyed on variable name with values as arrays of answers for that variable. Useful
+ *       for UNION queries.
+ *   Note that all of the transformations that return values directly lose any type information
+ *   and the ability to distinguish between URIs, blank nodes, and literals.
+ */
+SPARQL._query_transformations = {
+	query: function (o) { return o; },
+	ask: function (o) { return o["boolean"]; },
+	selectValues: function (o) {
+		var v = o.head.vars[0]; // assume one variable
+		var values = [];
+		for (var i = 0; i < o.results.bindings.length; i++)
+			values.push(o.results.bindings[i][v].value);
+		return values;
+	},
+	selectSingleValue: function(o) { return o.results.bindings[0][o.head.vars[0]].value; },
+	selectValueArrays: function(o) {
+		// factor by value (useful for UNION queries)
+		var ret = {};
+		for (var i = 0; i < o.head.vars.length; i++)
+			ret[o.head.vars[i]] = [];
+		for (var i = 0; i < o.results.bindings.length; i++)
+			for (var v in o.results.bindings[i])
+				if (ret[v] instanceof Array) ret[v].push(o.results.bindings[i][v].value);
+		return ret;
+	},
+    selectValueHashes: function(o) {
+        var hashes = [];
+        for (var i = 0; i < o.results.bindings.length; i++) {
+            var hash = {};
+            for (var v in o.results.bindings[i])
+                hash[v] = o.results.bindings[i][v].value;
+            hashes.push(hash);
+        }
+        return hashes;
+    }
+};
+
+SPARQL.statistics = {
+	queries_sent : 0,
+	successes    : 0,
+	failures     : 0
+};
+
+// A SPARQL service represents a single endpoint which implements the HTTP (GET or POST) 
+// bindings of the SPARQL Protocol. It provides convenience methods to set dataset and
+// prefix options for all queries created for this endpoint.
+SPARQL.Service = function(endpoint) {
+	//---------------
+	// private fields
+	var _endpoint = endpoint;
+	var _default_graphs = [];
+	var _named_graphs = [];
+	var _prefix_map = {};
+    var _method = 'POST';
+	var _output = 'json';
+	var _max_simultaneous = 0;
+	var _request_headers = {};
+
+	//----------
+	// accessors
+	this.endpoint = function() { return _endpoint; };
+	this.defaultGraphs = function() { return _default_graphs; };
+	this.namedGraphs = function() { return _named_graphs; };
+	this.prefixes = function() { return _prefix_map; };
+    this.method = function() { return _method; };
+    this.output = function() { return _output; };
+	this.maxSimultaneousQueries = function() { return _max_simultaneous; };
+	this.requestHeaders = function() { return _request_headers; };
+	
+	//---------
+	// mutators
+	function _add_graphs(toAdd, arr) {
+		if (toAdd instanceof Array)
+			for (var i = 0; i < toAdd.length; i++) arr.push(toAdd[i]);
+		else
+			arr.push(toAdd);
+	}
+	this.addDefaultGraph = function(g) { _add_graphs(g, this.defaultGraphs()); };
+	this.addNamedGraph = function(g) { _add_graphs(g, this.namedGraphs()); };
+	this.setPrefix = function(p, u) { this.prefixes()[p] = u; };
+	this.createQuery = function(p) { return new SPARQL.Query(this, p); };
+    this.setMethod = function(m) {
+        if (m != 'GET' && m != 'POST') throw("HTTP methods other than GET and POST are not supported.");
+        _method = m;
+    };
+	this.setOutput = function(o) { _output = o; };
+	this.setMaxSimultaneousQueries = function(m) { _max_simultaneous = m; };
+	this.setRequestHeader = function(h, v) { _request_headers[h] = v; };
+	
+	//---------------
+	// protected methods (should only be called within this module
+	this._active_queries = 0;
+	this._queued_queries = [];
+	this._next_in_queue  = 0;
+	this._canRun = function() { return this.maxSimultaneousQueries() <= 0 || this._active_queries < this.maxSimultaneousQueries();};
+	this._queue  = function(q,f, p) { 
+		if (!p) p = 0; 
+		if (p > 0) {
+			for (var i = 0; i < this._queued_queries.length; i++) {
+				if (this._queued_queries[i] != null && this._queued_queries[i][2] < p) {
+					this._queued_queries.splice(i, 0, [q, f, p]);
+					return;
+				}
+			}
+		}
+		this._queued_queries.push([q,f,p]); 
+	};
+	this._markRunning = function(q) { this._active_queries++; };
+	this._markDone    = function(q) { 
+		this._active_queries--; 
+		//document.getElementById('log').innerHTML+="query done. " + this._active_queries + " queries still active.<br>";
+		if (this._queued_queries[this._next_in_queue] != null && this._canRun()) {
+			var a = this._queued_queries[this._next_in_queue];
+			this._queued_queries[this._next_in_queue++] = null;
+			// a[0] is query object, a[1] is function to run query
+			//document.getElementById('log').innerHTML += "running query from Q<br>";
+			a[1]();
+		}
+	};
+
+	//---------------
+	// public methods
+
+	// use our varied transformations to create the various shortcut methods of actually 
+	// issuing queries without explicitly creating a query object
+	for (var query_form in SPARQL._query_transformations) {
+		// need the extra function to properly scope query_form (qf)
+		this[query_form] = (function(qf) {
+			return function(queryString, callback) {
+				var q = this.createQuery();
+				q._doQuery(queryString, callback, SPARQL._query_transformations[qf]);
+			};
+		})(query_form);
+	}
+	
+	//------------
+	// constructor
+    
+	if (!_endpoint)
+		return null;
+	
+	return this;
+}
+
+/**
+ * A SPARQL query object should be created using the createQuery method of a SPARQL
+ * service object. It allows prefixes and datasets to be defined specifically for
+ * a single query, and provides introspective methods to see the query string and the
+ * full (HTTP GET) URL of the query.
+ */
+SPARQL.Query = function(service, priority) {
+	//---------------
+	// private fields
+	var _conn = null;
+	var _service = service;
+	var _default_graphs = clone_obj(service.defaultGraphs()); // prevent future updates from affecting us
+	var _named_graphs = clone_obj(service.namedGraphs());
+	var _prefix_map = clone_obj(service.prefixes());
+	var _user_query = ''; // doesn't include auto-generated prefix declarations
+    var _method = service.method();
+	var _output = service.output();
+	var _priority = priority || 0;
+	var _request_headers = clone_obj(service.requestHeaders());
+
+	//------------------
+	// private functions
+	function _create_json(text) {
+		if (!text)
+			return null;
+		// make sure this is safe JSON
+		// see: http://www.ietf.org/internet-drafts/draft-crockford-jsonorg-json-03.txt
+
+		// (1) strip out quoted strings
+		var no_strings = text.replace(/"(\\.|[^"\\])*"/g, '');
+		// (2) make sure that all the characters are explicitly part of the JSON grammar
+		// (in particular, note as discussed in the IETF submission, there are no assignments
+		//  or function invocations allowed by this reg. exp.)
+		var hasBadCharacter = /[^,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]/.test(no_strings);
+		// (3) evaluate the JSON string, returning its contents
+		if (!hasBadCharacter) {
+			try {
+				return eval('(' + text + ')');
+			} catch (e) {
+				return null;
+			}
+		}
+		return null;
+	}
+
+	function clone_obj(o) {
+		var o2 = o instanceof Array ? [] : {};
+		for(var x in o) {o2[x] = o[x];}
+		return o2;
+	}
+
+	//----------------
+	// private methods
+	this._doCallback = function(cb, which, arg) {
+		//document.getElementById('log').innerHTML += "_doCallback ... <br>";
+		var user_data = "argument" in cb ? cb.argument : null;
+		if (which in cb) {
+			if (cb.scope) {
+                cb[which].apply(cb.scope, [arg, user_data]);
+			} else {
+				cb[which](arg, user_data);
+			}
+		}
+	}
+
+	this._queryFailure = function(xhr, arg) {
+		SPARQL.statistics.failures++;
+		_service._markDone(this);
+		this._doCallback(arg.callback, 'failure', xhr /* just pass through the connection response object */);
+	};
+	this._querySuccess = function(xhr, arg) {
+        //alert(xhr.responseText);
+		SPARQL.statistics.successes++;
+		_service._markDone(this);
+		this._doCallback(arg.callback, 'success', arg.transformer(
+			_output == 'json' ? _create_json(xhr.responseText) : xhr.responseText
+		));
+	};
+
+	function getXmlHttpRequest(url) {
+		// right now, this only does Firefox (Opera? Safari?)
+		return new XMLHttpRequest();
+	}
+
+	this._doQuery = function(queryString, callback, transformer) {
+		_user_query = queryString;
+		if (_service._canRun()) {
+			try {
+				if (_method != 'POST' && _method != 'GET')
+					throw("HTTP methods other than GET and POST are not supported.");
+
+				var url = _method == 'GET' ? this.queryUrl() : this.service().endpoint();
+				var xhr = getXmlHttpRequest(url);
+				var content = null;
+
+				try {
+                    if (!document.domain || ((url.match(/^http:\/\//) && url.slice(7, document.domain.length + 7) != document.domain || url.match(/^https:\/\//) && url.slice(8, document.domain.length + 8) != document.domain) && window.netscape && netscape.security && netscape.security.PrivilegeManager)) {
+						netscape.security.PrivilegeManager.enablePrivilege( "UniversalBrowserRead");
+						netscape.security.PrivilegeManager.enablePrivilege( "UniversalXPConnect");
+					}
+				} catch(e) {
+					alert("Cross-site requests prohibited. You will only be able to SPARQL the origin site: " + e);
+                    return;
+				}
+
+				xhr.open(_method, url, true /* async */);
+
+				// set the headers, including the content-type for POSTed queries
+				for (var header in this.requestHeaders())
+                    if (typeof(this.requestHeaders()[header]) != "function")
+	    				xhr.setRequestHeader(header, this.requestHeaders()[header]);
+				if (_method == 'POST') {
+					xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
+					content = this.queryParameters();
+				}
+
+				SPARQL.statistics.queries_sent++;
+				_service._markRunning(this);
+
+				var callbackData = {
+					scope: this,
+					success: this._querySuccess,
+					failure: this._queryFailure,
+					argument: {
+						transformer: transformer,
+						callback: callback
+					}
+				};
+
+				// I've seen some strange race-condition behavior (strange since normally
+				// JS is single-threaded, so synchronization conditions don't occur barring
+				// reentrancy) with onreadystatechange. Instead, we poll asynchronously to
+				// determine when the request is done.
+				var token = window.setInterval(
+					function () {
+						if (xhr.readyState == 4) { // ready!
+							// clear this handler
+							window.clearInterval(token);
+							// we check the status to know which callback to call
+							if (xhr.status >= 200 && xhr.status < 300)
+								callbackData.success.apply(callbackData.scope, [xhr, callbackData.argument]);
+							else
+								callbackData.failure.apply(callbackData.scope, [xhr, callbackData.argument]);
+						}
+					},
+					200 /* maybe this should be customizable */
+				);
+
+				xhr.send(content);
+			} catch (e) {
+				alert("Error sending SPARQL query: " + e);
+			}
+		} else {
+			var self = this;
+			_service._queue(self, function() { self._doQuery(queryString, callback, transformer); }, _priority);
+		}
+	};
+
+
+	//----------
+	// accessors
+	this.request = function() { return _conn; };
+	this.service = function() { return _service; };
+	this.defaultGraphs = function() { return _default_graphs; };
+	this.namedGraphs = function() { return _named_graphs; };
+	this.prefixes = function() { return _prefix_map; };
+    this.method = function() { return _method; };
+    this.requestHeaders = function() { return _request_headers; };
+
+
+    /**
+     * Returns the SPARQL query represented by this object. The parameter, which can
+     * be omitted, determines whether or not auto-generated PREFIX clauses are included
+     * in the returned query string.
+     */
+	this.queryString = function(excludePrefixes) {
+		var preamble = '';
+		if (!excludePrefixes) {
+			for (var prefix in this.prefixes()) {
+				if(typeof(this.prefixes()[prefix]) != 'string') continue;
+				preamble += 'PREFIX ' + prefix + ': <' + this.prefixes()[prefix] + '> ';
+			}
+		}
+		return preamble + _user_query;
+	};
+
+    /**
+     * Returns the HTTP query parameters to invoke this query. This includes entries for
+     * all of the default graphs, the named graphs, the SPARQL query itself, and an
+     * output parameter to specify JSON (or other) output is desired.
+     */
+	this.queryParameters = function () {
+		var urlQueryString = '';
+		var i;
+
+		// add default and named graphs to the protocol invocation
+		for (i = 0; i < this.defaultGraphs().length; i++) urlQueryString += 'default-graph-uri=' + encodeURIComponent(this.defaultGraphs()[i]) + '&';
+		for (i = 0; i < this.namedGraphs().length; i++) urlQueryString += 'named-graph-uri=' + encodeURIComponent(this.namedGraphs()[i]) + '&';
+
+		// specify JSON output (currently output= supported by latest Joseki) (or other output)
+		urlQueryString += 'output=' + _output + '&';
+		return urlQueryString + 'query=' + encodeURIComponent(this.queryString());
+	}
+	
+    /**
+     * Returns the HTTP GET URL to invoke this query. (Note that this returns a full HTTP GET URL 
+     * even if this query is set to actually use POST.)
+     */
+	this.queryUrl = function() {
+		var url = this.service().endpoint() + '?';
+		return url + this.queryParameters();
+	};
+	
+	//---------
+	// mutators
+	function _add_graphs(toAdd, arr) {
+		if (toAdd instanceof Array)
+			for (var i = 0; i < toAdd.length; i++) arr.push(toAdd[i]);
+		else
+			arr.push(toAdd);
+	}
+	this.addDefaultGraph = function(g) { _add_graphs(g, this.defaultGraphs()); };
+	this.addNamedGraph = function(g) { _add_graphs(g, this.namedGraphs()); };
+	this.setPrefix = function(p, u) { this.prefixes()[p] = u; };
+    this.setMethod = function(m) {
+        if (m != 'GET' && m != 'POST') throw("HTTP methods other than GET and POST are not supported.");
+        _method = m;
+    };
+	this.setRequestHeader = function(h, v) { _request_headers[h] = v; };
+	
+	//---------------
+	// public methods
+
+	// use our varied transformations to create the various methods of actually issuing 
+	// queries
+	for (var query_form in SPARQL._query_transformations) {
+		// need the extra function to properly scope query_form (qf)
+		this[query_form] = (function(qf) {
+			return function(queryString, callback) {
+				this._doQuery(queryString, callback, SPARQL._query_transformations[qf]);
+			};
+		})(query_form);
+	}
+	
+
+	//------------
+	// constructor
+	
+	return this;
+}
+
+// Nothing to see here, yet.
+SPARQL.QueryUtilities = {
+};
+

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/extras/webjars/snorql/src/main/resources/style.css
----------------------------------------------------------------------
diff --git a/extras/webjars/snorql/src/main/resources/style.css b/extras/webjars/snorql/src/main/resources/style.css
new file mode 100755
index 0000000..acc8746
--- /dev/null
+++ b/extras/webjars/snorql/src/main/resources/style.css
@@ -0,0 +1,85 @@
+/**
+ * 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.
+ */
+.snorql {
+    background: none repeat scroll 0 0 #eeeeee;
+    font-family: sans-serif;
+    padding: 1em 1em 5em 1em;
+    border: 2px solid #000000;
+    border-radius: 5px;
+    margin: 2em auto 10em auto;
+}
+#footer_snorql { font-size: 60%; margin: 10px 0; text-align: center; }
+.subtitle { text-align: center; margin-top: 0; }
+form { margin: 0; }
+textarea { width: 100%; margin: 10px 0;border:1px solid #999; }
+.snorql pre#prefixestext { color: #555; margin: 10px 0;  width: auto; color: inherit; background-color: inherit; border: 0; }
+img { border: none; }
+.section { margin: 15px 0 0; padding: 0; }
+.busy { color: #888; }
+.link { background: url("link.png") center right no-repeat; padding-right: 13px; }
+.queryresults { border-collapse: collapse; margin-top: 0.3em; border: 1px solid gray;}
+.queryresults td, .queryresults th { padding: 0.2em 0.4em; vertical-align: top; }
+.uri { white-space: nowrap; }
+.uri a, a.uri { text-decoration: none; }
+.unbound { color: #888; }
+.queryresults a small { font-size: 100%; }
+.queryresults small { font-size: 100%; color: #666; }
+.queryresults .property { white-space: nowrap; }
+#rdficon { float: right; margin: 0.6em 1em; }
+.directory li { margin-bottom: 0.5em; }
+.directory small { font-size: 80%; color: #666; }
+
+.snorql h2 {
+   color: #666666;
+   margin: 0;
+   padding: 0;
+}
+.result h2 {
+    margin: 5px 0;
+    color: #666666;
+}
+/* .snorql #snorql_header, .snorql .section { background: #ccf; } */
+.snorql table.queryresults th { background: #666666; color: #ffffff; font-weight: bold; }
+.snorql table.queryresults tr.odd td { background-color: #aaaaaa !important; }
+.snorql table.queryresults tr.even td { background-color: #cccccc !important; }
+
+.browser h1, .browser h2 { color: #666666; }
+.browser #header, .browser .section { background: #666666; }
+.browser table.queryresults th { background: none repeat scroll 0 0 gray; color: white; }
+.browser table.queryresults tr.odd td { background-color: #aaaaaa !important; }
+.browser table.queryresults tr.even td { background-color: #cccccc !important; }
+
+#result {
+    border: 1px solid #999;
+    font-size: 12px;
+    overflow-x: auto;
+    padding: 5px;
+    width: 98%;
+    display:none;
+    background-color: white;
+}
+
+.snorql div.CodeMirror-scroll {
+    height: auto !important;
+    overflow-y: hidden !important;
+    overflow-x: auto !important;
+}
+
+.snorql div.CodeMirror-gutter pre, .snorql div.CodeMirror-lines pre {
+    overflow: inherit !important;
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/extras/webjars/snorql/src/main/resources/xml-to-html.xsl
----------------------------------------------------------------------
diff --git a/extras/webjars/snorql/src/main/resources/xml-to-html.xsl b/extras/webjars/snorql/src/main/resources/xml-to-html.xsl
new file mode 100755
index 0000000..1333027
--- /dev/null
+++ b/extras/webjars/snorql/src/main/resources/xml-to-html.xsl
@@ -0,0 +1,183 @@
+<?xml version="1.0"?>
+
+<!--
+
+XSLT script to format SPARQL Query Results XML Format into xhtml
+
+Copyright © 2004, 2005 World Wide Web Consortium, (Massachusetts
+Institute of Technology, European Research Consortium for
+Informatics and Mathematics, Keio University). All Rights
+Reserved. This work is distributed under the W3C® Software
+License [1] in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE.
+
+[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
+
+Version 1 : Dave Beckett (DAWG)
+Version 2 : Jeen Broekstra (DAWG)
+Customization for SPARQler: Andy Seaborne
+
+-->
+
+<xsl:stylesheet version="1.0"
+		xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+		xmlns="http://www.w3.org/1999/xhtml"
+		xmlns:res="http://www.w3.org/2005/sparql-results#"
+		exclude-result-prefixes="res xsl">
+
+  <!--
+    <xsl:output
+    method="html"
+    media-type="text/html"
+    doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"
+    indent="yes"
+    encoding="UTF-8"/>
+  -->
+
+  <!-- or this? -->
+
+  <xsl:output
+   method="xml" 
+   indent="yes"
+   encoding="UTF-8" 
+   doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
+   doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
+   omit-xml-declaration="no" />
+
+
+  <xsl:template name="header">
+    <div>
+      <h2>Header</h2>
+      <xsl:for-each select="res:head/res:link"> 
+	<p>Link to <xsl:value-of select="@href"/></p>
+      </xsl:for-each>
+    </div>
+  </xsl:template>
+
+  <xsl:template name="boolean-result">
+    <div>
+      <!--      
+	<h2>Boolean Result</h2>
+      -->      
+      <p>ASK => <xsl:value-of select="res:boolean"/></p>
+    </div>
+  </xsl:template>
+
+
+  <xsl:template name="vb-result">
+    <div>
+      <!--
+	<h2>Variable Bindings Result</h2>
+	<p>Ordered: <xsl:value-of select="res:results/@ordered"/></p>
+	<p>Distinct: <xsl:value-of select="res:results/@distinct"/></p>
+      -->
+
+      <table>
+	<xsl:text>
+	</xsl:text>
+	<tr>
+	  <xsl:for-each select="res:head/res:variable">
+	    <th><xsl:value-of select="@name"/></th>
+	  </xsl:for-each>
+	</tr>
+	<xsl:text>
+	</xsl:text>
+	<xsl:for-each select="res:results/res:result">
+	  <tr>
+	    <xsl:apply-templates select="."/>
+	  </tr>
+	</xsl:for-each>
+      </table>
+    </div>
+  </xsl:template>
+
+  <xsl:template match="res:result">
+    <xsl:variable name="current" select="."/>
+    <xsl:for-each select="//res:head/res:variable">
+      <xsl:variable name="name" select="@name"/>
+      <td>
+	<xsl:choose>
+	  <xsl:when test="$current/res:binding[@name=$name]">
+	    <!-- apply template for the correct value type (bnode, uri, literal) -->
+	    <xsl:apply-templates select="$current/res:binding[@name=$name]"/>
+	  </xsl:when>
+	  <xsl:otherwise>
+	    <!-- no binding available for this variable in this solution -->
+	  </xsl:otherwise>
+	</xsl:choose>
+      </td>
+    </xsl:for-each>
+  </xsl:template>
+
+  <xsl:template match="res:bnode">
+    <xsl:text>_:</xsl:text>
+    <xsl:value-of select="text()"/>
+  </xsl:template>
+
+  <xsl:template match="res:uri">
+    <xsl:variable name="uri" select="text()"/>
+    <xsl:text>&lt;</xsl:text>
+    <xsl:value-of select="$uri"/>
+    <xsl:text>&gt;</xsl:text>
+  </xsl:template>
+
+  <xsl:template match="res:literal">
+    <xsl:text>"</xsl:text>
+    <xsl:value-of select="text()"/>
+    <xsl:text>"</xsl:text>
+
+    <xsl:choose>
+      <xsl:when test="@datatype">
+	<!-- datatyped literal value -->
+	^^&lt;<xsl:value-of select="@datatype"/>&gt;
+      </xsl:when>
+      <xsl:when test="@xml:lang">
+	<!-- lang-string -->
+	@<xsl:value-of select="@xml:lang"/>
+      </xsl:when>
+    </xsl:choose>
+  </xsl:template>
+
+  <xsl:template match="res:sparql">
+    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+      <head>
+	<title>SPARQL Query Results</title>
+	<style>
+	  <![CDATA[
+	  h1 { font-size: 150% ; }
+	  h2 { font-size: 125% ; }
+	  table { border-collapse: collapse ; border: 1px solid black ; }
+	  td, th
+ 	  { border: 1px solid black ;
+	    padding-left:0.5em; padding-right: 0.5em; 
+	    padding-top:0.2ex ; padding-bottom:0.2ex 
+	  }
+	  ]]>
+	</style>
+      </head>
+      <body>
+
+
+	<h1>SPARQL Query Results</h1>
+
+	<xsl:if test="res:head/res:link">
+	  <xsl:call-template name="header"/>
+	</xsl:if>
+
+	<xsl:choose>
+	  <xsl:when test="res:boolean">
+	    <xsl:call-template name="boolean-result" />
+	  </xsl:when>
+
+	  <xsl:when test="res:results">
+	    <xsl:call-template name="vb-result" />
+	  </xsl:when>
+
+	</xsl:choose>
+
+
+      </body>
+    </html>
+  </xsl:template>
+</xsl:stylesheet>

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/extras/webjars/strftime/pom.xml
----------------------------------------------------------------------
diff --git a/extras/webjars/strftime/pom.xml b/extras/webjars/strftime/pom.xml
new file mode 100644
index 0000000..6f337ab
--- /dev/null
+++ b/extras/webjars/strftime/pom.xml
@@ -0,0 +1,81 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ 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.
+  -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>org.apache.marmotta</groupId>
+        <artifactId>marmotta-parent</artifactId>
+        <version>3.1.0-incubating</version>
+        <relativePath>../../../parent/</relativePath> 
+    </parent>
+
+    <properties>
+        <webjar.version>1.3</webjar.version>
+    </properties>
+
+
+    <groupId>org.apache.marmotta.webjars</groupId>
+    <artifactId>strftime</artifactId>
+    <packaging>jar</packaging>
+
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.sonatype.plugins</groupId>
+                <artifactId>yuicompressor-maven-plugin</artifactId>
+                <version>1.0.0</version>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>aggregate</goal>
+                        </goals>
+                    </execution>
+                </executions>
+                <configuration>
+                    <nomunge>true</nomunge>
+                    <sourceDirectory>${project.basedir}/src/main/resources</sourceDirectory>
+                    <output>${project.build.outputDirectory}/META-INF/resources/webjars/${project.artifactId}/${webjar.version}/strftime.js</output>
+                </configuration>
+            </plugin>
+            <plugin>
+                <!-- these are "extras", so they come from 3rd parties, no RAT check! -->
+                <groupId>org.apache.rat</groupId>
+                <artifactId>apache-rat-plugin</artifactId>
+                <configuration>
+                    <excludes>
+                        <exclude>src/**</exclude>
+                    </excludes>
+                </configuration>
+            </plugin>
+        </plugins>
+        <resources>
+            <resource>
+                <directory>src/main/resources</directory>
+                <excludes>
+                    <exclude>**/*.js</exclude>
+                </excludes>
+                <filtering>false</filtering>
+                <targetPath>${project.build.outputDirectory}/META-INF/resources/webjars/${project.artifactId}/${webjar.version}</targetPath>
+            </resource>
+        </resources>
+     </build>
+
+</project>

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/extras/webjars/strftime/src/main/resources/strftime.js
----------------------------------------------------------------------
diff --git a/extras/webjars/strftime/src/main/resources/strftime.js b/extras/webjars/strftime/src/main/resources/strftime.js
new file mode 100644
index 0000000..4e84444
--- /dev/null
+++ b/extras/webjars/strftime/src/main/resources/strftime.js
@@ -0,0 +1,750 @@
+/*
+ strftime for Javascript
+ Copyright (c) 2008, Philip S Tellis <ph...@bluesmoon.info>
+ All rights reserved.
+ 
+ extended with german locales and %F formatter for Marmotta
+ Jakob Frank <ja...@apache.org>
+ 
+ This code is distributed under the terms of the BSD licence
+ 
+ Redistribution and use of this software in source and binary forms, with or without modification,
+ are permitted provided that the following conditions are met:
+
+   * Redistributions of source code must retain the above copyright notice, this list of conditions
+     and the following disclaimer.
+   * Redistributions in binary form must reproduce the above copyright notice, this list of
+     conditions and the following disclaimer in the documentation and/or other materials provided
+     with the distribution.
+   * The names of the contributors to this file may not be used to endorse or promote products
+     derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
+WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/**
+ * \file strftime.js
+ * \author Philip S Tellis \<philip@bluesmoon.info\>
+ * \version 1.3
+ * \date 2008/06
+ * \brief Javascript implementation of strftime
+ * 
+ * Implements strftime for the Date object in javascript based on the PHP implementation described at
+ * http://www.php.net/strftime  This is in turn based on the Open Group specification defined
+ * at http://www.opengroup.org/onlinepubs/007908799/xsh/strftime.html This implementation does not
+ * include modified conversion specifiers (i.e., Ex and Ox)
+ *
+ * The following format specifiers are supported:
+ *
+ * \copydoc formats
+ *
+ * \%a, \%A, \%b and \%B should be localised for non-English locales.
+ *
+ * \par Usage:
+ * This library may be used as follows:
+ * \code
+ *     var d = new Date();
+ *
+ *     var ymd = d.strftime('%Y/%m/%d');
+ *     var iso = d.strftime('%Y-%m-%dT%H:%M:%S%z');
+ *
+ * \endcode
+ *
+ * \sa \link Date.prototype.strftime Date.strftime \endlink for a description of each of the supported format specifiers
+ * \sa Date.ext.locales for localisation information
+ * \sa http://www.php.net/strftime for the PHP implementation which is the basis for this
+ * \sa http://tech.bluesmoon.info/2008/04/strftime-in-javascript.html for feedback
+ */
+
+//! Date extension object - all supporting objects go in here.
+Date.ext = Date.ext || {};
+
+//! Utility methods
+Date.ext.util = Date.ext.util || {};
+
+/**
+\brief Left pad a number with something
+\details Takes a number and pads it to the left with the passed in pad character
+\param x	The number to pad
+\param pad	The string to pad with
+\param r	[optional] Upper limit for pad.  A value of 10 pads to 2 digits, a value of 100 pads to 3 digits.
+		Default is 10.
+
+\return The number left padded with the pad character.  This function returns a string and not a number.
+*/
+Date.ext.util.xPad=function(x, pad, r)
+{
+	if(typeof(r) == 'undefined')
+	{
+		r=10;
+	}
+	for( ; parseInt(x, 10)<r && r>1; r/=10)
+		x = pad.toString() + x;
+	return x.toString();
+};
+
+/**
+\brief Currently selected locale.
+\details
+The locale for a specific date object may be changed using \code Date.locale = "new-locale"; \endcode
+The default will be based on the lang attribute of the HTML tag of your document
+*/
+Date.prototype.locale = 'en-GB';
+//! \cond FALSE
+if(document.getElementsByTagName('html') && document.getElementsByTagName('html')[0].lang)
+{
+	Date.prototype.locale = document.getElementsByTagName('html')[0].lang;
+}
+//! \endcond
+
+/**
+\brief Localised strings for days of the week and months of the year.
+\details
+To create your own local strings, add a locale object to the locales object.
+The key of your object should be the same as your locale name.  For example:
+   en-US,
+   fr,
+   fr-CH,
+   de-DE
+Names are case sensitive and are described at http://www.w3.org/TR/REC-html40/struct/dirlang.html#langcodes
+Your locale object must contain the following keys:
+\param a	Short names of days of week starting with Sunday
+\param A	Long names days of week starting with Sunday
+\param b	Short names of months of the year starting with January
+\param B	Long names of months of the year starting with February
+\param c	The preferred date and time representation in your locale
+\param p	AM or PM in your locale
+\param P	am or pm in your locale
+\param x	The  preferred date representation for the current locale without the time.
+\param X	The preferred time representation for the current locale without the date.
+
+\sa Date.ext.locales.en for a sample implementation
+\sa \ref localisation for detailed documentation on localising strftime for your own locale
+*/
+Date.ext.locales = Date.ext.locales || { };
+
+/**
+ * \brief Localised strings for English (British).
+ * \details
+ * This will be used for any of the English dialects unless overridden by a country specific one.
+ * This is the default locale if none specified
+ */
+Date.ext.locales.en = Date.ext.locales.en || {
+	a: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
+	A: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],
+	b: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
+	B: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
+	c: '%a %d %b %Y %T %Z',
+	p: ['AM', 'PM'],
+	P: ['am', 'pm'],
+	x: '%d/%m/%y',
+	X: '%T'
+};
+
+//! \cond FALSE
+// Localised strings for US English
+Date.ext.locales['en-US'] = Date.ext.locales.en;
+Date.ext.locales['en-US'].c = '%a %d %b %Y %r %Z';
+Date.ext.locales['en-US'].x = '%D';
+Date.ext.locales['en-US'].X = '%r';
+
+// Localised strings for British English
+Date.ext.locales['en-GB'] = Date.ext.locales.en;
+
+// Localised strings for Australian English
+Date.ext.locales['en-AU'] = Date.ext.locales['en-GB'];
+//! \endcond
+
+Date.ext.locales.de = Date.ext.locales.de || {
+        a: ['So', 'Mo', 'Di', 'Mi', 'Do', 'Fr', 'Sa'],
+        A: ['Sonntag', 'Montag', 'Dienstag', 'Mittwoch', 'Donnerstag', 'Freitag', 'Samstag'],
+        b: ['Jan', 'Feb', 'Mär', 'Apr', 'Mai', 'Jun', 'Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Dez'],
+        B: ['Jänner', 'Februar', 'März', 'April', 'Mai', 'Juni', 'Juli', 'August', 'September', 'Oktober', 'November', 'Dezember'],
+        c: '%a %d %b %Y %T %Z',
+        p: ['', ''],
+        P: ['', ''],
+        x: '%d.%m.%Y',
+        X: '%T'
+    };
+Date.ext.locales['de-AT'] = Date.ext.locales['de-AT'] || Date.ext.locales.de;
+Date.ext.locales['de-CH'] = Date.ext.locales['de-CH'] || Date.ext.locales.de;
+Date.ext.locales['de-DE'] = Date.ext.locales['de-DE'] || Date.ext.locales.de;
+//! \brief List of supported format specifiers.
+/**
+ * \details
+ * \arg \%a - abbreviated weekday name according to the current locale
+ * \arg \%A - full weekday name according to the current locale
+ * \arg \%b - abbreviated month name according to the current locale
+ * \arg \%B - full month name according to the current locale
+ * \arg \%c - preferred date and time representation for the current locale
+ * \arg \%C - century number (the year divided by 100 and truncated to an integer, range 00 to 99)
+ * \arg \%d - day of the month as a decimal number (range 01 to 31)
+ * \arg \%D - same as %m/%d/%y
+ * \arg \%e - day of the month as a decimal number, a single digit is preceded by a space (range ' 1' to '31')
+ * \arg \%F - same as %Y-%m-%d
+ * \arg \%g - like %G, but without the century
+ * \arg \%G - The 4-digit year corresponding to the ISO week number
+ * \arg \%h - same as %b
+ * \arg \%H - hour as a decimal number using a 24-hour clock (range 00 to 23)
+ * \arg \%I - hour as a decimal number using a 12-hour clock (range 01 to 12)
+ * \arg \%j - day of the year as a decimal number (range 001 to 366)
+ * \arg \%m - month as a decimal number (range 01 to 12)
+ * \arg \%M - minute as a decimal number
+ * \arg \%n - newline character
+ * \arg \%p - either `AM' or `PM' according to the given time value, or the corresponding strings for the current locale
+ * \arg \%P - like %p, but lower case
+ * \arg \%r - time in a.m. and p.m. notation equal to %I:%M:%S %p
+ * \arg \%R - time in 24 hour notation equal to %H:%M
+ * \arg \%S - second as a decimal number
+ * \arg \%t - tab character
+ * \arg \%T - current time, equal to %H:%M:%S
+ * \arg \%u - weekday as a decimal number [1,7], with 1 representing Monday
+ * \arg \%U - week number of the current year as a decimal number, starting with
+ *            the first Sunday as the first day of the first week
+ * \arg \%V - The ISO 8601:1988 week number of the current year as a decimal number,
+ *            range 01 to 53, where week 1 is the first week that has at least 4 days
+ *            in the current year, and with Monday as the first day of the week.
+ * \arg \%w - day of the week as a decimal, Sunday being 0
+ * \arg \%W - week number of the current year as a decimal number, starting with the
+ *            first Monday as the first day of the first week
+ * \arg \%x - preferred date representation for the current locale without the time
+ * \arg \%X - preferred time representation for the current locale without the date
+ * \arg \%y - year as a decimal number without a century (range 00 to 99)
+ * \arg \%Y - year as a decimal number including the century
+ * \arg \%z - numerical time zone representation
+ * \arg \%Z - time zone name or abbreviation
+ * \arg \%% - a literal `\%' character
+ */
+Date.ext.formats = {
+	a: function(d) { return Date.ext.locales[d.locale].a[d.getDay()]; },
+	A: function(d) { return Date.ext.locales[d.locale].A[d.getDay()]; },
+	b: function(d) { return Date.ext.locales[d.locale].b[d.getMonth()]; },
+	B: function(d) { return Date.ext.locales[d.locale].B[d.getMonth()]; },
+	c: 'toLocaleString',
+	C: function(d) { return Date.ext.util.xPad(parseInt(d.getFullYear()/100, 10), 0); },
+	d: ['getDate', '0'],
+	e: ['getDate', ' '],
+	g: function(d) { return Date.ext.util.xPad(parseInt(Date.ext.util.G(d)/100, 10), 0); },
+	G: function(d) {
+			var y = d.getFullYear();
+			var V = parseInt(Date.ext.formats.V(d), 10);
+			var W = parseInt(Date.ext.formats.W(d), 10);
+
+			if(W > V) {
+				y++;
+			} else if(W===0 && V>=52) {
+				y--;
+			}
+
+			return y;
+		},
+	H: ['getHours', '0'],
+	I: function(d) { var I=d.getHours()%12; return Date.ext.util.xPad(I===0?12:I, 0); },
+	j: function(d) {
+			var ms = d - new Date('' + d.getFullYear() + '/1/1 GMT');
+			ms += d.getTimezoneOffset()*60000;
+			var doy = parseInt(ms/60000/60/24, 10)+1;
+			return Date.ext.util.xPad(doy, 0, 100);
+		},
+	m: function(d) { return Date.ext.util.xPad(d.getMonth()+1, 0); },
+	M: ['getMinutes', '0'],
+	p: function(d) { return Date.ext.locales[d.locale].p[d.getHours() >= 12 ? 1 : 0 ]; },
+	P: function(d) { return Date.ext.locales[d.locale].P[d.getHours() >= 12 ? 1 : 0 ]; },
+	S: ['getSeconds', '0'],
+	u: function(d) { var dow = d.getDay(); return dow===0?7:dow; },
+	U: function(d) {
+			var doy = parseInt(Date.ext.formats.j(d), 10);
+			var rdow = 6-d.getDay();
+			var woy = parseInt((doy+rdow)/7, 10);
+			return Date.ext.util.xPad(woy, 0);
+		},
+	V: function(d) {
+			var woy = parseInt(Date.ext.formats.W(d), 10);
+			var dow1_1 = (new Date('' + d.getFullYear() + '/1/1')).getDay();
+			// First week is 01 and not 00 as in the case of %U and %W,
+			// so we add 1 to the final result except if day 1 of the year
+			// is a Monday (then %W returns 01).
+			// We also need to subtract 1 if the day 1 of the year is 
+			// Friday-Sunday, so the resulting equation becomes:
+			var idow = woy + (dow1_1 > 4 || dow1_1 <= 1 ? 0 : 1);
+			if(idow == 53 && (new Date('' + d.getFullYear() + '/12/31')).getDay() < 4)
+			{
+				idow = 1;
+			}
+			else if(idow === 0)
+			{
+				idow = Date.ext.formats.V(new Date('' + (d.getFullYear()-1) + '/12/31'));
+			}
+
+			return Date.ext.util.xPad(idow, 0);
+		},
+	w: 'getDay',
+	W: function(d) {
+			var doy = parseInt(Date.ext.formats.j(d), 10);
+			var rdow = 7-Date.ext.formats.u(d);
+			var woy = parseInt((doy+rdow)/7, 10);
+			return Date.ext.util.xPad(woy, 0, 10);
+		},
+	y: function(d) { return Date.ext.util.xPad(d.getFullYear()%100, 0); },
+	Y: 'getFullYear',
+	z: function(d) {
+			var o = d.getTimezoneOffset();
+			var H = Date.ext.util.xPad(parseInt(Math.abs(o/60), 10), 0);
+			var M = Date.ext.util.xPad(o%60, 0);
+			return (o>0?'-':'+') + H + M;
+		},
+	Z: function(d) { return d.toString().replace(/^.*\(([^)]+)\)$/, '$1'); },
+	'%': function(d) { return '%'; }
+};
+
+/**
+\brief List of aggregate format specifiers.
+\details
+Aggregate format specifiers map to a combination of basic format specifiers.
+These are implemented in terms of Date.ext.formats.
+
+A format specifier that maps to 'locale' is read from Date.ext.locales[current-locale].
+
+\sa Date.ext.formats
+*/
+Date.ext.aggregates = {
+	c: 'locale',
+	D: '%m/%d/%y',
+	F: '%Y-%m-%d',
+	h: '%b',
+	n: '\n',
+	r: '%I:%M:%S %p',
+	R: '%H:%M',
+	t: '\t',
+	T: '%H:%M:%S',
+	x: 'locale',
+	X: 'locale'
+};
+
+//! \cond FALSE
+// Cache timezone values because they will never change for a given JS instance
+Date.ext.aggregates.z = Date.ext.formats.z(new Date());
+Date.ext.aggregates.Z = Date.ext.formats.Z(new Date());
+//! \endcond
+
+//! List of unsupported format specifiers.
+/**
+ * \details
+ * All format specifiers supported by the PHP implementation are supported by
+ * this javascript implementation.
+ */
+Date.ext.unsupported = { };
+
+
+/**
+ * \brief Formats the date according to the specified format.
+ * \param fmt	The format to format the date in.  This may be a combination of the following:
+ * \copydoc formats
+ *
+ * \return	A string representation of the date formatted based on the passed in parameter
+ * \sa http://www.php.net/strftime for documentation on format specifiers
+*/
+Date.prototype.strftime=function(fmt)
+{
+	// Fix locale if declared locale hasn't been defined
+	// After the first call this condition should never be entered unless someone changes the locale
+	if(!(this.locale in Date.ext.locales))
+	{
+		if(this.locale.replace(/-[a-zA-Z]+$/, '') in Date.ext.locales)
+		{
+			this.locale = this.locale.replace(/-[a-zA-Z]+$/, '');
+		}
+		else
+		{
+			this.locale = 'en-GB';
+		}
+	}
+
+	var d = this;
+	// First replace aggregates
+	while(fmt.match(/%[cDFhnrRtTxXzZ]/))
+	{
+		fmt = fmt.replace(/%([cDFhnrRtTxXzZ])/g, function(m0, m1)
+				{
+					var f = Date.ext.aggregates[m1];
+					return (f == 'locale' ? Date.ext.locales[d.locale][m1] : f);
+				});
+	}
+
+
+	// Now replace formats - we need a closure so that the date object gets passed through
+	var str = fmt.replace(/%([aAbBCdegGHIjmMpPSuUVwWyY%])/g, function(m0, m1) 
+			{
+				var f = Date.ext.formats[m1];
+				if(typeof(f) == 'string') {
+					return d[f]();
+				} else if(typeof(f) == 'function') {
+					return f.call(d, d);
+				} else if(typeof(f) == 'object' && typeof(f[0]) == 'string') {
+					return Date.ext.util.xPad(d[f[0]](), f[1]);
+				} else {
+					return m1;
+				}
+			});
+	d=null;
+	return str;
+};
+
+/**
+ * \mainpage strftime for Javascript
+ *
+ * \section toc Table of Contents
+ * - \ref intro_sec
+ * - <a class="el" href="strftime.js">Download full source</a> / <a class="el" href="strftime-min.js">minified</a>
+ * - \subpage usage
+ * - \subpage format_specifiers
+ * - \subpage localisation
+ * - \link strftime.js API Documentation \endlink
+ * - \subpage demo
+ * - \subpage changelog
+ * - \subpage faq
+ * - <a class="el" href="http://tech.bluesmoon.info/2008/04/strftime-in-javascript.html">Feedback</a>
+ * - \subpage copyright_licence
+ *
+ * \section intro_sec Introduction
+ *
+ * C and PHP developers have had access to a built in strftime function for a long time.
+ * This function is an easy way to format dates and times for various display needs.
+ *
+ * This library brings the flexibility of strftime to the javascript Date object
+ *
+ * Use this library if you frequently need to format dates in javascript in a variety of ways.  For example,
+ * if you have PHP code that writes out formatted dates, and want to mimic the functionality using
+ * progressively enhanced javascript, then this library can do exactly what you want.
+ *
+ *
+ *
+ *
+ * \page usage Example usage
+ *
+ * \section usage_sec Usage
+ * This library may be used as follows:
+ * \code
+ *     var d = new Date();
+ *
+ *     var ymd = d.strftime('%Y/%m/%d');
+ *     var iso = d.strftime('%Y-%m-%dT%H:%M:%S%z');
+ *
+ * \endcode
+ *
+ * \subsection examples Examples
+ * 
+ * To get the current time in hours and minutes:
+ * \code
+ * 	var d = new Date();
+ * 	d.strftime("%H:%M");
+ * \endcode
+ *
+ * To get the current time with seconds in AM/PM notation:
+ * \code
+ * 	var d = new Date();
+ * 	d.strftime("%r");
+ * \endcode
+ *
+ * To get the year and day of the year for August 23, 2009:
+ * \code
+ * 	var d = new Date('2009/8/23');
+ * 	d.strftime("%Y-%j");
+ * \endcode
+ *
+ * \section demo_sec Demo
+ *
+ * Try your own examples on the \subpage demo page.  You can use any of the supported
+ * \subpage format_specifiers.
+ *
+ *
+ *
+ *
+ * \page localisation Localisation
+ * You can localise strftime by implementing the short and long forms for days of the
+ * week and months of the year, and the localised aggregates for the preferred date
+ * and time representation for your locale.  You need to add your locale to the
+ * Date.ext.locales object.
+ *
+ * \section localising_fr Localising for french
+ *
+ * For example, this is how we'd add French language strings to the locales object:
+ * \dontinclude index.html
+ * \skip Generic french
+ * \until };
+ * The % format specifiers are all defined in \ref formats.  You can use any of those.
+ *
+ * This locale definition may be included in your own source file, or in the HTML file
+ * including \c strftime.js, however it must be defined \em after including \c strftime.js
+ *
+ * The above definition includes generic french strings and formats that are used in France.
+ * Other french speaking countries may have other representations for dates and times, so we
+ * need to override this for them.  For example, Canadian french uses a Y-m-d date format,
+ * while French french uses d.m.Y.  We fix this by defining Canadian french to be the same
+ * as generic french, and then override the format specifiers for \c x for the \c fr-CA locale:
+ * \until End french
+ *
+ * You can now use any of the French locales at any time by setting \link Date.prototype.locale Date.locale \endlink
+ * to \c "fr", \c "fr-FR", \c "fr-CA", or any other french dialect:
+ * \code
+ *     var d = new Date("2008/04/22");
+ *     d.locale = "fr";
+ *
+ *     d.strftime("%A, %d %B == %x");
+ * \endcode
+ * will return:
+ * \code
+ *     mardi, 22 avril == 22.04.2008
+ * \endcode
+ * While changing the locale to "fr-CA":
+ * \code
+ *     d.locale = "fr-CA";
+ *
+ *     d.strftime("%A, %d %B == %x");
+ * \endcode
+ * will return:
+ * \code
+ *     mardi, 22 avril == 2008-04-22
+ * \endcode
+ *
+ * You can use any of the format specifiers defined at \ref formats
+ *
+ * The locale for all dates defaults to the value of the \c lang attribute of your HTML document if
+ * it is set, or to \c "en" otherwise.
+ * \note
+ * Your locale definitions \b MUST be added to the locale object before calling
+ * \link Date.prototype.strftime Date.strftime \endlink.
+ *
+ * \sa \ref formats for a list of format specifiers that can be used in your definitions
+ * for c, x and X.
+ *
+ * \section locale_names Locale names
+ *
+ * Locale names are defined in RFC 1766. Typically, a locale would be a two letter ISO639
+ * defined language code and an optional ISO3166 defined country code separated by a -
+ * 
+ * eg: fr-FR, de-DE, hi-IN
+ *
+ * \sa http://www.ietf.org/rfc/rfc1766.txt
+ * \sa http://www.loc.gov/standards/iso639-2/php/code_list.php
+ * \sa http://www.iso.org/iso/country_codes/iso_3166_code_lists/english_country_names_and_code_elements.htm
+ * 
+ * \section locale_fallback Locale fallbacks
+ *
+ * If a locale object corresponding to the fully specified locale isn't found, an attempt will be made
+ * to fall back to the two letter language code.  If a locale object corresponding to that isn't found
+ * either, then the locale will fall back to \c "en".  No warning will be issued.
+ *
+ * For example, if we define a locale for de:
+ * \until };
+ * Then set the locale to \c "de-DE":
+ * \code
+ *     d.locale = "de-DE";
+ *
+ *     d.strftime("%a, %d %b");
+ * \endcode
+ * In this case, the \c "de" locale will be used since \c "de-DE" has not been defined:
+ * \code
+ *     Di, 22 Apr
+ * \endcode
+ *
+ * Swiss german will return the same since it will also fall back to \c "de":
+ * \code
+ *     d.locale = "de-CH";
+ *
+ *     d.strftime("%a, %d %b");
+ * \endcode
+ * \code
+ *     Di, 22 Apr
+ * \endcode
+ *
+ * We need to override the \c a specifier for Swiss german, since it's different from German german:
+ * \until End german
+ * We now get the correct results:
+ * \code
+ *     d.locale = "de-CH";
+ *
+ *     d.strftime("%a, %d %b");
+ * \endcode
+ * \code
+ *     Die, 22 Apr
+ * \endcode
+ *
+ * \section builtin_locales Built in locales
+ *
+ * This library comes with pre-defined locales for en, en-GB, en-US and en-AU.
+ *
+ * 
+ *
+ *
+ * \page format_specifiers Format specifiers
+ * 
+ * \section specifiers Format specifiers
+ * strftime has several format specifiers defined by the Open group at 
+ * http://www.opengroup.org/onlinepubs/007908799/xsh/strftime.html
+ *
+ * PHP added a few of its own, defined at http://www.php.net/strftime
+ *
+ * This javascript implementation supports all the PHP specifiers
+ *
+ * \subsection supp Supported format specifiers:
+ * \copydoc formats
+ * 
+ * \subsection unsupportedformats Unsupported format specifiers:
+ * \copydoc unsupported
+ *
+ *
+ *
+ *
+ * \page demo strftime demo
+ * <div style="float:right;width:45%;">
+ * \copydoc formats
+ * </div>
+ * \htmlinclude index.html
+ *
+ *
+ *
+ *
+ * \page faq FAQ
+ * 
+ * \section how_tos Usage
+ *
+ * \subsection howtouse Is there a manual on how to use this library?
+ *
+ * Yes, see \ref usage
+ *
+ * \subsection wheretoget Where can I get a minified version of this library?
+ *
+ * The minified version is available <a href="strftime-min.js" title="Minified strftime.js">here</a>.
+ *
+ * \subsection which_specifiers Which format specifiers are supported?
+ *
+ * See \ref format_specifiers
+ *
+ * \section whys Why?
+ *
+ * \subsection why_lib Why this library?
+ *
+ * I've used the strftime function in C, PHP and the Unix shell, and found it very useful
+ * to do date formatting.  When I needed to do date formatting in javascript, I decided
+ * that it made the most sense to just reuse what I'm already familiar with.
+ *
+ * \subsection why_another Why another strftime implementation for Javascript?
+ *
+ * Yes, there are other strftime implementations for Javascript, but I saw problems with
+ * all of them that meant I couldn't use them directly.  Some implementations had bad
+ * designs.  For example, iterating through all possible specifiers and scanning the string
+ * for them.  Others were tied to specific libraries like prototype.
+ *
+ * Trying to extend any of the existing implementations would have required only slightly
+ * less effort than writing this from scratch.  In the end it took me just about 3 hours
+ * to write the code and about 6 hours battling with doxygen to write these docs.
+ *
+ * I also had an idea of how I wanted to implement this, so decided to try it.
+ *
+ * \subsection why_extend_date Why extend the Date class rather than subclass it?
+ *
+ * I tried subclassing Date and failed.  I didn't want to waste time on figuring
+ * out if there was a problem in my code or if it just wasn't possible.  Adding to the
+ * Date.prototype worked well, so I stuck with it.
+ *
+ * I did have some worries because of the way for..in loops got messed up after json.js added
+ * to the Object.prototype, but that isn't an issue here since {} is not a subclass of Date.
+ *
+ * My last doubt was about the Date.ext namespace that I created.  I still don't like this,
+ * but I felt that \c ext at least makes clear that this is external or an extension.
+ *
+ * It's quite possible that some future version of javascript will add an \c ext or a \c locale
+ * or a \c strftime property/method to the Date class, but this library should probably
+ * check for capabilities before doing what it does.
+ *
+ * \section curiosity Curiosity
+ *
+ * \subsection how_big How big is the code?
+ *
+ * \arg 26K bytes with documentation
+ * \arg 4242 bytes minified using <a href="http://developer.yahoo.com/yui/compressor/">YUI Compressor</a>
+ * \arg 1477 bytes minified and gzipped
+ *
+ * \subsection how_long How long did it take to write this?
+ *
+ * 15 minutes for the idea while I was composing this blog post:
+ * http://tech.bluesmoon.info/2008/04/javascript-date-functions.html
+ *
+ * 3 hours in one evening to write v1.0 of the code and 6 hours the same
+ * night to write the docs and this manual.  As you can tell, I'm fairly
+ * sleepy.
+ *
+ * Versions 1.1 and 1.2 were done in a couple of hours each, and version 1.3
+ * in under one hour.
+ *
+ * \section contributing Contributing
+ *
+ * \subsection how_to_rfe How can I request features or make suggestions?
+ *
+ * You can leave a comment on my blog post about this library here:
+ * http://tech.bluesmoon.info/2008/04/strftime-in-javascript.html
+ *
+ * \subsection how_to_contribute Can I/How can I contribute code to this library?
+ *
+ * Yes, that would be very nice, thank you.  You can do various things.  You can make changes
+ * to the library, and make a diff against the current file and mail me that diff at
+ * philip@bluesmoon.info, or you could just host the new file on your own servers and add
+ * your name to the copyright list at the top stating which parts you've added.
+ *
+ * If you do mail me a diff, let me know how you'd like to be listed in the copyright section.
+ *
+ * \subsection copyright_signover Who owns the copyright on contributed code?
+ *
+ * The contributor retains copyright on contributed code.
+ *
+ * In some cases I may use contributed code as a template and write the code myself.  In this
+ * case I'll give the contributor credit for the idea, but will not add their name to the
+ * copyright holders list.
+ *
+ *
+ *
+ *
+ * \page copyright_licence Copyright & Licence
+ *
+ * \section copyright Copyright
+ * \dontinclude strftime.js
+ * \skip Copyright
+ * \until rights
+ *
+ * \section licence Licence
+ * \skip This code
+ * \until SUCH DAMAGE.
+ *
+ *
+ *
+ * \page changelog ChangeLog
+ *
+ * \par 1.3 - 2008/06/17:
+ * - Fixed padding issue with negative timezone offsets in %r
+ *   reported and fixed by Mikko <mi...@iki.fi>
+ * - Added support for %P
+ * - Internationalised %r, %p and %P
+ *
+ * \par 1.2 - 2008/04/27:
+ * - Fixed support for c (previously it just returned toLocaleString())
+ * - Add support for c, x and X
+ * - Add locales for en-GB, en-US and en-AU
+ * - Make en-GB the default locale (previous was en)
+ * - Added more localisation docs
+ *
+ * \par 1.1 - 2008/04/27:
+ * - Fix bug in xPad which wasn't padding more than a single digit
+ * - Fix bug in j which had an off by one error for days after March 10th because of daylight savings
+ * - Add support for g, G, U, V and W
+ *
+ * \par 1.0 - 2008/04/22:
+ * - Initial release with support for a, A, b, B, c, C, d, D, e, H, I, j, m, M, p, r, R, S, t, T, u, w, y, Y, z, Z, and %
+ */

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/launchers/marmotta-installer/pom.xml
----------------------------------------------------------------------
diff --git a/launchers/marmotta-installer/pom.xml b/launchers/marmotta-installer/pom.xml
index 11b8ec7..5db3648 100644
--- a/launchers/marmotta-installer/pom.xml
+++ b/launchers/marmotta-installer/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/marmotta/blob/582abb5b/launchers/marmotta-installer/src/main/resources/installer/LICENSE.txt
----------------------------------------------------------------------
diff --git a/launchers/marmotta-installer/src/main/resources/installer/LICENSE.txt b/launchers/marmotta-installer/src/main/resources/installer/LICENSE.txt
index 4a0bf89..9e10bdc 100644
--- a/launchers/marmotta-installer/src/main/resources/installer/LICENSE.txt
+++ b/launchers/marmotta-installer/src/main/resources/installer/LICENSE.txt
@@ -2692,6 +2692,37 @@ For the JSONLD-Java component,
     THE POSSIBILITY OF SUCH DAMAGE.
         
 
+For the marmotta-commons component,
+
+    located at commons/marmotta-commons/src/ext/java
+
+   Javolution - Java(tm) Solution for Real-Time and Embedded Systems
+   Copyright (c) 2012, Javolution (http://javolution.org/)
+   All rights reserved.
+
+   Redistribution and use in source and binary forms, with or without
+   modification, are permitted provided that the following conditions are met:
+
+      1. Redistributions of source code must retain the above copyright
+         notice, this list of conditions and the following disclaimer.
+
+      2. Redistributions in binary form must reproduce the above copyright
+         notice, this list of conditions and the following disclaimer in the
+         documentation and/or other materials provided with the distribution.
+
+   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+   CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+   EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+   PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+   PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+   LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+   NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+   SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
 
 Apache Marmotta 3rd party data files:
 ====================================


[037/100] [abbrv] [partial] Reverting the erroneous merge by Sebastian according to the instructions in INFRA-6876

Posted by wi...@apache.org.
http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0033-in.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0033-in.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0033-in.jsonld
deleted file mode 100644
index 33d4b17..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0033-in.jsonld
+++ /dev/null
@@ -1,19 +0,0 @@
-{
-  "@context": {
-    "ex": "http://example.org/vocab#"
-  },
-  "@id": [
-    {
-      "@id": "_:a0",
-      "ex:prop": {
-        "@id": "_:a1"
-      }
-    },
-    {
-      "@id": "_:b0",
-      "ex:prop": {
-        "@id": "_:b1"
-      }
-    }
-  ]
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0033-out.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0033-out.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0033-out.jsonld
deleted file mode 100644
index 69a9786..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0033-out.jsonld
+++ /dev/null
@@ -1 +0,0 @@
-[{"@id":"_:c14n0"},{"@id":"_:c14n1","http://example.org/vocab#prop":{"@id":"_:c14n0"}},{"@id":"_:c14n2"},{"@id":"_:c14n3","http://example.org/vocab#prop":{"@id":"_:c14n2"}}]
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0034-in.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0034-in.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0034-in.jsonld
deleted file mode 100644
index 2909456..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0034-in.jsonld
+++ /dev/null
@@ -1,19 +0,0 @@
-{
-  "@context": {
-    "ex": "http://example.org/vocab#"
-  },
-  "@id": [
-    {
-      "@id": "_:b0",
-      "ex:prop": {
-        "@id": "_:b1"
-      }
-    },
-    {
-      "@id": "_:a0",
-      "ex:prop": {
-        "@id": "_:a1"
-      }
-    }
-  ]
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0034-out.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0034-out.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0034-out.jsonld
deleted file mode 100644
index 69a9786..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0034-out.jsonld
+++ /dev/null
@@ -1 +0,0 @@
-[{"@id":"_:c14n0"},{"@id":"_:c14n1","http://example.org/vocab#prop":{"@id":"_:c14n0"}},{"@id":"_:c14n2"},{"@id":"_:c14n3","http://example.org/vocab#prop":{"@id":"_:c14n2"}}]
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0035-in.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0035-in.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0035-in.jsonld
deleted file mode 100644
index 8ba344b..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0035-in.jsonld
+++ /dev/null
@@ -1,27 +0,0 @@
-{
-  "@context": {
-    "ex": "http://example.org/vocab#",
-    "ex:p1": {
-      "@type": "@id"
-    },
-    "xsd": "http://www.w3.org/2001/XMLSchema#"
-  },
-  "@id": [
-    {
-      "@id": "_:a1",
-      "ex:p1": "_:a3"
-    },
-    {
-      "@id": "_:a2",
-      "ex:p1": "_:a4"
-    },
-    {
-      "@id": "_:a3",
-      "ex:p2": "Foo"
-    },
-    {
-      "@id": "_:a4",
-      "ex:p2": "Foo"
-    }
-  ]
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0035-out.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0035-out.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0035-out.jsonld
deleted file mode 100644
index 1da3b40..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0035-out.jsonld
+++ /dev/null
@@ -1 +0,0 @@
-[{"@id":"_:c14n0","http://example.org/vocab#p1":{"@id":"_:c14n1"}},{"@id":"_:c14n1","http://example.org/vocab#p2":"Foo"},{"@id":"_:c14n2","http://example.org/vocab#p1":{"@id":"_:c14n3"}},{"@id":"_:c14n3","http://example.org/vocab#p2":"Foo"}]
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0036-in.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0036-in.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0036-in.jsonld
deleted file mode 100644
index 4b01746..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0036-in.jsonld
+++ /dev/null
@@ -1,27 +0,0 @@
-{
-  "@context": {
-    "ex": "http://example.org/vocab#",
-    "ex:p1": {
-      "@type": "@id"
-    },
-    "xsd": "http://www.w3.org/2001/XMLSchema#"
-  },
-  "@id": [
-    {
-      "@id": "_:a1",
-      "ex:p1": "_:a4"
-    },
-    {
-      "@id": "_:a2",
-      "ex:p1": "_:a3"
-    },
-    {
-      "@id": "_:a3",
-      "ex:p2": "Foo"
-    },
-    {
-      "@id": "_:a4",
-      "ex:p2": "Foo"
-    }
-  ]
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0036-out.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0036-out.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0036-out.jsonld
deleted file mode 100644
index 1da3b40..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0036-out.jsonld
+++ /dev/null
@@ -1 +0,0 @@
-[{"@id":"_:c14n0","http://example.org/vocab#p1":{"@id":"_:c14n1"}},{"@id":"_:c14n1","http://example.org/vocab#p2":"Foo"},{"@id":"_:c14n2","http://example.org/vocab#p1":{"@id":"_:c14n3"}},{"@id":"_:c14n3","http://example.org/vocab#p2":"Foo"}]
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0037-in.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0037-in.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0037-in.jsonld
deleted file mode 100644
index 252c8ea..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0037-in.jsonld
+++ /dev/null
@@ -1,27 +0,0 @@
-{
-  "@context": {
-    "ex": "http://example.org/vocab#",
-    "ex:p1": {
-      "@type": "@id"
-    },
-    "xsd": "http://www.w3.org/2001/XMLSchema#"
-  },
-  "@id": [
-    {
-      "@id": "_:b1",
-      "ex:p1": "_:b4"
-    },
-    {
-      "@id": "_:b2",
-      "ex:p1": "_:b3"
-    },
-    {
-      "@id": "_:b3",
-      "ex:p2": "Foo"
-    },
-    {
-      "@id": "_:b4",
-      "ex:p2": "Foo"
-    }
-  ]
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0037-out.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0037-out.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0037-out.jsonld
deleted file mode 100644
index 1da3b40..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0037-out.jsonld
+++ /dev/null
@@ -1 +0,0 @@
-[{"@id":"_:c14n0","http://example.org/vocab#p1":{"@id":"_:c14n1"}},{"@id":"_:c14n1","http://example.org/vocab#p2":"Foo"},{"@id":"_:c14n2","http://example.org/vocab#p1":{"@id":"_:c14n3"}},{"@id":"_:c14n3","http://example.org/vocab#p2":"Foo"}]
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0038-in.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0038-in.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0038-in.jsonld
deleted file mode 100644
index 03b6d60..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0038-in.jsonld
+++ /dev/null
@@ -1,28 +0,0 @@
-{
-  "@context": {
-    "ex": "http://example.org/vocab#",
-    "ex:p1": {
-      "@type": "@id"
-    },
-    "xsd": "http://www.w3.org/2001/XMLSchema#"
-  },
-  "@id": [
-    {
-      "@id": "_:a0",
-      "ex:p1": [
-        "_:a1",
-        "_:a2"
-      ]
-    },
-    {
-      "@id": "_:a1",
-      "ex:p1": "_:a3"
-    },
-    {
-      "@id": "_:a2"
-    },
-    {
-      "@id": "_:a3"
-    }
-  ]
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0038-out.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0038-out.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0038-out.jsonld
deleted file mode 100644
index 8f8fb4b..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0038-out.jsonld
+++ /dev/null
@@ -1 +0,0 @@
-[{"@id":"_:c14n0"},{"@id":"_:c14n1","http://example.org/vocab#p1":{"@id":"_:c14n0"}},{"@id":"_:c14n2","http://example.org/vocab#p1":[{"@id":"_:c14n1"},{"@id":"_:c14n3"}]},{"@id":"_:c14n3"}]
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0039-in.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0039-in.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0039-in.jsonld
deleted file mode 100644
index e340db7..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0039-in.jsonld
+++ /dev/null
@@ -1,22 +0,0 @@
-{
-  "@context": {
-    "ex": "http://example.org/vocab#",
-    "ex:p1": {
-      "@type": "@id"
-    },
-    "xsd": "http://www.w3.org/2001/XMLSchema#"
-  },
-  "@id": [
-    {
-      "@id": "_:b0",
-      "ex:p1": [
-        {},
-        "_:b2"
-      ]
-    },
-    {
-      "@id": "_:b2",
-      "ex:p1": {}
-    }
-  ]
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0039-out.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0039-out.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0039-out.jsonld
deleted file mode 100644
index 8f8fb4b..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0039-out.jsonld
+++ /dev/null
@@ -1 +0,0 @@
-[{"@id":"_:c14n0"},{"@id":"_:c14n1","http://example.org/vocab#p1":{"@id":"_:c14n0"}},{"@id":"_:c14n2","http://example.org/vocab#p1":[{"@id":"_:c14n1"},{"@id":"_:c14n3"}]},{"@id":"_:c14n3"}]
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0040-in.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0040-in.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0040-in.jsonld
deleted file mode 100644
index 6a8201e..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0040-in.jsonld
+++ /dev/null
@@ -1,33 +0,0 @@
-{
-  "@context": {
-    "ex": "http://example.org/vocab#",
-    "ex:p1": {
-      "@type": "@id"
-    },
-    "xsd": "http://www.w3.org/2001/XMLSchema#"
-  },
-  "@id": [
-    {
-      "@id": "_:b1",
-      "ex:p1": "_:b2"
-    },
-    {
-      "@id": "_:b2",
-      "ex:p1": "_:b3"
-    },
-    {
-      "@id": "_:b3"
-    },
-    {
-      "@id": "_:c1",
-      "ex:p1": "_:c2"
-    },
-    {
-      "@id": "_:c2",
-      "ex:p1": "_:c3"
-    },
-    {
-      "@id": "_:c3"
-    }
-  ]
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0040-out.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0040-out.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0040-out.jsonld
deleted file mode 100644
index 2600730..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0040-out.jsonld
+++ /dev/null
@@ -1 +0,0 @@
-[{"@id":"_:c14n0"},{"@id":"_:c14n1","http://example.org/vocab#p1":{"@id":"_:c14n0"}},{"@id":"_:c14n2","http://example.org/vocab#p1":{"@id":"_:c14n1"}},{"@id":"_:c14n3"},{"@id":"_:c14n4","http://example.org/vocab#p1":{"@id":"_:c14n3"}},{"@id":"_:c14n5","http://example.org/vocab#p1":{"@id":"_:c14n4"}}]
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0041-in.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0041-in.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0041-in.jsonld
deleted file mode 100644
index 1015f12..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0041-in.jsonld
+++ /dev/null
@@ -1,33 +0,0 @@
-{
-  "@context": {
-    "ex": "http://example.org/vocab#",
-    "ex:p1": {
-      "@type": "@id"
-    },
-    "xsd": "http://www.w3.org/2001/XMLSchema#"
-  },
-  "@id": [
-    {
-      "@id": "_:b1",
-      "ex:p1": "_:b2"
-    },
-    {
-      "@id": "_:b2",
-      "ex:p1": "_:b3"
-    },
-    {
-      "@id": "_:b3"
-    },
-    {
-      "@id": "_:b4",
-      "ex:p1": "_:b5"
-    },
-    {
-      "@id": "_:b5",
-      "ex:p1": "_:b6"
-    },
-    {
-      "@id": "_:b6"
-    }
-  ]
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0041-out.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0041-out.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0041-out.jsonld
deleted file mode 100644
index 2600730..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0041-out.jsonld
+++ /dev/null
@@ -1 +0,0 @@
-[{"@id":"_:c14n0"},{"@id":"_:c14n1","http://example.org/vocab#p1":{"@id":"_:c14n0"}},{"@id":"_:c14n2","http://example.org/vocab#p1":{"@id":"_:c14n1"}},{"@id":"_:c14n3"},{"@id":"_:c14n4","http://example.org/vocab#p1":{"@id":"_:c14n3"}},{"@id":"_:c14n5","http://example.org/vocab#p1":{"@id":"_:c14n4"}}]
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0042-in.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0042-in.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0042-in.jsonld
deleted file mode 100644
index ab0a3cc..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0042-in.jsonld
+++ /dev/null
@@ -1,27 +0,0 @@
-{
-  "@context": {
-    "ex": "http://example.org/vocab#",
-    "ex:p1": {
-      "@type": "@id"
-    },
-    "xsd": "http://www.w3.org/2001/XMLSchema#"
-  },
-  "@id": [
-    {
-      "@id": "_:b1",
-      "ex:p1": "_:b3"
-    },
-    {
-      "@id": "_:b3",
-      "ex:p1": {}
-    },
-    {
-      "@id": "_:b5",
-      "ex:p1": "_:b6"
-    },
-    {
-      "@id": "_:b6",
-      "ex:p1": {}
-    }
-  ]
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0042-out.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0042-out.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0042-out.jsonld
deleted file mode 100644
index 2600730..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0042-out.jsonld
+++ /dev/null
@@ -1 +0,0 @@
-[{"@id":"_:c14n0"},{"@id":"_:c14n1","http://example.org/vocab#p1":{"@id":"_:c14n0"}},{"@id":"_:c14n2","http://example.org/vocab#p1":{"@id":"_:c14n1"}},{"@id":"_:c14n3"},{"@id":"_:c14n4","http://example.org/vocab#p1":{"@id":"_:c14n3"}},{"@id":"_:c14n5","http://example.org/vocab#p1":{"@id":"_:c14n4"}}]
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0043-in.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0043-in.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0043-in.jsonld
deleted file mode 100644
index 5ab536c..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0043-in.jsonld
+++ /dev/null
@@ -1,10 +0,0 @@
-{
-  "@context": {
-    "ex": "http://example.org/vocab#"
-  },
-  "@id": "http://example.org/test",
-  "ex:test": {
-    "@language": "en",
-    "@value": "test"
-  }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0043-out.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0043-out.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0043-out.jsonld
deleted file mode 100644
index 7e2f2f5..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0043-out.jsonld
+++ /dev/null
@@ -1 +0,0 @@
-[{"@id":"http://example.org/test","http://example.org/vocab#test":{"@language":"en","@value":"test"}}]
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0044-in.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0044-in.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0044-in.jsonld
deleted file mode 100644
index 362fae9..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0044-in.jsonld
+++ /dev/null
@@ -1,107 +0,0 @@
-{
-  "@context": {
-    "eg": "http://example.org/vocab#",
-    "eg:p": {
-      "@type": "@id"
-    },
-    "xsd": "http://www.w3.org/2001/XMLSchema#"
-  },
-  "@id": [
-    {
-      "@id": "_:b1",
-      "eg:p": [
-        "_:b2",
-        "_:b4",
-        "_:b3"
-      ]
-    },
-    {
-      "@id": "_:b2",
-      "eg:p": [
-        "_:b1",
-        "_:b3",
-        "_:b5"
-      ]
-    },
-    {
-      "@id": "_:b3",
-      "eg:p": [
-        "_:b1",
-        "_:b2",
-        "_:b6"
-      ]
-    },
-    {
-      "@id": "_:b4",
-      "eg:p": [
-        "_:b1",
-        "_:b5",
-        "_:b6"
-      ]
-    },
-    {
-      "@id": "_:b5",
-      "eg:p": [
-        "_:b2",
-        "_:b4",
-        "_:b6"
-      ]
-    },
-    {
-      "@id": "_:b6",
-      "eg:p": [
-        "_:b3",
-        "_:b4",
-        "_:b5"
-      ]
-    },
-    {
-      "@id": "_:c1",
-      "eg:p": [
-        "_:c4",
-        "_:c5",
-        "_:c6"
-      ]
-    },
-    {
-      "@id": "_:c2",
-      "eg:p": [
-        "_:c4",
-        "_:c5",
-        "_:c6"
-      ]
-    },
-    {
-      "@id": "_:c3",
-      "eg:p": [
-        "_:c4",
-        "_:c5",
-        "_:c6"
-      ]
-    },
-    {
-      "@id": "_:c4",
-      "eg:p": [
-        "_:c1",
-        "_:c2",
-        "_:c3"
-      ]
-    },
-    {
-      "@id": "_:c5",
-      "eg:p": [
-        "_:c1",
-        "_:c2",
-        "_:c3"
-      ]
-    },
-    {
-      "@id": "_:c6",
-      "eg:p": [
-        "_:c1",
-        "_:c2",
-        "_:c3"
-      ]
-    }
-  ]
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0044-out.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0044-out.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0044-out.jsonld
deleted file mode 100644
index 04e86c9..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0044-out.jsonld
+++ /dev/null
@@ -1 +0,0 @@
-[{"@id":"_:c14n0","http://example.org/vocab#p":[{"@id":"_:c14n1"},{"@id":"_:c14n2"},{"@id":"_:c14n3"}]},{"@id":"_:c14n1","http://example.org/vocab#p":[{"@id":"_:c14n0"},{"@id":"_:c14n2"},{"@id":"_:c14n4"}]},{"@id":"_:c14n10","http://example.org/vocab#p":[{"@id":"_:c14n7"},{"@id":"_:c14n8"},{"@id":"_:c14n9"}]},{"@id":"_:c14n11","http://example.org/vocab#p":[{"@id":"_:c14n7"},{"@id":"_:c14n8"},{"@id":"_:c14n9"}]},{"@id":"_:c14n2","http://example.org/vocab#p":[{"@id":"_:c14n0"},{"@id":"_:c14n1"},{"@id":"_:c14n5"}]},{"@id":"_:c14n3","http://example.org/vocab#p":[{"@id":"_:c14n0"},{"@id":"_:c14n4"},{"@id":"_:c14n5"}]},{"@id":"_:c14n4","http://example.org/vocab#p":[{"@id":"_:c14n1"},{"@id":"_:c14n3"},{"@id":"_:c14n5"}]},{"@id":"_:c14n5","http://example.org/vocab#p":[{"@id":"_:c14n2"},{"@id":"_:c14n3"},{"@id":"_:c14n4"}]},{"@id":"_:c14n6","http://example.org/vocab#p":[{"@id":"_:c14n7"},{"@id":"_:c14n8"},{"@id":"_:c14n9"}]},{"@id":"_:c14n7","http://example.org/vocab#p":[{"@id":"_:c14n10"},{
 "@id":"_:c14n11"},{"@id":"_:c14n6"}]},{"@id":"_:c14n8","http://example.org/vocab#p":[{"@id":"_:c14n10"},{"@id":"_:c14n11"},{"@id":"_:c14n6"}]},{"@id":"_:c14n9","http://example.org/vocab#p":[{"@id":"_:c14n10"},{"@id":"_:c14n11"},{"@id":"_:c14n6"}]}]
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0045-in.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0045-in.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0045-in.jsonld
deleted file mode 100644
index 32dfac1..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0045-in.jsonld
+++ /dev/null
@@ -1,107 +0,0 @@
-{
-  "@context": {
-    "eg": "http://example.org/vocab#",
-    "eg:p": {
-      "@type": "@id"
-    },
-    "xsd": "http://www.w3.org/2001/XMLSchema#"
-  },
-  "@id": [
-    {
-      "@id": "_:c1",
-      "eg:p": [
-        "_:c4",
-        "_:c5",
-        "_:c6"
-      ]
-    },
-    {
-      "@id": "_:c2",
-      "eg:p": [
-        "_:c4",
-        "_:c5",
-        "_:c6"
-      ]
-    },
-    {
-      "@id": "_:c3",
-      "eg:p": [
-        "_:c4",
-        "_:c5",
-        "_:c6"
-      ]
-    },
-    {
-      "@id": "_:c4",
-      "eg:p": [
-        "_:c1",
-        "_:c2",
-        "_:c3"
-      ]
-    },
-    {
-      "@id": "_:c5",
-      "eg:p": [
-        "_:c1",
-        "_:c2",
-        "_:c3"
-      ]
-    },
-    {
-      "@id": "_:c6",
-      "eg:p": [
-        "_:c1",
-        "_:c2",
-        "_:c3"
-      ]
-    },
-    {
-      "@id": "_:b1",
-      "eg:p": [
-        "_:b2",
-        "_:b4",
-        "_:b3"
-      ]
-    },
-    {
-      "@id": "_:b2",
-      "eg:p": [
-        "_:b1",
-        "_:b3",
-        "_:b5"
-      ]
-    },
-    {
-      "@id": "_:b3",
-      "eg:p": [
-        "_:b1",
-        "_:b2",
-        "_:b6"
-      ]
-    },
-    {
-      "@id": "_:b4",
-      "eg:p": [
-        "_:b1",
-        "_:b5",
-        "_:b6"
-      ]
-    },
-    {
-      "@id": "_:b5",
-      "eg:p": [
-        "_:b2",
-        "_:b4",
-        "_:b6"
-      ]
-    },
-    {
-      "@id": "_:b6",
-      "eg:p": [
-        "_:b3",
-        "_:b4",
-        "_:b5"
-      ]
-    }
-  ]
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0045-out.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0045-out.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0045-out.jsonld
deleted file mode 100644
index 04e86c9..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0045-out.jsonld
+++ /dev/null
@@ -1 +0,0 @@
-[{"@id":"_:c14n0","http://example.org/vocab#p":[{"@id":"_:c14n1"},{"@id":"_:c14n2"},{"@id":"_:c14n3"}]},{"@id":"_:c14n1","http://example.org/vocab#p":[{"@id":"_:c14n0"},{"@id":"_:c14n2"},{"@id":"_:c14n4"}]},{"@id":"_:c14n10","http://example.org/vocab#p":[{"@id":"_:c14n7"},{"@id":"_:c14n8"},{"@id":"_:c14n9"}]},{"@id":"_:c14n11","http://example.org/vocab#p":[{"@id":"_:c14n7"},{"@id":"_:c14n8"},{"@id":"_:c14n9"}]},{"@id":"_:c14n2","http://example.org/vocab#p":[{"@id":"_:c14n0"},{"@id":"_:c14n1"},{"@id":"_:c14n5"}]},{"@id":"_:c14n3","http://example.org/vocab#p":[{"@id":"_:c14n0"},{"@id":"_:c14n4"},{"@id":"_:c14n5"}]},{"@id":"_:c14n4","http://example.org/vocab#p":[{"@id":"_:c14n1"},{"@id":"_:c14n3"},{"@id":"_:c14n5"}]},{"@id":"_:c14n5","http://example.org/vocab#p":[{"@id":"_:c14n2"},{"@id":"_:c14n3"},{"@id":"_:c14n4"}]},{"@id":"_:c14n6","http://example.org/vocab#p":[{"@id":"_:c14n7"},{"@id":"_:c14n8"},{"@id":"_:c14n9"}]},{"@id":"_:c14n7","http://example.org/vocab#p":[{"@id":"_:c14n10"},{
 "@id":"_:c14n11"},{"@id":"_:c14n6"}]},{"@id":"_:c14n8","http://example.org/vocab#p":[{"@id":"_:c14n10"},{"@id":"_:c14n11"},{"@id":"_:c14n6"}]},{"@id":"_:c14n9","http://example.org/vocab#p":[{"@id":"_:c14n10"},{"@id":"_:c14n11"},{"@id":"_:c14n6"}]}]
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0046-in.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0046-in.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0046-in.jsonld
deleted file mode 100644
index 30b8322..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0046-in.jsonld
+++ /dev/null
@@ -1,107 +0,0 @@
-{
-  "@context": {
-    "eg": "http://example.org/vocab#",
-    "eg:p": {
-      "@type": "@id"
-    },
-    "xsd": "http://www.w3.org/2001/XMLSchema#"
-  },
-  "@id": [
-    {
-      "@id": "_:b6",
-      "eg:p": [
-        "_:b3",
-        "_:b4",
-        "_:b5"
-      ]
-    },
-    {
-      "@id": "_:c1",
-      "eg:p": [
-        "_:c6",
-        "_:c5",
-        "_:c4"
-      ]
-    },
-    {
-      "@id": "_:b1",
-      "eg:p": [
-        "_:b3",
-        "_:b4",
-        "_:b2"
-      ]
-    },
-    {
-      "@id": "_:c4",
-      "eg:p": [
-        "_:c3",
-        "_:c2",
-        "_:c1"
-      ]
-    },
-    {
-      "@id": "_:c5",
-      "eg:p": [
-        "_:c1",
-        "_:c2",
-        "_:c3"
-      ]
-    },
-    {
-      "@id": "_:c6",
-      "eg:p": [
-        "_:c3",
-        "_:c1",
-        "_:c2"
-      ]
-    },
-    {
-      "@id": "_:b2",
-      "eg:p": [
-        "_:b1",
-        "_:b5",
-        "_:b3"
-      ]
-    },
-    {
-      "@id": "_:c2",
-      "eg:p": [
-        "_:c6",
-        "_:c5",
-        "_:c4"
-      ]
-    },
-    {
-      "@id": "_:b5",
-      "eg:p": [
-        "_:b6",
-        "_:b4",
-        "_:b2"
-      ]
-    },
-    {
-      "@id": "_:b3",
-      "eg:p": [
-        "_:b6",
-        "_:b2",
-        "_:b1"
-      ]
-    },
-    {
-      "@id": "_:b4",
-      "eg:p": [
-        "_:b5",
-        "_:b1",
-        "_:b6"
-      ]
-    },
-    {
-      "@id": "_:c3",
-      "eg:p": [
-        "_:c5",
-        "_:c4",
-        "_:c6"
-      ]
-    }
-  ]
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0046-out.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0046-out.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0046-out.jsonld
deleted file mode 100644
index 04e86c9..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0046-out.jsonld
+++ /dev/null
@@ -1 +0,0 @@
-[{"@id":"_:c14n0","http://example.org/vocab#p":[{"@id":"_:c14n1"},{"@id":"_:c14n2"},{"@id":"_:c14n3"}]},{"@id":"_:c14n1","http://example.org/vocab#p":[{"@id":"_:c14n0"},{"@id":"_:c14n2"},{"@id":"_:c14n4"}]},{"@id":"_:c14n10","http://example.org/vocab#p":[{"@id":"_:c14n7"},{"@id":"_:c14n8"},{"@id":"_:c14n9"}]},{"@id":"_:c14n11","http://example.org/vocab#p":[{"@id":"_:c14n7"},{"@id":"_:c14n8"},{"@id":"_:c14n9"}]},{"@id":"_:c14n2","http://example.org/vocab#p":[{"@id":"_:c14n0"},{"@id":"_:c14n1"},{"@id":"_:c14n5"}]},{"@id":"_:c14n3","http://example.org/vocab#p":[{"@id":"_:c14n0"},{"@id":"_:c14n4"},{"@id":"_:c14n5"}]},{"@id":"_:c14n4","http://example.org/vocab#p":[{"@id":"_:c14n1"},{"@id":"_:c14n3"},{"@id":"_:c14n5"}]},{"@id":"_:c14n5","http://example.org/vocab#p":[{"@id":"_:c14n2"},{"@id":"_:c14n3"},{"@id":"_:c14n4"}]},{"@id":"_:c14n6","http://example.org/vocab#p":[{"@id":"_:c14n7"},{"@id":"_:c14n8"},{"@id":"_:c14n9"}]},{"@id":"_:c14n7","http://example.org/vocab#p":[{"@id":"_:c14n10"},{
 "@id":"_:c14n11"},{"@id":"_:c14n6"}]},{"@id":"_:c14n8","http://example.org/vocab#p":[{"@id":"_:c14n10"},{"@id":"_:c14n11"},{"@id":"_:c14n6"}]},{"@id":"_:c14n9","http://example.org/vocab#p":[{"@id":"_:c14n10"},{"@id":"_:c14n11"},{"@id":"_:c14n6"}]}]
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0047-in.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0047-in.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0047-in.jsonld
deleted file mode 100644
index 73235dc..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0047-in.jsonld
+++ /dev/null
@@ -1,49 +0,0 @@
-{
-  "@context": {
-    "eg": "http://example.org/vocab#",
-    "eg:p": {
-      "@type": "@id"
-    },
-    "xsd": "http://www.w3.org/2001/XMLSchema#"
-  },
-  "@id": [
-    {
-      "@id": "_:b1",
-      "eg:p": [
-        "_:b2"
-      ]
-    },
-    {
-      "@id": "_:b2",
-      "eg:p": [
-        "_:b3"
-      ]
-    },
-    {
-      "@id": "_:b3",
-      "eg:z": [
-        "foo1",
-        "foo2"
-      ]
-    },
-    {
-      "@id": "_:c1",
-      "eg:p": [
-        "_:c2"
-      ]
-    },
-    {
-      "@id": "_:c2",
-      "eg:p": [
-        "_:c3"
-      ]
-    },
-    {
-      "@id": "_:c3",
-      "eg:z": [
-        "bar1",
-        "bar2"
-      ]
-    }
-  ]
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0047-out.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0047-out.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0047-out.jsonld
deleted file mode 100644
index e890491..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0047-out.jsonld
+++ /dev/null
@@ -1 +0,0 @@
-[{"@id":"_:c14n0","http://example.org/vocab#p":{"@id":"_:c14n1"}},{"@id":"_:c14n1","http://example.org/vocab#p":{"@id":"_:c14n2"}},{"@id":"_:c14n2","http://example.org/vocab#z":["bar1","bar2"]},{"@id":"_:c14n3","http://example.org/vocab#p":{"@id":"_:c14n4"}},{"@id":"_:c14n4","http://example.org/vocab#p":{"@id":"_:c14n5"}},{"@id":"_:c14n5","http://example.org/vocab#z":["foo1","foo2"]}]
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0048-in.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0048-in.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0048-in.jsonld
deleted file mode 100644
index b906670..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0048-in.jsonld
+++ /dev/null
@@ -1,49 +0,0 @@
-{
-  "@context": {
-    "eg": "http://example.org/vocab#",
-    "eg:p": {
-      "@type": "@id"
-    },
-    "xsd": "http://www.w3.org/2001/XMLSchema#"
-  },
-  "@id": [
-    {
-      "@id": "_:c1",
-      "eg:p": [
-        "_:c2"
-      ]
-    },
-    {
-      "@id": "_:c2",
-      "eg:p": [
-        "_:c3"
-      ]
-    },
-    {
-      "@id": "_:c3",
-      "eg:z": [
-        "bar1",
-        "bar2"
-      ]
-    },
-    {
-      "@id": "_:b1",
-      "eg:p": [
-        "_:b2"
-      ]
-    },
-    {
-      "@id": "_:b2",
-      "eg:p": [
-        "_:b3"
-      ]
-    },
-    {
-      "@id": "_:b3",
-      "eg:z": [
-        "foo1",
-        "foo2"
-      ]
-    }
-  ]
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0048-out.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0048-out.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0048-out.jsonld
deleted file mode 100644
index e890491..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0048-out.jsonld
+++ /dev/null
@@ -1 +0,0 @@
-[{"@id":"_:c14n0","http://example.org/vocab#p":{"@id":"_:c14n1"}},{"@id":"_:c14n1","http://example.org/vocab#p":{"@id":"_:c14n2"}},{"@id":"_:c14n2","http://example.org/vocab#z":["bar1","bar2"]},{"@id":"_:c14n3","http://example.org/vocab#p":{"@id":"_:c14n4"}},{"@id":"_:c14n4","http://example.org/vocab#p":{"@id":"_:c14n5"}},{"@id":"_:c14n5","http://example.org/vocab#z":["foo1","foo2"]}]
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0049-in.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0049-in.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0049-in.jsonld
deleted file mode 100644
index 9ef190e..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0049-in.jsonld
+++ /dev/null
@@ -1,11 +0,0 @@
-{
-  "@context": {
-    "eg": "http://example.org/vocab#",
-    "eg:p": {
-      "@type": "@id"
-    },
-    "xsd": "http://www.w3.org/2001/XMLSchema#"
-  },
-  "@id": "http://example.org/test#example",
-  "eg:p": null
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0049-out.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0049-out.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0049-out.jsonld
deleted file mode 100644
index aa595db..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0049-out.jsonld
+++ /dev/null
@@ -1 +0,0 @@
-[{"@id":"http://example.org/test#example"}]
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0050-in.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0050-in.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0050-in.jsonld
deleted file mode 100644
index 15d342f..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0050-in.jsonld
+++ /dev/null
@@ -1,20 +0,0 @@
-{
-  "@context": {
-    "eg": "http://example.org/vocab#",
-    "eg:p": {
-      "@type": "@id"
-    },
-    "xsd": "http://www.w3.org/2001/XMLSchema#"
-  },
-  "@id": "_:c1",
-  "eg:array": [
-    "value",
-    null
-  ],
-  "eg:doc": "Test 'null' in various locations",
-  "eg:null": null,
-  "eg:object": {
-    "prop1": "value1",
-    "prop2": null
-  }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0050-out.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0050-out.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0050-out.jsonld
deleted file mode 100644
index a061fd0..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0050-out.jsonld
+++ /dev/null
@@ -1 +0,0 @@
-[{"@id":"_:c14n0","prop1":"value1"},{"@id":"_:c14n1","http://example.org/vocab#array":"value","http://example.org/vocab#doc":"Test 'null' in various locations","http://example.org/vocab#object":{"@id":"_:c14n0"}}]
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0051-in.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0051-in.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0051-in.jsonld
deleted file mode 100644
index 52e673b..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0051-in.jsonld
+++ /dev/null
@@ -1,14 +0,0 @@
-[
-  {
-    "@id": "http://example.org/test#example",
-    "http://example.org/test#property": "object1"
-  },
-  {
-    "@id": "http://example.org/test#example",
-    "http://example.org/test#property": "object2"
-  },
-  {
-    "@id": "http://example.org/test#example",
-    "http://example.org/test#property": "object3"
-  }
-]
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0051-out.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0051-out.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0051-out.jsonld
deleted file mode 100644
index 9540db4..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0051-out.jsonld
+++ /dev/null
@@ -1 +0,0 @@
-[{"@id":"http://example.org/test#example","http://example.org/test#property":["object1","object2","object3"]}]
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0052-in.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0052-in.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0052-in.jsonld
deleted file mode 100644
index 37f9ecb..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0052-in.jsonld
+++ /dev/null
@@ -1,20 +0,0 @@
-{
-  "@context": {
-    "http://example.org/test#property1": {
-      "@type": "uri"
-    },
-    "http://example.org/test#property2": {
-      "@type": "uri"
-    },
-    "uri": "@id"
-  },
-  "http://example.org/test#property1": {
-    "http://example.org/test#property4": "foo",
-    "uri": "http://example.org/test#example2"
-  },
-  "http://example.org/test#property2": "http://example.org/test#example3",
-  "http://example.org/test#property3": {
-    "uri": "http://example.org/test#example4"
-  },
-  "uri": "http://example.org/test#example1"
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0052-out.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0052-out.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0052-out.jsonld
deleted file mode 100644
index 39fdbce..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0052-out.jsonld
+++ /dev/null
@@ -1 +0,0 @@
-[{"@id":"http://example.org/test#example1","http://example.org/test#property1":{"@id":"http://example.org/test#example2"},"http://example.org/test#property2":{"@id":"http://example.org/test#example3"},"http://example.org/test#property3":{"@id":"http://example.org/test#example4"}},{"@id":"http://example.org/test#example2","http://example.org/test#property4":"foo"},{"@id":"http://example.org/test#example3"},{"@id":"http://example.org/test#example4"}]
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-manifest.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-manifest.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-manifest.jsonld
deleted file mode 100644
index bf36434..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-manifest.jsonld
+++ /dev/null
@@ -1,268 +0,0 @@
-{
-   "@context": "http://json-ld.org/test-suite/context.jsonld",
-   "@id": "",
-   "@type": "jld:Manifest",
-   "rdfs:comment": "JSON-LD to Expansion tests use object compare",
-   "name": "normalize",
-   "sequence": [{
-      "@type": ["test:TestCase", "jld:NormalizeTest"],
-      "name": "simple id",
-      "input": "normalize-0001-in.jsonld",
-      "expect": "normalize-0001-out.jsonld"
-   }, {
-      "@type": ["test:TestCase", "jld:NormalizeTest"],
-      "name": "duplicate property iri values",
-      "input": "normalize-0002-in.jsonld",
-      "expect": "normalize-0002-out.jsonld"
-   }, {
-      "@type": ["test:TestCase", "jld:NormalizeTest"],
-      "name": "bnode",
-      "input": "normalize-0003-in.jsonld",
-      "expect": "normalize-0003-out.jsonld"
-   }, {
-      "@type": ["test:TestCase", "jld:NormalizeTest"],
-      "name": "bnode plus embed w/subject",
-      "input": "normalize-0004-in.jsonld",
-      "expect": "normalize-0004-out.jsonld"
-   }, {
-      "@type": ["test:TestCase", "jld:NormalizeTest"],
-      "name": "bnode embed",
-      "input": "normalize-0005-in.jsonld",
-      "expect": "normalize-0005-out.jsonld"
-   }, {
-      "@type": ["test:TestCase", "jld:NormalizeTest"],
-      "name": "multiple rdf types",
-      "input": "normalize-0006-in.jsonld",
-      "expect": "normalize-0006-out.jsonld"
-   }, {
-      "@type": ["test:TestCase", "jld:NormalizeTest"],
-      "name": "coerce CURIE value",
-      "input": "normalize-0007-in.jsonld",
-      "expect": "normalize-0007-out.jsonld"
-   }, {
-      "@type": ["test:TestCase", "jld:NormalizeTest"],
-      "name": "single subject complex",
-      "input": "normalize-0008-in.jsonld",
-      "expect": "normalize-0008-out.jsonld"
-   }, {
-      "@type": ["test:TestCase", "jld:NormalizeTest"],
-      "name": "multiple subjects - complex",
-      "input": "normalize-0009-in.jsonld",
-      "expect": "normalize-0009-out.jsonld"
-   }, {
-      "@type": ["test:TestCase", "jld:NormalizeTest"],
-      "name": "type",
-      "input": "normalize-0010-in.jsonld",
-      "expect": "normalize-0010-out.jsonld"
-   }, {
-      "@type": ["test:TestCase", "jld:NormalizeTest"],
-      "name": "type-coerced type",
-      "input": "normalize-0011-in.jsonld",
-      "expect": "normalize-0011-out.jsonld"
-   }, {
-      "@type": ["test:TestCase", "jld:NormalizeTest"],
-      "name": "type-coerced type, remove duplicate reference",
-      "input": "normalize-0012-in.jsonld",
-      "expect": "normalize-0012-out.jsonld"
-   }, {
-      "@type": ["test:TestCase", "jld:NormalizeTest"],
-      "name": "type-coerced type, cycle",
-      "input": "normalize-0013-in.jsonld",
-      "expect": "normalize-0013-out.jsonld"
-   }, {
-      "@type": ["test:TestCase", "jld:NormalizeTest"],
-      "name": "check types",
-      "input": "normalize-0014-in.jsonld",
-      "expect": "normalize-0014-out.jsonld"
-   }, {
-      "@type": ["test:TestCase", "jld:NormalizeTest"],
-      "name": "top level context",
-      "input": "normalize-0015-in.jsonld",
-      "expect": "normalize-0015-out.jsonld"
-   }, {
-      "@type": ["test:TestCase", "jld:NormalizeTest"],
-      "name": "blank node - dual link - embed",
-      "input": "normalize-0016-in.jsonld",
-      "expect": "normalize-0016-out.jsonld"
-   }, {
-      "@type": ["test:TestCase", "jld:NormalizeTest"],
-      "name": "blank node - dual link - non-embed",
-      "input": "normalize-0017-in.jsonld",
-      "expect": "normalize-0017-out.jsonld"
-   }, {
-      "@type": ["test:TestCase", "jld:NormalizeTest"],
-      "name": "blank node - self link",
-      "input": "normalize-0018-in.jsonld",
-      "expect": "normalize-0018-out.jsonld"
-   }, {
-      "@type": ["test:TestCase", "jld:NormalizeTest"],
-      "name": "blank node - disjoint self links",
-      "input": "normalize-0019-in.jsonld",
-      "expect": "normalize-0019-out.jsonld"
-   }, {
-      "@type": ["test:TestCase", "jld:NormalizeTest"],
-      "name": "blank node - diamond",
-      "input": "normalize-0020-in.jsonld",
-      "expect": "normalize-0020-out.jsonld"
-   }, {
-      "@type": ["test:TestCase", "jld:NormalizeTest"],
-      "name": "blank node - circle of 2",
-      "input": "normalize-0021-in.jsonld",
-      "expect": "normalize-0021-out.jsonld"
-   }, {
-      "@type": ["test:TestCase", "jld:NormalizeTest"],
-      "name": "blank node - double circle of 2",
-      "input": "normalize-0022-in.jsonld",
-      "expect": "normalize-0022-out.jsonld"
-   }, {
-      "@type": ["test:TestCase", "jld:NormalizeTest"],
-      "name": "blank node - circle of 3",
-      "input": "normalize-0023-in.jsonld",
-      "expect": "normalize-0023-out.jsonld"
-   }, {
-      "@type": ["test:TestCase", "jld:NormalizeTest"],
-      "name": "blank node - double circle of 3 (1-2-3)",
-      "input": "normalize-0024-in.jsonld",
-      "expect": "normalize-0024-out.jsonld"
-   }, {
-      "@type": ["test:TestCase", "jld:NormalizeTest"],
-      "name": "blank node - double circle of 3 (1-3-2)",
-      "input": "normalize-0025-in.jsonld",
-      "expect": "normalize-0025-out.jsonld"
-   }, {
-      "@type": ["test:TestCase", "jld:NormalizeTest"],
-      "name": "blank node - double circle of 3 (2-1-3)",
-      "input": "normalize-0026-in.jsonld",
-      "expect": "normalize-0026-out.jsonld"
-   }, {
-      "@type": ["test:TestCase", "jld:NormalizeTest"],
-      "name": "blank node - double circle of 3 (2-3-1)",
-      "input": "normalize-0027-in.jsonld",
-      "expect": "normalize-0027-out.jsonld"
-   }, {
-      "@type": ["test:TestCase", "jld:NormalizeTest"],
-      "name": "blank node - double circle of 3 (3-2-1)",
-      "input": "normalize-0028-in.jsonld",
-      "expect": "normalize-0028-out.jsonld"
-   }, {
-      "@type": ["test:TestCase", "jld:NormalizeTest"],
-      "name": "blank node - double circle of 3 (3-1-2)",
-      "input": "normalize-0029-in.jsonld",
-      "expect": "normalize-0029-out.jsonld"
-   }, {
-      "@type": ["test:TestCase", "jld:NormalizeTest"],
-      "name": "blank node - point at circle of 3",
-      "input": "normalize-0030-in.jsonld",
-      "expect": "normalize-0030-out.jsonld"
-   }, {
-      "@type": ["test:TestCase", "jld:NormalizeTest"],
-      "name": "bnode (1)",
-      "input": "normalize-0031-in.jsonld",
-      "expect": "normalize-0031-out.jsonld"
-   }, {
-      "@type": ["test:TestCase", "jld:NormalizeTest"],
-      "name": "bnode (2)",
-      "input": "normalize-0032-in.jsonld",
-      "expect": "normalize-0032-out.jsonld"
-   }, {
-      "@type": ["test:TestCase", "jld:NormalizeTest"],
-      "name": "disjoint identical subgraphs (1)",
-      "input": "normalize-0033-in.jsonld",
-      "expect": "normalize-0033-out.jsonld"
-   }, {
-      "@type": ["test:TestCase", "jld:NormalizeTest"],
-      "name": "disjoint identical subgraphs (2)",
-      "input": "normalize-0034-in.jsonld",
-      "expect": "normalize-0034-out.jsonld"
-   }, {
-      "@type": ["test:TestCase", "jld:NormalizeTest"],
-      "name": "reordered w/strings (1)",
-      "input": "normalize-0035-in.jsonld",
-      "expect": "normalize-0035-out.jsonld"
-   }, {
-      "@type": ["test:TestCase", "jld:NormalizeTest"],
-      "name": "reordered w/strings (2)",
-      "input": "normalize-0036-in.jsonld",
-      "expect": "normalize-0036-out.jsonld"
-   }, {
-      "@type": ["test:TestCase", "jld:NormalizeTest"],
-      "name": "reordered w/strings (3)",
-      "input": "normalize-0037-in.jsonld",
-      "expect": "normalize-0037-out.jsonld"
-   }, {
-      "@type": ["test:TestCase", "jld:NormalizeTest"],
-      "name": "reordered 4 bnodes, reordered 2 properties (1)",
-      "input": "normalize-0038-in.jsonld",
-      "expect": "normalize-0038-out.jsonld"
-   }, {
-      "@type": ["test:TestCase", "jld:NormalizeTest"],
-      "name": "reordered 4 bnodes, reordered 2 properties (2)",
-      "input": "normalize-0039-in.jsonld",
-      "expect": "normalize-0039-out.jsonld"
-   }, {
-      "@type": ["test:TestCase", "jld:NormalizeTest"],
-      "name": "reordered 6 bnodes (1)",
-      "input": "normalize-0040-in.jsonld",
-      "expect": "normalize-0040-out.jsonld"
-   }, {
-      "@type": ["test:TestCase", "jld:NormalizeTest"],
-      "name": "reordered 6 bnodes (2)",
-      "input": "normalize-0041-in.jsonld",
-      "expect": "normalize-0041-out.jsonld"
-   }, {
-      "@type": ["test:TestCase", "jld:NormalizeTest"],
-      "name": "reordered 6 bnodes (3)",
-      "input": "normalize-0042-in.jsonld",
-      "expect": "normalize-0042-out.jsonld"
-   }, {
-      "@type": ["test:TestCase", "jld:NormalizeTest"],
-      "name": "literal with language",
-      "input": "normalize-0043-in.jsonld",
-      "expect": "normalize-0043-out.jsonld"
-   }, {
-      "@type": ["test:TestCase", "jld:NormalizeTest"],
-      "name": "evil (1)",
-      "input": "normalize-0044-in.jsonld",
-      "expect": "normalize-0044-out.jsonld"
-   }, {
-      "@type": ["test:TestCase", "jld:NormalizeTest"],
-      "name": "evil (2)",
-      "input": "normalize-0045-in.jsonld",
-      "expect": "normalize-0045-out.jsonld"
-   }, {
-      "@type": ["test:TestCase", "jld:NormalizeTest"],
-      "name": "evil (3)",
-      "input": "normalize-0046-in.jsonld",
-      "expect": "normalize-0046-out.jsonld"
-   }, {
-      "@type": ["test:TestCase", "jld:NormalizeTest"],
-      "name": "deep diff (1)",
-      "input": "normalize-0047-in.jsonld",
-      "expect": "normalize-0047-out.jsonld"
-   }, {
-      "@type": ["test:TestCase", "jld:NormalizeTest"],
-      "name": "deep diff (2)",
-      "input": "normalize-0048-in.jsonld",
-      "expect": "normalize-0048-out.jsonld"
-   }, {
-      "@type": ["test:TestCase", "jld:NormalizeTest"],
-      "name": "remove null",
-      "input": "normalize-0049-in.jsonld",
-      "expect": "normalize-0049-out.jsonld"
-   }, {
-      "@type": ["test:TestCase", "jld:NormalizeTest"],
-      "name": "nulls",
-      "input": "normalize-0050-in.jsonld",
-      "expect": "normalize-0050-out.jsonld"
-   }, {
-      "@type": ["test:TestCase", "jld:NormalizeTest"],
-      "name": "merging subjects",
-      "input": "normalize-0051-in.jsonld",
-      "expect": "normalize-0051-out.jsonld"
-   }, {
-      "@type": ["test:TestCase", "jld:NormalizeTest"],
-      "name": "alias keywords",
-      "input": "normalize-0052-in.jsonld",
-      "expect": "normalize-0052-out.jsonld"
-   }]
-}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0001.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0001.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0001.jsonld
deleted file mode 100644
index fc4e381..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0001.jsonld
+++ /dev/null
@@ -1,4 +0,0 @@
-{
-  "@id": "http://greggkellogg.net/foaf#me",
-  "http://xmlns.com/foaf/0.1/name": "Gregg Kellogg"
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0001.sparql
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0001.sparql b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0001.sparql
deleted file mode 100644
index 2e277df..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0001.sparql
+++ /dev/null
@@ -1,5 +0,0 @@
-PREFIX foaf: <http://xmlns.com/foaf/0.1/>
-
-ASK WHERE {
-	<http://greggkellogg.net/foaf#me> foaf:name "Gregg Kellogg" .
-}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0002.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0002.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0002.jsonld
deleted file mode 100644
index bd662d1..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0002.jsonld
+++ /dev/null
@@ -1,5 +0,0 @@
-{
-  "@context": {"foaf": "http://xmlns.com/foaf/0.1/"},
-  "@id": "http://greggkellogg.net/foaf#me",
-  "foaf:name": "Gregg Kellogg"
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0002.sparql
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0002.sparql b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0002.sparql
deleted file mode 100644
index 2e277df..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0002.sparql
+++ /dev/null
@@ -1,5 +0,0 @@
-PREFIX foaf: <http://xmlns.com/foaf/0.1/>
-
-ASK WHERE {
-	<http://greggkellogg.net/foaf#me> foaf:name "Gregg Kellogg" .
-}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0003.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0003.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0003.jsonld
deleted file mode 100644
index 7955fff..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0003.jsonld
+++ /dev/null
@@ -1,4 +0,0 @@
-{
-  "@context": {"foaf": "http://xmlns.com/foaf/0.1/"},
-  "@type": "foaf:Person"
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0003.sparql
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0003.sparql b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0003.sparql
deleted file mode 100644
index b127345..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0003.sparql
+++ /dev/null
@@ -1,5 +0,0 @@
-PREFIX foaf: <http://xmlns.com/foaf/0.1/>
-
-ASK WHERE {
-  ?s a foaf:Person .
-}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0004.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0004.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0004.jsonld
deleted file mode 100644
index 31d68b8..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0004.jsonld
+++ /dev/null
@@ -1,6 +0,0 @@
-{
-  "http://www.w3.org/2000/01/rdf-schema#label": {
-    "@value": "A plain literal with a lang tag.",
-    "@language": "en-us"
-  }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0004.sparql
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0004.sparql b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0004.sparql
deleted file mode 100644
index 1bef03c..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0004.sparql
+++ /dev/null
@@ -1,5 +0,0 @@
-PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
-
-ASK WHERE {
-  _:s rdfs:label "A plain literal with a lang tag."@en-us .
-}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0005.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0005.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0005.jsonld
deleted file mode 100644
index 1b04c4e..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0005.jsonld
+++ /dev/null
@@ -1,6 +0,0 @@
-{
-  "@id": "http://greggkellogg.net/foaf#me",
-  "http://xmlns.com/foaf/0.1/knows": {
-    "http://xmlns.com/foaf/0.1/name": {"@value": "Herman Iván", "@language": "hu"}
-  }
-}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0005.sparql
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0005.sparql b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0005.sparql
deleted file mode 100644
index 8d2756f..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0005.sparql
+++ /dev/null
@@ -1,5 +0,0 @@
-PREFIX foaf: <http://xmlns.com/foaf/0.1/>
-
-ASK WHERE {
-  <http://greggkellogg.net/foaf#me> foaf:knows [ foaf:name "Herman Iv\u00E1n"@hu ].
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0006.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0006.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0006.jsonld
deleted file mode 100644
index f83b97c..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0006.jsonld
+++ /dev/null
@@ -1,7 +0,0 @@
-{
-  "@id":  "http://greggkellogg.net/foaf#me",
-  "http://purl.org/dc/terms/created":  {
-    "@value": "1957-02-27",
-    "@type": "http://www.w3.org/2001/XMLSchema#date"
-  }
-}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0006.sparql
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0006.sparql b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0006.sparql
deleted file mode 100644
index 150a92f..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0006.sparql
+++ /dev/null
@@ -1,6 +0,0 @@
-PREFIX dc: <http://purl.org/dc/terms/>
-PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
-
-ASK WHERE {
-  <http://greggkellogg.net/foaf#me> dc:created "1957-02-27"^^xsd:date
-}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0007.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0007.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0007.jsonld
deleted file mode 100644
index 5d2c77d..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0007.jsonld
+++ /dev/null
@@ -1,4 +0,0 @@
-{
-  "@id": "http://greggkellogg.net/foaf#me",
-  "@type": "http://xmlns.com/foaf/0.1/Person"
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0007.sparql
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0007.sparql b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0007.sparql
deleted file mode 100644
index 1cd523d..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0007.sparql
+++ /dev/null
@@ -1,6 +0,0 @@
-PREFIX foaf: <http://xmlns.com/foaf/0.1/>
-PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
-
-ASK WHERE {
-  <http://greggkellogg.net/foaf#me> rdf:type foaf:Person
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0008.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0008.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0008.jsonld
deleted file mode 100644
index f767f65..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0008.jsonld
+++ /dev/null
@@ -1,4 +0,0 @@
-{
-  "@context": {"d": "http://example.com/default#"},
-  "d:foo": "bar"
-}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0008.sparql
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0008.sparql b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0008.sparql
deleted file mode 100644
index ae60cda..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0008.sparql
+++ /dev/null
@@ -1,3 +0,0 @@
-ASK WHERE {
-  _:a <http://example.com/default#foo> "bar" .
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0009.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0009.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0009.jsonld
deleted file mode 100644
index b8cec51..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0009.jsonld
+++ /dev/null
@@ -1,4 +0,0 @@
-{
-  "@context": {"": "http://example.com/default#"},
-  ":foo": "bar"
-}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0009.sparql
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0009.sparql b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0009.sparql
deleted file mode 100644
index ae60cda..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0009.sparql
+++ /dev/null
@@ -1,3 +0,0 @@
-ASK WHERE {
-  _:a <http://example.com/default#foo> "bar" .
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0010.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0010.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0010.jsonld
deleted file mode 100644
index 1ecc30b..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0010.jsonld
+++ /dev/null
@@ -1,8 +0,0 @@
-{
-  "@context": {"foaf": "http://xmlns.com/foaf/0.1/"},
-  "@id": "http://greggkellogg.net/foaf#me",
-  "foaf:knows": {
-    "@id": "http://manu.sporny.org/#me",
-    "foaf:name": "Manu Sporny"
-  }
-}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0010.sparql
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0010.sparql b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0010.sparql
deleted file mode 100644
index 09110ab..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0010.sparql
+++ /dev/null
@@ -1,6 +0,0 @@
-PREFIX foaf: <http://xmlns.com/foaf/0.1/>
-
-ASK WHERE {
-  <http://greggkellogg.net/foaf#me> foaf:knows <http://manu.sporny.org/#me> .
-  <http://manu.sporny.org/#me> foaf:name "Manu Sporny" .
-}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0011.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0011.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0011.jsonld
deleted file mode 100644
index 853938f..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0011.jsonld
+++ /dev/null
@@ -1,9 +0,0 @@
-{
-  "@context": {
-    "foaf": "http://xmlns.com/foaf/0.1/"
-  },
-  "@id": "http://greggkellogg.net/foaf#me",
-  "foaf:knows": {
-    "foaf:name": "Dave Longley"
-  }
-}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0011.sparql
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0011.sparql b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0011.sparql
deleted file mode 100644
index 98396d8..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0011.sparql
+++ /dev/null
@@ -1,6 +0,0 @@
-PREFIX foaf: <http://xmlns.com/foaf/0.1/>
-
-ASK WHERE {
-  <http://greggkellogg.net/foaf#me> foaf:knows ?o .
-  ?o foaf:name "Dave Longley" .
-}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0012.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0012.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0012.jsonld
deleted file mode 100644
index 2b32617..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0012.jsonld
+++ /dev/null
@@ -1,7 +0,0 @@
-{
-  "@context": {
-    "foaf": "http://xmlns.com/foaf/0.1/"
-  },
-  "@id": "http://greggkellogg.net/foaf#me",
-  "foaf:knows": ["Manu Sporny", "Dave Longley"]
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0012.sparql
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0012.sparql b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0012.sparql
deleted file mode 100644
index cebd022..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0012.sparql
+++ /dev/null
@@ -1,5 +0,0 @@
-PREFIX foaf: <http://xmlns.com/foaf/0.1/>
-
-ASK WHERE {
-  <http://greggkellogg.net/foaf#me> foaf:knows "Manu Sporny", "Dave Longley" .
-}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0013.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0013.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0013.jsonld
deleted file mode 100644
index d5b025d..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0013.jsonld
+++ /dev/null
@@ -1,7 +0,0 @@
-{
-  "@context": {
-    "foaf": "http://xmlns.com/foaf/0.1/"
-  },
-  "@id": "http://greggkellogg.net/foaf#me",
-  "foaf:knows": {"@list": []}
-}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0013.sparql
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0013.sparql b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0013.sparql
deleted file mode 100644
index 8d302ce..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0013.sparql
+++ /dev/null
@@ -1,5 +0,0 @@
-PREFIX foaf: <http://xmlns.com/foaf/0.1/>
-
-ASK WHERE {
-  <http://greggkellogg.net/foaf#me> foaf:knows [] .
-}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0014.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0014.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0014.jsonld
deleted file mode 100644
index 327284f..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0014.jsonld
+++ /dev/null
@@ -1,7 +0,0 @@
-{
-  "@context": {
-    "foaf": "http://xmlns.com/foaf/0.1/"
-  },
-  "@id": "http://greggkellogg.net/foaf#me",
-  "foaf:knows": {"@list": ["Manu Sporny"]}
-}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0014.sparql
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0014.sparql b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0014.sparql
deleted file mode 100644
index 92cde3e..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0014.sparql
+++ /dev/null
@@ -1,5 +0,0 @@
-PREFIX foaf: <http://xmlns.com/foaf/0.1/>
-
-ASK WHERE {
-  <http://greggkellogg.net/foaf#me> foaf:knows ("Manu Sporny") .
-}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0015.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0015.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0015.jsonld
deleted file mode 100644
index b340db4..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0015.jsonld
+++ /dev/null
@@ -1,7 +0,0 @@
-{
-  "@context": {
-    "foaf": "http://xmlns.com/foaf/0.1/"
-  },
-  "@id": "http://greggkellogg.net/foaf#me",
-  "foaf:knows": {"@list": ["Manu Sporny", "Dave Longley"]}
-}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0015.sparql
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0015.sparql b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0015.sparql
deleted file mode 100644
index 393a23b..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0015.sparql
+++ /dev/null
@@ -1,5 +0,0 @@
-PREFIX foaf: <http://xmlns.com/foaf/0.1/>
-
-ASK WHERE {
-  <http://greggkellogg.net/foaf#me> foaf:knows ("Manu Sporny" "Dave Longley") .
-}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0016.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0016.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0016.jsonld
deleted file mode 100644
index bdd01c9..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0016.jsonld
+++ /dev/null
@@ -1,4 +0,0 @@
-{
-  "@id": "",
-  "@type": "http://www.w3.org/2000/01/rdf-schema#Resource"
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0016.sparql
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0016.sparql b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0016.sparql
deleted file mode 100644
index 42dd56b..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0016.sparql
+++ /dev/null
@@ -1,5 +0,0 @@
-PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
-
-ASK WHERE {
-  <http://json-ld.org/test-suite/tests/rdf-0016.jsonld> a rdfs:Resource
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0017.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0017.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0017.jsonld
deleted file mode 100644
index 7e39ca8..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0017.jsonld
+++ /dev/null
@@ -1,4 +0,0 @@
-{
-  "@id": "a/b",
-  "@type": "http://www.w3.org/2000/01/rdf-schema#Resource"
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0017.sparql
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0017.sparql b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0017.sparql
deleted file mode 100644
index 10ea9d2..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0017.sparql
+++ /dev/null
@@ -1,5 +0,0 @@
-PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
-
-ASK WHERE {
-  <http://json-ld.org/test-suite/tests/a/b> a rdfs:Resource
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0018.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0018.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0018.jsonld
deleted file mode 100644
index 64ee0c9..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0018.jsonld
+++ /dev/null
@@ -1,4 +0,0 @@
-{
-  "@id": "#frag",
-  "@type": "http://www.w3.org/2000/01/rdf-schema#Resource"
-}
\ No newline at end of file


[058/100] [abbrv] git commit: removed Andy Seaborne from the authors list, he's not a committer.

Posted by wi...@apache.org.
removed Andy Seaborne from the authors list, he's not a committer.

http://marmotta.apache.org/acknowledgements.html


Project: http://git-wip-us.apache.org/repos/asf/marmotta/repo
Commit: http://git-wip-us.apache.org/repos/asf/marmotta/commit/27ccb556
Tree: http://git-wip-us.apache.org/repos/asf/marmotta/tree/27ccb556
Diff: http://git-wip-us.apache.org/repos/asf/marmotta/diff/27ccb556

Branch: refs/heads/ldp
Commit: 27ccb556ebf642cafbce52e829bd9c7cf5247325
Parents: 2c1b1f5
Author: Jakob Frank <ja...@apache.org>
Authored: Tue Apr 8 10:57:57 2014 +0200
Committer: Jakob Frank <ja...@apache.org>
Committed: Tue Apr 8 11:05:47 2014 +0200

----------------------------------------------------------------------
 .../marmotta-installer/src/main/resources/installer/standalone.xml  | 1 -
 1 file changed, 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/marmotta/blob/27ccb556/launchers/marmotta-installer/src/main/resources/installer/standalone.xml
----------------------------------------------------------------------
diff --git a/launchers/marmotta-installer/src/main/resources/installer/standalone.xml b/launchers/marmotta-installer/src/main/resources/installer/standalone.xml
index 2590979..7d392aa 100644
--- a/launchers/marmotta-installer/src/main/resources/installer/standalone.xml
+++ b/launchers/marmotta-installer/src/main/resources/installer/standalone.xml
@@ -39,7 +39,6 @@
             <author name="Dietmar Glachs" email="dglachs@apache.org" />
             <author name="Raffaele Palmieri" email="rpalmieri@apache.org" />
             <author name="Peter Ansell" email="ansell@apache.org" />
-            <author name="Andy Seaborne" email="andy@apache.org" />
             <author name="Nandana Mihindukulasooriya" email="nandana@apache.org" />
             <author name="Fabian Christ" email="fchrist@apache.org" />
         </authors>


[003/100] [abbrv] [partial] Reverting the erroneous merge by Sebastian according to the instructions in INFRA-6876

Posted by wi...@apache.org.
http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/platform/marmotta-core/src/main/resources/web/public/js/lib/jquery-1.6.4.js
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/resources/web/public/js/lib/jquery-1.6.4.js b/platform/marmotta-core/src/main/resources/web/public/js/lib/jquery-1.6.4.js
deleted file mode 100644
index 11e6d06..0000000
--- a/platform/marmotta-core/src/main/resources/web/public/js/lib/jquery-1.6.4.js
+++ /dev/null
@@ -1,9046 +0,0 @@
-/*!
- * jQuery JavaScript Library v1.6.4
- * http://jquery.com/
- *
- * Copyright 2011, John Resig
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * Includes Sizzle.js
- * http://sizzlejs.com/
- * Copyright 2011, The Dojo Foundation
- * Released under the MIT, BSD, and GPL Licenses.
- *
- * Date: Mon Sep 12 18:54:48 2011 -0400
- */
-(function( window, undefined ) {
-
-// Use the correct document accordingly with window argument (sandbox)
-var document = window.document,
-	navigator = window.navigator,
-	location = window.location;
-var jQuery = (function() {
-
-// Define a local copy of jQuery
-var jQuery = function( selector, context ) {
-		// The jQuery object is actually just the init constructor 'enhanced'
-		return new jQuery.fn.init( selector, context, rootjQuery );
-	},
-
-	// Map over jQuery in case of overwrite
-	_jQuery = window.jQuery,
-
-	// Map over the $ in case of overwrite
-	_$ = window.$,
-
-	// A central reference to the root jQuery(document)
-	rootjQuery,
-
-	// A simple way to check for HTML strings or ID strings
-	// Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
-	quickExpr = /^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,
-
-	// Check if a string has a non-whitespace character in it
-	rnotwhite = /\S/,
-
-	// Used for trimming whitespace
-	trimLeft = /^\s+/,
-	trimRight = /\s+$/,
-
-	// Check for digits
-	rdigit = /\d/,
-
-	// Match a standalone tag
-	rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>)?$/,
-
-	// JSON RegExp
-	rvalidchars = /^[\],:{}\s]*$/,
-	rvalidescape = /\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,
-	rvalidtokens = /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,
-	rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g,
-
-	// Useragent RegExp
-	rwebkit = /(webkit)[ \/]([\w.]+)/,
-	ropera = /(opera)(?:.*version)?[ \/]([\w.]+)/,
-	rmsie = /(msie) ([\w.]+)/,
-	rmozilla = /(mozilla)(?:.*? rv:([\w.]+))?/,
-
-	// Matches dashed string for camelizing
-	rdashAlpha = /-([a-z]|[0-9])/ig,
-	rmsPrefix = /^-ms-/,
-
-	// Used by jQuery.camelCase as callback to replace()
-	fcamelCase = function( all, letter ) {
-		return ( letter + "" ).toUpperCase();
-	},
-
-	// Keep a UserAgent string for use with jQuery.browser
-	userAgent = navigator.userAgent,
-
-	// For matching the engine and version of the browser
-	browserMatch,
-
-	// The deferred used on DOM ready
-	readyList,
-
-	// The ready event handler
-	DOMContentLoaded,
-
-	// Save a reference to some core methods
-	toString = Object.prototype.toString,
-	hasOwn = Object.prototype.hasOwnProperty,
-	push = Array.prototype.push,
-	slice = Array.prototype.slice,
-	trim = String.prototype.trim,
-	indexOf = Array.prototype.indexOf,
-
-	// [[Class]] -> type pairs
-	class2type = {};
-
-jQuery.fn = jQuery.prototype = {
-	constructor: jQuery,
-	init: function( selector, context, rootjQuery ) {
-		var match, elem, ret, doc;
-
-		// Handle $(""), $(null), or $(undefined)
-		if ( !selector ) {
-			return this;
-		}
-
-		// Handle $(DOMElement)
-		if ( selector.nodeType ) {
-			this.context = this[0] = selector;
-			this.length = 1;
-			return this;
-		}
-
-		// The body element only exists once, optimize finding it
-		if ( selector === "body" && !context && document.body ) {
-			this.context = document;
-			this[0] = document.body;
-			this.selector = selector;
-			this.length = 1;
-			return this;
-		}
-
-		// Handle HTML strings
-		if ( typeof selector === "string" ) {
-			// Are we dealing with HTML string or an ID?
-			if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) {
-				// Assume that strings that start and end with <> are HTML and skip the regex check
-				match = [ null, selector, null ];
-
-			} else {
-				match = quickExpr.exec( selector );
-			}
-
-			// Verify a match, and that no context was specified for #id
-			if ( match && (match[1] || !context) ) {
-
-				// HANDLE: $(html) -> $(array)
-				if ( match[1] ) {
-					context = context instanceof jQuery ? context[0] : context;
-					doc = (context ? context.ownerDocument || context : document);
-
-					// If a single string is passed in and it's a single tag
-					// just do a createElement and skip the rest
-					ret = rsingleTag.exec( selector );
-
-					if ( ret ) {
-						if ( jQuery.isPlainObject( context ) ) {
-							selector = [ document.createElement( ret[1] ) ];
-							jQuery.fn.attr.call( selector, context, true );
-
-						} else {
-							selector = [ doc.createElement( ret[1] ) ];
-						}
-
-					} else {
-						ret = jQuery.buildFragment( [ match[1] ], [ doc ] );
-						selector = (ret.cacheable ? jQuery.clone(ret.fragment) : ret.fragment).childNodes;
-					}
-
-					return jQuery.merge( this, selector );
-
-				// HANDLE: $("#id")
-				} else {
-					elem = document.getElementById( match[2] );
-
-					// Check parentNode to catch when Blackberry 4.6 returns
-					// nodes that are no longer in the document #6963
-					if ( elem && elem.parentNode ) {
-						// Handle the case where IE and Opera return items
-						// by name instead of ID
-						if ( elem.id !== match[2] ) {
-							return rootjQuery.find( selector );
-						}
-
-						// Otherwise, we inject the element directly into the jQuery object
-						this.length = 1;
-						this[0] = elem;
-					}
-
-					this.context = document;
-					this.selector = selector;
-					return this;
-				}
-
-			// HANDLE: $(expr, $(...))
-			} else if ( !context || context.jquery ) {
-				return (context || rootjQuery).find( selector );
-
-			// HANDLE: $(expr, context)
-			// (which is just equivalent to: $(context).find(expr)
-			} else {
-				return this.constructor( context ).find( selector );
-			}
-
-		// HANDLE: $(function)
-		// Shortcut for document ready
-		} else if ( jQuery.isFunction( selector ) ) {
-			return rootjQuery.ready( selector );
-		}
-
-		if (selector.selector !== undefined) {
-			this.selector = selector.selector;
-			this.context = selector.context;
-		}
-
-		return jQuery.makeArray( selector, this );
-	},
-
-	// Start with an empty selector
-	selector: "",
-
-	// The current version of jQuery being used
-	jquery: "1.6.4",
-
-	// The default length of a jQuery object is 0
-	length: 0,
-
-	// The number of elements contained in the matched element set
-	size: function() {
-		return this.length;
-	},
-
-	toArray: function() {
-		return slice.call( this, 0 );
-	},
-
-	// Get the Nth element in the matched element set OR
-	// Get the whole matched element set as a clean array
-	get: function( num ) {
-		return num == null ?
-
-			// Return a 'clean' array
-			this.toArray() :
-
-			// Return just the object
-			( num < 0 ? this[ this.length + num ] : this[ num ] );
-	},
-
-	// Take an array of elements and push it onto the stack
-	// (returning the new matched element set)
-	pushStack: function( elems, name, selector ) {
-		// Build a new jQuery matched element set
-		var ret = this.constructor();
-
-		if ( jQuery.isArray( elems ) ) {
-			push.apply( ret, elems );
-
-		} else {
-			jQuery.merge( ret, elems );
-		}
-
-		// Add the old object onto the stack (as a reference)
-		ret.prevObject = this;
-
-		ret.context = this.context;
-
-		if ( name === "find" ) {
-			ret.selector = this.selector + (this.selector ? " " : "") + selector;
-		} else if ( name ) {
-			ret.selector = this.selector + "." + name + "(" + selector + ")";
-		}
-
-		// Return the newly-formed element set
-		return ret;
-	},
-
-	// Execute a callback for every element in the matched set.
-	// (You can seed the arguments with an array of args, but this is
-	// only used internally.)
-	each: function( callback, args ) {
-		return jQuery.each( this, callback, args );
-	},
-
-	ready: function( fn ) {
-		// Attach the listeners
-		jQuery.bindReady();
-
-		// Add the callback
-		readyList.done( fn );
-
-		return this;
-	},
-
-	eq: function( i ) {
-		return i === -1 ?
-			this.slice( i ) :
-			this.slice( i, +i + 1 );
-	},
-
-	first: function() {
-		return this.eq( 0 );
-	},
-
-	last: function() {
-		return this.eq( -1 );
-	},
-
-	slice: function() {
-		return this.pushStack( slice.apply( this, arguments ),
-			"slice", slice.call(arguments).join(",") );
-	},
-
-	map: function( callback ) {
-		return this.pushStack( jQuery.map(this, function( elem, i ) {
-			return callback.call( elem, i, elem );
-		}));
-	},
-
-	end: function() {
-		return this.prevObject || this.constructor(null);
-	},
-
-	// For internal use only.
-	// Behaves like an Array's method, not like a jQuery method.
-	push: push,
-	sort: [].sort,
-	splice: [].splice
-};
-
-// Give the init function the jQuery prototype for later instantiation
-jQuery.fn.init.prototype = jQuery.fn;
-
-jQuery.extend = jQuery.fn.extend = function() {
-	var options, name, src, copy, copyIsArray, clone,
-		target = arguments[0] || {},
-		i = 1,
-		length = arguments.length,
-		deep = false;
-
-	// Handle a deep copy situation
-	if ( typeof target === "boolean" ) {
-		deep = target;
-		target = arguments[1] || {};
-		// skip the boolean and the target
-		i = 2;
-	}
-
-	// Handle case when target is a string or something (possible in deep copy)
-	if ( typeof target !== "object" && !jQuery.isFunction(target) ) {
-		target = {};
-	}
-
-	// extend jQuery itself if only one argument is passed
-	if ( length === i ) {
-		target = this;
-		--i;
-	}
-
-	for ( ; i < length; i++ ) {
-		// Only deal with non-null/undefined values
-		if ( (options = arguments[ i ]) != null ) {
-			// Extend the base object
-			for ( name in options ) {
-				src = target[ name ];
-				copy = options[ name ];
-
-				// Prevent never-ending loop
-				if ( target === copy ) {
-					continue;
-				}
-
-				// Recurse if we're merging plain objects or arrays
-				if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) {
-					if ( copyIsArray ) {
-						copyIsArray = false;
-						clone = src && jQuery.isArray(src) ? src : [];
-
-					} else {
-						clone = src && jQuery.isPlainObject(src) ? src : {};
-					}
-
-					// Never move original objects, clone them
-					target[ name ] = jQuery.extend( deep, clone, copy );
-
-				// Don't bring in undefined values
-				} else if ( copy !== undefined ) {
-					target[ name ] = copy;
-				}
-			}
-		}
-	}
-
-	// Return the modified object
-	return target;
-};
-
-jQuery.extend({
-	noConflict: function( deep ) {
-		if ( window.$ === jQuery ) {
-			window.$ = _$;
-		}
-
-		if ( deep && window.jQuery === jQuery ) {
-			window.jQuery = _jQuery;
-		}
-
-		return jQuery;
-	},
-
-	// Is the DOM ready to be used? Set to true once it occurs.
-	isReady: false,
-
-	// A counter to track how many items to wait for before
-	// the ready event fires. See #6781
-	readyWait: 1,
-
-	// Hold (or release) the ready event
-	holdReady: function( hold ) {
-		if ( hold ) {
-			jQuery.readyWait++;
-		} else {
-			jQuery.ready( true );
-		}
-	},
-
-	// Handle when the DOM is ready
-	ready: function( wait ) {
-		// Either a released hold or an DOMready/load event and not yet ready
-		if ( (wait === true && !--jQuery.readyWait) || (wait !== true && !jQuery.isReady) ) {
-			// Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
-			if ( !document.body ) {
-				return setTimeout( jQuery.ready, 1 );
-			}
-
-			// Remember that the DOM is ready
-			jQuery.isReady = true;
-
-			// If a normal DOM Ready event fired, decrement, and wait if need be
-			if ( wait !== true && --jQuery.readyWait > 0 ) {
-				return;
-			}
-
-			// If there are functions bound, to execute
-			readyList.resolveWith( document, [ jQuery ] );
-
-			// Trigger any bound ready events
-			if ( jQuery.fn.trigger ) {
-				jQuery( document ).trigger( "ready" ).unbind( "ready" );
-			}
-		}
-	},
-
-	bindReady: function() {
-		if ( readyList ) {
-			return;
-		}
-
-		readyList = jQuery._Deferred();
-
-		// Catch cases where $(document).ready() is called after the
-		// browser event has already occurred.
-		if ( document.readyState === "complete" ) {
-			// Handle it asynchronously to allow scripts the opportunity to delay ready
-			return setTimeout( jQuery.ready, 1 );
-		}
-
-		// Mozilla, Opera and webkit nightlies currently support this event
-		if ( document.addEventListener ) {
-			// Use the handy event callback
-			document.addEventListener( "DOMContentLoaded", DOMContentLoaded, false );
-
-			// A fallback to window.onload, that will always work
-			window.addEventListener( "load", jQuery.ready, false );
-
-		// If IE event model is used
-		} else if ( document.attachEvent ) {
-			// ensure firing before onload,
-			// maybe late but safe also for iframes
-			document.attachEvent( "onreadystatechange", DOMContentLoaded );
-
-			// A fallback to window.onload, that will always work
-			window.attachEvent( "onload", jQuery.ready );
-
-			// If IE and not a frame
-			// continually check to see if the document is ready
-			var toplevel = false;
-
-			try {
-				toplevel = window.frameElement == null;
-			} catch(e) {}
-
-			if ( document.documentElement.doScroll && toplevel ) {
-				doScrollCheck();
-			}
-		}
-	},
-
-	// See test/unit/core.js for details concerning isFunction.
-	// Since version 1.3, DOM methods and functions like alert
-	// aren't supported. They return false on IE (#2968).
-	isFunction: function( obj ) {
-		return jQuery.type(obj) === "function";
-	},
-
-	isArray: Array.isArray || function( obj ) {
-		return jQuery.type(obj) === "array";
-	},
-
-	// A crude way of determining if an object is a window
-	isWindow: function( obj ) {
-		return obj && typeof obj === "object" && "setInterval" in obj;
-	},
-
-	isNaN: function( obj ) {
-		return obj == null || !rdigit.test( obj ) || isNaN( obj );
-	},
-
-	type: function( obj ) {
-		return obj == null ?
-			String( obj ) :
-			class2type[ toString.call(obj) ] || "object";
-	},
-
-	isPlainObject: function( obj ) {
-		// Must be an Object.
-		// Because of IE, we also have to check the presence of the constructor property.
-		// Make sure that DOM nodes and window objects don't pass through, as well
-		if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) {
-			return false;
-		}
-
-		try {
-			// Not own constructor property must be Object
-			if ( obj.constructor &&
-				!hasOwn.call(obj, "constructor") &&
-				!hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) {
-				return false;
-			}
-		} catch ( e ) {
-			// IE8,9 Will throw exceptions on certain host objects #9897
-			return false;
-		}
-
-		// Own properties are enumerated firstly, so to speed up,
-		// if last one is own, then all properties are own.
-
-		var key;
-		for ( key in obj ) {}
-
-		return key === undefined || hasOwn.call( obj, key );
-	},
-
-	isEmptyObject: function( obj ) {
-		for ( var name in obj ) {
-			return false;
-		}
-		return true;
-	},
-
-	error: function( msg ) {
-		throw msg;
-	},
-
-	parseJSON: function( data ) {
-		if ( typeof data !== "string" || !data ) {
-			return null;
-		}
-
-		// Make sure leading/trailing whitespace is removed (IE can't handle it)
-		data = jQuery.trim( data );
-
-		// Attempt to parse using the native JSON parser first
-		if ( window.JSON && window.JSON.parse ) {
-			return window.JSON.parse( data );
-		}
-
-		// Make sure the incoming data is actual JSON
-		// Logic borrowed from http://json.org/json2.js
-		if ( rvalidchars.test( data.replace( rvalidescape, "@" )
-			.replace( rvalidtokens, "]" )
-			.replace( rvalidbraces, "")) ) {
-
-			return (new Function( "return " + data ))();
-
-		}
-		jQuery.error( "Invalid JSON: " + data );
-	},
-
-	// Cross-browser xml parsing
-	parseXML: function( data ) {
-		var xml, tmp;
-		try {
-			if ( window.DOMParser ) { // Standard
-				tmp = new DOMParser();
-				xml = tmp.parseFromString( data , "text/xml" );
-			} else { // IE
-				xml = new ActiveXObject( "Microsoft.XMLDOM" );
-				xml.async = "false";
-				xml.loadXML( data );
-			}
-		} catch( e ) {
-			xml = undefined;
-		}
-		if ( !xml || !xml.documentElement || xml.getElementsByTagName( "parsererror" ).length ) {
-			jQuery.error( "Invalid XML: " + data );
-		}
-		return xml;
-	},
-
-	noop: function() {},
-
-	// Evaluates a script in a global context
-	// Workarounds based on findings by Jim Driscoll
-	// http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context
-	globalEval: function( data ) {
-		if ( data && rnotwhite.test( data ) ) {
-			// We use execScript on Internet Explorer
-			// We use an anonymous function so that context is window
-			// rather than jQuery in Firefox
-			( window.execScript || function( data ) {
-				window[ "eval" ].call( window, data );
-			} )( data );
-		}
-	},
-
-	// Convert dashed to camelCase; used by the css and data modules
-	// Microsoft forgot to hump their vendor prefix (#9572)
-	camelCase: function( string ) {
-		return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
-	},
-
-	nodeName: function( elem, name ) {
-		return elem.nodeName && elem.nodeName.toUpperCase() === name.toUpperCase();
-	},
-
-	// args is for internal usage only
-	each: function( object, callback, args ) {
-		var name, i = 0,
-			length = object.length,
-			isObj = length === undefined || jQuery.isFunction( object );
-
-		if ( args ) {
-			if ( isObj ) {
-				for ( name in object ) {
-					if ( callback.apply( object[ name ], args ) === false ) {
-						break;
-					}
-				}
-			} else {
-				for ( ; i < length; ) {
-					if ( callback.apply( object[ i++ ], args ) === false ) {
-						break;
-					}
-				}
-			}
-
-		// A special, fast, case for the most common use of each
-		} else {
-			if ( isObj ) {
-				for ( name in object ) {
-					if ( callback.call( object[ name ], name, object[ name ] ) === false ) {
-						break;
-					}
-				}
-			} else {
-				for ( ; i < length; ) {
-					if ( callback.call( object[ i ], i, object[ i++ ] ) === false ) {
-						break;
-					}
-				}
-			}
-		}
-
-		return object;
-	},
-
-	// Use native String.trim function wherever possible
-	trim: trim ?
-		function( text ) {
-			return text == null ?
-				"" :
-				trim.call( text );
-		} :
-
-		// Otherwise use our own trimming functionality
-		function( text ) {
-			return text == null ?
-				"" :
-				text.toString().replace( trimLeft, "" ).replace( trimRight, "" );
-		},
-
-	// results is for internal usage only
-	makeArray: function( array, results ) {
-		var ret = results || [];
-
-		if ( array != null ) {
-			// The window, strings (and functions) also have 'length'
-			// The extra typeof function check is to prevent crashes
-			// in Safari 2 (See: #3039)
-			// Tweaked logic slightly to handle Blackberry 4.7 RegExp issues #6930
-			var type = jQuery.type( array );
-
-			if ( array.length == null || type === "string" || type === "function" || type === "regexp" || jQuery.isWindow( array ) ) {
-				push.call( ret, array );
-			} else {
-				jQuery.merge( ret, array );
-			}
-		}
-
-		return ret;
-	},
-
-	inArray: function( elem, array ) {
-		if ( !array ) {
-			return -1;
-		}
-
-		if ( indexOf ) {
-			return indexOf.call( array, elem );
-		}
-
-		for ( var i = 0, length = array.length; i < length; i++ ) {
-			if ( array[ i ] === elem ) {
-				return i;
-			}
-		}
-
-		return -1;
-	},
-
-	merge: function( first, second ) {
-		var i = first.length,
-			j = 0;
-
-		if ( typeof second.length === "number" ) {
-			for ( var l = second.length; j < l; j++ ) {
-				first[ i++ ] = second[ j ];
-			}
-
-		} else {
-			while ( second[j] !== undefined ) {
-				first[ i++ ] = second[ j++ ];
-			}
-		}
-
-		first.length = i;
-
-		return first;
-	},
-
-	grep: function( elems, callback, inv ) {
-		var ret = [], retVal;
-		inv = !!inv;
-
-		// Go through the array, only saving the items
-		// that pass the validator function
-		for ( var i = 0, length = elems.length; i < length; i++ ) {
-			retVal = !!callback( elems[ i ], i );
-			if ( inv !== retVal ) {
-				ret.push( elems[ i ] );
-			}
-		}
-
-		return ret;
-	},
-
-	// arg is for internal usage only
-	map: function( elems, callback, arg ) {
-		var value, key, ret = [],
-			i = 0,
-			length = elems.length,
-			// jquery objects are treated as arrays
-			isArray = elems instanceof jQuery || length !== undefined && typeof length === "number" && ( ( length > 0 && elems[ 0 ] && elems[ length -1 ] ) || length === 0 || jQuery.isArray( elems ) ) ;
-
-		// Go through the array, translating each of the items to their
-		if ( isArray ) {
-			for ( ; i < length; i++ ) {
-				value = callback( elems[ i ], i, arg );
-
-				if ( value != null ) {
-					ret[ ret.length ] = value;
-				}
-			}
-
-		// Go through every key on the object,
-		} else {
-			for ( key in elems ) {
-				value = callback( elems[ key ], key, arg );
-
-				if ( value != null ) {
-					ret[ ret.length ] = value;
-				}
-			}
-		}
-
-		// Flatten any nested arrays
-		return ret.concat.apply( [], ret );
-	},
-
-	// A global GUID counter for objects
-	guid: 1,
-
-	// Bind a function to a context, optionally partially applying any
-	// arguments.
-	proxy: function( fn, context ) {
-		if ( typeof context === "string" ) {
-			var tmp = fn[ context ];
-			context = fn;
-			fn = tmp;
-		}
-
-		// Quick check to determine if target is callable, in the spec
-		// this throws a TypeError, but we will just return undefined.
-		if ( !jQuery.isFunction( fn ) ) {
-			return undefined;
-		}
-
-		// Simulated bind
-		var args = slice.call( arguments, 2 ),
-			proxy = function() {
-				return fn.apply( context, args.concat( slice.call( arguments ) ) );
-			};
-
-		// Set the guid of unique handler to the same of original handler, so it can be removed
-		proxy.guid = fn.guid = fn.guid || proxy.guid || jQuery.guid++;
-
-		return proxy;
-	},
-
-	// Mutifunctional method to get and set values to a collection
-	// The value/s can optionally be executed if it's a function
-	access: function( elems, key, value, exec, fn, pass ) {
-		var length = elems.length;
-
-		// Setting many attributes
-		if ( typeof key === "object" ) {
-			for ( var k in key ) {
-				jQuery.access( elems, k, key[k], exec, fn, value );
-			}
-			return elems;
-		}
-
-		// Setting one attribute
-		if ( value !== undefined ) {
-			// Optionally, function values get executed if exec is true
-			exec = !pass && exec && jQuery.isFunction(value);
-
-			for ( var i = 0; i < length; i++ ) {
-				fn( elems[i], key, exec ? value.call( elems[i], i, fn( elems[i], key ) ) : value, pass );
-			}
-
-			return elems;
-		}
-
-		// Getting an attribute
-		return length ? fn( elems[0], key ) : undefined;
-	},
-
-	now: function() {
-		return (new Date()).getTime();
-	},
-
-	// Use of jQuery.browser is frowned upon.
-	// More details: http://docs.jquery.com/Utilities/jQuery.browser
-	uaMatch: function( ua ) {
-		ua = ua.toLowerCase();
-
-		var match = rwebkit.exec( ua ) ||
-			ropera.exec( ua ) ||
-			rmsie.exec( ua ) ||
-			ua.indexOf("compatible") < 0 && rmozilla.exec( ua ) ||
-			[];
-
-		return { browser: match[1] || "", version: match[2] || "0" };
-	},
-
-	sub: function() {
-		function jQuerySub( selector, context ) {
-			return new jQuerySub.fn.init( selector, context );
-		}
-		jQuery.extend( true, jQuerySub, this );
-		jQuerySub.superclass = this;
-		jQuerySub.fn = jQuerySub.prototype = this();
-		jQuerySub.fn.constructor = jQuerySub;
-		jQuerySub.sub = this.sub;
-		jQuerySub.fn.init = function init( selector, context ) {
-			if ( context && context instanceof jQuery && !(context instanceof jQuerySub) ) {
-				context = jQuerySub( context );
-			}
-
-			return jQuery.fn.init.call( this, selector, context, rootjQuerySub );
-		};
-		jQuerySub.fn.init.prototype = jQuerySub.fn;
-		var rootjQuerySub = jQuerySub(document);
-		return jQuerySub;
-	},
-
-	browser: {}
-});
-
-// Populate the class2type map
-jQuery.each("Boolean Number String Function Array Date RegExp Object".split(" "), function(i, name) {
-	class2type[ "[object " + name + "]" ] = name.toLowerCase();
-});
-
-browserMatch = jQuery.uaMatch( userAgent );
-if ( browserMatch.browser ) {
-	jQuery.browser[ browserMatch.browser ] = true;
-	jQuery.browser.version = browserMatch.version;
-}
-
-// Deprecated, use jQuery.browser.webkit instead
-if ( jQuery.browser.webkit ) {
-	jQuery.browser.safari = true;
-}
-
-// IE doesn't match non-breaking spaces with \s
-if ( rnotwhite.test( "\xA0" ) ) {
-	trimLeft = /^[\s\xA0]+/;
-	trimRight = /[\s\xA0]+$/;
-}
-
-// All jQuery objects should point back to these
-rootjQuery = jQuery(document);
-
-// Cleanup functions for the document ready method
-if ( document.addEventListener ) {
-	DOMContentLoaded = function() {
-		document.removeEventListener( "DOMContentLoaded", DOMContentLoaded, false );
-		jQuery.ready();
-	};
-
-} else if ( document.attachEvent ) {
-	DOMContentLoaded = function() {
-		// Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
-		if ( document.readyState === "complete" ) {
-			document.detachEvent( "onreadystatechange", DOMContentLoaded );
-			jQuery.ready();
-		}
-	};
-}
-
-// The DOM ready check for Internet Explorer
-function doScrollCheck() {
-	if ( jQuery.isReady ) {
-		return;
-	}
-
-	try {
-		// If IE is used, use the trick by Diego Perini
-		// http://javascript.nwbox.com/IEContentLoaded/
-		document.documentElement.doScroll("left");
-	} catch(e) {
-		setTimeout( doScrollCheck, 1 );
-		return;
-	}
-
-	// and execute any waiting functions
-	jQuery.ready();
-}
-
-return jQuery;
-
-})();
-
-
-var // Promise methods
-	promiseMethods = "done fail isResolved isRejected promise then always pipe".split( " " ),
-	// Static reference to slice
-	sliceDeferred = [].slice;
-
-jQuery.extend({
-	// Create a simple deferred (one callbacks list)
-	_Deferred: function() {
-		var // callbacks list
-			callbacks = [],
-			// stored [ context , args ]
-			fired,
-			// to avoid firing when already doing so
-			firing,
-			// flag to know if the deferred has been cancelled
-			cancelled,
-			// the deferred itself
-			deferred  = {
-
-				// done( f1, f2, ...)
-				done: function() {
-					if ( !cancelled ) {
-						var args = arguments,
-							i,
-							length,
-							elem,
-							type,
-							_fired;
-						if ( fired ) {
-							_fired = fired;
-							fired = 0;
-						}
-						for ( i = 0, length = args.length; i < length; i++ ) {
-							elem = args[ i ];
-							type = jQuery.type( elem );
-							if ( type === "array" ) {
-								deferred.done.apply( deferred, elem );
-							} else if ( type === "function" ) {
-								callbacks.push( elem );
-							}
-						}
-						if ( _fired ) {
-							deferred.resolveWith( _fired[ 0 ], _fired[ 1 ] );
-						}
-					}
-					return this;
-				},
-
-				// resolve with given context and args
-				resolveWith: function( context, args ) {
-					if ( !cancelled && !fired && !firing ) {
-						// make sure args are available (#8421)
-						args = args || [];
-						firing = 1;
-						try {
-							while( callbacks[ 0 ] ) {
-								callbacks.shift().apply( context, args );
-							}
-						}
-						finally {
-							fired = [ context, args ];
-							firing = 0;
-						}
-					}
-					return this;
-				},
-
-				// resolve with this as context and given arguments
-				resolve: function() {
-					deferred.resolveWith( this, arguments );
-					return this;
-				},
-
-				// Has this deferred been resolved?
-				isResolved: function() {
-					return !!( firing || fired );
-				},
-
-				// Cancel
-				cancel: function() {
-					cancelled = 1;
-					callbacks = [];
-					return this;
-				}
-			};
-
-		return deferred;
-	},
-
-	// Full fledged deferred (two callbacks list)
-	Deferred: function( func ) {
-		var deferred = jQuery._Deferred(),
-			failDeferred = jQuery._Deferred(),
-			promise;
-		// Add errorDeferred methods, then and promise
-		jQuery.extend( deferred, {
-			then: function( doneCallbacks, failCallbacks ) {
-				deferred.done( doneCallbacks ).fail( failCallbacks );
-				return this;
-			},
-			always: function() {
-				return deferred.done.apply( deferred, arguments ).fail.apply( this, arguments );
-			},
-			fail: failDeferred.done,
-			rejectWith: failDeferred.resolveWith,
-			reject: failDeferred.resolve,
-			isRejected: failDeferred.isResolved,
-			pipe: function( fnDone, fnFail ) {
-				return jQuery.Deferred(function( newDefer ) {
-					jQuery.each( {
-						done: [ fnDone, "resolve" ],
-						fail: [ fnFail, "reject" ]
-					}, function( handler, data ) {
-						var fn = data[ 0 ],
-							action = data[ 1 ],
-							returned;
-						if ( jQuery.isFunction( fn ) ) {
-							deferred[ handler ](function() {
-								returned = fn.apply( this, arguments );
-								if ( returned && jQuery.isFunction( returned.promise ) ) {
-									returned.promise().then( newDefer.resolve, newDefer.reject );
-								} else {
-									newDefer[ action + "With" ]( this === deferred ? newDefer : this, [ returned ] );
-								}
-							});
-						} else {
-							deferred[ handler ]( newDefer[ action ] );
-						}
-					});
-				}).promise();
-			},
-			// Get a promise for this deferred
-			// If obj is provided, the promise aspect is added to the object
-			promise: function( obj ) {
-				if ( obj == null ) {
-					if ( promise ) {
-						return promise;
-					}
-					promise = obj = {};
-				}
-				var i = promiseMethods.length;
-				while( i-- ) {
-					obj[ promiseMethods[i] ] = deferred[ promiseMethods[i] ];
-				}
-				return obj;
-			}
-		});
-		// Make sure only one callback list will be used
-		deferred.done( failDeferred.cancel ).fail( deferred.cancel );
-		// Unexpose cancel
-		delete deferred.cancel;
-		// Call given func if any
-		if ( func ) {
-			func.call( deferred, deferred );
-		}
-		return deferred;
-	},
-
-	// Deferred helper
-	when: function( firstParam ) {
-		var args = arguments,
-			i = 0,
-			length = args.length,
-			count = length,
-			deferred = length <= 1 && firstParam && jQuery.isFunction( firstParam.promise ) ?
-				firstParam :
-				jQuery.Deferred();
-		function resolveFunc( i ) {
-			return function( value ) {
-				args[ i ] = arguments.length > 1 ? sliceDeferred.call( arguments, 0 ) : value;
-				if ( !( --count ) ) {
-					// Strange bug in FF4:
-					// Values changed onto the arguments object sometimes end up as undefined values
-					// outside the $.when method. Cloning the object into a fresh array solves the issue
-					deferred.resolveWith( deferred, sliceDeferred.call( args, 0 ) );
-				}
-			};
-		}
-		if ( length > 1 ) {
-			for( ; i < length; i++ ) {
-				if ( args[ i ] && jQuery.isFunction( args[ i ].promise ) ) {
-					args[ i ].promise().then( resolveFunc(i), deferred.reject );
-				} else {
-					--count;
-				}
-			}
-			if ( !count ) {
-				deferred.resolveWith( deferred, args );
-			}
-		} else if ( deferred !== firstParam ) {
-			deferred.resolveWith( deferred, length ? [ firstParam ] : [] );
-		}
-		return deferred.promise();
-	}
-});
-
-
-
-jQuery.support = (function() {
-
-	var div = document.createElement( "div" ),
-		documentElement = document.documentElement,
-		all,
-		a,
-		select,
-		opt,
-		input,
-		marginDiv,
-		support,
-		fragment,
-		body,
-		testElementParent,
-		testElement,
-		testElementStyle,
-		tds,
-		events,
-		eventName,
-		i,
-		isSupported;
-
-	// Preliminary tests
-	div.setAttribute("className", "t");
-	div.innerHTML = "   <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/>";
-
-
-	all = div.getElementsByTagName( "*" );
-	a = div.getElementsByTagName( "a" )[ 0 ];
-
-	// Can't get basic test support
-	if ( !all || !all.length || !a ) {
-		return {};
-	}
-
-	// First batch of supports tests
-	select = document.createElement( "select" );
-	opt = select.appendChild( document.createElement("option") );
-	input = div.getElementsByTagName( "input" )[ 0 ];
-
-	support = {
-		// IE strips leading whitespace when .innerHTML is used
-		leadingWhitespace: ( div.firstChild.nodeType === 3 ),
-
-		// Make sure that tbody elements aren't automatically inserted
-		// IE will insert them into empty tables
-		tbody: !div.getElementsByTagName( "tbody" ).length,
-
-		// Make sure that link elements get serialized correctly by innerHTML
-		// This requires a wrapper element in IE
-		htmlSerialize: !!div.getElementsByTagName( "link" ).length,
-
-		// Get the style information from getAttribute
-		// (IE uses .cssText instead)
-		style: /top/.test( a.getAttribute("style") ),
-
-		// Make sure that URLs aren't manipulated
-		// (IE normalizes it by default)
-		hrefNormalized: ( a.getAttribute( "href" ) === "/a" ),
-
-		// Make sure that element opacity exists
-		// (IE uses filter instead)
-		// Use a regex to work around a WebKit issue. See #5145
-		opacity: /^0.55$/.test( a.style.opacity ),
-
-		// Verify style float existence
-		// (IE uses styleFloat instead of cssFloat)
-		cssFloat: !!a.style.cssFloat,
-
-		// Make sure that if no value is specified for a checkbox
-		// that it defaults to "on".
-		// (WebKit defaults to "" instead)
-		checkOn: ( input.value === "on" ),
-
-		// Make sure that a selected-by-default option has a working selected property.
-		// (WebKit defaults to false instead of true, IE too, if it's in an optgroup)
-		optSelected: opt.selected,
-
-		// Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7)
-		getSetAttribute: div.className !== "t",
-
-		// Will be defined later
-		submitBubbles: true,
-		changeBubbles: true,
-		focusinBubbles: false,
-		deleteExpando: true,
-		noCloneEvent: true,
-		inlineBlockNeedsLayout: false,
-		shrinkWrapBlocks: false,
-		reliableMarginRight: true
-	};
-
-	// Make sure checked status is properly cloned
-	input.checked = true;
-	support.noCloneChecked = input.cloneNode( true ).checked;
-
-	// Make sure that the options inside disabled selects aren't marked as disabled
-	// (WebKit marks them as disabled)
-	select.disabled = true;
-	support.optDisabled = !opt.disabled;
-
-	// Test to see if it's possible to delete an expando from an element
-	// Fails in Internet Explorer
-	try {
-		delete div.test;
-	} catch( e ) {
-		support.deleteExpando = false;
-	}
-
-	if ( !div.addEventListener && div.attachEvent && div.fireEvent ) {
-		div.attachEvent( "onclick", function() {
-			// Cloning a node shouldn't copy over any
-			// bound event handlers (IE does this)
-			support.noCloneEvent = false;
-		});
-		div.cloneNode( true ).fireEvent( "onclick" );
-	}
-
-	// Check if a radio maintains it's value
-	// after being appended to the DOM
-	input = document.createElement("input");
-	input.value = "t";
-	input.setAttribute("type", "radio");
-	support.radioValue = input.value === "t";
-
-	input.setAttribute("checked", "checked");
-	div.appendChild( input );
-	fragment = document.createDocumentFragment();
-	fragment.appendChild( div.firstChild );
-
-	// WebKit doesn't clone checked state correctly in fragments
-	support.checkClone = fragment.cloneNode( true ).cloneNode( true ).lastChild.checked;
-
-	div.innerHTML = "";
-
-	// Figure out if the W3C box model works as expected
-	div.style.width = div.style.paddingLeft = "1px";
-
-	body = document.getElementsByTagName( "body" )[ 0 ];
-	// We use our own, invisible, body unless the body is already present
-	// in which case we use a div (#9239)
-	testElement = document.createElement( body ? "div" : "body" );
-	testElementStyle = {
-		visibility: "hidden",
-		width: 0,
-		height: 0,
-		border: 0,
-		margin: 0,
-		background: "none"
-	};
-	if ( body ) {
-		jQuery.extend( testElementStyle, {
-			position: "absolute",
-			left: "-1000px",
-			top: "-1000px"
-		});
-	}
-	for ( i in testElementStyle ) {
-		testElement.style[ i ] = testElementStyle[ i ];
-	}
-	testElement.appendChild( div );
-	testElementParent = body || documentElement;
-	testElementParent.insertBefore( testElement, testElementParent.firstChild );
-
-	// Check if a disconnected checkbox will retain its checked
-	// value of true after appended to the DOM (IE6/7)
-	support.appendChecked = input.checked;
-
-	support.boxModel = div.offsetWidth === 2;
-
-	if ( "zoom" in div.style ) {
-		// Check if natively block-level elements act like inline-block
-		// elements when setting their display to 'inline' and giving
-		// them layout
-		// (IE < 8 does this)
-		div.style.display = "inline";
-		div.style.zoom = 1;
-		support.inlineBlockNeedsLayout = ( div.offsetWidth === 2 );
-
-		// Check if elements with layout shrink-wrap their children
-		// (IE 6 does this)
-		div.style.display = "";
-		div.innerHTML = "<div style='width:4px;'></div>";
-		support.shrinkWrapBlocks = ( div.offsetWidth !== 2 );
-	}
-
-	div.innerHTML = "<table><tr><td style='padding:0;border:0;display:none'></td><td>t</td></tr></table>";
-	tds = div.getElementsByTagName( "td" );
-
-	// Check if table cells still have offsetWidth/Height when they are set
-	// to display:none and there are still other visible table cells in a
-	// table row; if so, offsetWidth/Height are not reliable for use when
-	// determining if an element has been hidden directly using
-	// display:none (it is still safe to use offsets if a parent element is
-	// hidden; don safety goggles and see bug #4512 for more information).
-	// (only IE 8 fails this test)
-	isSupported = ( tds[ 0 ].offsetHeight === 0 );
-
-	tds[ 0 ].style.display = "";
-	tds[ 1 ].style.display = "none";
-
-	// Check if empty table cells still have offsetWidth/Height
-	// (IE < 8 fail this test)
-	support.reliableHiddenOffsets = isSupported && ( tds[ 0 ].offsetHeight === 0 );
-	div.innerHTML = "";
-
-	// Check if div with explicit width and no margin-right incorrectly
-	// gets computed margin-right based on width of container. For more
-	// info see bug #3333
-	// Fails in WebKit before Feb 2011 nightlies
-	// WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
-	if ( document.defaultView && document.defaultView.getComputedStyle ) {
-		marginDiv = document.createElement( "div" );
-		marginDiv.style.width = "0";
-		marginDiv.style.marginRight = "0";
-		div.appendChild( marginDiv );
-		support.reliableMarginRight =
-			( parseInt( ( document.defaultView.getComputedStyle( marginDiv, null ) || { marginRight: 0 } ).marginRight, 10 ) || 0 ) === 0;
-	}
-
-	// Remove the body element we added
-	testElement.innerHTML = "";
-	testElementParent.removeChild( testElement );
-
-	// Technique from Juriy Zaytsev
-	// http://thinkweb2.com/projects/prototype/detecting-event-support-without-browser-sniffing/
-	// We only care about the case where non-standard event systems
-	// are used, namely in IE. Short-circuiting here helps us to
-	// avoid an eval call (in setAttribute) which can cause CSP
-	// to go haywire. See: https://developer.mozilla.org/en/Security/CSP
-	if ( div.attachEvent ) {
-		for( i in {
-			submit: 1,
-			change: 1,
-			focusin: 1
-		} ) {
-			eventName = "on" + i;
-			isSupported = ( eventName in div );
-			if ( !isSupported ) {
-				div.setAttribute( eventName, "return;" );
-				isSupported = ( typeof div[ eventName ] === "function" );
-			}
-			support[ i + "Bubbles" ] = isSupported;
-		}
-	}
-
-	// Null connected elements to avoid leaks in IE
-	testElement = fragment = select = opt = body = marginDiv = div = input = null;
-
-	return support;
-})();
-
-// Keep track of boxModel
-jQuery.boxModel = jQuery.support.boxModel;
-
-
-
-
-var rbrace = /^(?:\{.*\}|\[.*\])$/,
-	rmultiDash = /([A-Z])/g;
-
-jQuery.extend({
-	cache: {},
-
-	// Please use with caution
-	uuid: 0,
-
-	// Unique for each copy of jQuery on the page
-	// Non-digits removed to match rinlinejQuery
-	expando: "jQuery" + ( jQuery.fn.jquery + Math.random() ).replace( /\D/g, "" ),
-
-	// The following elements throw uncatchable exceptions if you
-	// attempt to add expando properties to them.
-	noData: {
-		"embed": true,
-		// Ban all objects except for Flash (which handle expandos)
-		"object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",
-		"applet": true
-	},
-
-	hasData: function( elem ) {
-		elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ];
-
-		return !!elem && !isEmptyDataObject( elem );
-	},
-
-	data: function( elem, name, data, pvt /* Internal Use Only */ ) {
-		if ( !jQuery.acceptData( elem ) ) {
-			return;
-		}
-
-		var thisCache, ret,
-			internalKey = jQuery.expando,
-			getByName = typeof name === "string",
-
-			// We have to handle DOM nodes and JS objects differently because IE6-7
-			// can't GC object references properly across the DOM-JS boundary
-			isNode = elem.nodeType,
-
-			// Only DOM nodes need the global jQuery cache; JS object data is
-			// attached directly to the object so GC can occur automatically
-			cache = isNode ? jQuery.cache : elem,
-
-			// Only defining an ID for JS objects if its cache already exists allows
-			// the code to shortcut on the same path as a DOM node with no cache
-			id = isNode ? elem[ jQuery.expando ] : elem[ jQuery.expando ] && jQuery.expando;
-
-		// Avoid doing any more work than we need to when trying to get data on an
-		// object that has no data at all
-		if ( (!id || (pvt && id && (cache[ id ] && !cache[ id ][ internalKey ]))) && getByName && data === undefined ) {
-			return;
-		}
-
-		if ( !id ) {
-			// Only DOM nodes need a new unique ID for each element since their data
-			// ends up in the global cache
-			if ( isNode ) {
-				elem[ jQuery.expando ] = id = ++jQuery.uuid;
-			} else {
-				id = jQuery.expando;
-			}
-		}
-
-		if ( !cache[ id ] ) {
-			cache[ id ] = {};
-
-			// TODO: This is a hack for 1.5 ONLY. Avoids exposing jQuery
-			// metadata on plain JS objects when the object is serialized using
-			// JSON.stringify
-			if ( !isNode ) {
-				cache[ id ].toJSON = jQuery.noop;
-			}
-		}
-
-		// An object can be passed to jQuery.data instead of a key/value pair; this gets
-		// shallow copied over onto the existing cache
-		if ( typeof name === "object" || typeof name === "function" ) {
-			if ( pvt ) {
-				cache[ id ][ internalKey ] = jQuery.extend(cache[ id ][ internalKey ], name);
-			} else {
-				cache[ id ] = jQuery.extend(cache[ id ], name);
-			}
-		}
-
-		thisCache = cache[ id ];
-
-		// Internal jQuery data is stored in a separate object inside the object's data
-		// cache in order to avoid key collisions between internal data and user-defined
-		// data
-		if ( pvt ) {
-			if ( !thisCache[ internalKey ] ) {
-				thisCache[ internalKey ] = {};
-			}
-
-			thisCache = thisCache[ internalKey ];
-		}
-
-		if ( data !== undefined ) {
-			thisCache[ jQuery.camelCase( name ) ] = data;
-		}
-
-		// TODO: This is a hack for 1.5 ONLY. It will be removed in 1.6. Users should
-		// not attempt to inspect the internal events object using jQuery.data, as this
-		// internal data object is undocumented and subject to change.
-		if ( name === "events" && !thisCache[name] ) {
-			return thisCache[ internalKey ] && thisCache[ internalKey ].events;
-		}
-
-		// Check for both converted-to-camel and non-converted data property names
-		// If a data property was specified
-		if ( getByName ) {
-
-			// First Try to find as-is property data
-			ret = thisCache[ name ];
-
-			// Test for null|undefined property data
-			if ( ret == null ) {
-
-				// Try to find the camelCased property
-				ret = thisCache[ jQuery.camelCase( name ) ];
-			}
-		} else {
-			ret = thisCache;
-		}
-
-		return ret;
-	},
-
-	removeData: function( elem, name, pvt /* Internal Use Only */ ) {
-		if ( !jQuery.acceptData( elem ) ) {
-			return;
-		}
-
-		var thisCache,
-
-			// Reference to internal data cache key
-			internalKey = jQuery.expando,
-
-			isNode = elem.nodeType,
-
-			// See jQuery.data for more information
-			cache = isNode ? jQuery.cache : elem,
-
-			// See jQuery.data for more information
-			id = isNode ? elem[ jQuery.expando ] : jQuery.expando;
-
-		// If there is already no cache entry for this object, there is no
-		// purpose in continuing
-		if ( !cache[ id ] ) {
-			return;
-		}
-
-		if ( name ) {
-
-			thisCache = pvt ? cache[ id ][ internalKey ] : cache[ id ];
-
-			if ( thisCache ) {
-
-				// Support interoperable removal of hyphenated or camelcased keys
-				if ( !thisCache[ name ] ) {
-					name = jQuery.camelCase( name );
-				}
-
-				delete thisCache[ name ];
-
-				// If there is no data left in the cache, we want to continue
-				// and let the cache object itself get destroyed
-				if ( !isEmptyDataObject(thisCache) ) {
-					return;
-				}
-			}
-		}
-
-		// See jQuery.data for more information
-		if ( pvt ) {
-			delete cache[ id ][ internalKey ];
-
-			// Don't destroy the parent cache unless the internal data object
-			// had been the only thing left in it
-			if ( !isEmptyDataObject(cache[ id ]) ) {
-				return;
-			}
-		}
-
-		var internalCache = cache[ id ][ internalKey ];
-
-		// Browsers that fail expando deletion also refuse to delete expandos on
-		// the window, but it will allow it on all other JS objects; other browsers
-		// don't care
-		// Ensure that `cache` is not a window object #10080
-		if ( jQuery.support.deleteExpando || !cache.setInterval ) {
-			delete cache[ id ];
-		} else {
-			cache[ id ] = null;
-		}
-
-		// We destroyed the entire user cache at once because it's faster than
-		// iterating through each key, but we need to continue to persist internal
-		// data if it existed
-		if ( internalCache ) {
-			cache[ id ] = {};
-			// TODO: This is a hack for 1.5 ONLY. Avoids exposing jQuery
-			// metadata on plain JS objects when the object is serialized using
-			// JSON.stringify
-			if ( !isNode ) {
-				cache[ id ].toJSON = jQuery.noop;
-			}
-
-			cache[ id ][ internalKey ] = internalCache;
-
-		// Otherwise, we need to eliminate the expando on the node to avoid
-		// false lookups in the cache for entries that no longer exist
-		} else if ( isNode ) {
-			// IE does not allow us to delete expando properties from nodes,
-			// nor does it have a removeAttribute function on Document nodes;
-			// we must handle all of these cases
-			if ( jQuery.support.deleteExpando ) {
-				delete elem[ jQuery.expando ];
-			} else if ( elem.removeAttribute ) {
-				elem.removeAttribute( jQuery.expando );
-			} else {
-				elem[ jQuery.expando ] = null;
-			}
-		}
-	},
-
-	// For internal use only.
-	_data: function( elem, name, data ) {
-		return jQuery.data( elem, name, data, true );
-	},
-
-	// A method for determining if a DOM node can handle the data expando
-	acceptData: function( elem ) {
-		if ( elem.nodeName ) {
-			var match = jQuery.noData[ elem.nodeName.toLowerCase() ];
-
-			if ( match ) {
-				return !(match === true || elem.getAttribute("classid") !== match);
-			}
-		}
-
-		return true;
-	}
-});
-
-jQuery.fn.extend({
-	data: function( key, value ) {
-		var data = null;
-
-		if ( typeof key === "undefined" ) {
-			if ( this.length ) {
-				data = jQuery.data( this[0] );
-
-				if ( this[0].nodeType === 1 ) {
-			    var attr = this[0].attributes, name;
-					for ( var i = 0, l = attr.length; i < l; i++ ) {
-						name = attr[i].name;
-
-						if ( name.indexOf( "data-" ) === 0 ) {
-							name = jQuery.camelCase( name.substring(5) );
-
-							dataAttr( this[0], name, data[ name ] );
-						}
-					}
-				}
-			}
-
-			return data;
-
-		} else if ( typeof key === "object" ) {
-			return this.each(function() {
-				jQuery.data( this, key );
-			});
-		}
-
-		var parts = key.split(".");
-		parts[1] = parts[1] ? "." + parts[1] : "";
-
-		if ( value === undefined ) {
-			data = this.triggerHandler("getData" + parts[1] + "!", [parts[0]]);
-
-			// Try to fetch any internally stored data first
-			if ( data === undefined && this.length ) {
-				data = jQuery.data( this[0], key );
-				data = dataAttr( this[0], key, data );
-			}
-
-			return data === undefined && parts[1] ?
-				this.data( parts[0] ) :
-				data;
-
-		} else {
-			return this.each(function() {
-				var $this = jQuery( this ),
-					args = [ parts[0], value ];
-
-				$this.triggerHandler( "setData" + parts[1] + "!", args );
-				jQuery.data( this, key, value );
-				$this.triggerHandler( "changeData" + parts[1] + "!", args );
-			});
-		}
-	},
-
-	removeData: function( key ) {
-		return this.each(function() {
-			jQuery.removeData( this, key );
-		});
-	}
-});
-
-function dataAttr( elem, key, data ) {
-	// If nothing was found internally, try to fetch any
-	// data from the HTML5 data-* attribute
-	if ( data === undefined && elem.nodeType === 1 ) {
-
-		var name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase();
-
-		data = elem.getAttribute( name );
-
-		if ( typeof data === "string" ) {
-			try {
-				data = data === "true" ? true :
-				data === "false" ? false :
-				data === "null" ? null :
-				!jQuery.isNaN( data ) ? parseFloat( data ) :
-					rbrace.test( data ) ? jQuery.parseJSON( data ) :
-					data;
-			} catch( e ) {}
-
-			// Make sure we set the data so it isn't changed later
-			jQuery.data( elem, key, data );
-
-		} else {
-			data = undefined;
-		}
-	}
-
-	return data;
-}
-
-// TODO: This is a hack for 1.5 ONLY to allow objects with a single toJSON
-// property to be considered empty objects; this property always exists in
-// order to make sure JSON.stringify does not expose internal metadata
-function isEmptyDataObject( obj ) {
-	for ( var name in obj ) {
-		if ( name !== "toJSON" ) {
-			return false;
-		}
-	}
-
-	return true;
-}
-
-
-
-
-function handleQueueMarkDefer( elem, type, src ) {
-	var deferDataKey = type + "defer",
-		queueDataKey = type + "queue",
-		markDataKey = type + "mark",
-		defer = jQuery.data( elem, deferDataKey, undefined, true );
-	if ( defer &&
-		( src === "queue" || !jQuery.data( elem, queueDataKey, undefined, true ) ) &&
-		( src === "mark" || !jQuery.data( elem, markDataKey, undefined, true ) ) ) {
-		// Give room for hard-coded callbacks to fire first
-		// and eventually mark/queue something else on the element
-		setTimeout( function() {
-			if ( !jQuery.data( elem, queueDataKey, undefined, true ) &&
-				!jQuery.data( elem, markDataKey, undefined, true ) ) {
-				jQuery.removeData( elem, deferDataKey, true );
-				defer.resolve();
-			}
-		}, 0 );
-	}
-}
-
-jQuery.extend({
-
-	_mark: function( elem, type ) {
-		if ( elem ) {
-			type = (type || "fx") + "mark";
-			jQuery.data( elem, type, (jQuery.data(elem,type,undefined,true) || 0) + 1, true );
-		}
-	},
-
-	_unmark: function( force, elem, type ) {
-		if ( force !== true ) {
-			type = elem;
-			elem = force;
-			force = false;
-		}
-		if ( elem ) {
-			type = type || "fx";
-			var key = type + "mark",
-				count = force ? 0 : ( (jQuery.data( elem, key, undefined, true) || 1 ) - 1 );
-			if ( count ) {
-				jQuery.data( elem, key, count, true );
-			} else {
-				jQuery.removeData( elem, key, true );
-				handleQueueMarkDefer( elem, type, "mark" );
-			}
-		}
-	},
-
-	queue: function( elem, type, data ) {
-		if ( elem ) {
-			type = (type || "fx") + "queue";
-			var q = jQuery.data( elem, type, undefined, true );
-			// Speed up dequeue by getting out quickly if this is just a lookup
-			if ( data ) {
-				if ( !q || jQuery.isArray(data) ) {
-					q = jQuery.data( elem, type, jQuery.makeArray(data), true );
-				} else {
-					q.push( data );
-				}
-			}
-			return q || [];
-		}
-	},
-
-	dequeue: function( elem, type ) {
-		type = type || "fx";
-
-		var queue = jQuery.queue( elem, type ),
-			fn = queue.shift(),
-			defer;
-
-		// If the fx queue is dequeued, always remove the progress sentinel
-		if ( fn === "inprogress" ) {
-			fn = queue.shift();
-		}
-
-		if ( fn ) {
-			// Add a progress sentinel to prevent the fx queue from being
-			// automatically dequeued
-			if ( type === "fx" ) {
-				queue.unshift("inprogress");
-			}
-
-			fn.call(elem, function() {
-				jQuery.dequeue(elem, type);
-			});
-		}
-
-		if ( !queue.length ) {
-			jQuery.removeData( elem, type + "queue", true );
-			handleQueueMarkDefer( elem, type, "queue" );
-		}
-	}
-});
-
-jQuery.fn.extend({
-	queue: function( type, data ) {
-		if ( typeof type !== "string" ) {
-			data = type;
-			type = "fx";
-		}
-
-		if ( data === undefined ) {
-			return jQuery.queue( this[0], type );
-		}
-		return this.each(function() {
-			var queue = jQuery.queue( this, type, data );
-
-			if ( type === "fx" && queue[0] !== "inprogress" ) {
-				jQuery.dequeue( this, type );
-			}
-		});
-	},
-	dequeue: function( type ) {
-		return this.each(function() {
-			jQuery.dequeue( this, type );
-		});
-	},
-	// Based off of the plugin by Clint Helfers, with permission.
-	// http://blindsignals.com/index.php/2009/07/jquery-delay/
-	delay: function( time, type ) {
-		time = jQuery.fx ? jQuery.fx.speeds[time] || time : time;
-		type = type || "fx";
-
-		return this.queue( type, function() {
-			var elem = this;
-			setTimeout(function() {
-				jQuery.dequeue( elem, type );
-			}, time );
-		});
-	},
-	clearQueue: function( type ) {
-		return this.queue( type || "fx", [] );
-	},
-	// Get a promise resolved when queues of a certain type
-	// are emptied (fx is the type by default)
-	promise: function( type, object ) {
-		if ( typeof type !== "string" ) {
-			object = type;
-			type = undefined;
-		}
-		type = type || "fx";
-		var defer = jQuery.Deferred(),
-			elements = this,
-			i = elements.length,
-			count = 1,
-			deferDataKey = type + "defer",
-			queueDataKey = type + "queue",
-			markDataKey = type + "mark",
-			tmp;
-		function resolve() {
-			if ( !( --count ) ) {
-				defer.resolveWith( elements, [ elements ] );
-			}
-		}
-		while( i-- ) {
-			if (( tmp = jQuery.data( elements[ i ], deferDataKey, undefined, true ) ||
-					( jQuery.data( elements[ i ], queueDataKey, undefined, true ) ||
-						jQuery.data( elements[ i ], markDataKey, undefined, true ) ) &&
-					jQuery.data( elements[ i ], deferDataKey, jQuery._Deferred(), true ) )) {
-				count++;
-				tmp.done( resolve );
-			}
-		}
-		resolve();
-		return defer.promise();
-	}
-});
-
-
-
-
-var rclass = /[\n\t\r]/g,
-	rspace = /\s+/,
-	rreturn = /\r/g,
-	rtype = /^(?:button|input)$/i,
-	rfocusable = /^(?:button|input|object|select|textarea)$/i,
-	rclickable = /^a(?:rea)?$/i,
-	rboolean = /^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,
-	nodeHook, boolHook;
-
-jQuery.fn.extend({
-	attr: function( name, value ) {
-		return jQuery.access( this, name, value, true, jQuery.attr );
-	},
-
-	removeAttr: function( name ) {
-		return this.each(function() {
-			jQuery.removeAttr( this, name );
-		});
-	},
-	
-	prop: function( name, value ) {
-		return jQuery.access( this, name, value, true, jQuery.prop );
-	},
-	
-	removeProp: function( name ) {
-		name = jQuery.propFix[ name ] || name;
-		return this.each(function() {
-			// try/catch handles cases where IE balks (such as removing a property on window)
-			try {
-				this[ name ] = undefined;
-				delete this[ name ];
-			} catch( e ) {}
-		});
-	},
-
-	addClass: function( value ) {
-		var classNames, i, l, elem,
-			setClass, c, cl;
-
-		if ( jQuery.isFunction( value ) ) {
-			return this.each(function( j ) {
-				jQuery( this ).addClass( value.call(this, j, this.className) );
-			});
-		}
-
-		if ( value && typeof value === "string" ) {
-			classNames = value.split( rspace );
-
-			for ( i = 0, l = this.length; i < l; i++ ) {
-				elem = this[ i ];
-
-				if ( elem.nodeType === 1 ) {
-					if ( !elem.className && classNames.length === 1 ) {
-						elem.className = value;
-
-					} else {
-						setClass = " " + elem.className + " ";
-
-						for ( c = 0, cl = classNames.length; c < cl; c++ ) {
-							if ( !~setClass.indexOf( " " + classNames[ c ] + " " ) ) {
-								setClass += classNames[ c ] + " ";
-							}
-						}
-						elem.className = jQuery.trim( setClass );
-					}
-				}
-			}
-		}
-
-		return this;
-	},
-
-	removeClass: function( value ) {
-		var classNames, i, l, elem, className, c, cl;
-
-		if ( jQuery.isFunction( value ) ) {
-			return this.each(function( j ) {
-				jQuery( this ).removeClass( value.call(this, j, this.className) );
-			});
-		}
-
-		if ( (value && typeof value === "string") || value === undefined ) {
-			classNames = (value || "").split( rspace );
-
-			for ( i = 0, l = this.length; i < l; i++ ) {
-				elem = this[ i ];
-
-				if ( elem.nodeType === 1 && elem.className ) {
-					if ( value ) {
-						className = (" " + elem.className + " ").replace( rclass, " " );
-						for ( c = 0, cl = classNames.length; c < cl; c++ ) {
-							className = className.replace(" " + classNames[ c ] + " ", " ");
-						}
-						elem.className = jQuery.trim( className );
-
-					} else {
-						elem.className = "";
-					}
-				}
-			}
-		}
-
-		return this;
-	},
-
-	toggleClass: function( value, stateVal ) {
-		var type = typeof value,
-			isBool = typeof stateVal === "boolean";
-
-		if ( jQuery.isFunction( value ) ) {
-			return this.each(function( i ) {
-				jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal );
-			});
-		}
-
-		return this.each(function() {
-			if ( type === "string" ) {
-				// toggle individual class names
-				var className,
-					i = 0,
-					self = jQuery( this ),
-					state = stateVal,
-					classNames = value.split( rspace );
-
-				while ( (className = classNames[ i++ ]) ) {
-					// check each className given, space seperated list
-					state = isBool ? state : !self.hasClass( className );
-					self[ state ? "addClass" : "removeClass" ]( className );
-				}
-
-			} else if ( type === "undefined" || type === "boolean" ) {
-				if ( this.className ) {
-					// store className if set
-					jQuery._data( this, "__className__", this.className );
-				}
-
-				// toggle whole className
-				this.className = this.className || value === false ? "" : jQuery._data( this, "__className__" ) || "";
-			}
-		});
-	},
-
-	hasClass: function( selector ) {
-		var className = " " + selector + " ";
-		for ( var i = 0, l = this.length; i < l; i++ ) {
-			if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) > -1 ) {
-				return true;
-			}
-		}
-
-		return false;
-	},
-
-	val: function( value ) {
-		var hooks, ret,
-			elem = this[0];
-		
-		if ( !arguments.length ) {
-			if ( elem ) {
-				hooks = jQuery.valHooks[ elem.nodeName.toLowerCase() ] || jQuery.valHooks[ elem.type ];
-
-				if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) {
-					return ret;
-				}
-
-				ret = elem.value;
-
-				return typeof ret === "string" ? 
-					// handle most common string cases
-					ret.replace(rreturn, "") : 
-					// handle cases where value is null/undef or number
-					ret == null ? "" : ret;
-			}
-
-			return undefined;
-		}
-
-		var isFunction = jQuery.isFunction( value );
-
-		return this.each(function( i ) {
-			var self = jQuery(this), val;
-
-			if ( this.nodeType !== 1 ) {
-				return;
-			}
-
-			if ( isFunction ) {
-				val = value.call( this, i, self.val() );
-			} else {
-				val = value;
-			}
-
-			// Treat null/undefined as ""; convert numbers to string
-			if ( val == null ) {
-				val = "";
-			} else if ( typeof val === "number" ) {
-				val += "";
-			} else if ( jQuery.isArray( val ) ) {
-				val = jQuery.map(val, function ( value ) {
-					return value == null ? "" : value + "";
-				});
-			}
-
-			hooks = jQuery.valHooks[ this.nodeName.toLowerCase() ] || jQuery.valHooks[ this.type ];
-
-			// If set returns undefined, fall back to normal setting
-			if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) {
-				this.value = val;
-			}
-		});
-	}
-});
-
-jQuery.extend({
-	valHooks: {
-		option: {
-			get: function( elem ) {
-				// attributes.value is undefined in Blackberry 4.7 but
-				// uses .value. See #6932
-				var val = elem.attributes.value;
-				return !val || val.specified ? elem.value : elem.text;
-			}
-		},
-		select: {
-			get: function( elem ) {
-				var value,
-					index = elem.selectedIndex,
-					values = [],
-					options = elem.options,
-					one = elem.type === "select-one";
-
-				// Nothing was selected
-				if ( index < 0 ) {
-					return null;
-				}
-
-				// Loop through all the selected options
-				for ( var i = one ? index : 0, max = one ? index + 1 : options.length; i < max; i++ ) {
-					var option = options[ i ];
-
-					// Don't return options that are disabled or in a disabled optgroup
-					if ( option.selected && (jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null) &&
-							(!option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" )) ) {
-
-						// Get the specific value for the option
-						value = jQuery( option ).val();
-
-						// We don't need an array for one selects
-						if ( one ) {
-							return value;
-						}
-
-						// Multi-Selects return an array
-						values.push( value );
-					}
-				}
-
-				// Fixes Bug #2551 -- select.val() broken in IE after form.reset()
-				if ( one && !values.length && options.length ) {
-					return jQuery( options[ index ] ).val();
-				}
-
-				return values;
-			},
-
-			set: function( elem, value ) {
-				var values = jQuery.makeArray( value );
-
-				jQuery(elem).find("option").each(function() {
-					this.selected = jQuery.inArray( jQuery(this).val(), values ) >= 0;
-				});
-
-				if ( !values.length ) {
-					elem.selectedIndex = -1;
-				}
-				return values;
-			}
-		}
-	},
-
-	attrFn: {
-		val: true,
-		css: true,
-		html: true,
-		text: true,
-		data: true,
-		width: true,
-		height: true,
-		offset: true
-	},
-	
-	attrFix: {
-		// Always normalize to ensure hook usage
-		tabindex: "tabIndex"
-	},
-	
-	attr: function( elem, name, value, pass ) {
-		var nType = elem.nodeType;
-		
-		// don't get/set attributes on text, comment and attribute nodes
-		if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
-			return undefined;
-		}
-
-		if ( pass && name in jQuery.attrFn ) {
-			return jQuery( elem )[ name ]( value );
-		}
-
-		// Fallback to prop when attributes are not supported
-		if ( !("getAttribute" in elem) ) {
-			return jQuery.prop( elem, name, value );
-		}
-
-		var ret, hooks,
-			notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
-
-		// Normalize the name if needed
-		if ( notxml ) {
-			name = jQuery.attrFix[ name ] || name;
-
-			hooks = jQuery.attrHooks[ name ];
-
-			if ( !hooks ) {
-				// Use boolHook for boolean attributes
-				if ( rboolean.test( name ) ) {
-					hooks = boolHook;
-
-				// Use nodeHook if available( IE6/7 )
-				} else if ( nodeHook ) {
-					hooks = nodeHook;
-				}
-			}
-		}
-
-		if ( value !== undefined ) {
-
-			if ( value === null ) {
-				jQuery.removeAttr( elem, name );
-				return undefined;
-
-			} else if ( hooks && "set" in hooks && notxml && (ret = hooks.set( elem, value, name )) !== undefined ) {
-				return ret;
-
-			} else {
-				elem.setAttribute( name, "" + value );
-				return value;
-			}
-
-		} else if ( hooks && "get" in hooks && notxml && (ret = hooks.get( elem, name )) !== null ) {
-			return ret;
-
-		} else {
-
-			ret = elem.getAttribute( name );
-
-			// Non-existent attributes return null, we normalize to undefined
-			return ret === null ?
-				undefined :
-				ret;
-		}
-	},
-
-	removeAttr: function( elem, name ) {
-		var propName;
-		if ( elem.nodeType === 1 ) {
-			name = jQuery.attrFix[ name ] || name;
-
-			jQuery.attr( elem, name, "" );
-			elem.removeAttribute( name );
-
-			// Set corresponding property to false for boolean attributes
-			if ( rboolean.test( name ) && (propName = jQuery.propFix[ name ] || name) in elem ) {
-				elem[ propName ] = false;
-			}
-		}
-	},
-
-	attrHooks: {
-		type: {
-			set: function( elem, value ) {
-				// We can't allow the type property to be changed (since it causes problems in IE)
-				if ( rtype.test( elem.nodeName ) && elem.parentNode ) {
-					jQuery.error( "type property can't be changed" );
-				} else if ( !jQuery.support.radioValue && value === "radio" && jQuery.nodeName(elem, "input") ) {
-					// Setting the type on a radio button after the value resets the value in IE6-9
-					// Reset value to it's default in case type is set after value
-					// This is for element creation
-					var val = elem.value;
-					elem.setAttribute( "type", value );
-					if ( val ) {
-						elem.value = val;
-					}
-					return value;
-				}
-			}
-		},
-		// Use the value property for back compat
-		// Use the nodeHook for button elements in IE6/7 (#1954)
-		value: {
-			get: function( elem, name ) {
-				if ( nodeHook && jQuery.nodeName( elem, "button" ) ) {
-					return nodeHook.get( elem, name );
-				}
-				return name in elem ?
-					elem.value :
-					null;
-			},
-			set: function( elem, value, name ) {
-				if ( nodeHook && jQuery.nodeName( elem, "button" ) ) {
-					return nodeHook.set( elem, value, name );
-				}
-				// Does not return so that setAttribute is also used
-				elem.value = value;
-			}
-		}
-	},
-
-	propFix: {
-		tabindex: "tabIndex",
-		readonly: "readOnly",
-		"for": "htmlFor",
-		"class": "className",
-		maxlength: "maxLength",
-		cellspacing: "cellSpacing",
-		cellpadding: "cellPadding",
-		rowspan: "rowSpan",
-		colspan: "colSpan",
-		usemap: "useMap",
-		frameborder: "frameBorder",
-		contenteditable: "contentEditable"
-	},
-	
-	prop: function( elem, name, value ) {
-		var nType = elem.nodeType;
-
-		// don't get/set properties on text, comment and attribute nodes
-		if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
-			return undefined;
-		}
-
-		var ret, hooks,
-			notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
-
-		if ( notxml ) {
-			// Fix name and attach hooks
-			name = jQuery.propFix[ name ] || name;
-			hooks = jQuery.propHooks[ name ];
-		}
-
-		if ( value !== undefined ) {
-			if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) {
-				return ret;
-
-			} else {
-				return (elem[ name ] = value);
-			}
-
-		} else {
-			if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) {
-				return ret;
-
-			} else {
-				return elem[ name ];
-			}
-		}
-	},
-	
-	propHooks: {
-		tabIndex: {
-			get: function( elem ) {
-				// elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set
-				// http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
-				var attributeNode = elem.getAttributeNode("tabindex");
-
-				return attributeNode && attributeNode.specified ?
-					parseInt( attributeNode.value, 10 ) :
-					rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ?
-						0 :
-						undefined;
-			}
-		}
-	}
-});
-
-// Add the tabindex propHook to attrHooks for back-compat
-jQuery.attrHooks.tabIndex = jQuery.propHooks.tabIndex;
-
-// Hook for boolean attributes
-boolHook = {
-	get: function( elem, name ) {
-		// Align boolean attributes with corresponding properties
-		// Fall back to attribute presence where some booleans are not supported
-		var attrNode;
-		return jQuery.prop( elem, name ) === true || ( attrNode = elem.getAttributeNode( name ) ) && attrNode.nodeValue !== false ?
-			name.toLowerCase() :
-			undefined;
-	},
-	set: function( elem, value, name ) {
-		var propName;
-		if ( value === false ) {
-			// Remove boolean attributes when set to false
-			jQuery.removeAttr( elem, name );
-		} else {
-			// value is true since we know at this point it's type boolean and not false
-			// Set boolean attributes to the same name and set the DOM property
-			propName = jQuery.propFix[ name ] || name;
-			if ( propName in elem ) {
-				// Only set the IDL specifically if it already exists on the element
-				elem[ propName ] = true;
-			}
-
-			elem.setAttribute( name, name.toLowerCase() );
-		}
-		return name;
-	}
-};
-
-// IE6/7 do not support getting/setting some attributes with get/setAttribute
-if ( !jQuery.support.getSetAttribute ) {
-	
-	// Use this for any attribute in IE6/7
-	// This fixes almost every IE6/7 issue
-	nodeHook = jQuery.valHooks.button = {
-		get: function( elem, name ) {
-			var ret;
-			ret = elem.getAttributeNode( name );
-			// Return undefined if nodeValue is empty string
-			return ret && ret.nodeValue !== "" ?
-				ret.nodeValue :
-				undefined;
-		},
-		set: function( elem, value, name ) {
-			// Set the existing or create a new attribute node
-			var ret = elem.getAttributeNode( name );
-			if ( !ret ) {
-				ret = document.createAttribute( name );
-				elem.setAttributeNode( ret );
-			}
-			return (ret.nodeValue = value + "");
-		}
-	};
-
-	// Set width and height to auto instead of 0 on empty string( Bug #8150 )
-	// This is for removals
-	jQuery.each([ "width", "height" ], function( i, name ) {
-		jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], {
-			set: function( elem, value ) {
-				if ( value === "" ) {
-					elem.setAttribute( name, "auto" );
-					return value;
-				}
-			}
-		});
-	});
-}
-
-
-// Some attributes require a special call on IE
-if ( !jQuery.support.hrefNormalized ) {
-	jQuery.each([ "href", "src", "width", "height" ], function( i, name ) {
-		jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], {
-			get: function( elem ) {
-				var ret = elem.getAttribute( name, 2 );
-				return ret === null ? undefined : ret;
-			}
-		});
-	});
-}
-
-if ( !jQuery.support.style ) {
-	jQuery.attrHooks.style = {
-		get: function( elem ) {
-			// Return undefined in the case of empty string
-			// Normalize to lowercase since IE uppercases css property names
-			return elem.style.cssText.toLowerCase() || undefined;
-		},
-		set: function( elem, value ) {
-			return (elem.style.cssText = "" + value);
-		}
-	};
-}
-
-// Safari mis-reports the default selected property of an option
-// Accessing the parent's selectedIndex property fixes it
-if ( !jQuery.support.optSelected ) {
-	jQuery.propHooks.selected = jQuery.extend( jQuery.propHooks.selected, {
-		get: function( elem ) {
-			var parent = elem.parentNode;
-
-			if ( parent ) {
-				parent.selectedIndex;
-
-				// Make sure that it also works with optgroups, see #5701
-				if ( parent.parentNode ) {
-					parent.parentNode.selectedIndex;
-				}
-			}
-			return null;
-		}
-	});
-}
-
-// Radios and checkboxes getter/setter
-if ( !jQuery.support.checkOn ) {
-	jQuery.each([ "radio", "checkbox" ], function() {
-		jQuery.valHooks[ this ] = {
-			get: function( elem ) {
-				// Handle the case where in Webkit "" is returned instead of "on" if a value isn't specified
-				return elem.getAttribute("value") === null ? "on" : elem.value;
-			}
-		};
-	});
-}
-jQuery.each([ "radio", "checkbox" ], function() {
-	jQuery.valHooks[ this ] = jQuery.extend( jQuery.valHooks[ this ], {
-		set: function( elem, value ) {
-			if ( jQuery.isArray( value ) ) {
-				return (elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0);
-			}
-		}
-	});
-});
-
-
-
-
-var rnamespaces = /\.(.*)$/,
-	rformElems = /^(?:textarea|input|select)$/i,
-	rperiod = /\./g,
-	rspaces = / /g,
-	rescape = /[^\w\s.|`]/g,
-	fcleanup = function( nm ) {
-		return nm.replace(rescape, "\\$&");
-	};
-
-/*
- * A number of helper functions used for managing events.
- * Many of the ideas behind this code originated from
- * Dean Edwards' addEvent library.
- */
-jQuery.event = {
-
-	// Bind an event to an element
-	// Original by Dean Edwards
-	add: function( elem, types, handler, data ) {
-		if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
-			return;
-		}
-
-		if ( handler === false ) {
-			handler = returnFalse;
-		} else if ( !handler ) {
-			// Fixes bug #7229. Fix recommended by jdalton
-			return;
-		}
-
-		var handleObjIn, handleObj;
-
-		if ( handler.handler ) {
-			handleObjIn = handler;
-			handler = handleObjIn.handler;
-		}
-
-		// Make sure that the function being executed has a unique ID
-		if ( !handler.guid ) {
-			handler.guid = jQuery.guid++;
-		}
-
-		// Init the element's event structure
-		var elemData = jQuery._data( elem );
-
-		// If no elemData is found then we must be trying to bind to one of the
-		// banned noData elements
-		if ( !elemData ) {
-			return;
-		}
-
-		var events = elemData.events,
-			eventHandle = elemData.handle;
-
-		if ( !events ) {
-			elemData.events = events = {};
-		}
-
-		if ( !eventHandle ) {
-			elemData.handle = eventHandle = function( e ) {
-				// Discard the second event of a jQuery.event.trigger() and
-				// when an event is called after a page has unloaded
-				return typeof jQuery !== "undefined" && (!e || jQuery.event.triggered !== e.type) ?
-					jQuery.event.handle.apply( eventHandle.elem, arguments ) :
-					undefined;
-			};
-		}
-
-		// Add elem as a property of the handle function
-		// This is to prevent a memory leak with non-native events in IE.
-		eventHandle.elem = elem;
-
-		// Handle multiple events separated by a space
-		// jQuery(...).bind("mouseover mouseout", fn);
-		types = types.split(" ");
-
-		var type, i = 0, namespaces;
-
-		while ( (type = types[ i++ ]) ) {
-			handleObj = handleObjIn ?
-				jQuery.extend({}, handleObjIn) :
-				{ handler: handler, data: data };
-
-			// Namespaced event handlers
-			if ( type.indexOf(".") > -1 ) {
-				namespaces = type.split(".");
-				type = namespaces.shift();
-				handleObj.namespace = namespaces.slice(0).sort().join(".");
-
-			} else {
-				namespaces = [];
-				handleObj.namespace = "";
-			}
-
-			handleObj.type = type;
-			if ( !handleObj.guid ) {
-				handleObj.guid = handler.guid;
-			}
-
-			// Get the current list of functions bound to this event
-			var handlers = events[ type ],
-				special = jQuery.event.special[ type ] || {};
-
-			// Init the event handler queue
-			if ( !handlers ) {
-				handlers = events[ type ] = [];
-
-				// Check for a special event handler
-				// Only use addEventListener/attachEvent if the special
-				// events handler returns false
-				if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
-					// Bind the global event handler to the element
-					if ( elem.addEventListener ) {
-						elem.addEventListener( type, eventHandle, false );
-
-					} else if ( elem.attachEvent ) {
-						elem.attachEvent( "on" + type, eventHandle );
-					}
-				}
-			}
-
-			if ( special.add ) {
-				special.add.call( elem, handleObj );
-
-				if ( !handleObj.handler.guid ) {
-					handleObj.handler.guid = handler.guid;
-				}
-			}
-
-			// Add the function to the element's handler list
-			handlers.push( handleObj );
-
-			// Keep track of which events have been used, for event optimization
-			jQuery.event.global[ type ] = true;
-		}
-
-		// Nullify elem to prevent memory leaks in IE
-		elem = null;
-	},
-
-	global: {},
-
-	// Detach an event or set of events from an element
-	remove: function( elem, types, handler, pos ) {
-		// don't do events on text and comment nodes
-		if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
-			return;
-		}
-
-		if ( handler === false ) {
-			handler = returnFalse;
-		}
-
-		var ret, type, fn, j, i = 0, all, namespaces, namespace, special, eventType, handleObj, origType,
-			elemData = jQuery.hasData( elem ) && jQuery._data( elem ),
-			events = elemData && elemData.events;
-
-		if ( !elemData || !events ) {
-			return;
-		}
-
-		// types is actually an event object here
-		if ( types && types.type ) {
-			handler = types.handler;
-			types = types.type;
-		}
-
-		// Unbind all events for the element
-		if ( !types || typeof types === "string" && types.charAt(0) === "." ) {
-			types = types || "";
-
-			for ( type in events ) {
-				jQuery.event.remove( elem, type + types );
-			}
-
-			return;
-		}
-
-		// Handle multiple events separated by a space
-		// jQuery(...).unbind("mouseover mouseout", fn);
-		types = types.split(" ");
-
-		while ( (type = types[ i++ ]) ) {
-			origType = type;
-			handleObj = null;
-			all = type.indexOf(".") < 0;
-			namespaces = [];
-
-			if ( !all ) {
-				// Namespaced event handlers
-				namespaces = type.split(".");
-				type = namespaces.shift();
-
-				namespace = new RegExp("(^|\\.)" +
-					jQuery.map( namespaces.slice(0).sort(), fcleanup ).join("\\.(?:.*\\.)?") + "(\\.|$)");
-			}
-
-			eventType = events[ type ];
-
-			if ( !eventType ) {
-				continue;
-			}
-
-			if ( !handler ) {
-				for ( j = 0; j < eventType.length; j++ ) {
-					handleObj = eventType[ j ];
-
-					if ( all || namespace.test( handleObj.namespace ) ) {
-						jQuery.event.remove( elem, origType, handleObj.handler, j );
-						eventType.splice( j--, 1 );
-					}
-				}
-
-				continue;
-			}
-
-			special = jQuery.event.special[ type ] || {};
-
-			for ( j = pos || 0; j < eventType.length; j++ ) {
-				handleObj = eventType[ j ];
-
-				if ( handler.guid === handleObj.guid ) {
-					// remove the given handler for the given type
-					if ( all || namespace.test( handleObj.namespace ) ) {
-						if ( pos == null ) {
-							eventType.splice( j--, 1 );
-						}
-
-						if ( special.remove ) {
-							special.remove.call( elem, handleObj );
-						}
-					}
-
-					if ( pos != null ) {
-						break;
-					}
-				}
-			}
-
-			// remove generic event handler if no more handlers exist
-			if ( eventType.length === 0 || pos != null && eventType.length === 1 ) {
-				if ( !special.teardown || special.teardown.call( elem, namespaces ) === false ) {
-					jQuery.removeEvent( elem, type, elemData.handle );
-				}
-
-				ret = null;
-				delete events[ type ];
-			}
-		}
-
-		// Remove the expando if it's no longer used
-		if ( jQuery.isEmptyObject( events ) ) {
-			var handle = elemData.handle;
-			if ( handle ) {
-				handle.elem = null;
-			}
-
-			delete elemData.events;
-			delete elemData.handle;
-
-			if ( jQuery.isEmptyObject( elemData ) ) {
-				jQuery.removeData( elem, undefined, true );
-			}
-		}
-	},
-	
-	// Events that are safe to short-circuit if no handlers are attached.
-	// Native DOM events should not be added, they may have inline handlers.
-	customEvent: {
-		"getData": true,
-		"setData": true,
-		"changeData": true
-	},
-
-	trigger: function( event, data, elem, onlyHandlers ) {
-		// Event object or event type
-		var type = event.type || event,
-			namespaces = [],
-			exclusive;
-
-		if ( type.indexOf("!") >= 0 ) {
-			// Exclusive events trigger only for the exact event (no namespaces)
-			type = type.slice(0, -1);
-			exclusive = true;
-		}
-
-		if ( type.indexOf(".") >= 0 ) {
-			// Namespaced trigger; create a regexp to match event type in handle()
-			namespaces = type.split(".");
-			type = namespaces.shift();
-			namespaces.sort();
-		}
-
-		if ( (!elem || jQuery.event.customEvent[ type ]) && !jQuery.event.global[ type ] ) {
-			// No jQuery handlers for this event type, and it can't have inline handlers
-			return;
-		}
-
-		// Caller can pass in an Event, Object, or just an event type string
-		event = typeof event === "object" ?
-			// jQuery.Event object
-			event[ jQuery.expando ] ? event :
-			// Object literal
-			new jQuery.Event( type, event ) :
-			// Just the event type (string)
-			new jQuery.Event( type );
-
-		event.type = type;
-		event.exclusive = exclusive;
-		event.namespace = namespaces.join(".");
-		event.namespace_re = new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.)?") + "(\\.|$)");
-		
-		// triggerHandler() and global events don't bubble or run the default action
-		if ( onlyHandlers || !elem ) {
-			event.preventDefault();
-			event.stopPropagation();
-		}
-
-		// Handle a global trigger
-		if ( !elem ) {
-			// TODO: Stop taunting the data cache; remove global events and always attach to document
-			jQuery.each( jQuery.cache, function() {
-				// internalKey variable is just used to make it easier to find
-				// and potentially change this stuff later; currently it just
-				// points to jQuery.expando
-				var internalKey = jQuery.expando,
-					internalCache = this[ internalKey ];
-				if ( internalCache && internalCache.events && internalCache.events[ type ] ) {
-					jQuery.event.trigger( event, data, internalCache.handle.elem );
-				}
-			});
-			return;
-		}
-
-		// Don't do events on text and comment nodes
-		if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
-			return;
-		}
-
-		// Clean up the event in case it is being reused
-		event.result = undefined;
-		event.target = elem;
-
-		// Clone any incoming data and prepend the event, creating the handler arg list
-		data = data != null ? jQuery.makeArray( data ) : [];
-		data.unshift( event );
-
-		var cur = elem,
-			// IE doesn't like method names with a colon (#3533, #8272)
-			ontype = type.indexOf(":") < 0 ? "on" + type : "";
-
-		// Fire event on the current element, then bubble up the DOM tree
-		do {
-			var handle = jQuery._data( cur, "handle" );
-
-			event.currentTarget = cur;
-			if ( handle ) {
-				handle.apply( cur, data );
-			}
-
-			// Trigger an inline bound script
-			if ( ontype && jQuery.acceptData( cur ) && cur[ ontype ] && cur[ ontype ].apply( cur, data ) === false ) {
-				event.result = false;
-				event.preventDefault();
-			}
-
-			// Bubble up to document, then to window
-			cur = cur.parentNode || cur.ownerDocument || cur === event.target.ownerDocument && window;
-		} while ( cur && !event.isPropagationStopped() );
-
-		// If nobody prevented the default action, do it now
-		if ( !event.isDefaultPrevented() ) {
-			var old,
-				special = jQuery.event.special[ type ] || {};
-
-			if ( (!special._default || special._default.call( elem.ownerDocument, event ) === false) &&
-				!(type === "click" && jQuery.nodeName( elem, "a" )) && jQuery.acceptData( elem ) ) {
-
-				// Call a native DOM method on the target with the same name name as the event.
-				// Can't use an .isFunction)() check here because IE6/7 fails that test.
-				// IE<9 dies on focus to hidden element (#1486), may want to revisit a try/catch.
-				try {
-					if ( ontype && elem[ type ] ) {
-						// Don't re-trigger an onFOO event when we call its FOO() method
-						old = elem[ ontype ];
-
-						if ( old ) {
-							elem[ ontype ] = null;
-						}
-
-						jQuery.event.triggered = type;
-						elem[ type ]();
-					}
-				} catch ( ieError ) {}
-
-				if ( old ) {
-					elem[ ontype ] = old;
-				}
-
-				jQuery.event.triggered = undefined;
-			}
-		}
-		
-		return event.result;
-	},
-
-	handle: function( event ) {
-		event = jQuery.event.fix( event || window.event );
-		// Snapshot the handlers list since a called handler may add/remove events.
-		var handlers = ((jQuery._data( this, "events" ) || {})[ event.type ] || []).slice(0),
-			run_all = !event.exclusive && !event.namespace,
-			args = Array.prototype.slice.call( arguments, 0 );
-
-		// Use the fix-ed Event rather than the (read-only) native event
-		args[0] = event;
-		event.currentTarget = this;
-
-		for ( var j = 0, l = handlers.length; j < l; j++ ) {
-			var handleObj = handlers[ j ];
-
-			// Triggered event must 1) be non-exclusive and have no namespace, or
-			// 2) have namespace(s) a subset or equal to those in the bound event.
-			if ( run_all || event.namespace_re.test( handleObj.namespace ) ) {
-				// Pass in a reference to the handler function itself
-				// So that we can later remove it
-				event.handler = handleObj.handler;
-				event.data = handleObj.data;
-				event.handleObj = handleObj;
-
-				var ret = handleObj.handler.apply( this, args );
-
-				if ( ret !== undefined ) {
-					event.result = ret;
-					if ( ret === false ) {
-						event.preventDefault();
-						event.stopPropagation();
-					}
-				}
-
-				if ( event.isImmediatePropagationStopped() ) {
-					break;
-				}
-			}
-		}
-		return event.result;
-	},
-
-	props: "altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),
-
-	fix: function( event ) {
-		if ( event[ jQuery.expando ] ) {
-			return event;
-		}
-
-		// store a copy of the original event object
-		// and "clone" to set read-only properties
-		var originalEvent = event;
-		event = jQuery.Event( originalEvent );
-
-		for ( var i = this.props.length, prop; i; ) {
-			prop = this.props[ --i ];
-			event[ prop ] = originalEvent[ prop ];
-		}
-
-		// Fix target property, if necessary
-		if ( !event.target ) {
-			// Fixes #1925 where srcElement might not be defined either
-			event.target = event.srcElement || document;
-		}
-
-		// check if target is a textnode (safari)
-		if ( event.target.nodeType === 3 ) {
-			event.target = event.target.parentNode;
-		}
-
-		// Add relatedTarget, if necessary
-		if ( !event.relatedTarget && event.fromElement ) {
-			event.relatedTarget = event.fromElement === event.target ? event.toElement : event.fromElement;
-		}
-
-		// Calculate pageX/Y if missing and clientX/Y available
-		if ( event.pageX == null && event.clientX != null ) {
-			var eventDocument = event.target.ownerDocument || document,
-				doc = eventDocument.documentElement,
-				body = eventDocument.body;
-
-			event.pageX = event.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc && doc.clientLeft || body && body.clientLeft || 0);
-			event.pageY = event.clientY + (doc && doc.scrollTop  || body && body.scrollTop  || 0) - (doc && doc.clientTop  || body && body.clientTop  || 0);
-		}
-
-		// Add which for key events
-		if ( event.which == null && (event.charCode != null || event.keyCode != null) ) {
-			event.which = event.charCode != null ? event.charCode : event.keyCode;
-		}
-
-		// Add metaKey to non-Mac browsers (use ctrl for PC's and Meta for Macs)
-		if ( !event.metaKey && event.ctrlKey ) {
-			event.metaKey = event.ctrlKey;
-		}
-
-		// Add which for click: 1 === left; 2 === middle; 3 === right
-		// Note: button is not normalized, so don't use it
-		if ( !event.which && event.button !== undefined ) {
-			event.which = (event.button & 1 ? 1 : ( event.button & 2 ? 3 : ( event.button & 4 ? 2 : 0 ) ));
-		}
-
-		return event;
-	},
-
-	// Deprecated, use jQuery.guid instead
-	guid: 1E8,
-
-	// Deprecated, use jQuery.proxy instead
-	proxy: jQuery.proxy,
-
-	special: {
-		ready: {
-			// Make sure the ready event is setup
-			setup: jQuery.bindReady,
-			teardown: jQuery.noop
-		},
-
-		live: {
-			add: function( handleObj ) {
-				jQuery.event.add( this,
-					liveConvert( handleObj.origType, handleObj.selector ),
-					jQuery.extend({}, handleObj, {handler: liveHandler, guid: handleObj.handler.guid}) );
-			},
-
-			remove: function( handleObj ) {
-				jQuery.event.remove( this, liveConvert( handleObj.origType, handleObj.selector ), handleObj );
-			}
-		},
-
-		beforeunload: {
-			setup: function( data, namespaces, eventHandle ) {
-				// We only want to do this special case on windows
-				if ( jQuery.isWindow( this ) ) {
-					this.onbeforeunload = eventHandle;
-				}
-			},
-
-			teardown: function( namespaces, eventHandle ) {
-				if ( this.onbeforeunload === eventHandle ) {
-					this.onbeforeunload = null;
-				}
-			}
-		}
-	}
-};
-
-jQuery.removeEvent = document.removeEventListener ?
-	function( elem, type, handle ) {
-		if ( elem.removeEventListener ) {
-			elem.removeEventListener( type, handle, false );
-		}
-	} :
-	function( elem, type, handle ) {
-		if ( elem.detachEvent ) {
-			elem.detachEvent( "on" + type, handle );
-		}
-	};
-
-jQuery.Event = function( src, props ) {
-	// Allow instantiation without the 'new' keyword
-	if ( !this.preventDefault ) {
-		return new jQuery.Event( src, props );
-	}
-
-	// Event object
-	if ( src && src.type ) {
-		this.originalEvent = src;
-		this.type = src.type;
-
-		// Events bubbling up the document may have been marked as prevented
-		// by a handler lower down the tree; reflect the correct value.
-		this.isDefaultPrevented = (src.defaultPrevented || src.returnValue === false ||
-			src.getPreventDefault && src.getPreventDefault()) ? returnTrue : returnFalse;
-
-	// Event type
-	} else {
-		this.type = src;
-	}
-
-	// Put explicitly provided properties onto the event object
-	if ( props ) {
-		jQuery.extend( this, props );
-	}
-
-	// timeStamp is buggy for some events on Firefox(#3843)
-	// So we won't rely on the native value
-	this.timeStamp = jQuery.now();
-
-	// Mark it as fixed
-	this[ jQuery.expando ] = true;
-};
-
-function returnFalse() {
-	return false;
-}
-function returnTrue() {
-	return true;
-}
-
-// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
-// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
-jQuery.Event.prototype = {
-	preventDefault: function() {
-		this.isDefaultPrevented = returnTrue;
-
-		var e = this.originalEvent;
-		if ( !e ) {
-			return;
-		}
-
-		// if preventDefault exists run it on the original event
-		if ( e.preventDefault ) {
-			e.preventDefault();
-
-		// otherwise set the returnValue property of the original event to false (IE)
-		} else {
-			e.retu

<TRUNCATED>

[039/100] [abbrv] [partial] Reverting the erroneous merge by Sebastian according to the instructions in INFRA-6876

Posted by wi...@apache.org.
http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0004-out.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0004-out.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0004-out.jsonld
deleted file mode 100644
index 3b826ea..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0004-out.jsonld
+++ /dev/null
@@ -1,11 +0,0 @@
-{
-  "@context": {
-    "ex": "http://example.org/test#",
-    "ex:int": {
-      "@type": "xsd:integer"
-    },
-    "xsd": "http://www.w3.org/2001/XMLSchema#"
-  },
-  "@id": "http://example.org/test",
-  "ex:int": 123
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0005-context.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0005-context.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0005-context.jsonld
deleted file mode 100644
index 16469c8..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0005-context.jsonld
+++ /dev/null
@@ -1,12 +0,0 @@
-{
-  "@context": {
-    "ex": "http://example.org/vocab#",
-    "ex:date": {
-      "@type": "xsd:dateTime"
-    },
-    "ex:parent": {
-      "@type": "@id"
-    },
-    "xsd": "http://www.w3.org/2001/XMLSchema#"
-  }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0005-in.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0005-in.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0005-in.jsonld
deleted file mode 100644
index c67c753..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0005-in.jsonld
+++ /dev/null
@@ -1,13 +0,0 @@
-{
-  "@id": "http://example.org/test#example1",
-  "http://example.org/vocab#date": {
-    "@value": "2011-01-25T00:00:00Z",
-    "@type": "http://www.w3.org/2001/XMLSchema#dateTime"
-  },
-  "http://example.org/vocab#embed": {
-    "@id": "http://example.org/test#example2",
-    "http://example.org/vocab#parent": {
-      "@id": "http://example.org/test#example1"
-    }
-  }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0005-out.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0005-out.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0005-out.jsonld
deleted file mode 100644
index b49fac4..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0005-out.jsonld
+++ /dev/null
@@ -1,18 +0,0 @@
-{
-  "@context": {
-    "ex": "http://example.org/vocab#",
-    "ex:date": {
-      "@type": "xsd:dateTime"
-    },
-    "ex:parent": {
-      "@type": "@id"
-    },
-    "xsd": "http://www.w3.org/2001/XMLSchema#"
-  },
-  "@id": "http://example.org/test#example1",
-  "ex:date": "2011-01-25T00:00:00Z",
-  "ex:embed": {
-    "@id": "http://example.org/test#example2",
-    "ex:parent": "http://example.org/test#example1"
-  }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0006-context.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0006-context.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0006-context.jsonld
deleted file mode 100644
index 3f53478..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0006-context.jsonld
+++ /dev/null
@@ -1,5 +0,0 @@
-{
-  "@context": {
-    "ex": "http://example.org/vocab#"
-  }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0006-in.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0006-in.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0006-in.jsonld
deleted file mode 100644
index 558acbf..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0006-in.jsonld
+++ /dev/null
@@ -1,19 +0,0 @@
-{
-  "@id": "http://example.org/test",
-  "http://example.org/vocab#bool": {
-    "@value": "true",
-    "@type": "http://www.w3.org/2001/XMLSchema#boolean"
-  },
-  "http://example.org/vocab#double": {
-    "@value": "1.230000e+00",
-    "@type": "http://www.w3.org/2001/XMLSchema#double"
-  },
-  "http://example.org/vocab#double-zero": {
-    "@value": "0.000000e+00",
-    "@type": "http://www.w3.org/2001/XMLSchema#double"
-  },
-  "http://example.org/vocab#int": {
-    "@value": "123",
-    "@type": "http://www.w3.org/2001/XMLSchema#integer"
-  }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0006-out.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0006-out.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0006-out.jsonld
deleted file mode 100644
index 8ded5f5..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0006-out.jsonld
+++ /dev/null
@@ -1,10 +0,0 @@
-{
-  "@context": {
-    "ex": "http://example.org/vocab#"
-  },
-  "@id": "http://example.org/test",
-  "ex:bool": true,
-  "ex:double": 1.23,
-  "ex:double-zero": 0,
-  "ex:int": 123
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0007-context.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0007-context.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0007-context.jsonld
deleted file mode 100644
index 45b8c52..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0007-context.jsonld
+++ /dev/null
@@ -1,15 +0,0 @@
-{
-  "@context": {
-    "ex": "http://example.org/vocab#",
-    "ex:bool": {
-      "@type": "xsd:boolean"
-    },
-    "ex:double": {
-      "@type": "xsd:double"
-    },
-    "ex:int": {
-      "@type": "xsd:integer"
-    },
-    "xsd": "http://www.w3.org/2001/XMLSchema#"
-  }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0007-in.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0007-in.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0007-in.jsonld
deleted file mode 100644
index 558acbf..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0007-in.jsonld
+++ /dev/null
@@ -1,19 +0,0 @@
-{
-  "@id": "http://example.org/test",
-  "http://example.org/vocab#bool": {
-    "@value": "true",
-    "@type": "http://www.w3.org/2001/XMLSchema#boolean"
-  },
-  "http://example.org/vocab#double": {
-    "@value": "1.230000e+00",
-    "@type": "http://www.w3.org/2001/XMLSchema#double"
-  },
-  "http://example.org/vocab#double-zero": {
-    "@value": "0.000000e+00",
-    "@type": "http://www.w3.org/2001/XMLSchema#double"
-  },
-  "http://example.org/vocab#int": {
-    "@value": "123",
-    "@type": "http://www.w3.org/2001/XMLSchema#integer"
-  }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0007-out.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0007-out.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0007-out.jsonld
deleted file mode 100644
index f18bdcd..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0007-out.jsonld
+++ /dev/null
@@ -1,20 +0,0 @@
-{
-  "@context": {
-    "ex": "http://example.org/vocab#",
-    "ex:bool": {
-      "@type": "xsd:boolean"
-    },
-    "ex:double": {
-      "@type": "xsd:double"
-    },
-    "ex:int": {
-      "@type": "xsd:integer"
-    },
-    "xsd": "http://www.w3.org/2001/XMLSchema#"
-  },
-  "@id": "http://example.org/test",
-  "ex:bool": true,
-  "ex:double": 1.23,
-  "ex:double-zero": 0,
-  "ex:int": 123
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0008-context.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0008-context.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0008-context.jsonld
deleted file mode 100644
index 3f53478..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0008-context.jsonld
+++ /dev/null
@@ -1,5 +0,0 @@
-{
-  "@context": {
-    "ex": "http://example.org/vocab#"
-  }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0008-in.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0008-in.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0008-in.jsonld
deleted file mode 100644
index 44a5b78..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0008-in.jsonld
+++ /dev/null
@@ -1,7 +0,0 @@
-{
-  "@id": "http://example.org/test",
-  "http://example.org/vocab#test": {
-    "@language": "en",
-    "@value": "test"
-  }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0008-out.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0008-out.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0008-out.jsonld
deleted file mode 100644
index 5ab536c..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0008-out.jsonld
+++ /dev/null
@@ -1,10 +0,0 @@
-{
-  "@context": {
-    "ex": "http://example.org/vocab#"
-  },
-  "@id": "http://example.org/test",
-  "ex:test": {
-    "@language": "en",
-    "@value": "test"
-  }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0009-context.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0009-context.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0009-context.jsonld
deleted file mode 100644
index 8848f73..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0009-context.jsonld
+++ /dev/null
@@ -1,9 +0,0 @@
-{
-  "@context": {
-    "homepage": {
-      "@id": "http://xmlns.com/foaf/0.1/homepage",
-      "@type": "@id"
-    },
-    "name": "http://xmlns.com/foaf/0.1/name"
-  }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0009-in.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0009-in.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0009-in.jsonld
deleted file mode 100644
index 057da6f..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0009-in.jsonld
+++ /dev/null
@@ -1,9 +0,0 @@
-[
-  {
-    "http://xmlns.com/foaf/0.1/homepage": {
-      "@id": "http://john.doe.org/"
-    },
-    "http://xmlns.com/foaf/0.1/name": "John Doe"
-  },
-  {}
-]
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0009-out.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0009-out.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0009-out.jsonld
deleted file mode 100644
index 09d3937..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0009-out.jsonld
+++ /dev/null
@@ -1,17 +0,0 @@
-{
-  "@context": {
-    "homepage": {
-      "@id": "http://xmlns.com/foaf/0.1/homepage",
-      "@type": "@id"
-    },
-    "name": "http://xmlns.com/foaf/0.1/name"
-  },
-  "@id": [
-    {
-      "homepage": "http://john.doe.org/",
-      "name": "John Doe"
-    },
-    {
-    }
-  ]
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0010-context.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0010-context.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0010-context.jsonld
deleted file mode 100644
index 5b73639..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0010-context.jsonld
+++ /dev/null
@@ -1,14 +0,0 @@
-{
-  "@context": {
-    "http://example.org/test#property1": {
-      "@type": "uri"
-    },
-    "http://example.org/test#property2": {
-      "@type": "uri"
-    },
-    "http://example.org/test#property3": {
-      "@type": "uri"
-    },
-    "uri": "@id"
-  }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0010-in.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0010-in.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0010-in.jsonld
deleted file mode 100644
index a941054..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0010-in.jsonld
+++ /dev/null
@@ -1,13 +0,0 @@
-{
-  "@id": "http://example.org/test#example1",
-  "http://example.org/test#property1": {
-    "@id": "http://example.org/test#example2",
-    "http://example.org/test#property4": "foo"
-  },
-  "http://example.org/test#property2": {
-    "@id": "http://example.org/test#example3"
-  },
-  "http://example.org/test#property3": {
-    "@id": "http://example.org/test#example4"
-  }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0010-out.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0010-out.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0010-out.jsonld
deleted file mode 100644
index 5829d34..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0010-out.jsonld
+++ /dev/null
@@ -1,18 +0,0 @@
-{
-  "@context": {
-    "http://example.org/test#property2": {
-      "@type": "uri"
-    },
-    "http://example.org/test#property3": {
-      "@type": "uri"
-    },
-    "uri": "@id"
-  },
-  "http://example.org/test#property1": {
-    "http://example.org/test#property4": "foo",
-    "uri": "http://example.org/test#example2"
-  },
-  "http://example.org/test#property2": "http://example.org/test#example3",
-  "http://example.org/test#property3": "http://example.org/test#example4",
-  "uri": "http://example.org/test#example1"
-}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-manifest.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-manifest.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-manifest.jsonld
deleted file mode 100644
index 319ffb4..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-manifest.jsonld
+++ /dev/null
@@ -1,68 +0,0 @@
-{
-   "@context": "http://json-ld.org/test-suite/context.jsonld",
-   "@id": "",
-   "@type": "jld:Manifest",
-   "rdfs:comment": "JSON-LD to Compaction tests use object compare",
-   "name": "compact",
-   "sequence": [{
-      "@type": ["test:TestCase", "jld:CompactTest"],
-      "name": "add context",
-      "input": "compact-0001-in.jsonld",
-      "context": "compact-0001-context.jsonld",
-      "expect": "compact-0001-out.jsonld"
-   }, {
-      "@type": ["test:TestCase", "jld:CompactTest"],
-      "name": "reduced context",
-      "input": "compact-0002-in.jsonld",
-      "context": "compact-0002-context.jsonld",
-      "expect": "compact-0002-out.jsonld"
-   }, {
-      "@type": ["test:TestCase", "jld:CompactTest"],
-      "name": "coerced ex:contains",
-      "input": "compact-0003-in.jsonld",
-      "context": "compact-0003-context.jsonld",
-      "expect": "compact-0003-out.jsonld"
-   }, {
-      "@type": ["test:TestCase", "jld:CompactTest"],
-      "name": "with coerce",
-      "input": "compact-0004-in.jsonld",
-      "context": "compact-0004-context.jsonld",
-      "expect": "compact-0004-out.jsonld"
-   }, {
-      "@type": ["test:TestCase", "jld:CompactTest"],
-      "name": "with date coerce",
-      "input": "compact-0005-in.jsonld",
-      "context": "compact-0005-context.jsonld",
-      "expect": "compact-0005-out.jsonld"
-   }, {
-      "@type": ["test:TestCase", "jld:CompactTest"],
-      "name": "native types",
-      "input": "compact-0006-in.jsonld",
-      "context": "compact-0006-context.jsonld",
-      "expect": "compact-0006-out.jsonld"
-   }, {
-      "@type": ["test:TestCase", "jld:CompactTest"],
-      "name": "native types with coerce",
-      "input": "compact-0007-in.jsonld",
-      "context": "compact-0007-context.jsonld",
-      "expect": "compact-0007-out.jsonld"
-   }, {
-      "@type": ["test:TestCase", "jld:CompactTest"],
-      "name": "literal with language",
-      "input": "compact-0008-in.jsonld",
-      "context": "compact-0008-context.jsonld",
-      "expect": "compact-0008-out.jsonld"
-   }, {
-      "@type": ["test:TestCase", "jld:CompactTest"],
-      "name": "disjoint graph as array",
-      "input": "compact-0009-in.jsonld",
-      "context": "compact-0009-context.jsonld",
-      "expect": "compact-0009-out.jsonld"
-   }, {
-      "@type": ["test:TestCase", "jld:CompactTest"],
-      "name": "alias keywords",
-      "input": "compact-0010-in.jsonld",
-      "context": "compact-0010-context.jsonld",
-      "expect": "compact-0010-out.jsonld"
-   }]
-}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0001-in.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0001-in.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0001-in.jsonld
deleted file mode 100644
index 39c6605..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0001-in.jsonld
+++ /dev/null
@@ -1,3 +0,0 @@
-{
-  "@id": "http://example.org/test#example"
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0001-out.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0001-out.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0001-out.jsonld
deleted file mode 100644
index 39c6605..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0001-out.jsonld
+++ /dev/null
@@ -1,3 +0,0 @@
-{
-  "@id": "http://example.org/test#example"
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0002-in.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0002-in.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0002-in.jsonld
deleted file mode 100644
index ac24485..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0002-in.jsonld
+++ /dev/null
@@ -1,39 +0,0 @@
-{
-  "@context": {
-    "dc": "http://purl.org/dc/elements/1.1/",
-    "ex": "http://example.org/vocab#",
-    "ex:authored": {
-      "@type": "@id"
-    },
-    "ex:contains": {
-      "@type": "@id"
-    },
-    "foaf": "http://xmlns.com/foaf/0.1/",
-    "xsd": "http://www.w3.org/2001/XMLSchema#"
-  },
-  "@id": [
-    {
-      "@id": "http://example.org/test#chapter",
-      "dc:description": "Fun",
-      "dc:title": "Chapter One"
-    },
-    {
-      "@id": "http://example.org/test#jane",
-      "ex:authored": "http://example.org/test#chapter",
-      "foaf:name": "Jane"
-    },
-    {
-      "@id": "http://example.org/test#john",
-      "foaf:name": "John"
-    },
-    {
-      "@id": "http://example.org/test#library",
-      "ex:contains": {
-        "@id": "http://example.org/test#book",
-        "dc:contributor": "Writer",
-        "dc:title": "My Book",
-        "ex:contains": "http://example.org/test#chapter"
-      }
-    }
-  ]
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0002-out.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0002-out.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0002-out.jsonld
deleted file mode 100644
index 47eda67..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0002-out.jsonld
+++ /dev/null
@@ -1,31 +0,0 @@
-{
-  "@id": [
-    {
-      "@id": "http://example.org/test#chapter",
-      "http://purl.org/dc/elements/1.1/description": "Fun",
-      "http://purl.org/dc/elements/1.1/title": "Chapter One"
-    },
-    {
-      "@id": "http://example.org/test#jane",
-      "http://example.org/vocab#authored": {
-        "@id": "http://example.org/test#chapter"
-      },
-      "http://xmlns.com/foaf/0.1/name": "Jane"
-    },
-    {
-      "@id": "http://example.org/test#john",
-      "http://xmlns.com/foaf/0.1/name": "John"
-    },
-    {
-      "@id": "http://example.org/test#library",
-      "http://example.org/vocab#contains": {
-        "@id": "http://example.org/test#book",
-        "http://example.org/vocab#contains": {
-          "@id": "http://example.org/test#chapter"
-        },
-        "http://purl.org/dc/elements/1.1/contributor": "Writer",
-        "http://purl.org/dc/elements/1.1/title": "My Book"
-      }
-    }
-  ]
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0003-in.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0003-in.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0003-in.jsonld
deleted file mode 100644
index 1581559..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0003-in.jsonld
+++ /dev/null
@@ -1,13 +0,0 @@
-{
-  "@context": {
-    "dc": "http://purl.org/dc/elements/1.1/",
-    "ex": "http://example.org/vocab#",
-    "ex:contains": {
-      "@type": "@id"
-    },
-    "xsd": "http://www.w3.org/2001/XMLSchema#"
-  },
-  "@id": "http://example.org/test#book",
-  "dc:title": "Title",
-  "ex:contains": "http://example.org/test#chapter"
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0003-out.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0003-out.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0003-out.jsonld
deleted file mode 100644
index 9b70fba..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0003-out.jsonld
+++ /dev/null
@@ -1,7 +0,0 @@
-{
-  "@id": "http://example.org/test#book",
-  "http://example.org/vocab#contains": {
-    "@id": "http://example.org/test#chapter"
-  },
-  "http://purl.org/dc/elements/1.1/title": "Title"
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0004-in.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0004-in.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0004-in.jsonld
deleted file mode 100644
index b49fac4..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0004-in.jsonld
+++ /dev/null
@@ -1,18 +0,0 @@
-{
-  "@context": {
-    "ex": "http://example.org/vocab#",
-    "ex:date": {
-      "@type": "xsd:dateTime"
-    },
-    "ex:parent": {
-      "@type": "@id"
-    },
-    "xsd": "http://www.w3.org/2001/XMLSchema#"
-  },
-  "@id": "http://example.org/test#example1",
-  "ex:date": "2011-01-25T00:00:00Z",
-  "ex:embed": {
-    "@id": "http://example.org/test#example2",
-    "ex:parent": "http://example.org/test#example1"
-  }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0004-out.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0004-out.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0004-out.jsonld
deleted file mode 100644
index c67c753..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0004-out.jsonld
+++ /dev/null
@@ -1,13 +0,0 @@
-{
-  "@id": "http://example.org/test#example1",
-  "http://example.org/vocab#date": {
-    "@value": "2011-01-25T00:00:00Z",
-    "@type": "http://www.w3.org/2001/XMLSchema#dateTime"
-  },
-  "http://example.org/vocab#embed": {
-    "@id": "http://example.org/test#example2",
-    "http://example.org/vocab#parent": {
-      "@id": "http://example.org/test#example1"
-    }
-  }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0005-in.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0005-in.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0005-in.jsonld
deleted file mode 100644
index e723b25..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0005-in.jsonld
+++ /dev/null
@@ -1,16 +0,0 @@
-{
-  "@context": {
-    "d": "http://purl.org/dc/elements/1.1/",
-    "e": "http://example.org/vocab#",
-    "e:double-zero": {
-      "@type": "xsd:double"
-    },
-    "f": "http://xmlns.com/foaf/0.1/",
-    "xsd": "http://www.w3.org/2001/XMLSchema#"
-  },
-  "@id": "http://example.org/test",
-  "e:bool": true,
-  "e:double": 1.23,
-  "e:double-zero": 0.0e0,
-  "e:int": 123
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0005-out.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0005-out.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0005-out.jsonld
deleted file mode 100644
index e2a6b7d..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0005-out.jsonld
+++ /dev/null
@@ -1,19 +0,0 @@
-{
-  "@id": "http://example.org/test",
-  "http://example.org/vocab#bool": {
-    "@value": "true",
-    "@type": "http://www.w3.org/2001/XMLSchema#boolean"
-  },
-  "http://example.org/vocab#double": {
-    "@value": "1.230000e+00",
-    "@type": "http://www.w3.org/2001/XMLSchema#double"
-  },
-  "http://example.org/vocab#double-zero": {
-    "@value": "0.000000e+00",
-    "@type": "http://www.w3.org/2001/XMLSchema#double"
-  },
-  "http://example.org/vocab#int": {
-    "@value": "123",
-    "@type": "http://www.w3.org/2001/XMLSchema#integer"
-  }
-}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0006-in.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0006-in.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0006-in.jsonld
deleted file mode 100644
index 6c3f88a..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0006-in.jsonld
+++ /dev/null
@@ -1,7 +0,0 @@
-{
-  "@id": "http://example.org/test",
-  "http://example.org/test#int": {
-    "@value": "123",
-    "@type": "http://www.w3.org/2001/XMLSchema#integer"
-  }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0006-out.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0006-out.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0006-out.jsonld
deleted file mode 100644
index 6c3f88a..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0006-out.jsonld
+++ /dev/null
@@ -1,7 +0,0 @@
-{
-  "@id": "http://example.org/test",
-  "http://example.org/test#int": {
-    "@value": "123",
-    "@type": "http://www.w3.org/2001/XMLSchema#integer"
-  }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0007-in.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0007-in.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0007-in.jsonld
deleted file mode 100644
index 5ab536c..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0007-in.jsonld
+++ /dev/null
@@ -1,10 +0,0 @@
-{
-  "@context": {
-    "ex": "http://example.org/vocab#"
-  },
-  "@id": "http://example.org/test",
-  "ex:test": {
-    "@language": "en",
-    "@value": "test"
-  }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0007-out.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0007-out.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0007-out.jsonld
deleted file mode 100644
index 44a5b78..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0007-out.jsonld
+++ /dev/null
@@ -1,7 +0,0 @@
-{
-  "@id": "http://example.org/test",
-  "http://example.org/vocab#test": {
-    "@language": "en",
-    "@value": "test"
-  }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0008-in.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0008-in.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0008-in.jsonld
deleted file mode 100644
index 37f9ecb..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0008-in.jsonld
+++ /dev/null
@@ -1,20 +0,0 @@
-{
-  "@context": {
-    "http://example.org/test#property1": {
-      "@type": "uri"
-    },
-    "http://example.org/test#property2": {
-      "@type": "uri"
-    },
-    "uri": "@id"
-  },
-  "http://example.org/test#property1": {
-    "http://example.org/test#property4": "foo",
-    "uri": "http://example.org/test#example2"
-  },
-  "http://example.org/test#property2": "http://example.org/test#example3",
-  "http://example.org/test#property3": {
-    "uri": "http://example.org/test#example4"
-  },
-  "uri": "http://example.org/test#example1"
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0008-out.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0008-out.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0008-out.jsonld
deleted file mode 100644
index a941054..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0008-out.jsonld
+++ /dev/null
@@ -1,13 +0,0 @@
-{
-  "@id": "http://example.org/test#example1",
-  "http://example.org/test#property1": {
-    "@id": "http://example.org/test#example2",
-    "http://example.org/test#property4": "foo"
-  },
-  "http://example.org/test#property2": {
-    "@id": "http://example.org/test#example3"
-  },
-  "http://example.org/test#property3": {
-    "@id": "http://example.org/test#example4"
-  }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0009-in.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0009-in.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0009-in.jsonld
deleted file mode 100644
index eca3461..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0009-in.jsonld
+++ /dev/null
@@ -1,43 +0,0 @@
-{
-  "@context": {
-    "authored": {
-      "@id": "http://example.org/vocab#authored",
-      "@type": "@id"
-    },
-    "contains": {
-      "@id": "http://example.org/vocab#contains",
-      "@type": "@id"
-    },
-    "contributor": "http://purl.org/dc/elements/1.1/contributor",
-    "description": "http://purl.org/dc/elements/1.1/description",
-    "name": "http://xmlns.com/foaf/0.1/name",
-    "title": {
-      "@id": "http://purl.org/dc/elements/1.1/title"
-    }
-  },
-  "@id": [
-    {
-      "@id": "http://example.org/test#chapter",
-      "description": "Fun",
-      "title": "Chapter One"
-    },
-    {
-      "@id": "http://example.org/test#jane",
-      "authored": "http://example.org/test#chapter",
-      "name": "Jane"
-    },
-    {
-      "@id": "http://example.org/test#john",
-      "name": "John"
-    },
-    {
-      "@id": "http://example.org/test#library",
-      "contains": {
-        "@id": "http://example.org/test#book",
-        "contains": "http://example.org/test#chapter",
-        "contributor": "Writer",
-        "title": "My Book"
-      }
-    }
-  ]
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0009-out.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0009-out.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0009-out.jsonld
deleted file mode 100644
index 47eda67..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0009-out.jsonld
+++ /dev/null
@@ -1,31 +0,0 @@
-{
-  "@id": [
-    {
-      "@id": "http://example.org/test#chapter",
-      "http://purl.org/dc/elements/1.1/description": "Fun",
-      "http://purl.org/dc/elements/1.1/title": "Chapter One"
-    },
-    {
-      "@id": "http://example.org/test#jane",
-      "http://example.org/vocab#authored": {
-        "@id": "http://example.org/test#chapter"
-      },
-      "http://xmlns.com/foaf/0.1/name": "Jane"
-    },
-    {
-      "@id": "http://example.org/test#john",
-      "http://xmlns.com/foaf/0.1/name": "John"
-    },
-    {
-      "@id": "http://example.org/test#library",
-      "http://example.org/vocab#contains": {
-        "@id": "http://example.org/test#book",
-        "http://example.org/vocab#contains": {
-          "@id": "http://example.org/test#chapter"
-        },
-        "http://purl.org/dc/elements/1.1/contributor": "Writer",
-        "http://purl.org/dc/elements/1.1/title": "My Book"
-      }
-    }
-  ]
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0010-in.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0010-in.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0010-in.jsonld
deleted file mode 100644
index 16e6232..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0010-in.jsonld
+++ /dev/null
@@ -1,23 +0,0 @@
-{
-  "@context": {
-    "name": "http://xmlns.com/foaf/0.1/name",
-    "homepage": {
-      "@id": "http://xmlns.com/foaf/0.1/homepage",
-      "@type": "@id"
-    },
-    "know": "http://xmlns.com/foaf/0.1/knows",
-    "@iri": "@id"
-  },
-  "@id": "#me",
-  "know": [
-    {
-      "@id": "http://example.com/bob#me",
-      "name": "Bob",
-      "homepage": "http://example.com/bob"
-    }, {
-      "@id": "http://example.com/alice#me",
-      "name": "Alice",
-      "homepage": "http://example.com/alice"
-    }
-  ]
-}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0010-out.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0010-out.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0010-out.jsonld
deleted file mode 100644
index 09966fd..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0010-out.jsonld
+++ /dev/null
@@ -1,18 +0,0 @@
-{
-  "@id": "#me",
-  "http://xmlns.com/foaf/0.1/knows": [
-    {
-      "@id": "http://example.com/bob#me",
-      "http://xmlns.com/foaf/0.1/name": "Bob",
-      "http://xmlns.com/foaf/0.1/homepage": {
-        "@id": "http://example.com/bob"
-      }
-    }, {
-      "@id": "http://example.com/alice#me",
-      "http://xmlns.com/foaf/0.1/name": "Alice",
-      "http://xmlns.com/foaf/0.1/homepage": {
-        "@id": "http://example.com/alice"
-      }
-    }
-  ]
-}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-manifest.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-manifest.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-manifest.jsonld
deleted file mode 100644
index 0e044a4..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-manifest.jsonld
+++ /dev/null
@@ -1,58 +0,0 @@
-{
-   "@context": "http://json-ld.org/test-suite/context.jsonld",
-   "@id": "",
-   "@type": "jld:Manifest",
-   "rdfs:comment": "JSON-LD to Expansion tests use object compare",
-   "name": "expand",
-   "sequence": [{
-      "@type": ["test:TestCase", "jld:ExpandTest"],
-      "name": "id",
-      "input": "expand-0001-in.jsonld",
-      "expect": "expand-0001-out.jsonld"
-   }, {
-      "@type": ["test:TestCase", "jld:ExpandTest"],
-      "name": "complex",
-      "input": "expand-0002-in.jsonld",
-      "expect": "expand-0002-out.jsonld"
-   }, {
-      "@type": ["test:TestCase", "jld:ExpandTest"],
-      "name": "coerced ex:contains",
-      "input": "expand-0003-in.jsonld",
-      "expect": "expand-0003-out.jsonld"
-   }, {
-      "@type": ["test:TestCase", "jld:ExpandTest"],
-      "name": "remove type-coercion context",
-      "input": "expand-0004-in.jsonld",
-      "expect": "expand-0004-out.jsonld"
-   }, {
-      "@type": ["test:TestCase", "jld:ExpandTest"],
-      "name": "native types",
-      "input": "expand-0005-in.jsonld",
-      "expect": "expand-0005-out.jsonld"
-   }, {
-      "@type": ["test:TestCase", "jld:ExpandTest"],
-      "name": "native expanded type",
-      "input": "expand-0006-in.jsonld",
-      "expect": "expand-0006-out.jsonld"
-   }, {
-      "@type": ["test:TestCase", "jld:ExpandTest"],
-      "name": "literal with language",
-      "input": "expand-0007-in.jsonld",
-      "expect": "expand-0007-out.jsonld"
-   }, {
-      "@type": ["test:TestCase", "jld:ExpandTest"],
-      "name": "alias keywords",
-      "input": "expand-0008-in.jsonld",
-      "expect": "expand-0008-out.jsonld"
-   }, {
-      "@type": ["test:TestCase", "jld:ExpandTest"],
-      "name": "terms",
-      "input": "expand-0009-in.jsonld",
-      "expect": "expand-0009-out.jsonld"
-   }, {
-      "@type": ["test:TestCase", "jld:ExpandTest"],
-      "name": "do not expand aliased @id/@type",
-      "input": "expand-0010-in.jsonld",
-      "expect": "expand-0010-out.jsonld"
-   }]
-}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0001-frame.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0001-frame.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0001-frame.jsonld
deleted file mode 100644
index 16faf5b..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0001-frame.jsonld
+++ /dev/null
@@ -1,13 +0,0 @@
-{
-  "@context": {
-    "dc": "http://purl.org/dc/elements/1.1/",
-    "ex": "http://example.org/vocab#"
-  },
-  "@type": "ex:Library",
-  "ex:contains": {
-    "@type": "ex:Book",
-    "ex:contains": {
-      "@type": "ex:Chapter"
-    }
-  }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0001-in.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0001-in.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0001-in.jsonld
deleted file mode 100644
index d769f66..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0001-in.jsonld
+++ /dev/null
@@ -1,30 +0,0 @@
-{
-  "@context": {
-    "dc": "http://purl.org/dc/elements/1.1/",
-    "ex": "http://example.org/vocab#",
-    "ex:contains": {
-      "@type": "@id"
-    },
-    "xsd": "http://www.w3.org/2001/XMLSchema#"
-  },
-  "@id": [
-    {
-      "@id": "http://example.org/test/#library",
-      "@type": "ex:Library",
-      "ex:contains": "http://example.org/test#book"
-    },
-    {
-      "@id": "http://example.org/test#book",
-      "@type": "ex:Book",
-      "dc:contributor": "Writer",
-      "dc:title": "My Book",
-      "ex:contains": "http://example.org/test#chapter"
-    },
-    {
-      "@id": "http://example.org/test#chapter",
-      "@type": "ex:Chapter",
-      "dc:description": "Fun",
-      "dc:title": "Chapter One"
-    }
-  ]
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0001-out.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0001-out.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0001-out.jsonld
deleted file mode 100644
index 5435695..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0001-out.jsonld
+++ /dev/null
@@ -1,20 +0,0 @@
-{
-  "@context": {
-    "dc": "http://purl.org/dc/elements/1.1/",
-    "ex": "http://example.org/vocab#"
-  },
-  "@id": "http://example.org/test/#library",
-  "@type": "ex:Library",
-  "ex:contains": {
-    "@id": "http://example.org/test#book",
-    "@type": "ex:Book",
-    "dc:contributor": "Writer",
-    "dc:title": "My Book",
-    "ex:contains": {
-      "@id": "http://example.org/test#chapter",
-      "@type": "ex:Chapter",
-      "dc:description": "Fun",
-      "dc:title": "Chapter One"
-    }
-  }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0002-frame.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0002-frame.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0002-frame.jsonld
deleted file mode 100644
index 16faf5b..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0002-frame.jsonld
+++ /dev/null
@@ -1,13 +0,0 @@
-{
-  "@context": {
-    "dc": "http://purl.org/dc/elements/1.1/",
-    "ex": "http://example.org/vocab#"
-  },
-  "@type": "ex:Library",
-  "ex:contains": {
-    "@type": "ex:Book",
-    "ex:contains": {
-      "@type": "ex:Chapter"
-    }
-  }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0002-in.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0002-in.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0002-in.jsonld
deleted file mode 100644
index 4174975..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0002-in.jsonld
+++ /dev/null
@@ -1,31 +0,0 @@
-{
-  "@context": {
-    "dc": "http://purl.org/dc/elements/1.1/",
-    "ex": "http://example.org/vocab#",
-    "ex:contains": {
-      "@type": "@id"
-    },
-    "xsd": "http://www.w3.org/2001/XMLSchema#"
-  },
-  "@id": [
-    {
-      "@id": "http://example.org/test/#library",
-      "@type": "ex:Library",
-      "ex:contains": "http://example.org/test#book"
-    },
-    {
-      "@id": "http://example.org/test#book",
-      "@type": "ex:Book",
-      "dc:contributor": "Writer",
-      "dc:title": "My Book",
-      "ex:contains": "http://example.org/test#chapter"
-    },
-    {
-      "@id": "http://example.org/test#chapter",
-      "@type": "ex:Chapter",
-      "dc:description": "Fun",
-      "dc:title": "Chapter One",
-      "ex:act": "ex:ActOne"
-    }
-  ]
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0002-out.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0002-out.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0002-out.jsonld
deleted file mode 100644
index 241e10f..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0002-out.jsonld
+++ /dev/null
@@ -1,21 +0,0 @@
-{
-  "@context": {
-    "dc": "http://purl.org/dc/elements/1.1/",
-    "ex": "http://example.org/vocab#"
-  },
-  "@id": "http://example.org/test/#library",
-  "@type": "ex:Library",
-  "ex:contains": {
-    "@id": "http://example.org/test#book",
-    "@type": "ex:Book",
-    "dc:contributor": "Writer",
-    "dc:title": "My Book",
-    "ex:contains": {
-      "@id": "http://example.org/test#chapter",
-      "@type": "ex:Chapter",
-      "dc:description": "Fun",
-      "dc:title": "Chapter One",
-      "ex:act": "ex:ActOne"
-    }
-  }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0003-frame.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0003-frame.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0003-frame.jsonld
deleted file mode 100644
index 9da49cf..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0003-frame.jsonld
+++ /dev/null
@@ -1,7 +0,0 @@
-{
-  "@context": {
-    "dc": "http://purl.org/dc/elements/1.1/",
-    "ex": "http://example.org/vocab#"
-  },
-  "@type": "ex:DoesNotExist"
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0003-in.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0003-in.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0003-in.jsonld
deleted file mode 100644
index d769f66..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0003-in.jsonld
+++ /dev/null
@@ -1,30 +0,0 @@
-{
-  "@context": {
-    "dc": "http://purl.org/dc/elements/1.1/",
-    "ex": "http://example.org/vocab#",
-    "ex:contains": {
-      "@type": "@id"
-    },
-    "xsd": "http://www.w3.org/2001/XMLSchema#"
-  },
-  "@id": [
-    {
-      "@id": "http://example.org/test/#library",
-      "@type": "ex:Library",
-      "ex:contains": "http://example.org/test#book"
-    },
-    {
-      "@id": "http://example.org/test#book",
-      "@type": "ex:Book",
-      "dc:contributor": "Writer",
-      "dc:title": "My Book",
-      "ex:contains": "http://example.org/test#chapter"
-    },
-    {
-      "@id": "http://example.org/test#chapter",
-      "@type": "ex:Chapter",
-      "dc:description": "Fun",
-      "dc:title": "Chapter One"
-    }
-  ]
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0003-out.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0003-out.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0003-out.jsonld
deleted file mode 100644
index ec747fa..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0003-out.jsonld
+++ /dev/null
@@ -1 +0,0 @@
-null
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0004-frame.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0004-frame.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0004-frame.jsonld
deleted file mode 100644
index 81b9319..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0004-frame.jsonld
+++ /dev/null
@@ -1,10 +0,0 @@
-{
-  "@context": {
-    "dc": "http://purl.org/dc/elements/1.1/",
-    "ex": "http://example.org/vocab#",
-    "ex:contains": {
-      "@type": "@id"
-    }
-  },
-  "@type": "ex:Library"
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0004-in.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0004-in.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0004-in.jsonld
deleted file mode 100644
index 84a8f8c..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0004-in.jsonld
+++ /dev/null
@@ -1,29 +0,0 @@
-{
-  "@context": {
-    "dc": "http://purl.org/dc/elements/1.1/",
-    "ex": "http://example.org/vocab#",
-    "ex:contains": {
-      "@type": "@id"
-    }
-  },
-  "@id": [
-    {
-      "@id": "http://example.org/test/#library",
-      "@type": "ex:Library",
-      "ex:contains": "http://example.org/test#book"
-    },
-    {
-      "@id": "http://example.org/test#book",
-      "@type": "ex:Book",
-      "dc:contributor": "Writer",
-      "dc:title": "My Book",
-      "ex:contains": "http://example.org/test#chapter"
-    },
-    {
-      "@id": "http://example.org/test#chapter",
-      "@type": "ex:Chapter",
-      "dc:description": "Fun",
-      "dc:title": "Chapter One"
-    }
-  ]
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0004-out.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0004-out.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0004-out.jsonld
deleted file mode 100644
index 5435695..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0004-out.jsonld
+++ /dev/null
@@ -1,20 +0,0 @@
-{
-  "@context": {
-    "dc": "http://purl.org/dc/elements/1.1/",
-    "ex": "http://example.org/vocab#"
-  },
-  "@id": "http://example.org/test/#library",
-  "@type": "ex:Library",
-  "ex:contains": {
-    "@id": "http://example.org/test#book",
-    "@type": "ex:Book",
-    "dc:contributor": "Writer",
-    "dc:title": "My Book",
-    "ex:contains": {
-      "@id": "http://example.org/test#chapter",
-      "@type": "ex:Chapter",
-      "dc:description": "Fun",
-      "dc:title": "Chapter One"
-    }
-  }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0005-frame.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0005-frame.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0005-frame.jsonld
deleted file mode 100644
index df6e66e..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0005-frame.jsonld
+++ /dev/null
@@ -1,19 +0,0 @@
-{
-  "@context": {
-    "dc": "http://purl.org/dc/elements/1.1/",
-    "ex": "http://example.org/vocab#"
-  },
-  "@explicit": true,
-  "@type": "ex:Library",
-  "ex:contains": {
-    "@explicit": true,
-    "@type": "ex:Book",
-    "dc:title": {},
-    "ex:contains": {
-      "@explicit": true,
-      "@type": "ex:Chapter",
-      "dc:title": {},
-      "ex:null": {}
-    }
-  }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0005-in.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0005-in.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0005-in.jsonld
deleted file mode 100644
index d769f66..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0005-in.jsonld
+++ /dev/null
@@ -1,30 +0,0 @@
-{
-  "@context": {
-    "dc": "http://purl.org/dc/elements/1.1/",
-    "ex": "http://example.org/vocab#",
-    "ex:contains": {
-      "@type": "@id"
-    },
-    "xsd": "http://www.w3.org/2001/XMLSchema#"
-  },
-  "@id": [
-    {
-      "@id": "http://example.org/test/#library",
-      "@type": "ex:Library",
-      "ex:contains": "http://example.org/test#book"
-    },
-    {
-      "@id": "http://example.org/test#book",
-      "@type": "ex:Book",
-      "dc:contributor": "Writer",
-      "dc:title": "My Book",
-      "ex:contains": "http://example.org/test#chapter"
-    },
-    {
-      "@id": "http://example.org/test#chapter",
-      "@type": "ex:Chapter",
-      "dc:description": "Fun",
-      "dc:title": "Chapter One"
-    }
-  ]
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0005-out.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0005-out.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0005-out.jsonld
deleted file mode 100644
index 4bcb6c2..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0005-out.jsonld
+++ /dev/null
@@ -1,19 +0,0 @@
-{
-  "@context": {
-    "dc": "http://purl.org/dc/elements/1.1/",
-    "ex": "http://example.org/vocab#"
-  },
-  "@id": "http://example.org/test/#library",
-  "@type": "ex:Library",
-  "ex:contains": {
-    "@id": "http://example.org/test#book",
-    "@type": "ex:Book",
-    "dc:title": "My Book",
-    "ex:contains": {
-      "@id": "http://example.org/test#chapter",
-      "@type": "ex:Chapter",
-      "dc:title": "Chapter One",
-      "ex:null": null
-    }
-  }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0006-frame.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0006-frame.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0006-frame.jsonld
deleted file mode 100644
index 16faf5b..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0006-frame.jsonld
+++ /dev/null
@@ -1,13 +0,0 @@
-{
-  "@context": {
-    "dc": "http://purl.org/dc/elements/1.1/",
-    "ex": "http://example.org/vocab#"
-  },
-  "@type": "ex:Library",
-  "ex:contains": {
-    "@type": "ex:Book",
-    "ex:contains": {
-      "@type": "ex:Chapter"
-    }
-  }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0006-in.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0006-in.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0006-in.jsonld
deleted file mode 100644
index d769f66..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0006-in.jsonld
+++ /dev/null
@@ -1,30 +0,0 @@
-{
-  "@context": {
-    "dc": "http://purl.org/dc/elements/1.1/",
-    "ex": "http://example.org/vocab#",
-    "ex:contains": {
-      "@type": "@id"
-    },
-    "xsd": "http://www.w3.org/2001/XMLSchema#"
-  },
-  "@id": [
-    {
-      "@id": "http://example.org/test/#library",
-      "@type": "ex:Library",
-      "ex:contains": "http://example.org/test#book"
-    },
-    {
-      "@id": "http://example.org/test#book",
-      "@type": "ex:Book",
-      "dc:contributor": "Writer",
-      "dc:title": "My Book",
-      "ex:contains": "http://example.org/test#chapter"
-    },
-    {
-      "@id": "http://example.org/test#chapter",
-      "@type": "ex:Chapter",
-      "dc:description": "Fun",
-      "dc:title": "Chapter One"
-    }
-  ]
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0006-out.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0006-out.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0006-out.jsonld
deleted file mode 100644
index 5435695..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0006-out.jsonld
+++ /dev/null
@@ -1,20 +0,0 @@
-{
-  "@context": {
-    "dc": "http://purl.org/dc/elements/1.1/",
-    "ex": "http://example.org/vocab#"
-  },
-  "@id": "http://example.org/test/#library",
-  "@type": "ex:Library",
-  "ex:contains": {
-    "@id": "http://example.org/test#book",
-    "@type": "ex:Book",
-    "dc:contributor": "Writer",
-    "dc:title": "My Book",
-    "ex:contains": {
-      "@id": "http://example.org/test#chapter",
-      "@type": "ex:Chapter",
-      "dc:description": "Fun",
-      "dc:title": "Chapter One"
-    }
-  }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0007-frame.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0007-frame.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0007-frame.jsonld
deleted file mode 100644
index 16faf5b..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0007-frame.jsonld
+++ /dev/null
@@ -1,13 +0,0 @@
-{
-  "@context": {
-    "dc": "http://purl.org/dc/elements/1.1/",
-    "ex": "http://example.org/vocab#"
-  },
-  "@type": "ex:Library",
-  "ex:contains": {
-    "@type": "ex:Book",
-    "ex:contains": {
-      "@type": "ex:Chapter"
-    }
-  }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0007-in.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0007-in.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0007-in.jsonld
deleted file mode 100644
index 94c462f..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0007-in.jsonld
+++ /dev/null
@@ -1,33 +0,0 @@
-{
-  "@context": {
-    "dc": "http://purl.org/dc/elements/1.1/",
-    "ex": "http://example.org/vocab#",
-    "ex:contains": {
-      "@type": "@id"
-    },
-    "xsd": "http://www.w3.org/2001/XMLSchema#"
-  },
-  "@id": [
-    {
-      "@id": "http://example.org/test/#library",
-      "@type": [
-        "ex:Library",
-        "ex:Building"
-      ],
-      "ex:contains": "http://example.org/test#book"
-    },
-    {
-      "@id": "http://example.org/test#book",
-      "@type": "ex:Book",
-      "dc:contributor": "Writer",
-      "dc:title": "My Book",
-      "ex:contains": "http://example.org/test#chapter"
-    },
-    {
-      "@id": "http://example.org/test#chapter",
-      "@type": "ex:Chapter",
-      "dc:description": "Fun",
-      "dc:title": "Chapter One"
-    }
-  ]
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0007-out.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0007-out.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0007-out.jsonld
deleted file mode 100644
index 2c521de..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0007-out.jsonld
+++ /dev/null
@@ -1,23 +0,0 @@
-{
-  "@context": {
-    "dc": "http://purl.org/dc/elements/1.1/",
-    "ex": "http://example.org/vocab#"
-  },
-  "@id": "http://example.org/test/#library",
-  "@type": [
-    "ex:Library",
-    "ex:Building"
-  ],
-  "ex:contains": {
-    "@id": "http://example.org/test#book",
-    "@type": "ex:Book",
-    "dc:contributor": "Writer",
-    "dc:title": "My Book",
-    "ex:contains": {
-      "@id": "http://example.org/test#chapter",
-      "@type": "ex:Chapter",
-      "dc:description": "Fun",
-      "dc:title": "Chapter One"
-    }
-  }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0008-frame.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0008-frame.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0008-frame.jsonld
deleted file mode 100644
index b28c75b..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0008-frame.jsonld
+++ /dev/null
@@ -1,14 +0,0 @@
-{
-  "@context": {
-    "ex": "http://example.org/vocab#"
-  },
-  "@type": "ex:Example",
-  "ex:embedded": [],
-  "ex:literal": [],
-  "ex:mixed": [
-    {
-      "@embed": false
-    }
-  ],
-  "ex:single": []
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0008-in.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0008-in.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0008-in.jsonld
deleted file mode 100644
index db75633..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0008-in.jsonld
+++ /dev/null
@@ -1,38 +0,0 @@
-{
-  "@context": {
-    "ex": "http://example.org/vocab#"
-  },
-  "@id": [
-    {
-      "@id": "http://example.org/test/#example",
-      "@type": "ex:Example",
-      "ex:embedded": {
-        "@id": "http://example.org/test#subject1"
-      },
-      "ex:literal": [
-        "str1",
-        "str2",
-        "str3"
-      ],
-      "ex:mixed": [
-        {
-          "@id": "http://example.org/test#iri1"
-        },
-        "literal1",
-        {
-          "@id": "http://example.org/test#iri2"
-        },
-        "literal2",
-        {
-          "@id": "http://example.org/test#subject2",
-          "ex:prop": "property"
-        }
-      ],
-      "ex:single": "single"
-    },
-    {
-      "@id": "http://example.org/test#subject1",
-      "ex:prop": "property"
-    }
-  ]
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0008-out.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0008-out.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0008-out.jsonld
deleted file mode 100644
index 5bb767f..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0008-out.jsonld
+++ /dev/null
@@ -1,34 +0,0 @@
-{
-  "@context": {
-    "ex": "http://example.org/vocab#"
-  },
-  "@id": "http://example.org/test/#example",
-  "@type": "ex:Example",
-  "ex:embedded": [
-    {
-      "@id": "http://example.org/test#subject1",
-      "ex:prop": "property"
-    }
-  ],
-  "ex:literal": [
-    "str1",
-    "str2",
-    "str3"
-  ],
-  "ex:mixed": [
-    {
-      "@id": "http://example.org/test#iri1"
-    },
-    "literal1",
-    {
-      "@id": "http://example.org/test#iri2"
-    },
-    "literal2",
-    {
-      "@id": "http://example.org/test#subject2"
-    }
-  ],
-  "ex:single": [
-    "single"
-  ]
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0009-frame.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0009-frame.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0009-frame.jsonld
deleted file mode 100644
index cead004..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0009-frame.jsonld
+++ /dev/null
@@ -1,27 +0,0 @@
-{
-  "@context": {
-    "ex": "http://example.org/vocab#"
-  },
-  "@type": "ex:Example1",
-  "ex:p2": {
-    "@default": "custom-default"
-  },
-  "ex:p3": {
-    "@default": 3
-  },
-  "ex:p4": {
-    "@omitDefault": true
-  },
-  "ex:p5": {},
-  "ex:p6": {
-    "@type": "ex:Example2",
-    "ex:p3": {
-      "@default": 4
-    }
-  },
-  "ex:p7": [
-    {
-      "@type": "ex:Example3"
-    }
-  ]
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0009-in.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0009-in.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0009-in.jsonld
deleted file mode 100644
index 7cb3ac6..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0009-in.jsonld
+++ /dev/null
@@ -1,19 +0,0 @@
-{
-  "@context": {
-    "ex": "http://example.org/vocab#"
-  },
-  "@id": [
-    {
-      "@id": "http://example.org/test/#example1",
-      "@type": "ex:Example1",
-      "ex:p1": "non-default",
-      "ex:p6": {
-        "@id": "http://example.org/test/#example2"
-      }
-    },
-    {
-      "@id": "http://example.org/test/#example2",
-      "@type": "ex:Example2"
-    }
-  ]
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0009-out.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0009-out.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0009-out.jsonld
deleted file mode 100644
index 48afe98..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0009-out.jsonld
+++ /dev/null
@@ -1,17 +0,0 @@
-{
-  "@context": {
-    "ex": "http://example.org/vocab#"
-  },
-  "@id": "http://example.org/test/#example1",
-  "@type": "ex:Example1",
-  "ex:p1": "non-default",
-  "ex:p2": "custom-default",
-  "ex:p3": 3,
-  "ex:p5": null,
-  "ex:p6": {
-    "@id": "http://example.org/test/#example2",
-    "@type": "ex:Example2",
-    "ex:p3": 4
-  },
-  "ex:p7": []
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0010-frame.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0010-frame.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0010-frame.jsonld
deleted file mode 100644
index a6cea2b..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0010-frame.jsonld
+++ /dev/null
@@ -1,13 +0,0 @@
-{
-  "@context": {
-    "dc": "http://purl.org/dc/terms/",
-    "dc:creator": {
-      "@type": "@id"
-    },
-    "foaf": "http://xmlns.com/foaf/0.1/",
-    "ps": "http://purl.org/payswarm#"
-  },
-  "@id": "http://example.com/asset",
-  "@type": "ps:Asset",
-  "dc:creator": {}
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0010-in.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0010-in.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0010-in.jsonld
deleted file mode 100644
index ecc4cdb..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0010-in.jsonld
+++ /dev/null
@@ -1,15 +0,0 @@
-{
-  "@context": {
-    "dc0": "http://purl.org/dc/terms/",
-    "dc:creator": {
-      "@type": "@id"
-    },
-    "foaf": "http://xmlns.com/foaf/0.1/",
-    "ps": "http://purl.org/payswarm#"
-  },
-  "@id": "http://example.com/asset",
-  "@type": "ps:Asset",
-  "dc:creator": {
-    "foaf:name": "John Doe"
-  }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0010-out.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0010-out.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0010-out.jsonld
deleted file mode 100644
index e91362d..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0010-out.jsonld
+++ /dev/null
@@ -1,12 +0,0 @@
-{
-  "@context": {
-    "dc": "http://purl.org/dc/terms/",
-    "dc:creator": {
-      "@type": "@id"
-    },
-    "ps": "http://purl.org/payswarm#"
-  },
-  "@id": "http://example.com/asset",
-  "@type": "ps:Asset",
-  "dc:creator": null
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0011-frame.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0011-frame.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0011-frame.jsonld
deleted file mode 100644
index c219d40..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0011-frame.jsonld
+++ /dev/null
@@ -1,12 +0,0 @@
-{
-  "@context": {
-    "ex": "http://www.example.com/#"
-  },
-  "@type": "ex:Thing",
-  "ex:embed": {
-    "@embed": true
-  },
-  "ex:noembed": {
-    "@embed": false
-  }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0011-in.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0011-in.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0011-in.jsonld
deleted file mode 100644
index d5df9e3..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0011-in.jsonld
+++ /dev/null
@@ -1,15 +0,0 @@
-{
-  "@context": {
-    "ex": "http://www.example.com/#"
-  },
-  "@id": "ex:subject",
-  "@type": "ex:Thing",
-  "ex:embed": {
-    "@id": "ex:embedded",
-    "ex:title": "Embedded"
-  },
-  "ex:noembed": {
-    "@id": "ex:notembedded",
-    "ex:title": "Not Embedded"
-  }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0011-out.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0011-out.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0011-out.jsonld
deleted file mode 100644
index 641a51e..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0011-out.jsonld
+++ /dev/null
@@ -1,14 +0,0 @@
-{
-  "@context": {
-    "ex": "http://www.example.com/#"
-  },
-  "@id": "ex:subject",
-  "@type": "ex:Thing",
-  "ex:embed": {
-    "@id": "ex:embedded",
-    "ex:title": "Embedded"
-  },
-  "ex:noembed": {
-    "@id": "ex:notembedded"
-  }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0012-frame.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0012-frame.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0012-frame.jsonld
deleted file mode 100644
index 2159726..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0012-frame.jsonld
+++ /dev/null
@@ -1,11 +0,0 @@
-[
-  {
-    "@context": {
-      "sp": "http://smartplatforms.org/terms#"
-    },
-    "@type": "http://smartplatforms.org/terms#Medication"
-  },
-  {
-    "@type": "http://smartplatforms.org/terms#Fulfillment"
-  }
-]
\ No newline at end of file


[009/100] [abbrv] [partial] Reverting the erroneous merge by Sebastian according to the instructions in INFRA-6876

Posted by wi...@apache.org.
http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/parent/pom.xml
----------------------------------------------------------------------
diff --git a/parent/pom.xml b/parent/pom.xml
index 0e8afc4..84f3600 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -29,26 +29,28 @@
     <groupId>org.apache.marmotta</groupId>
     <artifactId>marmotta-parent</artifactId>
     <packaging>pom</packaging>
-    <version>3.1.0-incubating-SNAPSHOT</version>
+    <version>3.1.0-incubating</version>
 
     <name>Apache Marmotta Parent</name>
     <description>Parent POM for the Apache Marmotta project</description>
     <url>http://marmotta.incubator.apache.org</url>
 
     <properties>
-        <sesame.version>2.7.0-beta2</sesame.version>
+        <sesame.version>2.7.6</sesame.version>
         <junit.version>4.11</junit.version>
-        <weld.version>1.1.Final</weld.version>
-        <weld.core.version>1.1.11.Final</weld.core.version>
+        <weld.version>2.0.SP1</weld.version>
+        <weld.core.version>2.0.4.Final</weld.core.version>
         <rest.assured.version>1.7.1</rest.assured.version>
         <hamcrest.version>1.3</hamcrest.version>
         <tempus.fugit.version>1.1</tempus.fugit.version>
         <jatl.version>0.2.2</jatl.version>
-        <servlet.api.version>2.5</servlet.api.version>
-        <javax.el.version>2.2</javax.el.version>
-        <h2.version>1.3.170</h2.version>
-        <postgresql.version>9.2-1002-jdbc4</postgresql.version>
+        <servlet.api.version>3.0.1</servlet.api.version>
+        <javax.el.version>2.2.4</javax.el.version>
+        <h2.version>1.3.173</h2.version>
+        <postgresql.version>9.2-1003-jdbc4</postgresql.version>
         <mysql.version>5.1.21</mysql.version>
+        <jetty.version>9.0.3.v20130506</jetty.version>
+        <resteasy.version>3.0.4.Final</resteasy.version>
     </properties>
 
     <prerequisites>
@@ -96,10 +98,10 @@
                 <plugin>
                     <groupId>org.apache.maven.plugins</groupId>
                     <artifactId>maven-compiler-plugin</artifactId>
-                    <version>3.0</version>
+                    <version>3.1</version>
                     <configuration>
-                        <source>1.6</source>
-                        <target>1.6</target>
+                        <source>1.7</source>
+                        <target>1.7</target>
                     </configuration>
                 </plugin>
                 <plugin>
@@ -133,19 +135,21 @@
                 <plugin>
                     <groupId>org.apache.maven.plugins</groupId>
                     <artifactId>maven-surefire-plugin</artifactId>
-                    <version>2.12.4</version>
+                    <version>2.16</version>
                     <configuration>
                         <useSystemClassLoader>false</useSystemClassLoader>
-                        <forkMode>always</forkMode>
+                        <forkCount>1</forkCount>
+                        <reuseForks>false</reuseForks>
                     </configuration>
                 </plugin>
                 <plugin>
                     <groupId>org.apache.maven.plugins</groupId>
                     <artifactId>maven-failsafe-plugin</artifactId>
-                    <version>2.12.4</version>
+                    <version>2.16</version>
                     <configuration>
                         <useSystemClassLoader>false</useSystemClassLoader>
-                        <forkMode>always</forkMode>
+                        <forkCount>1</forkCount>
+                        <reuseForks>false</reuseForks>
                     </configuration>
                 </plugin>
  <!--               <plugin>
@@ -344,7 +348,7 @@
                         </execution>
                     </executions>
                     <configuration>
-                        <relativePath>../</relativePath>
+                        <relativePath>../../</relativePath>
                         <rootPath>$${rebel.root}</rootPath>
                     </configuration>
                 </plugin>
@@ -370,6 +374,9 @@
                         <header>parent/src/etc/header.txt</header>
                         <strictCheck>true</strictCheck>
                         <excludes>
+                            <!-- everything in extras is contributed 3rd party -->
+                            <exclude>**/extras/**</exclude>
+
                             <exclude>**/src/ext/**</exclude>
                             <exclude>COPYING.txt</exclude>
                             <exclude>NOTICE.txt</exclude>
@@ -403,6 +410,13 @@
                             <exclude>**/src/main/java/solr2155/**</exclude>
                             <exclude>**/src/main/java/net/miginfocom/**</exclude>
                             <exclude>**/src/main/java/org/oxbow/**</exclude>
+                            
+                            <!-- codemirror -->
+                            <exclude>**/codemirror.js</exclude>
+                            <exclude>**/codemirror.css</exclude>
+                            <exclude>**/simple-hint.js</exclude>
+                            <exclude>**/simple-hint.css</exclude>
+                            <exclude>**/sparql.js</exclude>
                         </excludes>
                     </configuration>
                 </plugin>
@@ -413,6 +427,9 @@
                     <configuration>
                         <excludeSubProjects>false</excludeSubProjects>
                         <excludes>
+                            <!-- 3rd party libraries -->
+                            <exclude>extras/**</exclude>
+
                             <!-- auto-generated files -->
                             <exclude>**/*.txt</exclude>
                             <exclude>**/atlassian-ide-plugin.xml</exclude>
@@ -425,6 +442,7 @@
                             <exclude>.git/**</exclude>
                             <exclude>.idea/**</exclude>
                             <exclude>.eclipse/**</exclude>
+                            <exclude>**/*.ids</exclude>
                             <exclude>**/*.iml</exclude>
                             <exclude>**/*.ipr</exclude>
                             <exclude>**/*.iws</exclude>
@@ -434,20 +452,10 @@
 
 
                             <!-- known 3rd-party source code -->
-                            <exclude>**/jquery*.js</exclude>
-                            <exclude>**/jquery*.css</exclude>
-                            <exclude>**/foundation.js</exclude>
-                            <exclude>**/strftime.js</exclude>
-                            <exclude>**/customforms.js</exclude>
-                            <exclude>**/pageguide.js</exclude>
-                            <exclude>**/raphael-dracula.pack.min.js</exclude>
-                            <exclude>**/dygraph/**</exclude>
-                            <exclude>**/sgvizler/**</exclude>
-                            <exclude>**/js/lib/**</exclude>
                             <exclude>**/src/ext/**</exclude>
                             <exclude>**/src/main/resources/task-dialog*.properties</exclude>
-                            <exclude>**/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/**</exclude>
                             <exclude>**/src/test/resources/org/apache/marmotta/commons/sesame/rio/vcard/*.vcf</exclude>
+                            <exclude>**/src/main/resources/web/admin/sgvizler.html</exclude>
 
                             <!-- META-INF files don't take a license header -->
                             <exclude>**/META-INF/**</exclude>
@@ -455,7 +463,6 @@
                             <!-- some parsers don't support comments, they are covered by the general LICENSE.txt
                                  similar to binaries -->
                             <exclude>**/src/test/resources/org/apache/marmotta/commons/sesame/rio/ical/*.ics</exclude>
-                            <exclude>**/src/test/resources/org/apache/marmotta/commons/sesame/rio/rdfjson/*.json</exclude>
                         </excludes>
                     </configuration>
                 </plugin>
@@ -564,7 +571,7 @@
             <dependency>
                 <groupId>com.google.guava</groupId>
                 <artifactId>guava</artifactId>
-                <version>13.0.1</version>
+                <version>14.0.1</version>
             </dependency>
             <dependency>
                 <groupId>commons-io</groupId>
@@ -583,9 +590,9 @@
                 </exclusions>
             </dependency>
             <dependency>
-                <groupId>commons-lang</groupId>
-                <artifactId>commons-lang</artifactId>
-                <version>2.6</version>
+                <groupId>org.apache.commons</groupId>
+                <artifactId>commons-lang3</artifactId>
+                <version>3.1</version>
             </dependency>
             <dependency>
                 <groupId>commons-net</groupId>
@@ -593,14 +600,19 @@
                 <version>3.2</version>
             </dependency>
             <dependency>
+                <groupId>commons-collections</groupId>
+                <artifactId>commons-collections</artifactId>
+                <version>3.2.1</version>
+            </dependency>
+            <dependency>
                 <groupId>commons-codec</groupId>
                 <artifactId>commons-codec</artifactId>
-                <version>1.7</version>
+                <version>1.8</version>
             </dependency>
             <dependency>
                 <groupId>org.apache.httpcomponents</groupId>
                 <artifactId>httpcore</artifactId>
-                <version>4.2.3</version>
+                <version>4.2.5</version>
                 <exclusions>
                     <exclusion>
                         <groupId>commons-logging</groupId>
@@ -611,7 +623,7 @@
             <dependency>
                 <groupId>org.apache.httpcomponents</groupId>
                 <artifactId>httpmime</artifactId>
-                <version>4.2.3</version>
+                <version>4.2.5</version>
                 <exclusions>
                     <exclusion>
                         <groupId>commons-logging</groupId>
@@ -622,7 +634,7 @@
             <dependency>
                 <groupId>org.apache.httpcomponents</groupId>
                 <artifactId>httpclient</artifactId>
-                <version>4.2.3</version>
+                <version>4.2.5</version>
                 <exclusions>
                     <exclusion>
                         <groupId>commons-logging</groupId>
@@ -633,7 +645,7 @@
             <dependency>
                 <groupId>org.apache.httpcomponents</groupId>
                 <artifactId>httpclient-cache</artifactId>
-                <version>4.2.3</version>
+                <version>4.2.5</version>
                 <exclusions>
                     <exclusion>
                         <groupId>commons-logging</groupId>
@@ -685,14 +697,9 @@
 
             <!-- XML Processing -->
             <dependency>
-                <groupId>xom</groupId>
-                <artifactId>xom</artifactId>
-                <version>1.2.6</version>
-            </dependency>
-            <dependency>
                 <groupId>org.jdom</groupId>
                 <artifactId>jdom2</artifactId>
-                <version>2.0.4</version>
+                <version>2.0.5</version>
             </dependency>
             <dependency>
                 <groupId>jaxen</groupId>
@@ -704,47 +711,47 @@
             <dependency>
                 <groupId>org.slf4j</groupId>
                 <artifactId>slf4j-api</artifactId>
-                <version>1.7.4</version>
+                <version>1.7.5</version>
             </dependency>
             <dependency>
                 <groupId>org.slf4j</groupId>
                 <artifactId>slf4j-ext</artifactId>
-                <version>1.7.4</version>
+                <version>1.7.5</version>
             </dependency>
             <dependency>
                 <groupId>org.slf4j</groupId>
                 <artifactId>jcl-over-slf4j</artifactId>
-                <version>1.7.4</version>
+                <version>1.7.5</version>
             </dependency>
             <dependency>
                 <groupId>org.slf4j</groupId>
                 <artifactId>log4j-over-slf4j</artifactId>
-                <version>1.7.4</version>
+                <version>1.7.5</version>
             </dependency>
             <dependency>
                 <groupId>org.slf4j</groupId>
                 <artifactId>jul-to-slf4j</artifactId>
-                <version>1.7.4</version>
+                <version>1.7.5</version>
             </dependency>
             <dependency>
                 <groupId>org.slf4j</groupId>
                 <artifactId>slf4j-simple</artifactId>
-                <version>1.7.4</version>
+                <version>1.7.5</version>
             </dependency>
             <dependency>
                 <groupId>ch.qos.logback</groupId>
                 <artifactId>logback-core</artifactId>
-                <version>1.0.10</version>
+                <version>1.0.13</version>
             </dependency>
             <dependency>
                 <groupId>ch.qos.logback</groupId>
                 <artifactId>logback-classic</artifactId>
-                <version>1.0.10</version>
+                <version>1.0.13</version>
             </dependency>
             <dependency>
                 <groupId>ch.qos.cal10n</groupId>
                 <artifactId>cal10n-api</artifactId>
-                <version>0.7.7</version>
+                <version>0.8.1</version>
             </dependency>
             <dependency>
                 <groupId>org.codehaus.janino</groupId>
@@ -755,20 +762,20 @@
             <!-- Servlet API, Web Services -->
             <dependency>
                 <groupId>javax.servlet</groupId>
-                <artifactId>servlet-api</artifactId>
+                <artifactId>javax.servlet-api</artifactId>
                 <version>${servlet.api.version}</version>
                 <scope>provided</scope>
             </dependency>
             <dependency>
                 <groupId>javax.el</groupId>
-                <artifactId>el-api</artifactId>
+                <artifactId>javax.el-api</artifactId>
                 <version>${javax.el.version}</version>
                 <scope>provided</scope>
             </dependency>
             <dependency>
                 <groupId>org.jboss.resteasy</groupId>
                 <artifactId>resteasy-cdi</artifactId>
-                <version>2.3.5.Final</version>
+                <version>${resteasy.version}</version>
                 <exclusions>
                     <exclusion>
                         <groupId>commons-logging</groupId>
@@ -779,27 +786,27 @@
             <dependency>
                 <groupId>org.jboss.resteasy</groupId>
                 <artifactId>resteasy-jackson-provider</artifactId>
-                <version>2.3.5.Final</version>
+                <version>${resteasy.version}</version>
             </dependency>
             <dependency>
                 <groupId>org.codehaus.jackson</groupId>
                 <artifactId>jackson-core-asl</artifactId>
-                <version>1.9.12</version>
+                <version>1.9.13</version>
             </dependency>
             <dependency>
                 <groupId>org.codehaus.jackson</groupId>
                 <artifactId>jackson-mapper-asl</artifactId>
-                <version>1.9.12</version>
+                <version>1.9.13</version>
             </dependency>
             <dependency>
                 <groupId>org.codehaus.jackson</groupId>
                 <artifactId>jackson-jaxrs</artifactId>
-                <version>1.9.12</version>
+                <version>1.9.13</version>
             </dependency>
             <dependency>
                 <groupId>org.codehaus.jackson</groupId>
                 <artifactId>jackson-xc</artifactId>
-                <version>1.9.12</version>
+                <version>1.9.13</version>
             </dependency>
             <dependency>
                 <groupId>org.json</groupId>
@@ -811,7 +818,13 @@
             <dependency>
                 <groupId>javax.enterprise</groupId>
                 <artifactId>cdi-api</artifactId>
-                <version>1.1-PRD</version>
+                <version>1.1</version>
+                <exclusions>
+                    <exclusion>
+                        <groupId>javax.el</groupId>
+                        <artifactId>el-api</artifactId>
+                    </exclusion>
+                </exclusions>
             </dependency>
             <dependency>
                 <groupId>org.jboss.weld</groupId>
@@ -835,18 +848,42 @@
                         <groupId>org.javassist</groupId>
                         <artifactId>javassist</artifactId>
                     </exclusion>
+                    <exclusion>
+                        <groupId>org.jboss.spec.javax.el</groupId>
+                        <artifactId>jboss-el-api_3.0_spec</artifactId>
+                    </exclusion>
                 </exclusions>
             </dependency>
             <dependency>
                 <groupId>org.jboss.weld.se</groupId>
                 <artifactId>weld-se-core</artifactId>
                 <version>${weld.core.version}</version>
+                <exclusions>
+                    <exclusion>
+                        <groupId>javax.el</groupId>
+                        <artifactId>el-api</artifactId>
+                    </exclusion>
+                    <exclusion>
+                        <groupId>org.jboss.spec.javax.el</groupId>
+                        <artifactId>jboss-el-api_3.0_spec</artifactId>
+                    </exclusion>
+                </exclusions>
             </dependency>
             <dependency>
                 <groupId>org.jboss.weld.servlet</groupId>
                 <artifactId>weld-servlet-core</artifactId>
                 <version>${weld.core.version}</version>
                 <scope>runtime</scope>
+                <exclusions>
+                    <exclusion>
+                        <groupId>javax.el</groupId>
+                        <artifactId>el-api</artifactId>
+                    </exclusion>
+                    <exclusion>
+                        <groupId>org.jboss.spec.javax.el</groupId>
+                        <artifactId>jboss-el-api_3.0_spec</artifactId>
+                    </exclusion>
+                </exclusions>
             </dependency>
             <dependency>
                 <groupId>org.javassist</groupId>
@@ -873,6 +910,31 @@
                 <version>1.8.2</version>
             </dependency>
             <dependency>
+                <groupId>org.webjars</groupId>
+                <artifactId>jquery-ui</artifactId>
+                <version>1.8.21</version>
+            </dependency>
+            <dependency>
+                <groupId>org.apache.marmotta.webjars</groupId>
+                <artifactId>codemirror</artifactId>
+                <version>${project.version}</version>
+            </dependency>
+            <dependency>
+                <groupId>org.apache.marmotta.webjars</groupId>
+                <artifactId>snorql</artifactId>
+                <version>${project.version}</version>
+            </dependency>
+            <dependency>
+                <groupId>org.apache.marmotta.webjars</groupId>
+                <artifactId>sgvizler</artifactId>
+                <version>${project.version}</version>
+            </dependency>
+            <dependency>
+                <groupId>org.apache.marmotta.webjars</groupId>
+                <artifactId>strftime</artifactId>
+                <version>${project.version}</version>
+            </dependency>
+            <dependency>
                 <groupId>org.apache.marmotta</groupId>
                 <artifactId>marmotta-client-js</artifactId>
                 <version>${project.version}</version>
@@ -881,7 +943,7 @@
             <dependency>
                 <groupId>net.sf.ehcache</groupId>
                 <artifactId>ehcache-core</artifactId>
-                <version>2.6.5</version>
+                <version>2.6.6</version>
             </dependency>
             <dependency>
                 <groupId>com.h2database</groupId>
@@ -889,7 +951,7 @@
                 <version>${h2.version}</version>
             </dependency>
             <dependency>
-                <groupId>org.jumpmind.symmetric.jdbc</groupId>
+                <groupId>org.postgresql</groupId>
                 <artifactId>postgresql</artifactId>
                 <version>${postgresql.version}</version>
             </dependency>
@@ -900,56 +962,21 @@
                 <optional>true</optional>
                 <scope>provided</scope>
             </dependency>
-            <dependency>
-                <groupId>org.jooq</groupId>
-                <artifactId>jooq</artifactId>
-                <version>2.6.0</version>
-            </dependency>
 
 
             <!-- Tomcat JDBC Connection Pool (replacement for c3p0, MARMOTTA-111 -->
             <dependency>
                 <groupId>org.apache.tomcat</groupId>
                 <artifactId>tomcat-jdbc</artifactId>
-                <version>7.0.37</version>
+                <version>7.0.42</version>
             </dependency>
-
-
-            <!-- SOLR (Semantic Search) -->
             <dependency>
-                <groupId>org.apache.solr</groupId>
-                <artifactId>solr-solrj</artifactId>
-                <version>3.6.1</version>
-                <exclusions>
-                    <exclusion>
-                        <groupId>commons-logging</groupId>
-                        <artifactId>commons-logging</artifactId>
-                    </exclusion>
-                </exclusions>
-            </dependency>
-            <dependency>
-                <groupId>org.apache.solr</groupId>
-                <artifactId>solr-core</artifactId>
-                <version>3.6.1</version>
-                <exclusions>
-                    <exclusion>
-                        <groupId>commons-logging</groupId>
-                        <artifactId>commons-logging</artifactId>
-                    </exclusion>
-                </exclusions>
-            </dependency>
-            <dependency>
-                <groupId>org.apache.solr</groupId>
-                <artifactId>solr-clustering</artifactId>
-                <version>3.6.1</version>
-                <exclusions>
-                    <exclusion>
-                        <groupId>commons-logging</groupId>
-                        <artifactId>commons-logging</artifactId>
-                    </exclusion>
-                </exclusions>
+                <groupId>org.apache.tomcat</groupId>
+                <artifactId>tomcat-juli</artifactId>
+                <version>7.0.42</version>
             </dependency>
 
+
             <!-- Test Support -->
             <dependency>
                 <groupId>com.jayway.restassured</groupId>
@@ -1015,6 +1042,11 @@
             </dependency>
             <dependency>
                 <groupId>org.openrdf.sesame</groupId>
+                <artifactId>sesame-rio-rdfjson</artifactId>
+                <version>${sesame.version}</version>
+            </dependency>
+            <dependency>
+                <groupId>org.openrdf.sesame</groupId>
                 <artifactId>sesame-rio-rdfxml</artifactId>
                 <version>${sesame.version}</version>
             </dependency>
@@ -1113,17 +1145,28 @@
                 <artifactId>sesame-queryresultio-text</artifactId>
                 <version>${sesame.version}</version>
             </dependency>
-
+            <dependency>
+                <groupId>org.openrdf.sesame</groupId>
+                <artifactId>sesame-sparql-testsuite</artifactId>
+                <version>${sesame.version}</version>
+                <scope>test</scope>
+            </dependency>
+            <dependency>
+                <groupId>org.openrdf.sesame</groupId>
+                <artifactId>sesame-store-testsuite</artifactId>
+                <version>${sesame.version}</version>
+                <scope>test</scope>
+            </dependency>
             <!-- RDFa Parser -->
             <dependency>
                 <groupId>org.semarglproject</groupId>
                 <artifactId>semargl-rdfa</artifactId>
-                <version>0.4</version>
+                <version>0.6</version>
             </dependency>
             <dependency>
                 <groupId>org.semarglproject</groupId>
                 <artifactId>semargl-sesame</artifactId>
-                <version>0.4</version>
+                <version>0.6</version>
             </dependency>
 
             <!-- KiWi Triple Store -->
@@ -1134,6 +1177,11 @@
             </dependency>
             <dependency>
                 <groupId>org.apache.marmotta</groupId>
+                <artifactId>kiwi-sparql</artifactId>
+                <version>${project.version}</version>
+            </dependency>
+            <dependency>
+                <groupId>org.apache.marmotta</groupId>
                 <artifactId>kiwi-transactions</artifactId>
                 <version>${project.version}</version>
             </dependency>
@@ -1182,21 +1230,11 @@
             </dependency>
             <dependency>
                 <groupId>org.apache.marmotta</groupId>
-                <artifactId>sesame-tools-rio-rdfjson</artifactId>
-                <version>${project.version}</version>
-            </dependency>
-            <dependency>
-                <groupId>org.apache.marmotta</groupId>
                 <artifactId>sesame-tools-rio-rss</artifactId>
                 <version>${project.version}</version>
             </dependency>
             <dependency>
                 <groupId>org.apache.marmotta</groupId>
-                <artifactId>sesame-tools-rio-jsonld</artifactId>
-                <version>${project.version}</version>
-            </dependency>
-            <dependency>
-                <groupId>org.apache.marmotta</groupId>
                 <artifactId>sesame-tools-facading</artifactId>
                 <version>${project.version}</version>
             </dependency>
@@ -1225,16 +1263,16 @@
                 <version>0.0.8</version>
             </dependency>
             <dependency>
-                <groupId>dfki.km.json</groupId>
-                <artifactId>jsonld-java</artifactId>
-                <version>1.0.0-SNAPSHOT</version>
+                <groupId>com.github.jsonld-java</groupId>
+                <artifactId>jsonld-java-sesame</artifactId>
+                <version>0.2</version>
             </dependency>
 
             <!-- Freemarker -->
             <dependency>
                 <groupId>org.freemarker</groupId>
                 <artifactId>freemarker</artifactId>
-                <version>2.3.19</version>
+                <version>2.3.20</version>
             </dependency>
 
             <!-- Quartz Scheduler -->
@@ -1270,8 +1308,13 @@
             <dependency>
                 <groupId>org.apache.tika</groupId>
                 <artifactId>tika-core</artifactId>
-                <version>1.2</version>
+                <version>1.4</version>
             </dependency>
+		    <dependency>
+		        <groupId>com.ibm.icu</groupId>
+		        <artifactId>icu4j</artifactId>
+		        <version>51.2</version>
+		    </dependency>
 
             <dependency>
                 <groupId>org.apache.marmotta</groupId>
@@ -1436,7 +1479,25 @@
             <dependency>
                 <groupId>com.thetransactioncompany</groupId>
                 <artifactId>cors-filter</artifactId>
-                <version>1.5.1</version>
+                <version>1.7.1</version>
+                <exclusions>
+                    <exclusion>
+                        <groupId>javax.servlet</groupId>
+                        <artifactId>servlet-api</artifactId>
+                    </exclusion>
+                </exclusions>
+            </dependency>
+
+            <!-- embedded jetty (testing) -->
+            <dependency>
+                <groupId>org.eclipse.jetty</groupId>
+                <artifactId>jetty-server</artifactId>
+                <version>${jetty.version}</version>
+            </dependency>
+            <dependency>
+                <groupId>org.eclipse.jetty</groupId>
+                <artifactId>jetty-servlet</artifactId>
+                <version>${jetty.version}</version>
             </dependency>
 
         </dependencies>
@@ -1447,7 +1508,8 @@
         <!-- Java Servlet API is always provided -->
         <dependency>
             <groupId>javax.servlet</groupId>
-            <artifactId>servlet-api</artifactId>
+            <artifactId>javax.servlet-api</artifactId>
+            <version>${servlet.api.version}</version>
             <scope>provided</scope>
         </dependency>
 
@@ -1518,7 +1580,13 @@
         </profile>
     </profiles>
 
+<!--
+    <scm>
+        <tag>3.0.0-incubating</tag>
+    </scm>
+-->
+
   <scm>
-    <tag>3.0.0-incubating</tag>
+    <tag>3.1.0-incubating</tag>
   </scm>
 </project>

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/platform/marmotta-core/pom.xml
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/pom.xml b/platform/marmotta-core/pom.xml
index 49c16f1..f27b855 100644
--- a/platform/marmotta-core/pom.xml
+++ b/platform/marmotta-core/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>
 
@@ -46,6 +46,34 @@
          further details: http://maven.apache.org/guides/mini/guide-attached-tests.html
     -->
     <build>
+        <pluginManagement>
+            <plugins>
+                <plugin> <!-- generate JRebel Configuration -->
+                    <groupId>org.zeroturnaround</groupId>
+                    <artifactId>jrebel-maven-plugin</artifactId>
+                    <version>1.1.3</version>
+                    <executions>
+                        <execution>
+                            <id>generate-rebel-xml</id>
+                            <phase>process-resources</phase>
+                            <goals>
+                                <goal>generate</goal>
+                            </goals>
+                        </execution>
+                    </executions>
+                    <configuration>
+                        <relativePath>../../</relativePath>
+                        <rootPath>$${rebel.root}</rootPath>
+                        <classpath>
+                            <resources>
+                                <resource><!-- default resource --></resource>
+                                <resource><directory>src/main/resources</directory></resource>
+                            </resources>
+                        </classpath>
+                    </configuration>
+                </plugin>
+            </plugins>
+        </pluginManagement>
         <plugins>
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
@@ -222,8 +250,8 @@
             <artifactId>commons-configuration</artifactId>
         </dependency>
         <dependency>
-            <groupId>commons-lang</groupId>
-            <artifactId>commons-lang</artifactId>
+            <groupId>org.apache.commons</groupId>
+            <artifactId>commons-lang3</artifactId>
         </dependency>
         <dependency>
             <groupId>commons-net</groupId>
@@ -248,7 +276,8 @@
 
         <dependency>
             <groupId>javax.servlet</groupId>
-            <artifactId>servlet-api</artifactId>
+            <artifactId>javax.servlet-api</artifactId>
+            <version>${servlet.api.version}</version>
             <scope>provided</scope>
         </dependency>
         <dependency>
@@ -282,6 +311,14 @@
             <artifactId>jquery</artifactId>
         </dependency>
         <dependency>
+            <groupId>org.apache.marmotta.webjars</groupId>
+            <artifactId>sgvizler</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.marmotta.webjars</groupId>
+            <artifactId>strftime</artifactId>
+        </dependency>
+        <dependency>
             <groupId>org.apache.marmotta</groupId>
             <artifactId>marmotta-client-js</artifactId>
         </dependency>
@@ -313,9 +350,15 @@
 
         <!-- Test Support -->
         <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>${jetty.version}</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.eclipse.jetty</groupId>
+            <artifactId>jetty-servlet</artifactId>
+            <version>${jetty.version}</version>
             <scope>test</scope>
         </dependency>
         <dependency>
@@ -326,6 +369,12 @@
         <dependency>
             <groupId>org.jboss.weld.se</groupId>
             <artifactId>weld-se-core</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>javax.el</groupId>
+            <artifactId>javax.el-api</artifactId>
+            <scope>test</scope>
         </dependency>
         <dependency>
             <groupId>com.h2database</groupId>
@@ -413,6 +462,10 @@
         </dependency>
         <dependency>
             <groupId>org.openrdf.sesame</groupId>
+            <artifactId>sesame-rio-rdfjson</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.openrdf.sesame</groupId>
             <artifactId>sesame-rio-rdfxml</artifactId>
         </dependency>
         <dependency>
@@ -470,15 +523,11 @@
         </dependency>
         <dependency>
             <groupId>org.apache.marmotta</groupId>
-            <artifactId>sesame-tools-rio-rdfjson</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.marmotta</groupId>
             <artifactId>sesame-tools-rio-rss</artifactId>
         </dependency>
         <dependency>
-            <groupId>org.apache.marmotta</groupId>
-            <artifactId>sesame-tools-rio-jsonld</artifactId>
+            <groupId>com.github.jsonld-java</groupId>
+            <artifactId>jsonld-java-sesame</artifactId>
         </dependency>
         <dependency>
             <groupId>org.apache.marmotta</groupId>
@@ -505,6 +554,10 @@
             <groupId>org.apache.tika</groupId>
             <artifactId>tika-core</artifactId>
         </dependency>
+        <dependency>
+            <groupId>com.ibm.icu</groupId>
+            <artifactId>icu4j</artifactId>
+        </dependency>
 
         <dependency>
             <groupId>org.apache.marmotta</groupId>

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/platform/marmotta-core/src/main/coffeescript/web/public/js/widgets/configurator/configurator.coffee
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/coffeescript/web/public/js/widgets/configurator/configurator.coffee b/platform/marmotta-core/src/main/coffeescript/web/public/js/widgets/configurator/configurator.coffee
index ffd54b7..b2ec849 100644
--- a/platform/marmotta-core/src/main/coffeescript/web/public/js/widgets/configurator/configurator.coffee
+++ b/platform/marmotta-core/src/main/coffeescript/web/public/js/widgets/configurator/configurator.coffee
@@ -71,8 +71,8 @@ class Model
       else if value.type.match /java.lang.String.*/ then clazz = StringProperty
       else if value.type.match /java.net.URL.*/ then clazz = URIProperty
       else if value.type.match /java.util.List.*/ then clazz = ListProperty
-      else if value.type.match /org.marmotta.†ype.Program/ then clazz = ProgramProperty
-      else if value.type.match /org.marmotta.†ype.Text/ then clazz = TextProperty
+      else if value.type.match /org.marmotta.type.Program/ then clazz = ProgramProperty
+      else if value.type.match /org.marmotta.type.Text/ then clazz = TextProperty
       else clazz = Property
 
       @properties.push new clazz property,value
@@ -544,10 +544,21 @@ class Client
 
         str = "{"
         for value,index in data
-          str += '"'+value.key + '":"'+value.getValue() + '"'
+          v = '"'+value.getValue()+'"'
+          if (value.getValue().split(",").length > 1)
+            x = value.getValue().split(",")
+            v = "["
+            for val,i in x
+              v += '"'+val+'"'
+              if i < x.length-1
+                v += ','
+
+            v += "]"
+
+          str += '"'+value.key + '":'+v
           str += "," if index < data.length-1
         str += "}"
-
+        console.log str
         $.ajax data =
           type : 'POST'
           contentType: "application/json"

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/config/ConfigurationService.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/config/ConfigurationService.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/config/ConfigurationService.java
index ebf173b..58fdab7 100644
--- a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/config/ConfigurationService.java
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/config/ConfigurationService.java
@@ -61,6 +61,12 @@ public interface ConfigurationService {
     static final String CONTEXT_INFERRED = "inferred";
 
     static final String CONTEXT_SYSTEM = "system";
+    
+    static final String DIR_CONFIG = "config";
+
+    static final String DIR_LOG = "log";
+
+    static final String DIR_IMPORT = "import";
 
     /**
      * Get the base URI of the system.
@@ -530,4 +536,7 @@ public interface ConfigurationService {
     void performServerShutdown();
 
 
+    boolean isInitialising();
+
+    void setInitialising(boolean initialising);
 }

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/importer/ImportWatchService.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/importer/ImportWatchService.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/importer/ImportWatchService.java
new file mode 100644
index 0000000..6472276
--- /dev/null
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/importer/ImportWatchService.java
@@ -0,0 +1,48 @@
+/**
+ * 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.platform.core.api.importer;
+
+import java.io.File;
+
+import org.apache.marmotta.platform.core.events.SystemStartupEvent;
+import org.openrdf.model.URI;
+
+/**
+ * A service for watching import directory
+ *  
+ * @author Sergio Fernández
+ *
+ */
+public interface ImportWatchService {
+
+	/**
+	 * Initialize the directory watching, performing an importation
+	 * of new files copied there
+	 */
+	public void initialize(SystemStartupEvent event);
+
+	/**
+	 * Import an observed item 
+	 * 
+	 * @param file
+	 * @param context
+	 * @return
+	 */
+	boolean execImport(File file, URI context);
+
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/jaxrs/ExceptionMapperService.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/jaxrs/ExceptionMapperService.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/jaxrs/ExceptionMapperService.java
new file mode 100644
index 0000000..970f6ee
--- /dev/null
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/jaxrs/ExceptionMapperService.java
@@ -0,0 +1,31 @@
+/*
+ * 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.platform.core.api.jaxrs;
+
+/**
+ * This service auto-registers JAX-RS exception mappers implementing the CDIExceptionMapper interface and
+ * registers them with RESTEasy. This allows applications based on Marmotta to easily implement and register their
+ * own ExceptionMapppers without needing to go into RESTEasy.
+ * <p/>
+ * Note that ExceptionMappers that are injected via CDI need to be annotated with @Dependent, or otherwise
+ * they will be proxied by the CDI implementation and then the generic type cannot be determined.
+ *
+ * @author Sebastian Schaffert (sschaffert@apache.org)
+ */
+public interface ExceptionMapperService {
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/modules/ModuleService.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/modules/ModuleService.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/modules/ModuleService.java
index 0739abe..173c34f 100644
--- a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/modules/ModuleService.java
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/modules/ModuleService.java
@@ -17,11 +17,13 @@
  */
 package org.apache.marmotta.platform.core.api.modules;
 
+import org.apache.commons.configuration.Configuration;
 import org.apache.marmotta.platform.core.model.module.ModuleConfiguration;
 
 import javax.enterprise.inject.spi.InjectionPoint;
 import java.net.URL;
 import java.util.Collection;
+import java.util.HashMap;
 import java.util.List;
 
 /**
@@ -129,4 +131,31 @@ public interface ModuleService {
      */
     public int getWeight(String moduleName);
 
+    /**
+     * returns  more complex admin page description
+     * @param moduleName
+     * @return
+     */
+    public List<HashMap<String,String>> getAdminPageObjects(String moduleName);
+
+    /**
+     * returns the icon (if set), null otherwise
+     * @param moduleName
+     * @return
+     */
+    public String getIcon(String moduleName);
+
+    /**
+     * list modules for container sorted on weight
+     * @param container
+     * @return
+     */
+    public List<String> listSortedModules(String container);
+
+    /**
+     * list containers sorted on weight
+     * @return
+     */
+    public List<String> listSortedContainers();
+
 }

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/prefix/PrefixService.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/prefix/PrefixService.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/prefix/PrefixService.java
index 3f49598..497b217 100644
--- a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/prefix/PrefixService.java
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/prefix/PrefixService.java
@@ -84,6 +84,14 @@ public interface PrefixService {
      * @return mappings
      */
     Map<String, String> getMappings();
+    
+    /**
+     * Delete a prefix mapping 
+     * 
+     * @param prefix
+     * @return
+     */
+    boolean remove(String prefix);
 
     /**
      * Get the CURIE for this URI if possible

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/templating/TemplatingService.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/templating/TemplatingService.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/templating/TemplatingService.java
index 2e6c770..7a17f87 100644
--- a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/templating/TemplatingService.java
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/templating/TemplatingService.java
@@ -33,10 +33,18 @@ import freemarker.template.TemplateException;
 public interface TemplatingService {
     
     final static String PATH = "/templates/";
+
+    public final static String DEFAULT_REST_PATH = "/doc/rest/";
+
+    public final static String DEFAULT_REST_FILE = "overview-index.html";
     
     static final String DEFAULT_PROJECT = "marmotta";
     
     static final String DEFAULT_STYLE = "blue";
+
+    static final String ADMIN_TPL = "admin.ftl";
+
+    public final static String DEFAULT_WEBSERVICE_TITLE = "Webservice";
     
     void initDataModel();
     

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/triplestore/SesameService.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/triplestore/SesameService.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/triplestore/SesameService.java
index bfc3f58..232351b 100644
--- a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/triplestore/SesameService.java
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/triplestore/SesameService.java
@@ -21,6 +21,7 @@ import org.openrdf.model.ValueFactory;
 import org.openrdf.repository.RepositoryConnection;
 import org.openrdf.repository.RepositoryException;
 import org.openrdf.repository.sail.SailRepository;
+import org.openrdf.sail.SailException;
 
 /**
  * Offers access to the Sesame repository underlying this LMF instance. The activation/deactivation methods
@@ -83,5 +84,12 @@ public interface SesameService {
      */
     @Deprecated
     ValueFactory getValueFactory();
-    
+
+    void restart();
+
+    /**
+     * Run the triple store garbage collector manually and clean up unreferenced nodes and triples.
+     * @throws org.openrdf.sail.SailException
+     */
+    void garbageCollect() throws SailException;
 }

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/filters/TemplatingFilter.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/filters/TemplatingFilter.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/filters/TemplatingFilter.java
index 4c3e541..cf3a370 100644
--- a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/filters/TemplatingFilter.java
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/filters/TemplatingFilter.java
@@ -167,7 +167,7 @@ public class TemplatingFilter implements MarmottaHttpFilter {
 
                     return;
                 } catch(TemplatingException e) {
-                    log.error("templating did not work");
+                    log.error("templating did not work: {}", e.getMessage());
                 }
 
             }

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/jaxrs/CDIExceptionMapper.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/jaxrs/CDIExceptionMapper.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/jaxrs/CDIExceptionMapper.java
new file mode 100644
index 0000000..c2eba6e
--- /dev/null
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/jaxrs/CDIExceptionMapper.java
@@ -0,0 +1,28 @@
+/*
+ * 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.platform.core.jaxrs;
+
+import javax.ws.rs.ext.ExceptionMapper;
+
+/**
+ * A marker-interface to allow CDI injection of ExceptionMappers implementing this interface by the ExceptionMapperService.
+ *
+ * @author Sebastian Schaffert (sschaffert@apache.org)
+ */
+public interface CDIExceptionMapper<E extends Throwable> extends ExceptionMapper<E> {
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/jaxrs/ErrorResponse.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/jaxrs/ErrorResponse.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/jaxrs/ErrorResponse.java
new file mode 100644
index 0000000..38ff150
--- /dev/null
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/jaxrs/ErrorResponse.java
@@ -0,0 +1,126 @@
+/*
+ * 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.platform.core.jaxrs;
+
+import javax.ws.rs.core.Response;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+import java.io.PrintWriter;
+import java.io.StringWriter;
+
+/**
+ * Represents a uniform error response for REST service requests.
+ *
+ * @author Sebastian Schaffert (sschaffert@apache.org)
+ */
+@XmlRootElement(name = "Error")
+public class ErrorResponse {
+
+    private int code;
+
+    private String message;
+
+    private String stackTrace;
+
+    public ErrorResponse() {
+    }
+
+    public ErrorResponse(int code, String message) {
+        this.code = code;
+        this.message = message;
+    }
+
+    public ErrorResponse(int code, String message, String stackTrace) {
+        this.code = code;
+        this.message = message;
+        this.stackTrace = stackTrace;
+    }
+
+    public ErrorResponse(int code, Exception ex) {
+        this(code, ex.getMessage(), ex);
+    }
+
+    public ErrorResponse(int code, String message, Exception ex) {
+        this.code = code;
+        this.message = message;
+
+        StringWriter writer = new StringWriter();
+        ex.printStackTrace(new PrintWriter(writer));
+
+        this.stackTrace = writer.toString();
+    }
+
+    @XmlElement(name = "code", required = true)
+    public int getCode() {
+        return code;
+    }
+
+    public void setCode(int code) {
+        this.code = code;
+    }
+
+    @XmlElement(name = "message", required = true)
+    public String getMessage() {
+        return message;
+    }
+
+    public void setMessage(String message) {
+        this.message = message;
+    }
+
+    @XmlElement(name = "stackTrace", required = false)
+    public String getStackTrace() {
+        return stackTrace;
+    }
+
+    public void setStackTrace(String stackTrace) {
+        this.stackTrace = stackTrace;
+    }
+
+    public static Response errorResponse(Response.Status status, String message) {
+        ErrorResponse entity = new ErrorResponse(status.getStatusCode(), message);
+        return Response.status(status).entity(entity).build();
+    }
+
+    public static Response errorResponse(Response.Status status, Exception ex) {
+        ErrorResponse entity = new ErrorResponse(status.getStatusCode(), ex);
+        return Response.status(status).entity(entity).build();
+    }
+
+    public static Response errorResponse(Response.Status status, String message, Exception ex) {
+        ErrorResponse entity = new ErrorResponse(status.getStatusCode(), message);
+
+        return Response.status(status).entity(entity).build();
+    }
+
+
+    public String toString() {
+        StringBuffer b = new StringBuffer();
+        b.append("Code: ");
+        b.append(code);
+        b.append(System.getProperty("line.separator"));
+        b.append("Message: ");
+        b.append(message);
+        if(stackTrace != null) {
+            b.append(System.getProperty("line.separator"));
+            b.append("StackTrace: ");
+            b.append(stackTrace);
+        }
+        return b.toString();
+    }
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/jaxrs/IllegalStateExceptionMapper.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/jaxrs/IllegalStateExceptionMapper.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/jaxrs/IllegalStateExceptionMapper.java
new file mode 100644
index 0000000..9dfe1c6
--- /dev/null
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/jaxrs/IllegalStateExceptionMapper.java
@@ -0,0 +1,47 @@
+/*
+ * 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.platform.core.jaxrs;
+
+import javax.enterprise.context.ApplicationScoped;
+import javax.enterprise.context.Dependent;
+import javax.ws.rs.core.Response;
+import javax.ws.rs.ext.Provider;
+
+/**
+ * Map MarmottaExceptions to a internal server error and return the default error object
+ *
+ * @author Sebastian Schaffert (sschaffert@apache.org)
+ */
+@Provider
+@Dependent
+public class IllegalStateExceptionMapper implements CDIExceptionMapper<IllegalStateException> {
+
+    /**
+     * Map an exception to a {@link javax.ws.rs.core.Response}. Returning
+     * {@code null} results in a {@link javax.ws.rs.core.Response.Status#NO_CONTENT}
+     * response. Throwing a runtime exception results in a
+     * {@link javax.ws.rs.core.Response.Status#INTERNAL_SERVER_ERROR} response
+     *
+     * @param exception the exception to map to a response
+     * @return a response mapped from the supplied exception
+     */
+    @Override
+    public Response toResponse(IllegalStateException exception) {
+        return ErrorResponse.errorResponse(Response.Status.SERVICE_UNAVAILABLE, exception.getMessage());
+    }
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/jaxrs/MarmottaExceptionMapper.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/jaxrs/MarmottaExceptionMapper.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/jaxrs/MarmottaExceptionMapper.java
new file mode 100644
index 0000000..51b3d88
--- /dev/null
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/jaxrs/MarmottaExceptionMapper.java
@@ -0,0 +1,49 @@
+/*
+ * 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.platform.core.jaxrs;
+
+import org.apache.marmotta.platform.core.exception.MarmottaException;
+
+import javax.enterprise.context.ApplicationScoped;
+import javax.enterprise.context.Dependent;
+import javax.ws.rs.core.Response;
+import javax.ws.rs.ext.Provider;
+
+/**
+ * Map MarmottaExceptions to a internal server error and return the default error object
+ *
+ * @author Sebastian Schaffert (sschaffert@apache.org)
+ */
+@Provider
+@Dependent
+public class MarmottaExceptionMapper implements CDIExceptionMapper<MarmottaException> {
+
+    /**
+     * Map an exception to a {@link javax.ws.rs.core.Response}. Returning
+     * {@code null} results in a {@link javax.ws.rs.core.Response.Status#NO_CONTENT}
+     * response. Throwing a runtime exception results in a
+     * {@link javax.ws.rs.core.Response.Status#INTERNAL_SERVER_ERROR} response
+     *
+     * @param exception the exception to map to a response
+     * @return a response mapped from the supplied exception
+     */
+    @Override
+    public Response toResponse(MarmottaException exception) {
+        return ErrorResponse.errorResponse(Response.Status.INTERNAL_SERVER_ERROR, exception);
+    }
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/jaxrs/MarmottaImportExceptionMapper.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/jaxrs/MarmottaImportExceptionMapper.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/jaxrs/MarmottaImportExceptionMapper.java
new file mode 100644
index 0000000..9b67df1
--- /dev/null
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/jaxrs/MarmottaImportExceptionMapper.java
@@ -0,0 +1,49 @@
+/*
+ * 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.platform.core.jaxrs;
+
+import org.apache.marmotta.platform.core.exception.io.MarmottaImportException;
+
+import javax.enterprise.context.ApplicationScoped;
+import javax.enterprise.context.Dependent;
+import javax.ws.rs.core.Response;
+import javax.ws.rs.ext.Provider;
+
+/**
+ * Map MarmottaExceptions to a internal server error and return the default error object
+ *
+ * @author Sebastian Schaffert (sschaffert@apache.org)
+ */
+@Provider
+@Dependent
+public class MarmottaImportExceptionMapper implements CDIExceptionMapper<MarmottaImportException> {
+
+    /**
+     * Map an exception to a {@link javax.ws.rs.core.Response}. Returning
+     * {@code null} results in a {@link javax.ws.rs.core.Response.Status#NO_CONTENT}
+     * response. Throwing a runtime exception results in a
+     * {@link javax.ws.rs.core.Response.Status#INTERNAL_SERVER_ERROR} response
+     *
+     * @param exception the exception to map to a response
+     * @return a response mapped from the supplied exception
+     */
+    @Override
+    public Response toResponse(MarmottaImportException exception) {
+        return ErrorResponse.errorResponse(Response.Status.INTERNAL_SERVER_ERROR, exception);
+    }
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/jaxrs/RepositoryExceptionMapper.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/jaxrs/RepositoryExceptionMapper.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/jaxrs/RepositoryExceptionMapper.java
new file mode 100644
index 0000000..42ddb08
--- /dev/null
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/jaxrs/RepositoryExceptionMapper.java
@@ -0,0 +1,50 @@
+/*
+ * 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.platform.core.jaxrs;
+
+import org.openrdf.repository.RepositoryException;
+
+import javax.enterprise.context.ApplicationScoped;
+import javax.enterprise.context.Dependent;
+import javax.ws.rs.core.Response;
+import javax.ws.rs.ext.Provider;
+
+/**
+ * Map RepositoryExceptions to a internal server error and return the default error object
+ *
+ * @author Sebastian Schaffert (sschaffert@apache.org)
+ */
+@Provider
+@Dependent
+public class RepositoryExceptionMapper implements CDIExceptionMapper<RepositoryException> {
+
+
+    /**
+     * Map an exception to a {@link javax.ws.rs.core.Response}. Returning
+     * {@code null} results in a {@link javax.ws.rs.core.Response.Status#NO_CONTENT}
+     * response. Throwing a runtime exception results in a
+     * {@link javax.ws.rs.core.Response.Status#INTERNAL_SERVER_ERROR} response
+     *
+     * @param exception the exception to map to a response
+     * @return a response mapped from the supplied exception
+     */
+    @Override
+    public Response toResponse(RepositoryException exception) {
+        return ErrorResponse.errorResponse(Response.Status.INTERNAL_SERVER_ERROR, exception);
+    }
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/jaxrs/URISyntaxExceptionMapper.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/jaxrs/URISyntaxExceptionMapper.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/jaxrs/URISyntaxExceptionMapper.java
new file mode 100644
index 0000000..ffbc66f
--- /dev/null
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/jaxrs/URISyntaxExceptionMapper.java
@@ -0,0 +1,47 @@
+/*
+ * 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.platform.core.jaxrs;
+
+import javax.enterprise.context.Dependent;
+import javax.ws.rs.core.Response;
+import javax.ws.rs.ext.Provider;
+import java.net.URISyntaxException;
+
+/**
+ * Map MarmottaExceptions to a internal server error and return the default error object
+ *
+ * @author Sebastian Schaffert (sschaffert@apache.org)
+ */
+@Provider
+@Dependent
+public class URISyntaxExceptionMapper implements CDIExceptionMapper<URISyntaxException> {
+
+    /**
+     * Map an exception to a {@link javax.ws.rs.core.Response}. Returning
+     * {@code null} results in a {@link javax.ws.rs.core.Response.Status#NO_CONTENT}
+     * response. Throwing a runtime exception results in a
+     * {@link javax.ws.rs.core.Response.Status#INTERNAL_SERVER_ERROR} response
+     *
+     * @param exception the exception to map to a response
+     * @return a response mapped from the supplied exception
+     */
+    @Override
+    public Response toResponse(URISyntaxException exception) {
+        return ErrorResponse.errorResponse(Response.Status.INTERNAL_SERVER_ERROR, exception);
+    }
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/jaxrs/UnsupportedOperationExceptionMapper.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/jaxrs/UnsupportedOperationExceptionMapper.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/jaxrs/UnsupportedOperationExceptionMapper.java
new file mode 100644
index 0000000..1a0f65e
--- /dev/null
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/jaxrs/UnsupportedOperationExceptionMapper.java
@@ -0,0 +1,47 @@
+/*
+ * 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.platform.core.jaxrs;
+
+import javax.enterprise.context.ApplicationScoped;
+import javax.enterprise.context.Dependent;
+import javax.ws.rs.core.Response;
+import javax.ws.rs.ext.Provider;
+
+/**
+ * Map MarmottaExceptions to a internal server error and return the default error object
+ *
+ * @author Sebastian Schaffert (sschaffert@apache.org)
+ */
+@Provider
+@Dependent
+public class UnsupportedOperationExceptionMapper implements CDIExceptionMapper<UnsupportedOperationException> {
+
+    /**
+     * Map an exception to a {@link javax.ws.rs.core.Response}. Returning
+     * {@code null} results in a {@link javax.ws.rs.core.Response.Status#NO_CONTENT}
+     * response. Throwing a runtime exception results in a
+     * {@link javax.ws.rs.core.Response.Status#INTERNAL_SERVER_ERROR} response
+     *
+     * @param exception the exception to map to a response
+     * @return a response mapped from the supplied exception
+     */
+    @Override
+    public Response toResponse(UnsupportedOperationException exception) {
+        return ErrorResponse.errorResponse(Response.Status.fromStatusCode(501), exception.getMessage());
+    }
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/model/template/MenuItem.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/model/template/MenuItem.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/model/template/MenuItem.java
index 883d01e..1e04adf 100644
--- a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/model/template/MenuItem.java
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/model/template/MenuItem.java
@@ -17,6 +17,8 @@
  */
 package org.apache.marmotta.platform.core.model.template;
 
+import org.apache.marmotta.platform.core.api.templating.TemplatingService;
+
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
@@ -31,19 +33,76 @@ import java.util.Map;
  */
 public class MenuItem {
 
-    private Map<String,Object> properties;
-    private List<MenuItem> submenu;
+    private boolean initialized = false;
+    public final static String DEFAULT_MENU_ICON = "icon-asterisk";
+
+    private HashMap<String,Object> properties;
+    private List<MenuItem> items;
+    private MenuItemType type;
+
+    public MenuItem(String label, MenuItemType type) {
+        this.properties = new HashMap<String, Object>();
+        this.type = type;
+        this.items = new ArrayList<MenuItem>();
 
-    public MenuItem() {
-        properties = new HashMap<String, Object>();
-        submenu = new ArrayList<MenuItem>();
+        properties.put("items",items);
+        properties.put("label",label);
+        properties.put("isActive",false);
+        properties.put("icon",DEFAULT_MENU_ICON);
     }
 
-    public Map<String, Object> getProperties() {
+    public HashMap<String,Object> getProperties() {
+        if(properties.get("items") != null) {
+            List<Object> os = new ArrayList<Object>();
+            for(MenuItem item : items) {
+                os.add(item.getProperties());
+            }
+            properties.put("items",os);
+        }
         return properties;
     }
 
-    public List<MenuItem> getSubmenu() {
-        return submenu;
+    public void set(String name, Object value) {
+        properties.put(name,value);
+    }
+
+    public Object get(String name) {
+        return properties.get(name);
+    }
+
+    public void addItem(MenuItem item) {
+        items.add(item);
+    }
+
+    public boolean setActive(String path) {
+        boolean isActive = false;
+        switch(type) {
+            case ROOT:
+            case CONTAINER:
+            case MODULE:
+                for(MenuItem item : items) {
+                    if(item.setActive(path)) {
+                        isActive = true;
+                    }
+                }
+                break;
+            case PAGE:
+                isActive  = get("path").equals(path);
+                break;
+            case WEBSERVICE:
+                String s = (String)properties.get("path");
+                isActive = (
+                        path.startsWith(s.substring(0,s.lastIndexOf("/"))) &&
+                                path.contains(TemplatingService.DEFAULT_REST_PATH));
+                break;
+            default:
+                isActive = false;
+        }
+        set("isActive",isActive);
+        return isActive;
+    }
+
+    public boolean isEmpty() {
+        return items.isEmpty();
     }
 }

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/model/template/MenuItemType.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/model/template/MenuItemType.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/model/template/MenuItemType.java
new file mode 100644
index 0000000..1c93f7b
--- /dev/null
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/model/template/MenuItemType.java
@@ -0,0 +1,29 @@
+/*
+ * 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.platform.core.model.template;
+
+/**
+ * ...
+ * <p/>
+ * Author: Thomas Kurz (tkurz@apache.org)
+ */
+public enum MenuItemType {
+
+    ROOT,CONTAINER,MODULE,PAGE,WEBSERVICE
+
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/rio/RDFHtmlWriterImpl.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/rio/RDFHtmlWriterImpl.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/rio/RDFHtmlWriterImpl.java
index 92dc972..bdaa063 100644
--- a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/rio/RDFHtmlWriterImpl.java
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/rio/RDFHtmlWriterImpl.java
@@ -24,6 +24,7 @@ import java.io.UnsupportedEncodingException;
 import java.io.Writer;
 import java.net.URLEncoder;
 import java.util.ArrayList;
+import java.util.Collection;
 import java.util.Comparator;
 import java.util.HashMap;
 import java.util.List;
@@ -31,7 +32,8 @@ import java.util.Map;
 import java.util.SortedSet;
 import java.util.TreeSet;
 
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.marmotta.commons.http.UriUtil;
 import org.apache.marmotta.kiwi.model.rdf.KiWiTriple;
 import org.apache.marmotta.platform.core.api.config.ConfigurationService;
 import org.apache.marmotta.platform.core.api.io.RDFHtmlWriter;
@@ -39,6 +41,7 @@ import org.apache.marmotta.platform.core.api.io.RDFWriterPriority;
 import org.apache.marmotta.platform.core.api.prefix.PrefixService;
 import org.apache.marmotta.platform.core.api.templating.TemplatingService;
 import org.apache.marmotta.platform.core.util.CDIContext;
+import org.openrdf.model.BNode;
 import org.openrdf.model.Literal;
 import org.openrdf.model.Resource;
 import org.openrdf.model.Statement;
@@ -46,6 +49,8 @@ import org.openrdf.model.URI;
 import org.openrdf.model.Value;
 import org.openrdf.rio.RDFFormat;
 import org.openrdf.rio.RDFHandlerException;
+import org.openrdf.rio.RioSetting;
+import org.openrdf.rio.WriterConfig;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -68,6 +73,8 @@ public class RDFHtmlWriterImpl implements RDFHtmlWriter {
     protected Logger log = LoggerFactory.getLogger(RDFHtmlWriterImpl.class);
 
     protected PrintWriter writer;
+    
+    protected WriterConfig config;
 
     protected Map<Resource, SortedSet<Statement>> tripleMap = new HashMap<Resource, SortedSet<Statement>>();
 
@@ -123,67 +130,78 @@ public class RDFHtmlWriterImpl implements RDFHtmlWriter {
     public void endRDF() throws RDFHandlerException {
 
         List<Map<String, Object>> resources = new ArrayList<Map<String, Object>>();
-        for (Map.Entry<Resource, SortedSet<Statement>> entry : tripleMap
-                .entrySet()) {
+        for (Map.Entry<Resource, SortedSet<Statement>> entry : tripleMap.entrySet()) {
             SortedSet<Statement> ts = entry.getValue();
             Map<String, Object> resource = new HashMap<String, Object>();
-            String uri = ts.first().getSubject().stringValue();
-            resource.put("uri", uri);
-            try {
-                resource.put("encoded_uri", URLEncoder.encode(uri, "UTF-8"));
-            } catch (UnsupportedEncodingException e) {
-                log.error("Error trying to encode '" + uri + "': "
-                        + e.getMessage());
-                resource.put("encoded_uri", uri);
+            String subject = ts.first().getSubject().stringValue();
+            if (UriUtil.validate(subject)) {
+            	resource.put("uri", subject);
+	            try {
+	                resource.put("encoded_uri", URLEncoder.encode(subject, "UTF-8"));
+	            } catch (UnsupportedEncodingException e) {
+	                log.error("Error trying to encode '{}': {}", subject, e.getMessage());
+	                resource.put("encoded_uri", subject);
+	            }
+            } else {
+            	resource.put("genid", subject);
+	            try {
+	                resource.put("encoded_genid", URLEncoder.encode(subject, "UTF-8"));
+	            } catch (UnsupportedEncodingException e) {
+	                log.error("Error trying to encode '{}': {}", subject, e.getMessage());
+	                resource.put("encoded_genid", subject);
+	            }
             }
 
             List<Map<String, Object>> triples = new ArrayList<Map<String, Object>>();
             for (Statement t : ts) {
                 Map<String, Object> triple = new HashMap<String, Object>();
 
+                //predicate
                 Map<String, String> predicate = new HashMap<String, String>();
                 String predicateUri = t.getPredicate().stringValue();
                 predicate.put("uri", predicateUri);
                 String predicateCurie = prefixService.getCurie(predicateUri);
-                predicate.put("curie",
-                        StringUtils.isNotBlank(predicateCurie) ? predicateCurie
-                                : predicateUri);
+                predicate.put("curie", StringUtils.isNotBlank(predicateCurie) ? predicateCurie : predicateUri);
                 triple.put("predicate", predicate);
                 predicate = null;
 
+                //object
                 Map<String, String> object = new HashMap<String, String>();
                 Value value = t.getObject();
                 String objectValue = value.stringValue();
-                if (value instanceof URI) {
+                if (value instanceof URI) { //http uri
                     object.put("uri", objectValue);
                     String objectCurie = prefixService.getCurie(objectValue);
-                    object.put("curie",
-                            StringUtils.isNotBlank(objectCurie) ? objectCurie
-                                    : objectValue);
+                    object.put("curie", StringUtils.isNotBlank(objectCurie) ? objectCurie : objectValue);
                     object.put("cache", "true");
-                } else if (value instanceof Literal) {
+                } else if (value instanceof BNode) { //blank node
+                    object.put("genid", objectValue);
+                    try {
+                    	object.put("encoded_genid", URLEncoder.encode(objectValue, "UTF-8"));
+                    } catch (UnsupportedEncodingException e) {
+                        log.error("Error trying to encode '{}': {}", subject, e.getMessage());
+                        object.put("encoded_genid", objectValue);
+                    }                 
+                } else if (value instanceof Literal) { //literal
                     Literal literal = (Literal) t.getObject();
                     String lang = literal.getLanguage();
                     if (StringUtils.isNotBlank(lang)) {
                         object.put("lang", lang);
                         objectValue = "\"" + objectValue + "\"@" + lang;
                         if (literal.getDatatype() != null) {
-                            String datatype = prefixService.getCurie(literal
-                                    .getDatatype().stringValue());
+                            String datatype = prefixService.getCurie(literal.getDatatype().stringValue());
                             object.put("datatype", datatype);
                             objectValue += "^^" + datatype;
                         }
                     } else {
                         if (literal.getDatatype() != null) {
-                            String datatype = prefixService.getCurie(literal
-                                    .getDatatype().stringValue());
+                            String datatype = prefixService.getCurie(literal.getDatatype().stringValue());
                             object.put("datatype", datatype);
-                            objectValue = "\"" + objectValue + "\"^^"
-                                    + datatype;
+                            objectValue = "\"" + objectValue + "\"^^"  + datatype;
                         }
                     }
                     object.put("value", objectValue);
-                } else {
+                } else { //should not arrive here...
                     object.put("value", objectValue);
                 }
                 triple.put("object", object);
@@ -193,9 +211,7 @@ public class RDFHtmlWriterImpl implements RDFHtmlWriter {
                 String contextUri = t.getContext().stringValue();
                 context.put("uri", contextUri);
                 String contextCurie = prefixService.getCurie(contextUri);
-                context.put("curie",
-                        StringUtils.isNotBlank(contextCurie) ? contextCurie
-                                : contextUri);
+                context.put("curie", StringUtils.isNotBlank(contextCurie) ? contextCurie : contextUri);
                 triple.put("context", context);
                 context = null;
 
@@ -318,5 +334,39 @@ public class RDFHtmlWriterImpl implements RDFHtmlWriter {
     public RDFWriterPriority getPriority() {
         return RDFWriterPriority.MEDIUM;
     }
+    
+    /**
+     * @return A collection of {@link RioSetting}s that are supported by this
+     *         RDFWriter.
+     * @since 2.7.0
+     */
+	@Override
+	public Collection<RioSetting<?>> getSupportedSettings() {
+		return new ArrayList<RioSetting<?>>();
+	}
+
+    /**
+     * Retrieves the current writer configuration as a single object.
+     * 
+     * @return a writer configuration object representing the current
+     *         configuration of the writer.
+     * @since 2.7.0
+     */
+	@Override
+	public WriterConfig getWriterConfig() {
+		return config;
+	}
+
+    /**
+     * Sets all supplied writer configuration options.
+     * 
+     * @param config
+     *        a writer configuration object.
+     * @since 2.7.0
+     */
+	@Override
+	public void setWriterConfig(WriterConfig config) {
+		this.config = config;
+	}    
 
 }

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/cache/CachingServiceImpl.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/cache/CachingServiceImpl.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/cache/CachingServiceImpl.java
index 4ffe5cf..f1e9d80 100644
--- a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/cache/CachingServiceImpl.java
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/cache/CachingServiceImpl.java
@@ -56,7 +56,12 @@ public class CachingServiceImpl implements CachingService {
 
     @PostConstruct
     public void initialize() {
-        URL url = this.getClass().getClassLoader().getResource("ehcache-lmf.xml");
+        URL url = this.getClass().getClassLoader().getResource("ehcache-marmotta.xml");
+
+        // backwards compatibility
+        if(url == null) {
+            url = this.getClass().getClassLoader().getResource("ehcache-lmf.xml");
+        }
 
         log.info("Apache Marmotta Caching Service starting up (configuration at {}) ...",url);
         manager = CacheManager.create(url);


[017/100] [abbrv] [partial] Reverting the erroneous merge by Sebastian according to the instructions in INFRA-6876

Posted by wi...@apache.org.
http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/kiwi/kiwi-triplestore/src/main/java/org/apache/marmotta/kiwi/persistence/KiWiPersistence.java
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-triplestore/src/main/java/org/apache/marmotta/kiwi/persistence/KiWiPersistence.java b/libraries/kiwi/kiwi-triplestore/src/main/java/org/apache/marmotta/kiwi/persistence/KiWiPersistence.java
index 27927f3..98ff1b9 100644
--- a/libraries/kiwi/kiwi-triplestore/src/main/java/org/apache/marmotta/kiwi/persistence/KiWiPersistence.java
+++ b/libraries/kiwi/kiwi-triplestore/src/main/java/org/apache/marmotta/kiwi/persistence/KiWiPersistence.java
@@ -17,11 +17,14 @@
  */
 package org.apache.marmotta.kiwi.persistence;
 
+import com.google.common.util.concurrent.AtomicLongMap;
 import org.apache.marmotta.kiwi.caching.KiWiCacheManager;
+import org.apache.marmotta.kiwi.config.KiWiConfiguration;
 import org.apache.marmotta.kiwi.model.rdf.KiWiNode;
 import org.apache.marmotta.kiwi.model.rdf.KiWiResource;
 import org.apache.marmotta.kiwi.model.rdf.KiWiUriResource;
 import org.apache.marmotta.kiwi.persistence.util.ScriptRunner;
+import org.apache.marmotta.kiwi.sail.KiWiValueFactory;
 import org.apache.tomcat.jdbc.pool.DataSource;
 import org.apache.tomcat.jdbc.pool.PoolProperties;
 import org.openrdf.model.Statement;
@@ -33,10 +36,15 @@ import org.slf4j.LoggerFactory;
 import java.io.IOException;
 import java.io.StringReader;
 import java.sql.Connection;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
 import java.sql.SQLException;
-import java.util.Collections;
+import java.util.HashSet;
+import java.util.Map;
 import java.util.Set;
-import java.util.WeakHashMap;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.atomic.AtomicLong;
+import java.util.concurrent.locks.ReentrantLock;
 
 /**
  * Add file description here!
@@ -51,34 +59,65 @@ public class KiWiPersistence {
     private static int KIWI_ID = 0;
 
     /**
-     * A unique name for identifying this instance of KiWiPersistence. Can be used in case there are several
-     * instances running in the same environment.
+     * The connection pool for managing JDBC connections
      */
-    private String name;
+    private DataSource connectionPool;
+
+    private PoolProperties        poolConfig;
 
+    private KiWiCacheManager      cacheManager;
+
+    private KiWiGarbageCollector  garbageCollector;
 
     /**
-     * The connection pool for managing JDBC connections
+     * The KiWi configuration for this persistence.
      */
-    private DataSource connectionPool;
+    private KiWiConfiguration     configuration;
 
     /**
-     * The SQL dialect to use
+     * A map holding in-memory sequences to be used for sequence caching in case the appropriate configuration option
+     * is configued and batched commits are enabled.
      */
-    private KiWiDialect           dialect;
+    private AtomicLongMap<String> memorySequences;
 
-    private PoolProperties        poolConfig;
+    private ReentrantLock          sequencesLock;
 
-    private KiWiCacheManager      cacheManager;
 
-    private KiWiGarbageCollector  garbageCollector;
+    /**
+     * A reference to the value factory used to access this store. Used for notifications when to flush batches.
+     */
+    private KiWiValueFactory      valueFactory;
 
+
+    /**
+     * This lock allows setting the backend into maintenance mode (by locking the write lock), which essentially
+     * grants an exclusive access to the database. This is currently used by the garbage collector, but can also
+     * be used in other situations-
+     */
+    private boolean         maintenance;
+
+    private boolean         droppedDatabase = false;
+
+    private boolean         initialized = false;
+
+    // keep track which memory sequences have been updated and need to be written back
+    private Set<String>     sequencesUpdated;
+
+    @Deprecated
     public KiWiPersistence(String name, String jdbcUrl, String db_user, String db_password, KiWiDialect dialect) {
-        this.name       = name;
-        this.dialect    = dialect;
+        this(new KiWiConfiguration(name,jdbcUrl,db_user,db_password,dialect));
+    }
+
+    public KiWiPersistence(KiWiConfiguration configuration) {
+        this.configuration = configuration;
+        this.maintenance = false;
+        this.sequencesLock = new ReentrantLock();
+        this.sequencesUpdated = new HashSet<>();
+    }
 
+    public void initialise() {
         // init JDBC connection pool
-        initConnectionPool(jdbcUrl, db_user, db_password);
+        initConnectionPool();
 
         // init EHCache caches
         initCachePool();
@@ -92,10 +131,14 @@ public class KiWiPersistence {
 
         }
 
+        //garbageCollector.start();
+
+        initialized = true;
     }
 
+
     public KiWiDialect getDialect() {
-        return dialect;
+        return configuration.getDialect();
     }
 
     public KiWiCacheManager getCacheManager() {
@@ -104,30 +147,39 @@ public class KiWiPersistence {
 
 
     private void initCachePool() {
-        cacheManager = new KiWiCacheManager(name);
+        cacheManager = new KiWiCacheManager(configuration.getName());
     }
 
 
-    private void initConnectionPool(String jdbcUrl, String db_user, String db_password) {
+    private void initConnectionPool() {
         poolConfig = new PoolProperties();
         poolConfig.setName("kiwi-" + (++KIWI_ID));
-        poolConfig.setUrl(jdbcUrl);
-        poolConfig.setDriverClassName(dialect.getDriverClass());
-        poolConfig.setUsername(db_user);
-        poolConfig.setPassword(db_password);
+        poolConfig.setUrl(configuration.getJdbcUrl());
+        poolConfig.setDriverClassName(configuration.getDialect().getDriverClass());
+        poolConfig.setUsername(configuration.getDbUser());
+        poolConfig.setPassword(configuration.getDbPassword());
         poolConfig.setDefaultTransactionIsolation(Connection.TRANSACTION_READ_COMMITTED);
         poolConfig.setCommitOnReturn(true);
+        poolConfig.setValidationQuery(configuration.getDialect().getValidationQuery());
+        poolConfig.setLogValidationErrors(true);
         /*
         poolConfig.setLogAbandoned(true);
         poolConfig.setRemoveAbandoned(true);
         */
 
         // interceptors
-        poolConfig.setJdbcInterceptors(
-                "org.apache.tomcat.jdbc.pool.interceptor.ConnectionState;"   +
-                "org.apache.tomcat.jdbc.pool.interceptor.StatementFinalizer;" +
-                "org.apache.tomcat.jdbc.pool.interceptor.SlowQueryReport"
-        );
+        if(configuration.isQueryLoggingEnabled()) {
+            poolConfig.setJdbcInterceptors(
+                    "org.apache.tomcat.jdbc.pool.interceptor.ConnectionState;"   +
+                            "org.apache.tomcat.jdbc.pool.interceptor.StatementFinalizer;" +
+                            "org.apache.tomcat.jdbc.pool.interceptor.SlowQueryReport"
+            );
+        } else {
+            poolConfig.setJdbcInterceptors(
+                    "org.apache.tomcat.jdbc.pool.interceptor.ConnectionState;"   +
+                            "org.apache.tomcat.jdbc.pool.interceptor.StatementFinalizer"
+            );
+        }
 
         if(log.isDebugEnabled()) {
             poolConfig.setSuspectTimeout(30);
@@ -151,9 +203,63 @@ public class KiWiPersistence {
 
     }
 
+    /**
+     * Initialise in-memory sequences if the feature is enabled.
+     */
+    public void initSequences(String scriptName) {
+        if(configuration.isBatchCommit() && configuration.isMemorySequences()) {
+            sequencesLock.lock();
+            try {
+                if(memorySequences == null) {
+                    memorySequences = AtomicLongMap.create();
+                }
+
+                try {
+                    Connection con = getJDBCConnection(true);
+                    try {
+                        for(String sequenceName : getDialect().listSequences(scriptName)) {
+
+                            // load sequence value from database
+                            // if there is a preparation needed to update the transaction, run it first
+                            if(getDialect().hasStatement(sequenceName+".prep")) {
+                                PreparedStatement prepNodeId = con.prepareStatement(getDialect().getStatement(sequenceName+".prep"));
+                                prepNodeId.executeUpdate();
+                                prepNodeId.close();
+                            }
+
+                            PreparedStatement queryNodeId = con.prepareStatement(getDialect().getStatement(sequenceName));
+                            ResultSet resultNodeId = queryNodeId.executeQuery();
+                            try {
+                                if(resultNodeId.next()) {
+                                    memorySequences.put(sequenceName,resultNodeId.getLong(1)-1);
+                                } else {
+                                    throw new SQLException("the sequence did not return a new value");
+                                }
+                            } finally {
+                                resultNodeId.close();
+                            }
+
+                            con.commit();
+                        }
+                    } finally {
+                        releaseJDBCConnection(con);
+                    }
+                } catch(SQLException ex) {
+                    log.warn("database error: could not initialise in-memory sequences",ex);
+                }
+            } finally {
+                sequencesLock.unlock();
+            }
+        }
+    }
+
     public void logPoolInfo() throws SQLException {
-        log.debug("num_busy_connections:    {}", connectionPool.getNumActive());
-        log.debug("num_idle_connections:    {}", connectionPool.getNumIdle());
+        if(connectionPool != null) {
+            log.debug("num_busy_connections:    {}", connectionPool.getNumActive());
+            log.debug("num_idle_connections:    {}", connectionPool.getNumIdle());
+        } else {
+            log.debug("connection pool not initialized");
+        }
 
     }
 
@@ -190,14 +296,14 @@ public class KiWiPersistence {
                 log.info("creating new KiWi database ...");
 
                 ScriptRunner runner = new ScriptRunner(connection.getJDBCConnection(), false, false);
-                runner.runScript(new StringReader(dialect.getCreateScript(scriptName)));
+                runner.runScript(new StringReader(configuration.getDialect().getCreateScript(scriptName)));
 
             } else {
                 int version = connection.getDatabaseVersion();
 
-                String updateScript = dialect.getMigrationScript(version,scriptName);
+                String updateScript = configuration.getDialect().getMigrationScript(version,scriptName);
                 if(updateScript != null && updateScript.length() > 0) {
-                    log.info("upgrading existing KiWi database from version {} to version {}", version, dialect.getVersion());
+                    log.info("upgrading existing KiWi database from version {} to version {}", version, configuration.getDialect().getVersion());
 
                     ScriptRunner runner = new ScriptRunner(connection.getJDBCConnection(), false, false);
                     runner.runScript(new StringReader(updateScript));
@@ -206,7 +312,7 @@ public class KiWiPersistence {
                     log.info("connecting to existing KiWi database (version: {})",version);
                 }
             }
-            connection.commit();
+            connection.getJDBCConnection().commit();
         } catch (SQLException ex) {
             log.error("SQL exception while initialising database, rolling back");
             connection.rollback();
@@ -217,6 +323,9 @@ public class KiWiPersistence {
         } finally {
             connection.close();
         }
+
+        // init the in-memory sequences
+        initSequences(scriptName);
     }
 
     /**
@@ -258,7 +367,7 @@ public class KiWiPersistence {
                 }
 
                 ScriptRunner runner = new ScriptRunner(connection.getJDBCConnection(), false, false);
-                runner.runScript(new StringReader(dialect.getDropScript(scriptName)));
+                runner.runScript(new StringReader(configuration.getDialect().getDropScript(scriptName)));
 
 
                 if(log.isDebugEnabled()) {
@@ -268,7 +377,7 @@ public class KiWiPersistence {
                         log.debug("- found table: {}",table);
                     }
                 }
-                connection.commit();
+                connection.getJDBCConnection().commit();
             } catch (SQLException ex) {
                 log.error("SQL exception while dropping database, rolling back");
                 connection.rollback();
@@ -282,6 +391,8 @@ public class KiWiPersistence {
         } catch(SQLException ex) {
             log.error("SQL exception while acquiring database connection");
         }
+
+        droppedDatabase = true;
     }
 
     /**
@@ -291,7 +402,20 @@ public class KiWiPersistence {
      * @throws SQLException in case a new connection could not be established
      */
     public KiWiConnection getConnection() throws SQLException {
-        return new KiWiConnection(this,dialect,cacheManager);
+        if(!initialized) {
+            throw new SQLException("persistence backend not initialized; call initialise before acquiring a connection");
+        }
+
+        if(connectionPool != null) {
+            KiWiConnection con = new KiWiConnection(this,configuration.getDialect(),cacheManager);
+            if(getDialect().isBatchSupported()) {
+                con.setBatchCommit(configuration.isBatchCommit());
+                con.setBatchSize(configuration.getBatchSize());
+            }
+            return con;
+        } else {
+            throw new SQLException("connection pool is closed, database connections not available");
+        }
     }
 
     /**
@@ -300,18 +424,60 @@ public class KiWiPersistence {
      * @throws SQLException
      */
     public Connection getJDBCConnection() throws SQLException {
-        Connection conn = connectionPool.getConnection();
-        conn.setAutoCommit(false);
-        //conn.setTransactionIsolation(Connection.TRANSACTION_READ_COMMITTED);
+        return getJDBCConnection(false);
+    }
 
-        //managedConnections.add(conn);
+    /**
+     * Return a raw JDBC connection from the connection pool, which already has the auto-commit disabled.
+     * @return
+     * @throws SQLException
+     */
+    public Connection getJDBCConnection(boolean maintenance) throws SQLException {
+        synchronized (this) {
+            if(this.maintenance) {
+                try {
+                    this.wait();
+                } catch (InterruptedException e) { }
+            }
+            if(maintenance) {
+                this.maintenance = true;
+            }
+        }
+
+        if(initialized && connectionPool != null) {
+            Connection conn = connectionPool.getConnection();
+            conn.setAutoCommit(false);
 
-        return conn;
+            return conn;
+        } else {
+            throw new SQLException("connection pool is closed, database connections not available");
+        }
     }
 
 
+    /**
+     * Release the JDBC connection passed as argument. This method will close the connection and release
+     * any locks that might be held by the caller.
+     * @param con
+     * @throws SQLException
+     */
+    public void releaseJDBCConnection(Connection con) throws SQLException {
+        try {
+            con.close();
+        } finally {
+            synchronized (this) {
+                if(this.maintenance) {
+                    this.maintenance = false;
+                    this.notifyAll();
+                }
+            }
+        }
+    }
+
     private void forceCloseConnections() {
-        connectionPool.close(true);
+        if(connectionPool != null) {
+            connectionPool.close(true);
+        }
 
         connectionPool = new DataSource(poolConfig);
     }
@@ -340,63 +506,33 @@ public class KiWiPersistence {
         garbageCollector.addTripleTableDependency(tableName, columnName);
     }
 
-    /**
-     * Return a Sesame RepositoryResult of statements according to the query pattern given in the arguments. Each of
-     * the parameters subject, predicate, object and context may be null, indicating a wildcard query. If the boolean
-     * parameter "inferred" is set to true, the result will also include inferred triples, if it is set to false only
-     * base triples.
-     * <p/>
-     * The RepositoryResult holds a direct connection to the database and needs to be closed properly, or otherwise
-     * the system might run out of resources. The returned RepositoryResult will try its best to clean up when the
-     * iteration has completed or the garbage collector calls the finalize() method, but this can take longer than
-     * necessary.
-     * <p/>
-     * This method will create a new database connection for running the query which is only released when the
-     * result is closed.
-     *
-     *
-     * @param subject    the subject to query for, or null for a wildcard query
-     * @param predicate  the predicate to query for, or null for a wildcard query
-     * @param object     the object to query for, or null for a wildcard query
-     * @param context    the context to query for, or null for a wildcard query
-     * @param inferred   if true, the result will also contain triples inferred by the reasoner, if false not
-     * @return a new RepositoryResult with a direct connection to the database; the result should be properly closed
-     *         by the caller
-     */
-    public RepositoryResult<Statement> listTriples(KiWiResource subject, KiWiUriResource predicate, KiWiNode object, KiWiResource context, boolean inferred) throws SQLException {
-        final KiWiConnection conn = getConnection();
 
-        return new RepositoryResult<Statement>(conn.listTriples(subject,predicate,object,context,inferred)) {
-            @Override
-            protected void handleClose() throws RepositoryException {
-                super.handleClose();
+    public void shutdown() {
+        initialized = false;
+
+        if(!droppedDatabase && !configuration.isCommitSequencesOnCommit()) {
+            log.info("storing in-memory sequences in database ...");
+            try {
+                KiWiConnection connection = getConnection();
                 try {
-                    if(!conn.isClosed()) {
-                        conn.commit();
-                        conn.close();
-                    }
-                } catch (SQLException ex) {
-                    throw new RepositoryException("SQL error when closing database connection",ex);
+                    connection.commitMemorySequences();
+                    connection.commit();
+                } finally {
+                    connection.close();
                 }
+            } catch (SQLException e) {
+                log.error("could not store back values of in-memory sequences", e);
             }
+        }
 
-            @Override
-            protected void finalize() throws Throwable {
-                handleClose();
-                super.finalize();
-            }
-        };
-    }
-
-
-    public void initialise() {
-        garbageCollector.start();
-    }
 
-    public void shutdown() {
         garbageCollector.shutdown();
         cacheManager.shutdown();
         connectionPool.close();
+
+        connectionPool = null;
+        memorySequences = null;
+
     }
 
     /**
@@ -407,4 +543,46 @@ public class KiWiPersistence {
     }
 
 
+    public void setValueFactory(KiWiValueFactory valueFactory) {
+        this.valueFactory = valueFactory;
+    }
+
+    public KiWiValueFactory getValueFactory() {
+        return valueFactory;
+    }
+
+    public KiWiConfiguration getConfiguration() {
+        return configuration;
+    }
+
+    public AtomicLongMap<String> getMemorySequences() {
+        return memorySequences;
+    }
+
+    public long incrementAndGetMemorySequence(String name) {
+        sequencesUpdated.add(name);
+
+        if(memorySequences != null) {
+            return memorySequences.incrementAndGet(name);
+        } else {
+            return 0;
+        }
+    }
+
+
+    public void garbageCollect() throws SQLException {
+        this.garbageCollector.garbageCollect();
+    }
+
+    public boolean checkConsistency() throws SQLException {
+        return garbageCollector.checkConsistency();
+    }
+
+    public Set<String> getSequencesUpdated() {
+        return sequencesUpdated;
+    }
+
+    public void setSequencesUpdated(Set<String> sequencesUpdated) {
+        this.sequencesUpdated = sequencesUpdated;
+    }
 }

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/kiwi/kiwi-triplestore/src/main/java/org/apache/marmotta/kiwi/persistence/h2/H2Dialect.java
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-triplestore/src/main/java/org/apache/marmotta/kiwi/persistence/h2/H2Dialect.java b/libraries/kiwi/kiwi-triplestore/src/main/java/org/apache/marmotta/kiwi/persistence/h2/H2Dialect.java
index dc57948..8bbb1a6 100644
--- a/libraries/kiwi/kiwi-triplestore/src/main/java/org/apache/marmotta/kiwi/persistence/h2/H2Dialect.java
+++ b/libraries/kiwi/kiwi-triplestore/src/main/java/org/apache/marmotta/kiwi/persistence/h2/H2Dialect.java
@@ -44,4 +44,47 @@ public class H2Dialect extends KiWiDialect {
     public String getDriverClass() {
         return "org.h2.Driver";
     }
+
+    @Override
+    public boolean isBatchSupported() {
+        return false;
+    }
+
+    @Override
+    public String getRegexp(String text, String pattern) {
+        return text + " REGEXP " + pattern;
+    }
+
+    @Override
+    public String getILike(String text, String pattern) {
+        return "lower("+text+") LIKE lower("+pattern+")";
+    }
+
+
+
+    @Override
+    public String getConcat(String... args) {
+        StringBuilder buf = new StringBuilder();
+        buf.append("CONCAT(");
+        for(int i=0; i<args.length; i++) {
+            buf.append(args[i]);
+            if(i + 1 <args.length) {
+                buf.append(",");
+            }
+        }
+        buf.append(")");
+        return buf.toString();
+    }
+
+    /**
+     * Get the query string that can be used for validating that a JDBC connection to this database is still valid.
+     * Typically, this should be an inexpensive operation like "SELECT 1",
+     *
+     * @return
+     */
+    @Override
+    public String getValidationQuery() {
+        return "SELECT 1";
+    }
+
 }

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/kiwi/kiwi-triplestore/src/main/java/org/apache/marmotta/kiwi/persistence/mysql/MySQLDialect.java
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-triplestore/src/main/java/org/apache/marmotta/kiwi/persistence/mysql/MySQLDialect.java b/libraries/kiwi/kiwi-triplestore/src/main/java/org/apache/marmotta/kiwi/persistence/mysql/MySQLDialect.java
index 73722de..7914363 100644
--- a/libraries/kiwi/kiwi-triplestore/src/main/java/org/apache/marmotta/kiwi/persistence/mysql/MySQLDialect.java
+++ b/libraries/kiwi/kiwi-triplestore/src/main/java/org/apache/marmotta/kiwi/persistence/mysql/MySQLDialect.java
@@ -55,4 +55,47 @@ public class MySQLDialect extends KiWiDialect {
     public String getDriverClass() {
         return "com.mysql.jdbc.Driver";
     }
+
+    @Override
+    public boolean isBatchSupported() {
+        return true;
+    }
+
+    @Override
+    public String getRegexp(String text, String pattern) {
+        return text + " RLIKE " + pattern;
+    }
+
+    @Override
+    public String getILike(String text, String pattern) {
+        return "lower("+text+") LIKE lower("+pattern+")";
+    }
+
+
+    @Override
+    public String getConcat(String... args) {
+        StringBuilder buf = new StringBuilder();
+        buf.append("CONCAT(");
+        for(int i=0; i<args.length; i++) {
+            buf.append(args[i]);
+            if(i + 1 <args.length) {
+                buf.append(",");
+            }
+        }
+        buf.append(")");
+        return buf.toString();
+    }
+
+
+    /**
+     * Get the query string that can be used for validating that a JDBC connection to this database is still valid.
+     * Typically, this should be an inexpensive operation like "SELECT 1",
+     *
+     * @return
+     */
+    @Override
+    public String getValidationQuery() {
+        return "SELECT 1";
+    }
+
 }

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/kiwi/kiwi-triplestore/src/main/java/org/apache/marmotta/kiwi/persistence/pgsql/PostgreSQLDialect.java
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-triplestore/src/main/java/org/apache/marmotta/kiwi/persistence/pgsql/PostgreSQLDialect.java b/libraries/kiwi/kiwi-triplestore/src/main/java/org/apache/marmotta/kiwi/persistence/pgsql/PostgreSQLDialect.java
index c517d0f..4110309 100644
--- a/libraries/kiwi/kiwi-triplestore/src/main/java/org/apache/marmotta/kiwi/persistence/pgsql/PostgreSQLDialect.java
+++ b/libraries/kiwi/kiwi-triplestore/src/main/java/org/apache/marmotta/kiwi/persistence/pgsql/PostgreSQLDialect.java
@@ -45,4 +45,56 @@ public class PostgreSQLDialect extends KiWiDialect {
     public String getDriverClass() {
         return "org.postgresql.Driver";
     }
+
+    @Override
+    public boolean isBatchSupported() {
+        return true;
+    }
+
+    @Override
+    public String getRegexp(String text, String pattern) {
+        return text + " ~ " + pattern;
+    }
+
+    @Override
+    public String getILike(String text, String pattern) {
+        return text + " ILIKE " + pattern;
+    }
+
+
+
+    @Override
+    public String getConcat(String... args) {
+        StringBuilder buf = new StringBuilder();
+        buf.append("(");
+        for(int i=0; i<args.length; i++) {
+            buf.append(args[i]);
+            if(i + 1 <args.length) {
+                buf.append("||");
+            }
+        }
+        buf.append(")");
+        return buf.toString();
+    }
+
+    /**
+     * Get the query string that can be used for validating that a JDBC connection to this database is still valid.
+     * Typically, this should be an inexpensive operation like "SELECT 1",
+     *
+     * @return
+     */
+    @Override
+    public String getValidationQuery() {
+        return "SELECT 1";
+    }
+
+    /**
+     * Return true in case the database system supports using cursors for queries over large data tables.
+     *
+     * @return
+     */
+    @Override
+    public boolean isCursorSupported() {
+        return true;
+    }
 }

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/kiwi/kiwi-triplestore/src/main/java/org/apache/marmotta/kiwi/sail/KiWiSailConnection.java
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-triplestore/src/main/java/org/apache/marmotta/kiwi/sail/KiWiSailConnection.java b/libraries/kiwi/kiwi-triplestore/src/main/java/org/apache/marmotta/kiwi/sail/KiWiSailConnection.java
index d4c84b3..a46bee1 100644
--- a/libraries/kiwi/kiwi-triplestore/src/main/java/org/apache/marmotta/kiwi/sail/KiWiSailConnection.java
+++ b/libraries/kiwi/kiwi-triplestore/src/main/java/org/apache/marmotta/kiwi/sail/KiWiSailConnection.java
@@ -20,24 +20,15 @@ package org.apache.marmotta.kiwi.sail;
 import com.google.common.base.Function;
 import com.google.common.collect.Iterables;
 import com.google.common.collect.Lists;
-import info.aduna.iteration.CloseableIteration;
-import info.aduna.iteration.DelayedIteration;
-import info.aduna.iteration.ExceptionConvertingIteration;
-import info.aduna.iteration.Iteration;
-import info.aduna.iteration.Iterations;
-import info.aduna.iteration.UnionIteration;
+import info.aduna.iteration.*;
+import org.apache.marmotta.commons.sesame.repository.ResourceConnection;
 import org.apache.marmotta.kiwi.model.rdf.KiWiNamespace;
 import org.apache.marmotta.kiwi.model.rdf.KiWiNode;
 import org.apache.marmotta.kiwi.model.rdf.KiWiResource;
 import org.apache.marmotta.kiwi.model.rdf.KiWiTriple;
 import org.apache.marmotta.kiwi.model.rdf.KiWiUriResource;
 import org.apache.marmotta.kiwi.persistence.KiWiConnection;
-import org.openrdf.model.Namespace;
-import org.openrdf.model.Resource;
-import org.openrdf.model.Statement;
-import org.openrdf.model.URI;
-import org.openrdf.model.Value;
-import org.openrdf.model.ValueFactory;
+import org.openrdf.model.*;
 import org.openrdf.query.BindingSet;
 import org.openrdf.query.Dataset;
 import org.openrdf.query.QueryEvaluationException;
@@ -49,7 +40,9 @@ import org.openrdf.query.algebra.Var;
 import org.openrdf.query.algebra.evaluation.EvaluationStrategy;
 import org.openrdf.query.algebra.evaluation.TripleSource;
 import org.openrdf.query.algebra.evaluation.impl.*;
+import org.openrdf.query.impl.EmptyBindingSet;
 import org.openrdf.repository.RepositoryException;
+import org.openrdf.repository.RepositoryResult;
 import org.openrdf.sail.Sail;
 import org.openrdf.sail.SailChangedEvent;
 import org.openrdf.sail.SailException;
@@ -70,7 +63,7 @@ import java.util.Set;
  * <p/>
  * Author: Sebastian Schaffert
  */
-public class KiWiSailConnection extends NotifyingSailConnectionBase implements InferencerConnection {
+public class KiWiSailConnection extends NotifyingSailConnectionBase implements InferencerConnection, ResourceConnection {
 
     private static final Logger log = LoggerFactory.getLogger(KiWiSailConnection.class);
 
@@ -89,7 +82,6 @@ public class KiWiSailConnection extends NotifyingSailConnectionBase implements I
 
     private boolean triplesAdded, triplesRemoved;
 
-    private HashSet<Long> deletedStatementsLog;
 
     public KiWiSailConnection(KiWiStore sailBase) throws SailException {
         super(sailBase);
@@ -149,7 +141,14 @@ public class KiWiSailConnection extends NotifyingSailConnectionBase implements I
                 }
             }
             if(contextSet.size() == 0) {
-                contextSet.add(valueFactory.createURI(defaultContext));
+                if(defaultContext != null) {
+                    contextSet.add(valueFactory.createURI(defaultContext));
+                } else {
+                    contextSet.add(null);
+                }
+            }
+            if(inferred && inferredContext != null) {
+                contextSet.add(valueFactory.createURI(inferredContext));
             }
 
             KiWiResource    ksubj = valueFactory.convert(subj);
@@ -164,16 +163,7 @@ public class KiWiSailConnection extends NotifyingSailConnectionBase implements I
                 KiWiTriple triple = (KiWiTriple)valueFactory.createStatement(ksubj,kpred,kobj,kcontext, databaseConnection);
                 triple.setInferred(inferred);
 
-                if(triple.getId() == null) {
-                    databaseConnection.storeTriple(triple);
-                    triplesAdded = true;
-                    notifyStatementAdded(triple);
-                } else if(deletedStatementsLog.contains(triple.getId())) {
-                    // this is a hack for a concurrency problem that may occur in case the triple is removed in the
-                    // transaction and then added again; in these cases the createStatement method might return
-                    // an expired state of the triple because it uses its own database connection
-
-                    databaseConnection.undeleteTriple(triple);
+                if(databaseConnection.storeTriple(triple)) {
                     triplesAdded = true;
                     notifyStatementAdded(triple);
                 }
@@ -238,7 +228,7 @@ public class KiWiSailConnection extends NotifyingSailConnectionBase implements I
             new FilterOptimizer().optimize(tupleExpr, dataset, bindings);
             new OrderLimitOptimizer().optimize(tupleExpr, dataset, bindings);
 
-            return strategy.evaluate(tupleExpr, bindings);
+            return strategy.evaluate(tupleExpr, EmptyBindingSet.getInstance());
 
         } catch (QueryEvaluationException e) {
             throw new SailException(e);
@@ -249,11 +239,16 @@ public class KiWiSailConnection extends NotifyingSailConnectionBase implements I
     @Override
     protected CloseableIteration<? extends Resource, SailException> getContextIDsInternal() throws SailException {
         try {
-            return new ExceptionConvertingIteration<Resource, SailException>(databaseConnection.listContexts()) {
+            return  new FilterIteration<Resource, SailException>(new ExceptionConvertingIteration<Resource, SailException>(databaseConnection.listContexts()) {
                 @Override
                 protected SailException convert(Exception e) {
                     return new SailException("database error while iterating over result set",e);
                 }
+            }) {
+                @Override
+                protected boolean accept(Resource object) throws SailException {
+                    return !object.stringValue().equals(defaultContext);
+                }
             };
         } catch (SQLException e) {
             throw new SailException("database error while listing contexts",e);
@@ -270,7 +265,16 @@ public class KiWiSailConnection extends NotifyingSailConnectionBase implements I
         contextSet.addAll(Lists.transform(Arrays.asList(contexts), new Function<Resource, KiWiResource>() {
             @Override
             public KiWiResource apply(Resource input) {
-                return valueFactory.convert(input);
+                if(input == null) {
+                    if(defaultContext != null) {
+                        // null value for context means statements without context; in KiWi, this means "default context"
+                        return (KiWiUriResource)valueFactory.createURI(defaultContext);
+                    } else {
+                        return null;
+                    }
+                } else {
+                    return valueFactory.convert(input);
+                }
             }
         }));
 
@@ -281,7 +285,7 @@ public class KiWiSailConnection extends NotifyingSailConnectionBase implements I
                     @Override
                     protected Iteration<? extends Statement, ? extends RepositoryException> createIteration() throws RepositoryException {
                         try {
-                            return databaseConnection.listTriples(rsubj, rpred, robj, context, includeInferred);
+                            return databaseConnection.listTriples(rsubj, rpred, robj, context, includeInferred, false);
                         } catch (SQLException e) {
                             throw new RepositoryException("database error while listing triples",e);
                         }
@@ -293,7 +297,7 @@ public class KiWiSailConnection extends NotifyingSailConnectionBase implements I
                 @Override
                 protected Iteration<? extends Statement, ? extends RepositoryException> createIteration() throws RepositoryException {
                     try {
-                        return databaseConnection.listTriples(rsubj, rpred, robj, null, includeInferred);
+                        return databaseConnection.listTriples(rsubj, rpred, robj, null, includeInferred, true);
                     } catch (SQLException e) {
                         throw new RepositoryException("database error while listing triples",e);
                     }
@@ -343,7 +347,6 @@ public class KiWiSailConnection extends NotifyingSailConnectionBase implements I
         // nothing to do, the database transaction is started automatically
         triplesAdded = false;
         triplesRemoved = false;
-        deletedStatementsLog = new HashSet<Long>();
     }
 
     @Override
@@ -354,7 +357,6 @@ public class KiWiSailConnection extends NotifyingSailConnectionBase implements I
             throw new SailException("database error while committing transaction",e);
         }
         if(triplesAdded || triplesRemoved) {
-            deletedStatementsLog.clear();
 
             store.notifySailChanged(new SailChangedEvent() {
                 @Override
@@ -379,7 +381,6 @@ public class KiWiSailConnection extends NotifyingSailConnectionBase implements I
     protected void rollbackInternal() throws SailException {
         try {
             databaseConnection.rollback();
-            deletedStatementsLog.clear();
         } catch (SQLException e) {
             throw new SailException("database error while rolling back transaction",e);
         }
@@ -394,9 +395,9 @@ public class KiWiSailConnection extends NotifyingSailConnectionBase implements I
                 if(triple.getId() != null) {
                     databaseConnection.deleteTriple(triple);
                     triplesRemoved = true;
-                    deletedStatementsLog.add(triple.getId());
                     notifyStatementRemoved(triple);
                 }
+                valueFactory.removeStatement(triple);
             }
             triples.close();
         } catch(SQLException ex) {
@@ -425,9 +426,9 @@ public class KiWiSailConnection extends NotifyingSailConnectionBase implements I
                 if(triple.getId() != null && triple.isInferred()) {
                     databaseConnection.deleteTriple(triple);
                     triplesRemoved = true;
-                    deletedStatementsLog.add(triple.getId());
                     notifyStatementRemoved(triple);
                 }
+                valueFactory.removeStatement(triple);
             }
             triples.close();
         } catch(SQLException ex) {
@@ -439,12 +440,6 @@ public class KiWiSailConnection extends NotifyingSailConnectionBase implements I
     /**
      * Removes an inferred statement from a specific context.
      *
-     * @param subj     The subject of the statement that should be removed.
-     * @param pred     The predicate of the statement that should be removed.
-     * @param obj      The object of the statement that should be removed.
-     * @param contexts The context(s) from which to remove the statements. Note that this
-     *                 parameter is a vararg and as such is optional. If no contexts are
-     *                 supplied the method operates on the entire repository.
      * @throws org.openrdf.sail.SailException If the statement could not be removed.
      * @throws IllegalStateException          If the connection has been closed.
      */
@@ -453,7 +448,6 @@ public class KiWiSailConnection extends NotifyingSailConnectionBase implements I
             if(triple.getId() != null && triple.isInferred()) {
                 databaseConnection.deleteTriple(triple);
                 triplesRemoved = true;
-                deletedStatementsLog.add(triple.getId());
                 notifyStatementRemoved(triple);
             }
         } catch(SQLException ex) {
@@ -610,7 +604,7 @@ public class KiWiSailConnection extends NotifyingSailConnectionBase implements I
                             throw new IllegalArgumentException("e must not be null");
                         }
                         else {
-                            throw new IllegalArgumentException("Unexpected exception type: " + e.getClass());
+                            throw new IllegalArgumentException("Unexpected exception type: " + e.getClass(),e);
                         }
                     }
                 };
@@ -631,6 +625,83 @@ public class KiWiSailConnection extends NotifyingSailConnectionBase implements I
         }
     }
 
+    /**
+     * Return an iterator over the resources contained in this repository.
+     *
+     * @return
+     */
+    @Override
+    public RepositoryResult<Resource> getResources() throws RepositoryException {
+        try {
+            return new RepositoryResult<Resource>(new ExceptionConvertingIteration<Resource,RepositoryException>(databaseConnection.listResources()) {
+                @Override
+                protected RepositoryException convert(Exception e) {
+                    return new RepositoryException(e);
+                }
+            });
+        } catch (SQLException e) {
+            throw new RepositoryException(e);
+        }
+    }
+
+    /**
+     * Return an iterator over the resources contained in this repository matching the given prefix.
+     *
+     * @return
+     */
+    @Override
+    public RepositoryResult<URI> getResources(String prefix) throws RepositoryException {
+        try {
+            return new RepositoryResult<URI>(new ExceptionConvertingIteration<URI,RepositoryException>(databaseConnection.listResources(prefix)) {
+                @Override
+                protected RepositoryException convert(Exception e) {
+                    return new RepositoryException(e);
+                }
+            });
+        } catch (SQLException e) {
+            throw new RepositoryException(e);
+        }
+    }
+
+    /**
+     * Return the Sesame URI with the given uri identifier if it exists, or null if it does not exist.
+     *
+     * @param uri
+     * @return
+     */
+    @Override
+    public URI getURI(String uri) {
+        try {
+            return databaseConnection.loadUriResource(uri);
+        } catch (SQLException e) {
+            return null;
+        }
+    }
+
+    /**
+     * Return the Sesame BNode with the given anonymous ID if it exists, or null if it does not exist.
+     *
+     * @param id
+     * @return
+     */
+    @Override
+    public BNode getBNode(String id) {
+        try {
+            return databaseConnection.loadAnonResource(id);
+        } catch (SQLException e) {
+            return null;
+        }
+    }
+
+    /**
+     * Remove the resource given as argument from the triple store and the resource repository.
+     *
+     * @param resource
+     */
+    @Override
+    public void removeResource(Resource resource) {
+        // handled by garbage collection
+    }
 
     protected static class KiWiEvaluationStatistics extends EvaluationStatistics {
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/kiwi/kiwi-triplestore/src/main/java/org/apache/marmotta/kiwi/sail/KiWiStore.java
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-triplestore/src/main/java/org/apache/marmotta/kiwi/sail/KiWiStore.java b/libraries/kiwi/kiwi-triplestore/src/main/java/org/apache/marmotta/kiwi/sail/KiWiStore.java
index 3c71e2c..4119023 100644
--- a/libraries/kiwi/kiwi-triplestore/src/main/java/org/apache/marmotta/kiwi/sail/KiWiStore.java
+++ b/libraries/kiwi/kiwi-triplestore/src/main/java/org/apache/marmotta/kiwi/sail/KiWiStore.java
@@ -18,6 +18,7 @@
 package org.apache.marmotta.kiwi.sail;
 
 import com.google.common.collect.MapMaker;
+import org.apache.marmotta.kiwi.config.KiWiConfiguration;
 import org.apache.marmotta.kiwi.model.caching.IntArray;
 import org.apache.marmotta.kiwi.persistence.KiWiDialect;
 import org.apache.marmotta.kiwi.persistence.KiWiPersistence;
@@ -91,20 +92,23 @@ public class KiWiStore extends NotifyingSailBase {
     protected ConcurrentMap<IntArray,Statement> tripleRegistry;
 
     public KiWiStore(KiWiPersistence persistence, String defaultContext, String inferredContext) {
-    	this.persistence    = persistence;
-    	this.defaultContext = defaultContext;
+        this.persistence    = persistence;
+        this.defaultContext = defaultContext;
         this.nodeLock       = new ReentrantLock();
         this.tripleLock     = new ReentrantLock();
         this.inferredContext = inferredContext;
-    	
-    	tripleRegistry  = new MapMaker().weakValues().makeMap();
+
 
     }
 
+    @Deprecated
     public KiWiStore(String name, String jdbcUrl, String db_user, String db_password, KiWiDialect dialect, String defaultContext, String inferredContext) {
-    	this(new KiWiPersistence(name,jdbcUrl,db_user,db_password,dialect), defaultContext, inferredContext);
+        this(new KiWiConfiguration(name,jdbcUrl,db_user,db_password,dialect, defaultContext, inferredContext));
     }
 
+    public KiWiStore(KiWiConfiguration configuration) {
+        this(new KiWiPersistence(configuration), configuration.getDefaultContext(), configuration.getInferredContext());
+    }
 
     /**
      * Do store-specific operations to initialize the store. The default
@@ -112,9 +116,11 @@ public class KiWiStore extends NotifyingSailBase {
      */
     @Override
     protected void initializeInternal() throws SailException {
+        tripleRegistry  = new MapMaker().weakValues().makeMap();
+
         try {
-            persistence.initDatabase();
             persistence.initialise();
+            persistence.initDatabase();
 
             initialized = true;
         } catch (SQLException e) {
@@ -168,15 +174,19 @@ public class KiWiStore extends NotifyingSailBase {
     protected void shutDownInternal() throws SailException {
         closeValueFactory();
         persistence.shutdown();
+        tripleRegistry = null;
+        initialized = false;
     }
 
     /**
      * In case there is a value factory managed by this repository directly, close it (and the underlying database
      * connection)
      */
-    public void closeValueFactory() {
+    public synchronized void closeValueFactory() {
         if(repositoryValueFactory != null) {
+            repositoryValueFactory.close();
             repositoryValueFactory = null;
+            persistence.setValueFactory(null);
         }
 
     }
@@ -197,11 +207,31 @@ public class KiWiStore extends NotifyingSailBase {
      * @return a ValueFactory object for this Sail object.
      */
     @Override
-    public ValueFactory getValueFactory() {
+    public synchronized ValueFactory getValueFactory() {
         if(repositoryValueFactory == null) {
             repositoryValueFactory = new KiWiValueFactory(this,  defaultContext);
+            persistence.setValueFactory(repositoryValueFactory);
         }
         return repositoryValueFactory;
     }
 
+    /**
+     * Manually call the garbage collector for the triple store. Otherwise it will run every hour.
+     */
+    public void garbageCollect() throws SailException {
+        try {
+            persistence.garbageCollect();
+        } catch (SQLException e) {
+            throw new SailException("error calling garbage collector",e);
+        }
+    }
+
+
+    public boolean checkConsistency() throws SailException {
+        try {
+            return persistence.checkConsistency();
+        } catch (SQLException e) {
+            throw new SailException("error calling consistency check",e);
+        }
+    }
 }

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/kiwi/kiwi-triplestore/src/main/java/org/apache/marmotta/kiwi/sail/KiWiValueFactory.java
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-triplestore/src/main/java/org/apache/marmotta/kiwi/sail/KiWiValueFactory.java b/libraries/kiwi/kiwi-triplestore/src/main/java/org/apache/marmotta/kiwi/sail/KiWiValueFactory.java
index 22038f6..9ec70fb 100644
--- a/libraries/kiwi/kiwi-triplestore/src/main/java/org/apache/marmotta/kiwi/sail/KiWiValueFactory.java
+++ b/libraries/kiwi/kiwi-triplestore/src/main/java/org/apache/marmotta/kiwi/sail/KiWiValueFactory.java
@@ -17,35 +17,26 @@
  */
 package org.apache.marmotta.kiwi.sail;
 
-import com.google.common.collect.MapMaker;
-import org.apache.commons.lang.LocaleUtils;
+import org.apache.commons.lang3.LocaleUtils;
+import org.apache.marmotta.commons.locking.ObjectLocks;
 import org.apache.marmotta.commons.sesame.model.LiteralCommons;
+import org.apache.marmotta.commons.sesame.model.LiteralKey;
 import org.apache.marmotta.commons.sesame.model.Namespaces;
 import org.apache.marmotta.commons.util.DateUtils;
 import org.apache.marmotta.kiwi.model.caching.IntArray;
 import org.apache.marmotta.kiwi.model.rdf.*;
 import org.apache.marmotta.kiwi.persistence.KiWiConnection;
-import org.openrdf.model.BNode;
-import org.openrdf.model.Literal;
-import org.openrdf.model.Resource;
-import org.openrdf.model.Statement;
-import org.openrdf.model.URI;
-import org.openrdf.model.Value;
-import org.openrdf.model.ValueFactory;
+import org.openrdf.model.*;
 import org.openrdf.model.impl.ContextStatementImpl;
-import org.openrdf.model.impl.StatementImpl;
-import org.openrdf.repository.RepositoryException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import javax.xml.datatype.XMLGregorianCalendar;
 import java.sql.SQLException;
-import java.util.Date;
-import java.util.List;
-import java.util.Locale;
-import java.util.Random;
+import java.util.*;
+import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ConcurrentMap;
-import java.util.concurrent.locks.ReentrantLock;
+import java.util.concurrent.locks.ReentrantReadWriteLock;
 
 /**
  * Add file description here!
@@ -58,7 +49,6 @@ public class KiWiValueFactory implements ValueFactory {
 
     private Random anonIdGenerator;
 
-
     /**
      * This is a hash map for storing references to resources that have not yet been persisted. It is used e.g. when
      * one or more transactions are currently active and request the creation of same resource several times
@@ -76,75 +66,88 @@ public class KiWiValueFactory implements ValueFactory {
 
     private KiWiStore store;
 
-    private ReentrantLock nodeLock;
-    private ReentrantLock tripleLock;
 
-    private ConcurrentMap<String,ReentrantLock> resourceLocks;
-    private ConcurrentMap<Object,ReentrantLock> literalLocks;
+    private ObjectLocks resourceLocks;
+    private ObjectLocks literalLocks;
 
     private String defaultContext;
 
+    private boolean batchCommit;
+
+    private int batchSize = 1000;
+
+    // the list containing the in-memory nodes that need to be committed later
+    private List<KiWiNode> nodeBatch;
+
+    // a quick lookup allowing to lookup nodes while they are not yet in the database
+    private Map<String,KiWiUriResource> batchUriLookup;
+    private Map<String,KiWiAnonResource> batchBNodeLookup;
+    private Map<String,KiWiLiteral> batchLiteralLookup;
+
+    private int poolSize = 4;
+    private int poolPosition = 0;
+
+    private ArrayList<KiWiConnection> pooledConnections;
+
+
+    private ReentrantReadWriteLock commitLock = new ReentrantReadWriteLock();
+
 
     public KiWiValueFactory(KiWiStore store, String defaultContext) {
-        nodeLock = store.nodeLock;
-        tripleLock = store.tripleLock;
-        resourceLocks = new MapMaker().weakKeys().weakValues().makeMap();
-        literalLocks  = new MapMaker().weakKeys().weakValues().makeMap();
+        resourceLocks = new ObjectLocks();
+        literalLocks  = new ObjectLocks();
 
         anonIdGenerator = new Random();
         tripleRegistry  = store.tripleRegistry;
 
         this.store          = store;
         this.defaultContext = defaultContext;
-    }
 
-    protected KiWiConnection aqcuireConnection() {
+        // batch commits
+        this.nodeBatch      = Collections.synchronizedList(new ArrayList<KiWiNode>(batchSize));
+
+        this.batchCommit    = store.getPersistence().getConfiguration().isBatchCommit();
+        this.batchSize      = store.getPersistence().getConfiguration().getBatchSize();
+
+        this.batchUriLookup     = new ConcurrentHashMap<String,KiWiUriResource>();
+        this.batchBNodeLookup   = new ConcurrentHashMap<String, KiWiAnonResource>();
+        this.batchLiteralLookup = new ConcurrentHashMap<String,KiWiLiteral>();
+
+        this.pooledConnections = new ArrayList<>(poolSize);
         try {
-            KiWiConnection connection = store.getPersistence().getConnection();
-            return connection;
-        } catch(SQLException ex) {
-            log.error("could not acquire database connection",ex);
-            throw new RuntimeException(ex);
+            for(int i = 0; i<poolSize ; i++) {
+                pooledConnections.add(store.getPersistence().getConnection());
+            }
+        } catch (SQLException e) {
+            log.error("error initialising value factory connection pool",e);
         }
     }
 
-    protected void releaseConnection(KiWiConnection con) {
+    protected KiWiConnection aqcuireConnection() {
         try {
-            con.commit();
-            con.close();
-        } catch (SQLException ex) {
-            log.error("could not release database connection", ex);
+            if(batchCommit) {
+                return pooledConnections.get(poolPosition++ % poolSize);
+            } else {
+                return store.getPersistence().getConnection();
+            }
+        } catch(SQLException ex) {
+            log.error("could not acquire database connection", ex);
             throw new RuntimeException(ex);
         }
     }
 
-    protected ReentrantLock acquireResourceLock(String uri) {
-        ReentrantLock lock;
-        synchronized (resourceLocks) {
-            lock = resourceLocks.get(uri);
-            if(lock == null) {
-                lock = new ReentrantLock();
-                resourceLocks.put(uri,lock);
+    protected void releaseConnection(KiWiConnection con) {
+        if(!batchCommit) {
+            try {
+                con.commit();
+                con.close();
+            } catch (SQLException ex) {
+                log.error("could not release database connection", ex);
+                throw new RuntimeException(ex);
             }
         }
-        lock.lock();
-
-        return lock;
     }
 
-    protected ReentrantLock acquireLiteralLock(Object value) {
-        ReentrantLock lock;
-        synchronized (literalLocks) {
-            lock = literalLocks.get(value);
-            if(lock == null) {
-                lock = new ReentrantLock();
-                literalLocks.put(value,lock);
-            }
-        }
-        lock.lock();
-
-        return lock;
-    }
     /**
      * Creates a new bNode.
      *
@@ -163,27 +166,63 @@ public class KiWiValueFactory implements ValueFactory {
      */
     @Override
     public URI createURI(String uri) {
+        commitLock.readLock().lock();
+
+        resourceLocks.lock(uri);
 
-        ReentrantLock lock = acquireResourceLock(uri);
-        KiWiConnection connection = aqcuireConnection();
         try {
-            // first look in the registry for newly created resources if the resource has already been created and
-            // is still volatile
-            KiWiUriResource result = connection.loadUriResource(uri);
+            KiWiUriResource result = batchUriLookup.get(uri);
 
-            if(result == null) {
-                result = new KiWiUriResource(uri);
-                connection.storeNode(result);
-            }
+            if(result != null) {
+                return result;
+            } else {
 
-            return result;
-        } catch (SQLException e) {
-            log.error("database error, could not load URI resource",e);
-            throw new IllegalStateException("database error, could not load URI resource",e);
+                KiWiConnection connection = aqcuireConnection();
+                try {
+                    // first look in the registry for newly created resources if the resource has already been created and
+                    // is still volatile
+                    result = connection.loadUriResource(uri);
+
+                    if(result == null) {
+                        result = new KiWiUriResource(uri);
+
+                        if(batchCommit) {
+                            result.setId(connection.getNodeId());
+                            batchUriLookup.put(uri, result);
+
+                            nodeBatch.add(result);
+
+                        } else {
+                            connection.storeNode(result, false);
+                        }
+
+                    }
+                    if(result.getId() == null) {
+                        log.error("node ID is null!");
+                    }
+
+                    return result;
+                } catch (SQLException e) {
+                    log.error("database error, could not load URI resource",e);
+                    throw new IllegalStateException("database error, could not load URI resource",e);
+                } finally {
+                    releaseConnection(connection);
+                }
+            }
         } finally {
-            releaseConnection(connection);
-            lock.unlock();
+            resourceLocks.unlock(uri);
+            commitLock.readLock().unlock();
+
+            try {
+                if(nodeBatch.size() >= batchSize) {
+                    flushBatch();
+                }
+            } catch (SQLException e) {
+                log.error("database error, could not load URI resource",e);
+                throw new IllegalStateException("database error, could not load URI resource",e);
+            }
         }
+
     }
 
     /**
@@ -213,25 +252,56 @@ public class KiWiValueFactory implements ValueFactory {
      */
     @Override
     public BNode createBNode(String nodeID) {
-        nodeLock.lock();
-        KiWiConnection connection = aqcuireConnection();
+        commitLock.readLock().lock();
+        resourceLocks.lock(nodeID);
+
         try {
-            // first look in the registry for newly created resources if the resource has already been created and
-            // is still volatile
-            KiWiAnonResource result = connection.loadAnonResource(nodeID);
+            KiWiAnonResource result = batchBNodeLookup.get(nodeID);
 
-            if(result == null) {
-                result = new KiWiAnonResource(nodeID);
-                connection.storeNode(result);
+            if(result != null) {
+                return result;
+            } else {
+                KiWiConnection connection = aqcuireConnection();
+                try {
+                    // first look in the registry for newly created resources if the resource has already been created and
+                    // is still volatile
+                    result = connection.loadAnonResource(nodeID);
+
+                    if(result == null) {
+                        result = new KiWiAnonResource(nodeID);
+
+                        if(batchCommit) {
+                            result.setId(connection.getNodeId());
+                            nodeBatch.add(result);
+                            batchBNodeLookup.put(nodeID,result);
+                        } else {
+                            connection.storeNode(result, false);
+                        }
+                    }
+                    if(result.getId() == null) {
+                        log.error("node ID is null!");
+                    }
+
+                    return result;
+                } catch (SQLException e) {
+                    log.error("database error, could not load anonymous resource",e);
+                    throw new IllegalStateException("database error, could not load anonymous resource",e);
+                } finally {
+                    releaseConnection(connection);
+                }
             }
-
-            return result;
-        } catch (SQLException e) {
-            log.error("database error, could not load anonymous resource",e);
-            throw new IllegalStateException("database error, could not load anonymous resource",e);
         } finally {
-            releaseConnection(connection);
-            nodeLock.unlock();
+            resourceLocks.unlock(nodeID);
+            commitLock.readLock().unlock();
+
+            try {
+                if(nodeBatch.size() >= batchSize) {
+                    flushBatch();
+                }
+            } catch (SQLException e) {
+                log.error("database error, could not load URI resource",e);
+                throw new IllegalStateException("database error, could not load URI resource",e);
+            }
         }
     }
 
@@ -260,12 +330,11 @@ public class KiWiValueFactory implements ValueFactory {
      * @return a typed literal representation of the supplied object.
      * @since 2.7.0
      */
-    @Override
     public Literal createLiteral(Object object) {
         if(object instanceof XMLGregorianCalendar) {
             return createLiteral((XMLGregorianCalendar)object);
         } else {
-            return createLiteral(object,null,null);
+            return createLiteral(object,null,LiteralCommons.getXSDType(object.getClass()));
         }
     }
 
@@ -276,7 +345,9 @@ public class KiWiValueFactory implements ValueFactory {
      */
     @Override
     public Literal createLiteral(String label) {
-        return createLiteral(label, null, LiteralCommons.getXSDType(String.class));
+        // FIXME: MARMOTTA-39 (no default datatype before RDF-1.1)
+        // return createLiteral(label, null, LiteralCommons.getXSDType(String.class));
+        return createLiteral(label, null, null);
     }
 
     /**
@@ -288,7 +359,9 @@ public class KiWiValueFactory implements ValueFactory {
      */
     @Override
     public Literal createLiteral(String label, String language) {
-        return createLiteral(label,language,LiteralCommons.getRDFLangStringType());
+        // FIXME: MARMOTTA-39 (no rdf:langString before RDF-1.1)
+        // return createLiteral(label,language,LiteralCommons.getRDFLangStringType());
+        return createLiteral(label, language, null);
     }
 
     /**
@@ -315,112 +388,173 @@ public class KiWiValueFactory implements ValueFactory {
      * @return
      */
     private <T> KiWiLiteral createLiteral(T value, String lang, String type) {
-        if (lang != null) {
-            type = LiteralCommons.getRDFLangStringType();
-        } else if(type == null) {
-            type = LiteralCommons.getXSDType(value.getClass());
+        commitLock.readLock().lock();
+        Locale locale;
+        if(lang != null) {
+            try {
+                Locale.Builder builder = new Locale.Builder();
+                builder.setLanguageTag(lang);
+                locale = builder.build(); 
+            } catch (IllformedLocaleException ex) {
+                log.warn("malformed language literal (language: {})", lang);
+                locale = null;
+                lang = null;
+            }
+        } else {
+            locale = null;
         }
 
-        KiWiLiteral result = null;
+        if (lang != null) {
+            // FIXME: MARMOTTA-39 (no rdf:langString)
+            // type = LiteralCommons.getRDFLangStringType();
+        } else if (type == null) {
+            // FIXME: MARMOTTA-39 (no default datatype before RDF-1.1)
+            // type = LiteralCommons.getXSDType(value.getClass());
+        }
+        String key = LiteralCommons.createCacheKey(value.toString(),locale,type);
+        LiteralKey lkey = new LiteralKey(value,type,lang);
 
-        final KiWiUriResource rtype = (KiWiUriResource)createURI(type);
-        final Locale locale;
-        if(lang != null) {
-            locale = LocaleUtils.toLocale(lang);
-        } else
-            locale  = null;
+        literalLocks.lock(lkey);
 
-        ReentrantLock lock = acquireLiteralLock(value);
-        KiWiConnection connection = aqcuireConnection();
         try {
+            KiWiLiteral result = batchLiteralLookup.get(key);
 
 
-            // differentiate between the different types of the value
-            if(value instanceof Date || type.equals(Namespaces.NS_XSD+"dateTime")) {
-                // parse if necessary
-                final Date dvalue;
-                if(value instanceof Date) {
-                    dvalue = (Date)value;
-                } else {
-                    dvalue = DateUtils.parseDate(value.toString());
-                }
-
-                result = connection.loadLiteral(dvalue);
-
-                if(result == null) {
-                    result= new KiWiDateLiteral(dvalue, rtype);
-                }
-            } else if(Integer.class.equals(value.getClass()) || int.class.equals(value.getClass())  ||
-                    Long.class.equals(value.getClass())    || long.class.equals(value.getClass()) ||
-                    type.equals(Namespaces.NS_XSD+"integer") || type.equals(Namespaces.NS_XSD+"long")) {
-                long ivalue = 0;
-                if(Integer.class.equals(value.getClass()) || int.class.equals(value.getClass())) {
-                    ivalue = (Integer)value;
-                } else if(Long.class.equals(value.getClass()) || long.class.equals(value.getClass())) {
-                    ivalue = (Long)value;
-                } else {
-                    ivalue = Long.parseLong(value.toString());
-                }
-
-
-                result = connection.loadLiteral(ivalue);
-
-                if(result == null) {
-                    result= new KiWiIntLiteral(ivalue, rtype);
-                }
-            } else if(Double.class.equals(value.getClass())   || double.class.equals(value.getClass())  ||
-                    Float.class.equals(value.getClass())    || float.class.equals(value.getClass()) ||
-                    type.equals(Namespaces.NS_XSD+"double") || type.equals(Namespaces.NS_XSD+"float")) {
-                double dvalue = 0.0;
-                if(Float.class.equals(value.getClass()) || float.class.equals(value.getClass())) {
-                    dvalue = (Float)value;
-                } else if(Double.class.equals(value.getClass()) || double.class.equals(value.getClass())) {
-                    dvalue = (Double)value;
-                } else {
-                    dvalue = Double.parseDouble(value.toString());
-                }
-
-
-                result = connection.loadLiteral(dvalue);
-
-                if(result == null) {
-                    result= new KiWiDoubleLiteral(dvalue, rtype);
-                }
-            } else if(Boolean.class.equals(value.getClass())   || boolean.class.equals(value.getClass())  ||
-                    type.equals(Namespaces.NS_XSD+"boolean")) {
-                boolean bvalue = false;
-                if(Boolean.class.equals(value.getClass())   || boolean.class.equals(value.getClass())) {
-                    bvalue = (Boolean)value;
-                } else {
-                    bvalue = Boolean.parseBoolean(value.toString());
-                }
-
-
-                result = connection.loadLiteral(bvalue);
-
-                if(result == null) {
-                    result= new KiWiBooleanLiteral(bvalue, rtype);
-                }
+            if(result != null) {
+                return result;
             } else {
-                result = connection.loadLiteral(value.toString(), lang, rtype);
-
-                if(result == null) {
-                    result = new KiWiStringLiteral(value.toString(), locale, rtype);
+                final KiWiUriResource rtype = type==null?null:(KiWiUriResource)createURI(type);
+
+                final KiWiConnection connection = aqcuireConnection();
+                try {
+
+                    try {
+                        // differentiate between the different types of the value
+                        if (type == null) {
+                            // FIXME: MARMOTTA-39 (this is to avoid a NullPointerException in the following if-clauses)
+                            result = connection.loadLiteral(value.toString(), lang, rtype);
+
+                            if(result == null) {
+                                result = new KiWiStringLiteral(value.toString(), locale, rtype);
+                            }
+                        } else if(value instanceof Date || type.equals(Namespaces.NS_XSD+"dateTime")) {
+                            // parse if necessary
+                            final Date dvalue;
+                            if(value instanceof Date) {
+                                dvalue = (Date)value;
+                            } else {
+                                dvalue = DateUtils.parseDate(value.toString());
+                            }
+
+                            result = connection.loadLiteral(dvalue);
+
+                            if(result == null) {
+                                result= new KiWiDateLiteral(dvalue, rtype);
+                            }
+                        } else if(Integer.class.equals(value.getClass()) || int.class.equals(value.getClass())  ||
+                                Long.class.equals(value.getClass())    || long.class.equals(value.getClass()) ||
+                                type.equals(Namespaces.NS_XSD+"integer") || type.equals(Namespaces.NS_XSD+"long")) {
+                            long ivalue = 0;
+                            if(Integer.class.equals(value.getClass()) || int.class.equals(value.getClass())) {
+                                ivalue = (Integer)value;
+                            } else if(Long.class.equals(value.getClass()) || long.class.equals(value.getClass())) {
+                                ivalue = (Long)value;
+                            } else {
+                                ivalue = Long.parseLong(value.toString());
+                            }
+
+
+                            result = connection.loadLiteral(ivalue);
+
+                            if(result == null) {
+                                result= new KiWiIntLiteral(ivalue, rtype);
+                            }
+                        } else if(Double.class.equals(value.getClass())   || double.class.equals(value.getClass())  ||
+                                Float.class.equals(value.getClass())    || float.class.equals(value.getClass()) ||
+                                type.equals(Namespaces.NS_XSD+"double") || type.equals(Namespaces.NS_XSD+"float")) {
+                            double dvalue = 0.0;
+                            if(Float.class.equals(value.getClass()) || float.class.equals(value.getClass())) {
+                                dvalue = (Float)value;
+                            } else if(Double.class.equals(value.getClass()) || double.class.equals(value.getClass())) {
+                                dvalue = (Double)value;
+                            } else {
+                                dvalue = Double.parseDouble(value.toString());
+                            }
+
+
+                            result = connection.loadLiteral(dvalue);
+
+                            if(result == null) {
+                                result= new KiWiDoubleLiteral(dvalue, rtype);
+                            }
+                        } else if(Boolean.class.equals(value.getClass())   || boolean.class.equals(value.getClass())  ||
+                                type.equals(Namespaces.NS_XSD+"boolean")) {
+                            boolean bvalue = false;
+                            if(Boolean.class.equals(value.getClass())   || boolean.class.equals(value.getClass())) {
+                                bvalue = (Boolean)value;
+                            } else {
+                                bvalue = Boolean.parseBoolean(value.toString());
+                            }
+
+
+                            result = connection.loadLiteral(bvalue);
+
+                            if(result == null) {
+                                result= new KiWiBooleanLiteral(bvalue, rtype);
+                            }
+                        } else {
+                            result = connection.loadLiteral(value.toString(), lang, rtype);
+
+                            if(result == null) {
+                                result = new KiWiStringLiteral(value.toString(), locale, rtype);
+                            }
+                        }
+                    } catch(IllegalArgumentException ex) {
+                        // malformed number or date
+                        log.warn("malformed argument for typed literal of type {}: {}", rtype.stringValue(), value);
+                        KiWiUriResource mytype = (KiWiUriResource)createURI(Namespaces.NS_XSD+"string");
+
+                        result = connection.loadLiteral(value.toString(), lang, mytype);
+
+                        if(result == null) {
+                            result = new KiWiStringLiteral(value.toString(), locale, mytype);
+                        }
+
+                    }
+
+                    if(result.getId() == null) {
+                        if(batchCommit) {
+                            result.setId(connection.getNodeId());
+                            batchLiteralLookup.put(key, result);
+
+                            nodeBatch.add(result);
+                        } else {
+                            connection.storeNode(result, false);
+                        }
+                    }
+
+                    return result;
+
+
+                } catch (SQLException e) {
+                    log.error("database error, could not load literal",e);
+                    throw new IllegalStateException("database error, could not load literal",e);
+                } finally {
+                    releaseConnection(connection);
                 }
             }
+        } finally {
+            literalLocks.unlock(lkey);
+            commitLock.readLock().unlock();
 
-            if(result.getId() == null) {
-                connection.storeNode(result);
+            try {
+                if(nodeBatch.size() >= batchSize) {
+                    flushBatch();
+                }
+            } catch (SQLException e) {
+                log.error("database error, could not load URI resource",e);
+                throw new IllegalStateException("database error, could not load URI resource",e);
             }
-
-            return result;
-
-        } catch (SQLException e) {
-            log.error("database error, could not load literal",e);
-            throw new IllegalStateException("database error, could not load literal",e);
-        } finally {
-            releaseConnection(connection);
-            lock.unlock();
         }
     }
 
@@ -532,7 +666,11 @@ public class KiWiValueFactory implements ValueFactory {
      */
     @Override
     public Statement createStatement(Resource subject, URI predicate, Value object) {
-        return createStatement(subject, predicate, object, createURI(defaultContext));
+        if(defaultContext != null) {
+            return createStatement(subject, predicate, object, createURI(defaultContext));
+        } else {
+            return createStatement(subject, predicate, object, null);
+        }
     }
 
     /**
@@ -548,41 +686,6 @@ public class KiWiValueFactory implements ValueFactory {
     @Override
     public Statement createStatement(Resource subject, URI predicate, Value object, Resource context) {
         return new ContextStatementImpl(subject,predicate,object,context);
-        /*
-        tripleLock.lock();
-        KiWiConnection connection = aqcuireConnection();
-        try {
-            IntArray cacheKey = IntArray.createSPOCKey(subject,predicate,object,context);
-            Statement result = tripleRegistry.get(cacheKey);
-            if(result == null || ((KiWiTriple)result).isDeleted()) {
-                KiWiResource ksubject   = convert(subject);
-                KiWiUriResource kpredicate = convert(predicate);
-                KiWiNode kobject    = convert(object);
-                KiWiResource    kcontext   = convert(context);
-
-                // test if the triple already exists in the database; if yes, return it
-                List<Statement> triples = connection.listTriples(ksubject,kpredicate,kobject,kcontext,true).asList();
-                if(triples.size() == 1) {
-                    result = triples.get(0);
-                } else {
-                    result = new KiWiTriple(ksubject,kpredicate,kobject,kcontext);
-                    ((KiWiTriple)result).setMarkedForReasoning(true);
-                }
-
-                tripleRegistry.put(cacheKey,result);
-            }
-            return result;
-        } catch (SQLException e) {
-            log.error("database error, could not load triple", e);
-            throw new IllegalStateException("database error, could not load triple",e);
-        } catch (RepositoryException e) {
-            log.error("database error, could not load triple", e);
-            throw new IllegalStateException("database error, could not load triple",e);
-        } finally {
-            releaseConnection(connection);
-            tripleLock.unlock();
-        }
-        */
     }
 
     /**
@@ -597,22 +700,19 @@ public class KiWiValueFactory implements ValueFactory {
      * @return The created statement.
      */
     public Statement createStatement(Resource subject, URI predicate, Value object, Resource context, KiWiConnection connection) {
-        IntArray cacheKey = IntArray.createSPOCKey(subject,predicate,object,context);
-        Statement result = tripleRegistry.get(cacheKey);
+        IntArray cacheKey = IntArray.createSPOCKey(subject, predicate, object, context);
+        KiWiTriple result = (KiWiTriple)tripleRegistry.get(cacheKey);
         try {
-            if(result == null || ((KiWiTriple)result).isDeleted()) {
+            if(result == null || result.isDeleted()) {
                 KiWiResource ksubject   = convert(subject);
                 KiWiUriResource kpredicate = convert(predicate);
                 KiWiNode kobject    = convert(object);
                 KiWiResource    kcontext   = convert(context);
 
-                // test if the triple already exists in the database; if yes, return it
-                List<Statement> triples = connection.listTriples(ksubject,kpredicate,kobject,kcontext,true).asList();
-                if(triples.size() == 1) {
-                    result = triples.get(0);
-                } else {
-                    result = new KiWiTriple(ksubject,kpredicate,kobject,kcontext);
-                    ((KiWiTriple)result).setMarkedForReasoning(true);
+                result = new KiWiTriple(ksubject,kpredicate,kobject,kcontext);
+                result.setId(connection.getTripleId(ksubject,kpredicate,kobject,kcontext,true));
+                if(result.getId() == null) {
+                    result.setMarkedForReasoning(true);
                 }
 
                 tripleRegistry.put(cacheKey,result);
@@ -621,12 +721,18 @@ public class KiWiValueFactory implements ValueFactory {
         } catch (SQLException e) {
             log.error("database error, could not load triple", e);
             throw new IllegalStateException("database error, could not load triple",e);
-        } catch (RepositoryException e) {
-            log.error("database error, could not load triple", e);
-            throw new IllegalStateException("database error, could not load triple",e);
         }
     }
 
+    /**
+     * Remove a statement from the triple registry. Called when the statement is deleted and the transaction commits.
+     * @param triple
+     */
+    protected void removeStatement(KiWiTriple triple) {
+        IntArray cacheKey = IntArray.createSPOCKey(triple.getSubject(), triple.getPredicate(), triple.getObject(), triple.getContext());
+        tripleRegistry.remove(cacheKey);
+        triple.setDeleted(true);
+    }
 
 
     public KiWiResource convert(Resource r) {
@@ -654,4 +760,87 @@ public class KiWiValueFactory implements ValueFactory {
         }
 
     }
+
+    public boolean isBatchCommit() {
+        return batchCommit;
+    }
+
+    public void setBatchCommit(boolean batchCommit) {
+        this.batchCommit = batchCommit;
+    }
+
+    public int getBatchSize() {
+        return batchSize;
+    }
+
+    public void setBatchSize(int batchSize) {
+        this.batchSize = batchSize;
+    }
+
+
+    /**
+     * Immediately flush the batch to the database using the value factory's connection. The method expects the
+     * underlying connection to start and commit the node batch.
+     */
+    public void flushBatch() throws SQLException {
+        KiWiConnection con = aqcuireConnection();
+        try {
+            flushBatch(con);
+        } finally {
+            releaseConnection(con);
+        }
+
+    }
+
+
+    /**
+     * Immediately flush the batch to the database. The method expects the underlying connection to start and commit
+     * the node batch.
+     */
+    public void flushBatch(KiWiConnection con) throws SQLException {
+        commitLock.writeLock().lock();
+        try {
+            if(batchCommit && nodeBatch.size() > 0) {
+                List<KiWiNode> processed = this.nodeBatch;
+                this.nodeBatch      = Collections.synchronizedList(new ArrayList<KiWiNode>(batchSize));
+
+                con.startNodeBatch();
+
+                for(KiWiNode n : processed) {
+                    con.storeNode(n,true);
+                }
+                batchLiteralLookup.clear();
+                batchUriLookup.clear();
+                batchBNodeLookup.clear();
+
+                con.commitNodeBatch();
+            }
+        } finally {
+            commitLock.writeLock().unlock();
+        }
+    }
+
+    public void close() {
+
+        for(KiWiConnection con : pooledConnections) {
+            try {
+                if(!con.isClosed()) {
+                    if(batchCommit && nodeBatch.size() > 0) {
+                        try {
+                            flushBatch(con);
+                        } catch (SQLException e) {
+                            log.error("error while flushing node batch",e);
+                        }
+                    }
+
+                    con.commit();
+                    con.close();
+                }
+            } catch (SQLException e) {
+                log.warn("could not close value factory connection: {}",e.getMessage());
+            }
+        }
+    }
+
+
 }

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/kiwi/kiwi-triplestore/src/main/resources/ehcache-kiwi.xml
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-triplestore/src/main/resources/ehcache-kiwi.xml b/libraries/kiwi/kiwi-triplestore/src/main/resources/ehcache-kiwi.xml
index 179f24d..9d27ef1 100644
--- a/libraries/kiwi/kiwi-triplestore/src/main/resources/ehcache-kiwi.xml
+++ b/libraries/kiwi/kiwi-triplestore/src/main/resources/ehcache-kiwi.xml
@@ -149,7 +149,7 @@ are "on" and "off".  The default is "autodetect".
        a cache from database ID to KiWiNode; should be very large since this kind of lookup is a very frequent operation
     -->
     <cache name="node-cache"
-           maxElementsInMemory="500000"
+           maxElementsInMemory="5000000"
            eternal="true"
            overflowToDisk="false"
            memoryStoreEvictionPolicy="LFU"/>
@@ -159,7 +159,7 @@ are "on" and "off".  The default is "autodetect".
         from the database by avoiding reconstructing each triple from the database result
     -->
     <cache name="triple-cache"
-           maxElementsInMemory="100000"
+           maxElementsInMemory="500000"
            overflowToDisk="false"
            timeToLiveSeconds="3600"
            memoryStoreEvictionPolicy="LFU"/>
@@ -176,7 +176,7 @@ are "on" and "off".  The default is "autodetect".
 
     <!-- a cache from URI to KiWiUriResource -->
     <cache name="uri-cache"
-           maxElementsInMemory="50000"
+           maxElementsInMemory="500000"
            eternal="true"
            overflowToDisk="false"
            memoryStoreEvictionPolicy="LFU"/>

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/kiwi/kiwi-triplestore/src/main/resources/org/apache/marmotta/kiwi/persistence/h2/create_base_tables.sql
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-triplestore/src/main/resources/org/apache/marmotta/kiwi/persistence/h2/create_base_tables.sql b/libraries/kiwi/kiwi-triplestore/src/main/resources/org/apache/marmotta/kiwi/persistence/h2/create_base_tables.sql
index 0e4fed5..3493187 100644
--- a/libraries/kiwi/kiwi-triplestore/src/main/resources/org/apache/marmotta/kiwi/persistence/h2/create_base_tables.sql
+++ b/libraries/kiwi/kiwi-triplestore/src/main/resources/org/apache/marmotta/kiwi/persistence/h2/create_base_tables.sql
@@ -20,7 +20,7 @@ CREATE SEQUENCE seq_namespaces;
 CREATE TABLE nodes (
   id        bigint     NOT NULL,
   ntype     char(8)    NOT NULL,
-  svalue    varchar(65536) NOT NULL,
+  svalue    varchar(2147483647) NOT NULL,
   dvalue    double precision,
   ivalue    bigint,
   tvalue    timestamp,
@@ -36,7 +36,7 @@ CREATE TABLE triples (
   subject   bigint     NOT NULL REFERENCES nodes(id),
   predicate bigint     NOT NULL REFERENCES nodes(id),
   object    bigint     NOT NULL REFERENCES nodes(id),
-  context   bigint     NOT NULL REFERENCES nodes(id),
+  context   bigint     REFERENCES nodes(id),
   creator   bigint     REFERENCES nodes(id),
   inferred  boolean    DEFAULT false,
   deleted   boolean    DEFAULT false,
@@ -66,18 +66,13 @@ CREATE TABLE metadata (
 CREATE INDEX idx_node_content ON nodes(svalue);
 CREATE INDEX idx_literal_lang ON nodes(lang);
 
-CREATE INDEX idx_triples_s ON triples(subject);
-CREATE INDEX idx_triples_o ON triples(object);
-CREATE INDEX idx_triples_sp ON triples(subject,predicate);
-CREATE INDEX idx_triples_po ON triples(predicate,object);
 CREATE INDEX idx_triples_spo ON triples(subject,predicate,object);
-CREATE INDEX idx_triples_cs ON triples(context,subject);
-CREATE INDEX idx_triples_csp ON triples(context,subject,predicate);
+CREATE INDEX idx_triples_op ON triples(object,predicate);
 CREATE INDEX idx_triples_cspo ON triples(context,subject,predicate,object);
 
 CREATE INDEX idx_namespaces_uri ON namespaces(uri);
 CREATE INDEX idx_namespaces_prefix ON namespaces(prefix);
 
 -- insert initial metadata
-INSERT INTO metadata(mkey,mvalue) VALUES ('version','1');
+INSERT INTO metadata(mkey,mvalue) VALUES ('version','2');
 INSERT INTO metadata(mkey,mvalue) VALUES ('created',FORMATDATETIME(now(),'yyyy-MM-dd HH:mm:ss z','en') );
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/kiwi/kiwi-triplestore/src/main/resources/org/apache/marmotta/kiwi/persistence/h2/drop_base_tables.sql
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-triplestore/src/main/resources/org/apache/marmotta/kiwi/persistence/h2/drop_base_tables.sql b/libraries/kiwi/kiwi-triplestore/src/main/resources/org/apache/marmotta/kiwi/persistence/h2/drop_base_tables.sql
index bf3d7e4..41ca5f7 100644
--- a/libraries/kiwi/kiwi-triplestore/src/main/resources/org/apache/marmotta/kiwi/persistence/h2/drop_base_tables.sql
+++ b/libraries/kiwi/kiwi-triplestore/src/main/resources/org/apache/marmotta/kiwi/persistence/h2/drop_base_tables.sql
@@ -16,13 +16,8 @@
 DROP INDEX IF EXISTS idx_node_content;
 DROP INDEX IF EXISTS idx_literal_lang;
 
-DROP INDEX IF EXISTS idx_triples_s;
-DROP INDEX IF EXISTS idx_triples_o;
-DROP INDEX IF EXISTS idx_triples_sp;
-DROP INDEX IF EXISTS idx_triples_po;
+DROP INDEX IF EXISTS idx_triples_op;
 DROP INDEX IF EXISTS idx_triples_spo;
-DROP INDEX IF EXISTS idx_triples_cs;
-DROP INDEX IF EXISTS idx_triples_csp;
 DROP INDEX IF EXISTS idx_triples_cspo;
 
 DROP INDEX IF EXISTS idx_namespaces_uri;


[070/100] [abbrv] git commit: MARMOTTA-339: Not building the assembly for ldpath breaks the release - use attach=false if you do not want to deploy the artifact.

Posted by wi...@apache.org.
MARMOTTA-339: Not building the assembly for ldpath breaks the release - use attach=false if you do not want to deploy the artifact.


Project: http://git-wip-us.apache.org/repos/asf/marmotta/repo
Commit: http://git-wip-us.apache.org/repos/asf/marmotta/commit/76ea6b55
Tree: http://git-wip-us.apache.org/repos/asf/marmotta/tree/76ea6b55
Diff: http://git-wip-us.apache.org/repos/asf/marmotta/diff/76ea6b55

Branch: refs/heads/ldp
Commit: 76ea6b5501c4b40b206d720aa8267819a2b46265
Parents: 994caea
Author: Jakob Frank <ja...@apache.org>
Authored: Wed Apr 9 09:34:19 2014 +0200
Committer: Jakob Frank <ja...@apache.org>
Committed: Wed Apr 9 09:34:19 2014 +0200

----------------------------------------------------------------------
 libraries/ldpath/ldpath-backend-linkeddata/pom.xml | 4 ++++
 1 file changed, 4 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/marmotta/blob/76ea6b55/libraries/ldpath/ldpath-backend-linkeddata/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-backend-linkeddata/pom.xml b/libraries/ldpath/ldpath-backend-linkeddata/pom.xml
index c7a167a..81abf13 100644
--- a/libraries/ldpath/ldpath-backend-linkeddata/pom.xml
+++ b/libraries/ldpath/ldpath-backend-linkeddata/pom.xml
@@ -157,12 +157,16 @@
                         <artifactId>maven-assembly-plugin</artifactId>
                         <executions>
                             <execution>
+                                <goals>
+                                    <goal>single</goal>
+                                </goals>
                                 <phase>package</phase>
                                 <configuration>
                                     <descriptors>
                                         <descriptor>assembly.xml</descriptor>
                                     </descriptors>
                                     <finalName>apache-marmotta-${project.version}</finalName>
+                                    <attach>false</attach>
                                 </configuration>
                             </execution>
                         </executions>


[092/100] [abbrv] git commit: backport: fix postgres validation query (MARMOTTA-498)

Posted by wi...@apache.org.
backport: fix postgres validation query (MARMOTTA-498)

(cherry picked from commit dfde1a8ea61dbbd43318af63b7278d42beddc38d)
Signed-off-by: Jakob Frank <ja...@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/marmotta/repo
Commit: http://git-wip-us.apache.org/repos/asf/marmotta/commit/9198e978
Tree: http://git-wip-us.apache.org/repos/asf/marmotta/tree/9198e978
Diff: http://git-wip-us.apache.org/repos/asf/marmotta/diff/9198e978

Branch: refs/heads/ldp
Commit: 9198e978cc3f5f6c2432083a7d050e81134a4cf3
Parents: 5e385b5
Author: Sebastian Schaffert <ss...@apache.org>
Authored: Thu May 15 15:16:53 2014 +0200
Committer: Jakob Frank <ja...@apache.org>
Committed: Mon May 19 14:45:27 2014 +0200

----------------------------------------------------------------------
 .../apache/marmotta/kiwi/persistence/pgsql/PostgreSQLDialect.java  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/marmotta/blob/9198e978/libraries/kiwi/kiwi-triplestore/src/main/java/org/apache/marmotta/kiwi/persistence/pgsql/PostgreSQLDialect.java
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-triplestore/src/main/java/org/apache/marmotta/kiwi/persistence/pgsql/PostgreSQLDialect.java b/libraries/kiwi/kiwi-triplestore/src/main/java/org/apache/marmotta/kiwi/persistence/pgsql/PostgreSQLDialect.java
index b5ed078..556a5d5 100644
--- a/libraries/kiwi/kiwi-triplestore/src/main/java/org/apache/marmotta/kiwi/persistence/pgsql/PostgreSQLDialect.java
+++ b/libraries/kiwi/kiwi-triplestore/src/main/java/org/apache/marmotta/kiwi/persistence/pgsql/PostgreSQLDialect.java
@@ -131,7 +131,7 @@ public class PostgreSQLDialect extends KiWiDialect {
      */
     @Override
     public String getValidationQuery() {
-        return "SELECT 1";
+        return "SELECT 1; COMMIT;";
     }
 
     /**


[004/100] [abbrv] [partial] Reverting the erroneous merge by Sebastian according to the instructions in INFRA-6876

Posted by wi...@apache.org.
http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/platform/marmotta-core/src/main/resources/web/admin/js/lib/sgvizler.pack.js
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/resources/web/admin/js/lib/sgvizler.pack.js b/platform/marmotta-core/src/main/resources/web/admin/js/lib/sgvizler.pack.js
deleted file mode 100644
index b847cc2..0000000
--- a/platform/marmotta-core/src/main/resources/web/admin/js/lib/sgvizler.pack.js
+++ /dev/null
@@ -1,1294 +0,0 @@
-/*  Sgvizler JavaScript SPARQL result set visualizer, version 0.5.1
- *  (c) 2011--2012 Martin G. Skjæveland
- *
- *  Sgvizler is freely distributable under the terms of an MIT-style license.
- *  Sgvizler web site: https://code.google.com/p/sgvizler/
- *--------------------------------------------------------------------------*/
-(function (global) {
-    "use strict";
-
-    /*global google, $, jQuery */
-    /*jslint browser: true */
-
-    var sgvizler = {
-
-        go: function (callback) {
-            this.loadLibs();
-
-            google.load('visualization',
-                        '1.0',
-                        {'packages':
-                         ['annotatedtimeline',
-                          'corechart',
-                          'gauge',
-                          'geomap',
-                          'geochart',
-                          'imagesparkline',
-                          'map',
-                          'orgchart',
-                          'table',
-                          'motionchart',
-                          'treemap'
-                         ]
-                        }
-                       );
-
-            google.setOnLoadCallback(function () {
-                sgvizler.charts.loadCharts();
-                sgvizler.drawFormQuery();
-                sgvizler.drawContainerQueries();
-                callback();
-            });
-        },
-
-        loadLibs: function () {
-            var i, libs = ['d3.v2.min.js', 'raphael-dracula.pack.min.js'];
-            if (sgvizler.ui.isElement(sgvizler.ui.id.script)) {
-                this.option.homefolder = $('#' + sgvizler.ui.id.script).attr('src').replace(/sgvizler\.pack\.js$/, "");
-                this.option.libfolder = this.option.homefolder + "/js/lib/";
-            }
-            // load "child" scripts
-            for (i = 0; i < libs.length; i += 1) {
-                $.ajax(this.option.libfolder + libs[i], { dataType: "script", async: false });
-            }
-
-            // load stylesheet
-            $('head').append('<link rel="stylesheet" href="'+this.option.stylepath+'sgvizler.chart.css" type="text/css" />');
-        },
-
-        drawFormQuery: function () {
-            var query = new sgvizler.query(sgvizler.ui.id.chartCon),
-                params = sgvizler.ui.getUrlParams();
-            $.extend(query,
-                     sgvizler.option.query,
-                     { query: params.query, chart: params.chart });
-
-            if (sgvizler.ui.isElement(query.container) && query.query) {
-                $.extend(query.chartOptions,
-                         { width: params.width, height: params.height });
-                query.draw();
-            }
-            sgvizler.ui.displayUI(query);
-        },
-
-        drawContainerQueries: function () {
-            $('[' + this.ui.attr.prefix + 'query]').each(function () {
-                var query = new sgvizler.query();
-                $.extend(query,
-                         sgvizler.option.query,
-                         sgvizler.ui.getQueryOptionAttr(this));
-                $.extend(query.chartOptions,
-                         sgvizler.ui.getChartOptionAttr(this));
-                query.draw();
-            });
-        },
-
-        // kept in separate files:
-        option: {},   // settings, global variables.
-        chart: {},    // the set of user-defined rendering functions.
-        charts: {},   // functions for handling rendering functions.
-        parser: {},   // SPARQL results XML/JSON parser.
-        ui: {}       // html get/set functions.
-    };
-
-    jQuery.ajaxSetup({
-        accepts: {
-            xml:  "application/sparql-results+xml",
-            json: "application/sparql-results+json"
-        }
-    });
-    sgvizler.option = {
-
-        home: (window.location.href).replace(window.location.search, ""),
-        homefolder: "",
-        libfolder: "/lib/",
-
-        stylepath:"",
-
-        //// Prefixes included in queries:
-        namespace: {
-            'rdf' : "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
-            'rdfs': "http://www.w3.org/2000/01/rdf-schema#",
-            'owl' : "http://www.w3.org/2002/07/owl#",
-            'xsd' : "http://www.w3.org/2001/XMLSchema#"
-        },
-
-        query: {}, // holds options set by user in html file.
-        chart: {}  // ditto.
-    };
-    sgvizler.ui = {
-
-        //// #id's to html elements:
-        id: {
-            script:       'sgvzlr_script',    // #id to the script tag for this file
-            chartCon:     'sgvzlr_gchart',    // #id to the container to hold the chart
-            queryForm:    'sgvzlr_formQuery', //
-            queryTxt:     'sgvzlr_cQuery',    // query text area.
-            formQuery:    'sgvzlr_strQuery',  // hidden query string. "trick" taken from snorql.
-            formWidth:    'sgvzlr_strWidth',  //
-            formHeight:   'sgvzlr_strHeight', //
-            formChart:    'sgvzlr_optChart',  //
-            prefixCon:    'sgvzlr_cPrefix',   // print prefixes
-            messageCon:   'sgvzlr_cMessage'  // print messages
-        },
-
-        attr: {
-            prefix:      'data-sgvizler-',
-            prefixChart: 'data-sgvizler-chart-options',
-
-            valueAssign: '=',
-            valueSplit:  '|'
-        },
-
-        params: [ 'query', 'chart', 'width', 'height' ], // permissible URL parameters.
-
-        displayUI: function (queryOpt) {
-            this.displayPrefixes();
-            this.displayChartTypesMenu();
-            this.displayUserInput(queryOpt);
-        },
-        displayPrefixes: function () {
-            this.setElementText(this.id.prefixCon, sgvizler.query.prototype.getPrefixes());
-        },
-        displayUserInput: function (queryOpt) {
-            this.setElementValue(this.id.queryTxt, queryOpt.query);
-            this.setElementValue(this.id.formChart, queryOpt.chart);
-            this.setElementValue(this.id.formWidth, queryOpt.chartOptions.width);
-            this.setElementValue(this.id.formHeight, queryOpt.chartOptions.height);
-        },
-        displayChartTypesMenu: function () {
-            var chart,
-                i;
-            if (this.isElement(this.id.formChart)) {
-                chart = sgvizler.charts.all;
-                for (i = 0; i < chart.length; i += 1) {
-                    $('#' + this.id.formChart)
-                        .append($('<option/>')
-                                .val(chart[i].id)
-                                .html(chart[i].id));
-                }
-            }
-        },
-
-        displayFeedback: function (queryOpt, messageName) {
-            var message,
-                container = queryOpt.container;
-            if (queryOpt.container === this.id.chartCon && this.isElement(this.id.messageCon)) {
-                container = this.id.messageCon;
-            }
-
-            if (queryOpt.loglevel === 0) {
-                message = "";
-            } else if (queryOpt.loglevel === 1) {
-                if (messageName === "LOADING") {
-                    message = "Loading...";
-                } else if (messageName === "ERROR_ENDPOINT" || messageName === "ERROR_UNKNOWN") {
-                    message = "Error.";
-                }
-            } else {
-                if (messageName === "LOADING") {
-                    message = "Sending query...";
-                } else if (messageName === "ERROR_ENDPOINT") {
-                    message = "Error querying endpoint. Possible errors:" +
-                        this.html.ul(
-                            this.html.a(queryOpt.endpoint, "SPARQL endpoint") + " down? " +
-                                this.html.a(queryOpt.endpoint + queryOpt.endpoint_query_url + queryOpt.encodedQuery,
-                                            "Check if query runs at the endpoint") + ".",
-                            "Malformed SPARQL query? " +
-                                this.html.a(queryOpt.validator_query_url + queryOpt.encodedQuery, "Check if it validates") + ".",
-                            "CORS supported and enabled? Read more about " +
-                                this.html.a("http://code.google.com/p/sgvizler/wiki/Compatibility", "CORS and compatibility") + ".",
-                            "Is your " + this.html.a("http://code.google.com/p/sgvizler/wiki/Compatibility", "browser support") + "ed?",
-                            "Hmm.. it might be a bug! Please file a report to " +
-                                this.html.a("http://code.google.com/p/sgvizler/issues/", "the issues") + "."
-                        );
-                } else if (messageName === "ERROR_UNKNOWN") {
-                    message = "Unknown error.";
-                } else if (messageName === "NO_RESULTS") {
-                    message = "Query returned no results.";
-                } else if (messageName === "DRAWING") {
-                    message = "Received " + queryOpt.noRows + " rows. Drawing chart...<br/>" +
-                        this.html.a(queryOpt.endpoint + queryOpt.endpoint_query_url + queryOpt.encodedQuery,
-                                    "View query results", "target='_blank'") + " (in new window).";
-                }
-            }
-            this.setElementHTML(container, this.html.tag("p", message));
-        },
-
-        setElementValue: function (elementID, value) {
-            if (this.isElement(elementID)) {
-                $('#' + elementID).val(value);
-            }
-        },
-        setElementText: function (elementID, value) {
-            if (this.isElement(elementID)) {
-                $('#' + elementID).text(value);
-            }
-        },
-        setElementHTML: function (elementID, value) {
-            if (this.isElement(elementID)) {
-                $('#' + elementID).html(value);
-            }
-        },
-        isElement: function (elementID) {
-            return $('#' + elementID).length > 0;
-        },
-
-        getQueryOptionAttr: function (element) {
-            var i,
-                queryOpt = {container: $(element).attr('id')},
-                attr = element.attributes;
-            for (i = 0; i < attr.length; i += 1) {
-                if (attr[i].name.lastIndexOf(this.attr.prefix, 0) === 0) { // starts-with attr.prefix.
-                    queryOpt[attr[i].name.substring(this.attr.prefix.length)] = attr[i].value;
-                }
-            }
-            return queryOpt;
-        },
-        getChartOptionAttr: function (element) {
-            var i,
-                options,
-                assignment,
-                path,
-                o,
-                j,
-                chartOpt = {},
-                attrValue = $(element).attr(sgvizler.ui.attr.prefixChart);
-            if (typeof attrValue !== 'undefined') {
-                options = attrValue.split(this.attr.valueSplit);
-                for (i = 0; i < options.length; i += 1) {
-                    assignment = options[i].split(this.attr.valueAssign);
-                    path = assignment[0].split(".");
-                    o = chartOpt;
-                    for (j = 0; j < path.length - 1; j += 1) {
-                        if (typeof o[path[j]] === 'undefined') {
-                            o[path[j]] = {};
-                        }
-                        o = o[path[j]];
-                    }
-                    o[path[j]] = assignment[1];
-                }
-            }
-            // get width and heigth from css. take only numbers.
-            chartOpt.width = /(\d+)/.exec($(element).css('width'))[1];
-            chartOpt.height = /(\d+)/.exec($(element).css('height'))[1];
-            return chartOpt;
-        },
-
-        getUrlParams: function () {
-            /*jslint regexp: true */
-            var urlParams = {},
-                e,
-                r = /([^&=]+)=?([^&]*)/g, // parameter, value pairs.
-                d = function (s) { return decodeURIComponent(s.replace(/\+/g, " ")); }, // replace '+' with space.
-                q = window.location.search.substring(1); // URL query string part.
-
-            while ((e = r.exec(q))) {
-                if (e[2].length > 0 && this.params.indexOf(e[1]) !== -1) {
-                    urlParams[d(e[1])] = d(e[2]);
-                }
-            }
-            return urlParams;
-        },
-
-        resetPage: function () {
-            document.location = sgvizler.home;
-        },
-        submitQuery: function () {
-            $('#' + this.id.formQuery).val($('#' + this.id.queryTxt).val());
-            $('#' + this.id.queryForm).submit();
-        },
-
-        html: {
-            a: function (href, link, attr) {
-                if (typeof attr === 'undefined') { attr = ""; }
-                if (typeof href !== 'undefined' && typeof link !== 'undefined') {
-                    return "<a " + attr + " href='" + href + "'>" + link + "</a>";
-                }
-            },
-            ul: function () {
-                var i,
-                    txt;
-                if (arguments.length) {
-                    txt = "<ul>";
-                    for (i = 0; i < arguments.length; i += 1) {
-                        txt += "<li>" + arguments[i] + "</li>";
-                    }
-                    return txt + "</ul>";
-                }
-            },
-            tag: function (tag, content) {
-                return "<" + tag + ">" + content + "</" + tag + ">";
-            }
-        }
-    };
-
-    sgvizler.parser = {
-
-        // variable notation: xtable, xcol(s), xrow(s) -- x is 's'(parql) or 'g'(oogle).
-
-        defaultGDatatype: 'string',
-
-        countRowsSparqlXML: function (sxml) {
-            return $(sxml).find('sparql').find('results').find('result').length;
-        },
-
-        countRowsSparqlJSON: function (stable) {
-            if (typeof stable.results.bindings !== 'undefined') {
-                return stable.results.bindings.length;
-            }
-        },
-
-        SparqlXML2GoogleJSON: function (sxml) {
-            var c,
-                r,
-                gcols = [],
-                grows = [],
-                gdatatype = [], // for easy reference of datatypes
-                sresults = $(sxml).find('sparql').find('results').find('result');
-
-            // gcols
-            c = 0;
-            $(sxml).find('sparql').find('head').find('variable').each(function () {
-                var stype = null,
-                    sdatatype = null,
-                    name = $(this).attr('name'),
-                    scell = null,
-                    scells = $(sresults).find('binding[name="' + name + '"]');
-                if (scells.length) {
-                    scell = $(scells).first().children().first()[0]; // uri, literal element
-                    stype = scell.nodeName;
-                    sdatatype = $(scell).attr('datatype');
-                }
-                gdatatype[c] = sgvizler.parser.getGoogleJsonDatatype(stype, sdatatype);
-                gcols[c] = {'id': name, 'label': name, 'type': gdatatype[c]};
-                c += 1;
-            });
-
-            // grows
-            r = 0;
-            $(sresults).each(function () {
-                var gvalue,
-                    scells,
-                    scell,
-                    stype,
-                    svalue,
-                    grow = [];
-                for (c = 0; c < gcols.length; c += 1) {
-                    gvalue = null;
-                    scells = $(this).find('binding[name="' + gcols[c].id + '"]');
-                    if (scells.length &&
-                            typeof $(scells).first().children().first() !== 'undefined' &&
-                            $(scells).first().children().first().firstChild !== null) {
-                        scell = $(scells).first().children().first()[0]; // uri, literal element
-                        stype = scell.nodeName;
-                        svalue = $(scell).first().text();
-                        gvalue = sgvizler.parser.getGoogleJsonValue(svalue, gdatatype[c], stype);
-                    }
-                    grow[c] = {'v': gvalue};
-                }
-                grows[r] = {'c': grow};
-                r += 1;
-            });
-            return {'cols': gcols, 'rows': grows};
-        },
-
-        SparqlJSON2GoogleJSON: function (stable) {
-            var c,
-                r,
-                srow,
-                grow,
-                gvalue,
-                stype,
-                sdatatype,
-                gcols = [],
-                grows = [],
-                gdatatype = [], // for easy reference of datatypes
-                scols = stable.head.vars,
-                srows = stable.results.bindings;
-
-            for (c = 0; c < scols.length; c += 1) {
-                r = 0;
-                stype = null;
-                sdatatype = null;
-                // find a row where there is a value for this column
-                while (typeof srows[r][scols[c]] === 'undefined' && r + 1 < srows.length) { r += 1; }
-                if (typeof srows[r][scols[c]] !== 'undefined') {
-                    stype = srows[r][scols[c]].type;
-                    sdatatype = srows[r][scols[c]].datatype;
-                }
-                gdatatype[c] = this.getGoogleJsonDatatype(stype, sdatatype);
-                gcols[c] = {'id': scols[c], 'label': scols[c], 'type': gdatatype[c]};
-            }
-
-            // loop rows
-            for (r = 0; r < srows.length; r += 1) {
-                srow = srows[r];
-                grow = [];
-                // loop cells
-                for (c = 0; c < scols.length; c += 1) {
-                    gvalue = null;
-                    if (typeof srow[scols[c]] !== 'undefined' &&
-                            typeof srow[scols[c]].value !== 'undefined') {
-                        gvalue = this.getGoogleJsonValue(srow[scols[c]].value, gdatatype[c], srow[scols[c]].type);
-                    }
-                    grow[c] = { 'v': gvalue };
-                }
-                grows[r] = {'c': grow};
-            }
-            return {'cols': gcols, 'rows': grows};
-        },
-
-        getGoogleJsonValue: function (value, gdatatype, stype) {
-            var newvalue;
-            if (gdatatype === 'number') {
-                newvalue = Number(value);
-            } else if (gdatatype === 'date') {
-                //assume format yyyy-MM-dd
-                newvalue = new Date(value.substr(0, 4),
-                                value.substr(5, 2),
-                                value.substr(8, 2));
-            } else if (gdatatype === 'datetime') {
-                //assume format yyyy-MM-ddZHH:mm:ss
-                newvalue = new Date(value.substr(0, 4),
-                                value.substr(5, 2),
-                                value.substr(8, 2),
-                                value.substr(11, 2),
-                                value.substr(14, 2),
-                                value.substr(17, 2));
-            } else if (gdatatype === 'timeofday') {
-                //assume format HH:mm:ss
-                newvalue = [value.substr(0, 2),
-                        value.substr(3, 2),
-                        value.substr(6, 2)];
-            } else { // datatype === 'string' || datatype === 'boolean'
-                if (stype === 'uri') { // replace namespace with prefix
-                    newvalue = this.prefixify(value);
-                }
-                newvalue = value;
-            }
-            return newvalue;
-        },
-
-        getGoogleJsonDatatype: function (stype, sdatatype) {
-            var gdatatype = this.defaultGDatatype,
-                xsdns = sgvizler.option.namespace.xsd;
-            if (typeof stype !== 'undefined' && (stype === 'typed-literal' || stype === 'literal')) {
-                if (sdatatype === xsdns + "float"   ||
-                        sdatatype === xsdns + "double"  ||
-                        sdatatype === xsdns + "decimal" ||
-                        sdatatype === xsdns + "int"     ||
-                        sdatatype === xsdns + "long"    ||
-                        sdatatype === xsdns + "integer") {
-                    gdatatype =  'number';
-                } else if (sdatatype === xsdns + "boolean") {
-                    gdatatype =  'boolean';
-                } else if (sdatatype === xsdns + "date") {
-                    gdatatype =  'date';
-                } else if (sdatatype === xsdns + "dateTime") {
-                    gdatatype =  'datetime';
-                } else if (sdatatype === xsdns + "time") {
-                    gdatatype =  'timeofday';
-                }
-            }
-            return gdatatype;
-        },
-
-        prefixify: function (url) {
-            var ns;
-            for (ns in sgvizler.option.namespace) {
-                if (sgvizler.option.namespace.hasOwnProperty(ns) &&
-                        url.lastIndexOf(sgvizler.option.namespace[ns], 0) === 0) {
-                    return url.replace(sgvizler.option.namespace[ns], ns + ":");
-                }
-            }
-            return url;
-        },
-        unprefixify: function (qname) {
-            var ns;
-            for (ns in sgvizler.option.namespace) {
-                if (sgvizler.option.namespace.hasOwnProperty(ns) &&
-                        qname.lastIndexOf(ns + ":", 0) === 0) {
-                    return qname.replace(ns + ":", sgvizler.option.namespace[ns]);
-                }
-            }
-            return qname;
-        }
-    };
-
-
-    /*global XDomainRequest */
-
-    sgvizler.query = function (container) {
-        this.container = container;
-
-        //defaults
-        this.query = "SELECT ?class (count(?instance) AS ?noOfInstances)\nWHERE{ ?instance a ?class }\nGROUP BY ?class\nORDER BY ?class";
-        this.endpoint = "http://sws.ifi.uio.no/sparql/world";
-        this.endpoint_output = 'json';  // xml, json, jsonp
-        this.endpoint_query_url = "?output=text&amp;query=";
-        this.validator_query_url = "http://www.sparql.org/query-validator?languageSyntax=SPARQL&amp;outputFormat=sparql&amp;linenumbers=true&amp;query=";
-        this.chart = 'gLineChart';
-        this.loglevel = 2;
-
-        this.chartOptions = {
-            'width':           '800',
-            'height':          '400',
-            'chartArea':       { left: '5%', top: '5%', width: '75%', height: '80%' },
-            'gGeoMap': {
-                'dataMode':           'markers'
-            },
-            'gMap': {
-                'dataMode':           'markers'
-            },
-            'sMap': {
-                'dataMode':           'markers',
-                'showTip':            true,
-                'useMapTypeControl':  true
-            },
-            'gSparkline': {
-                'showAxisLines':      false
-            }
-        };
-    };
-
-    sgvizler.query.prototype.draw = function (listeners,options,callback) {
-        var that = this,
-            chartFunc = sgvizler.charts.getChart(this.container, this.chart);
-        this.setChartSpecificOptions();
-        this.insertFrom();
-        $.extend(this.chartOptions,options);
-        this.runQuery(function (data) {
-            var dataTable = new google.visualization.DataTable(that.processQueryResults(data));
-            for(var listener in listeners) {
-                google.visualization.events.addListener(chartFunc, listener, function(){
-                    listeners[listener](chartFunc,dataTable);
-                });
-            }
-            chartFunc.draw(dataTable,that.chartOptions);
-            if(callback)callback(dataTable);
-        });
-    };
-
-    sgvizler.query.prototype.runQuery = function (callback) {
-        var xdr,
-            url,
-            endpoint_output = this.endpoint_output;
-        sgvizler.ui.displayFeedback(this, "LOADING");
-        this.encodedQuery = encodeURIComponent(this.getPrefixes() + this.query);
-        if (this.endpoint_output !== 'jsonp' && $.browser.msie && window.XDomainRequest) {
-            xdr = new XDomainRequest();
-            url = this.endpoint +
-                "?query=" + this.encodedQuery +
-                "&output=" + this.endpoint_output;
-            xdr.open("GET", url);
-            xdr.onload = function () {
-                var data;
-                if (endpoint_output === "xml") {
-                    data = $.parseXML(xdr.responseText);
-                } else {
-                    data = $.parseJSON(xdr.responseText);
-                }
-                callback(data);
-            };
-            xdr.send();
-        } else {
-            $.get(this.endpoint,
-                  { query: this.getPrefixes() + this.query,
-                    output: (this.endpoint_output === 'jsonp') ? 'json' : this.endpoint_output },
-                  function (data) { callback(data); },
-                  this.endpoint_output)
-                .error(function () {
-                    sgvizler.ui.displayFeedback(this, "ERROR_ENDPOINT");
-                });
-        }
-    };
-
-    sgvizler.query.prototype.processQueryResults = function (data) {
-        this.setResultRowCount(data);
-        if (this.noRows === null) {
-            sgvizler.ui.displayFeedback(this, "ERROR_UNKNOWN");
-        } else if (this.noRows === 0) {
-            sgvizler.ui.displayFeedback(this, "NO_RESULTS");
-        } else {
-            sgvizler.ui.displayFeedback(this, "DRAWING");
-            return this.getGoogleJSON(data);
-        }
-    };
-
-    sgvizler.query.prototype.setResultRowCount = function (data) {
-        if (this.endpoint_output === 'xml') {
-            this.noRows = sgvizler.parser.countRowsSparqlXML(data);
-        } else {
-            this.noRows = sgvizler.parser.countRowsSparqlJSON(data);
-        }
-    };
-
-    sgvizler.query.prototype.getGoogleJSON = function (data) {
-        if (this.endpoint_output === 'xml') {
-            data = sgvizler.parser.SparqlXML2GoogleJSON(data);
-        } else {
-            data = sgvizler.parser.SparqlJSON2GoogleJSON(data);
-        }
-        return data;
-    };
-
-    sgvizler.query.prototype.insertFrom = function () {
-        if (typeof this.rdf !== 'undefined') {
-            var i,
-                froms = this.rdf.split(sgvizler.ui.attr.valueSplit),
-                from = "";
-            for (i = 0; i < froms.length; i += 1) {
-                from += 'FROM <' + froms[i] + '>\n';
-            }
-            this.query = this.query.replace(/(WHERE)?(\s)*\{/, '\n' + from + 'WHERE {');
-        }
-    };
-
-    sgvizler.query.prototype.getPrefixes = function () {
-        var prefix,
-            prefixes = "";
-        for (prefix in sgvizler.option.namespace) {
-            if (sgvizler.option.namespace.hasOwnProperty(prefix)) {
-                prefixes += "PREFIX " + prefix + ": <" + sgvizler.option.namespace[prefix] + ">\n";
-            }
-        }
-        return prefixes;
-    };
-
-    sgvizler.query.prototype.setChartSpecificOptions = function () {
-        var level1,
-            level2;
-        for (level1 in this.chartOptions) {
-            if (this.chartOptions.hasOwnProperty(level1) &&
-                    level1 === this.chart) {
-                for (level2 in this.chartOptions[level1]) {
-                    if (this.chartOptions[level1].hasOwnProperty(level2)) {
-                        this.chartOptions[level2] = this.chartOptions[level1][level2];
-                    }
-                }
-            }
-        }
-    };
-
-    sgvizler.charts = {
-        // Package for handling rendering functions. The rendering
-        // functions themselves are kept in sgvizler.chart.*
-
-        all: [],
-
-        loadCharts: function () {
-            var googlecharts = [
-                { 'id': "gLineChart",        'func': google.visualization.LineChart },
-                { 'id': "gAreaChart",        'func': google.visualization.AreaChart },
-                { 'id': "gSteppedAreaChart", 'func': google.visualization.SteppedAreaChart },
-                { 'id': "gPieChart",         'func': google.visualization.PieChart },
-                { 'id': "gBubbleChart",      'func': google.visualization.BubbleChart },
-                { 'id': "gColumnChart",      'func': google.visualization.ColumnChart },
-                { 'id': "gBarChart",         'func': google.visualization.BarChart },
-                { 'id': "gSparkline",        'func': google.visualization.ImageSparkLine },
-                { 'id': "gScatterChart",     'func': google.visualization.ScatterChart },
-                { 'id': "gCandlestickChart", 'func': google.visualization.CandlestickChart },
-                { 'id': "gGauge",            'func': google.visualization.Gauge },
-                { 'id': "gOrgChart",         'func': google.visualization.OrgChart },
-                { 'id': "gTreeMap",          'func': google.visualization.TreeMap },
-                { 'id': "gTimeline",         'func': google.visualization.AnnotatedTimeLine },
-                { 'id': "gMotionChart",      'func': google.visualization.MotionChart },
-                { 'id': "gGeoChart",         'func': google.visualization.GeoChart },
-                { 'id': "gGeoMap",           'func': google.visualization.GeoMap },
-                { 'id': "gMap",              'func': google.visualization.Map },
-                { 'id': "gTable",            'func': google.visualization.Table }
-            ],
-                chart;
-
-            $.merge(this.all, googlecharts);
-            for (chart in sgvizler.chart) {
-                if (sgvizler.chart.hasOwnProperty(chart)) {
-                    this.register(
-                        sgvizler.chart[chart].prototype.id,
-                        sgvizler.chart[chart]
-                    );
-                }
-            }
-        },
-
-        register: function (id, func) {
-            this.all.push({'id': id, 'func': func});
-        },
-
-        getChart: function (containerId, chartId) {
-            var i,
-                container = document.getElementById(containerId);
-            for (i = 0; i < this.all.length; i += 1) {
-                if (chartId === this.all[i].id) {
-                    return new this.all[i].func(container);
-                }
-            }
-        }
-    };
-
-
-    /*global d3 */
-    /** dForceGraph **
-
-
-        D3 force directed graph. Under development.
-    */
-    sgvizler.chart.dForceGraph = function (container) { this.container = container; };
-    sgvizler.chart.dForceGraph.prototype = {
-        id:   "dForceGraph",
-        draw: function (data, chartOpt) {
-            var noColumns = data.getNumberOfColumns(),
-                noRows = data.getNumberOfRows(),
-                opt = $.extend({'maxnodesize': 15, 'minnodesize': 2 }, chartOpt), // set defaults
-                colors = d3.scale.category20(),
-                w = chartOpt.width,
-                h = chartOpt.height,
-                isNumber = function (n) {  return !isNaN(parseFloat(n)) && isFinite(n); },
-
-                // build arrays of nodes and links.
-                nodes = [],
-                edges = [],
-                t_color = {},
-                t_size = {},
-                t_maxnodesize = 0,
-
-                r,
-                source,
-                target,
-
-                nodesizeratio,
-                i,
-                color,
-                size,
-
-                vis,
-                force,
-                link,
-                node,
-                ticks;
-
-            for (r = 0; r < noRows; r += 1) {
-                source = data.getValue(r, 0);
-                target = data.getValue(r, 1);
-                // nodes
-                if (source !== null && $.inArray(source, nodes) === -1) {
-                    nodes.push(source);
-                    t_size[source] = (noColumns > 2) ? Math.sqrt(data.getValue(r, 2)) : 0;
-                    t_color[source] = (noColumns > 3) ? data.getValue(r, 3) : 0;
-                    if (t_size[source] > t_maxnodesize) {
-                        t_maxnodesize = t_size[source];
-                    }
-                }
-                if (target !== null && $.inArray(target, nodes) === -1) {
-                    nodes.push(target);
-                }
-                // edges
-                if (source !== null && target !== null) {
-                    edges.push({'source': $.inArray(source, nodes),
-                                'target': $.inArray(target, nodes)
-                            }
-                        );
-                }
-            }
-            if (t_maxnodesize === 0) {
-                t_maxnodesize = 1;
-            }
-            nodesizeratio = opt.maxnodesize / t_maxnodesize;
-            for (i = 0; i < nodes.length; i += 1) {
-                color = typeof t_color[nodes[i]] !== 'undefined' ?
-                        t_color[nodes[i]] :
-                        1;
-                size = isNumber(t_size[nodes[i]]) ?
-                        opt.minnodesize + t_size[nodes[i]] * nodesizeratio :
-                        opt.minnodesize;
-
-                nodes[i] = {'name': nodes[i], 'color': color, 'size': size };
-            }
-
-            $(this.container).empty();
-
-            vis = d3.select(this.container)
-                .append("svg:svg")
-                .attr("width", w)
-                .attr("height", h)
-                .attr("pointer-events", "all")
-                .append('svg:g')
-                .call(d3.behavior.zoom().on("zoom", function () {
-                    vis.attr("transform", "translate(" + d3.event.translate + ")" +
-                         " scale(" + d3.event.scale + ")");
-                }))
-                .append('svg:g');
-
-            vis.append('svg:rect')
-                .attr('width', w)
-                .attr('height', h)
-                .attr('fill', 'white');
-
-            force = d3.layout.force()
-                .gravity(0.05)
-                .distance(100)
-                .charge(-100)
-                .nodes(nodes)
-                .links(edges)
-                .size([w, h])
-                .start();
-
-            link = vis.selectAll("line.link")
-                .data(edges)
-                .enter().append("svg:line")
-                .attr("class", "link")
-                //.style("stroke-width", function (d) { return Math.sqrt(d.value); })
-                .attr("x1", function (d) { return d.source.x; })
-                .attr("y1", function (d) { return d.source.y; })
-                .attr("x2", function (d) { return d.target.x; })
-                .attr("y2", function (d) { return d.target.y; });
-
-            node = vis.selectAll("g.node")
-                .data(nodes)
-                .enter().append("svg:g")
-                .attr("class", "node")
-                .call(force.drag);
-
-            node.append("svg:circle")
-                .style("fill", function (d) { return colors(d.color); })
-                .attr("class", "node")
-                .attr("r", function (d) { return d.size; });
-
-            node.append("svg:title")
-                .text(function (d) { return d.name; });
-
-            node.append("svg:text")
-                .attr("class", "nodetext")
-                .attr("dx", 12)
-                .attr("dy", ".35em")
-                .text(function (d) { return d.name; });
-
-            ticks = 0;
-            force.on("tick", function () {
-                ticks += 1;
-                if (ticks > 250) {
-                    force.stop();
-                    force.charge(0)
-                        .linkStrength(0)
-                        .linkDistance(0)
-                        .gravity(0)
-                        .start();
-                }
-
-                link.attr("x1", function (d) { return d.source.x; })
-                    .attr("y1", function (d) { return d.source.y; })
-                    .attr("x2", function (d) { return d.target.x; })
-                    .attr("y2", function (d) { return d.target.y; });
-
-                node.attr("transform", function (d) {
-                    return "translate(" + d.x + "," + d.y + ")";
-                });
-            });
-        }
-    };
-
-
-    /*global Graph */
-    /** rdGraph **
-
-      Original version written by Magnus Stuhr.
-
-      Draws a graph with clickable and movable nodes. 
-
-      Input format:
-      - 7 columns, last three are optional.
-      - each row represents a source node, a target node and an edge from source to target.
-      - the URIs are the id's for the nodes, and make the nodes clickable.
-      
-      1             2         3         4             5           6             7
-      sourceURI sourceLabel   targetURI targetLabel   edgeLabel   sourceColor   targetColor
-
-    */
-    sgvizler.chart.rdGraph = function (container) { this.container = container; };
-    sgvizler.chart.rdGraph.prototype = {
-        id: "rdGraph",
-        draw: function (data, chartOpt) {
-
-            var numberOfColumns = data.getNumberOfColumns(),
-                numberOfRows = data.getNumberOfRows(),
-
-                // set defaults.
-                opt = $.extend({
-                    noderadius: 0.5,
-                    nodefontsize: "10px",
-                    nodeheight: 20,
-                    nodestrokewidth: "1px",
-                    nodecornerradius: "1px",
-                    nodepadding: 7,
-                    nodecolor: "green",
-                    edgestroke: "blue",
-                    edgefill: "blue",
-                    edgestrokewidth: 1,
-                    edgefontsize: "10px",
-                    edgeseparator: ", "
-                }, chartOpt),
-
-                graph = new Graph(),
-                layouter,
-                renderer,
-                row,
-                i,
-                edge,
-                source,
-                target,
-                label,
-
-                // custom node rendering using Raphael.
-                nodeRenderer = function (color, URL) {
-                    return function (r, n) {
-                        return r.set()
-                            // rectangle
-                            .push(r.rect(n.point[0],
-                                        n.point[1],
-                                        n.label.length * opt.nodepadding,
-                                        opt.nodeheight)
-                                 .attr({"fill": color,
-                                        "stroke-width": opt.nodestrokewidth,
-                                        "r" : opt.nodecornerradius}))
-                           // label inside rectangle
-                            .push(r.text(n.point[0] + n.label.length * opt.nodepadding / 2,
-                                        n.point[1] + opt.nodeheight / 2,
-                                        n.label)
-                                 .attr({"font-size": opt.nodefontsize})
-                                 .click(function () { if (URL) { window.open(sgvizler.parser.unprefixify(URL)); } })
-                                );
-                    };
-                },
-
-                // helper function.
-                addNode = function (URL, name, color) {
-                    graph.addNode(URL, {label: name, render: nodeRenderer(color, URL)});
-                    //console.log("add node - name: " + name + ", URL: " + URL);
-                },
-                edges = {},
-                keys_edges = [];
-
-            for (row = 0; row < numberOfRows; row += 1) {
-                source = data.getValue(row, 0);
-                target = data.getValue(row, 2);
-
-                // add source node
-                // Note: dracula library takes care of duplicates?
-                if (source) {
-                    addNode(source,
-                            data.getValue(row, 1) || source,
-                            numberOfColumns > 5 ? data.getValue(row, 5) : opt.nodecolor);
-                }
-                // add target node
-                if (target) {
-                    addNode(target,
-                            data.getValue(row, 3) || target,
-                            numberOfColumns > 6 ? data.getValue(row, 6) : opt.nodecolor);
-                }
-
-                // collect edge labels. Only one edge per pair of nodes,
-                // so we concatinate labels of multiple edges into one.
-                if (source && target) {
-                    label = "";
-                    // test if source--target pair is seen before:
-                    if (typeof edges[source + target] !== 'undefined') {
-                        label = edges[source + target].label; // retrieve accumulated label.
-                    } else {
-                        keys_edges.push(source + target);
-                    }
-
-                    if (numberOfColumns > 4 && data.getValue(row, 4).length > 0) {
-                        if (label.length > 0) {
-                            label += opt.edgeseparator;
-                        }
-                        label += data.getValue(row, 4);
-                    }
-
-                    edges[source + target] = {
-                        'source': source,
-                        'target': target,
-                        'label': label
-                    };
-                }
-            }
-
-            // add edges
-            for (i = 0; i < keys_edges.length; i += 1) {
-                edge = edges[keys_edges[i]];
-                //console.log("add edge - source: " + edge.source + ", target " + edge.target);
-                graph.addEdge(edge.source, edge.target,
-                              { "stroke": opt.edgestroke,
-                                "fill": opt.edgefill,
-                                "label": edge.label,
-                                "width": opt.edgestrokewidth,
-                                "fontsize": opt.edgefontsize
-                              });
-            }
-
-            layouter = new Graph.Layout.Spring(graph);
-            layouter.layout();
-
-            $(this.container).empty();
-            renderer = new Graph.Renderer.Raphael(this.container, graph, opt.width, opt.height, {"noderadius": opt.nodeheight * opt.noderadius});
-            renderer.draw();
-        }
-    };    /** sDefList **
-
-
-     Make a html dt list.
-
-
-     Format, 2--N columns:
-     1. Term
-     2--N. Definition
-
-
-     Available options:
-     'cellSep'   :  string (can be html) to separate cells in definition columns. (default: ' ')
-     'termPrefix  :  string (can be html) to prefix each term with. (default: '')
-     'termPostfix :  string (can be html) to postfix each term with. (default: ':')
-     'definitionPrefix  :  string (can be html) to prefix each definition with. (default: '')
-     'definitionPostfix :  string (can be html) to postfix each definition with. (default: '')
-    */
-    sgvizler.chart.DefList = function (container) { this.container = container; };
-    sgvizler.chart.DefList.prototype = {
-        id:   "sDefList",
-        draw: function (data, chartOpt) {
-            var r,
-                c,
-                term,
-                definition,
-                noColumns = data.getNumberOfColumns(),
-                noRows = data.getNumberOfRows(),
-                opt = $.extend({ cellSep: ' ', termPrefix: '', termPostfix: ':', definitionPrefix: '', definitionPostfix: '' }, chartOpt),
-                list = $(document.createElement('dl'));
-
-
-            for (r = 0; r < noRows; r += 1) {
-                term = opt.termPrefix + data.getValue(r, 0) + opt.termPostfix;
-                list.append($(document.createElement('dt')).html(term));
-                definition = opt.definitionPrefix;
-                for (c = 1; c < noColumns; c += 1) {
-                    definition += data.getValue(r, c);
-                    if (c + 1 !== noColumns) {
-                        definition += opt.cellSep;
-                    }
-                }
-                definition += opt.definitionPostfix;
-                list.append($(document.createElement('dd')).html(definition));
-            }
-            $(this.container).empty();
-            $(this.container).append(list);
-        }
-    };
-    /** sList **
-
-
-     Make a html list, either numbered (ol) or bullets (ul). Each row
-     becomes a list item.
-
-
-     Any number of columns in any format. Everything is displayed as text.
-
-
-     Available options:
-     'list'      :  "ol" / "ul"  (default: "ul")
-     'cellSep'   :  string (can be html) to separate cells in row. (default: ', ')
-     'rowPrefix  :  string (can be html) to prefix each row with. (default: '')
-     'rowPostfix :  string (can be html) to postfix each row with. (default: '')
-    */
-    sgvizler.chart.List = function (container) { this.container = container; };
-    sgvizler.chart.List.prototype = {
-        id:   "sList",
-        draw: function (data, chartOpt) {
-            var noColumns = data.getNumberOfColumns(),
-                noRows = data.getNumberOfRows(),
-                opt = $.extend({ list: 'ul', cellSep: ', ', rowPrefix: '', rowPostfix: '' }, chartOpt),
-                list = $(document.createElement(opt.list)),
-                r,
-                c,
-                rowtext;
-
-
-            for (r = 0; r < noRows; r += 1) {
-                rowtext = opt.rowPrefix;
-                for (c = 0; c < noColumns; c += 1) {
-                    rowtext += data.getValue(r, c);
-                    if (c + 1 !== noColumns) {
-                        rowtext += opt.cellSep;
-                    }
-                }
-                rowtext += opt.rowPostfix;
-                list.append($(document.createElement('li')).html(rowtext));
-            }
-            $(this.container).empty();
-            $(this.container).append(list);
-        }
-    };
-
-
-    /** sMap **
-
-
-     Extends gMap in markers dataMode. Draws textboxes with heading,
-     paragraph, link and image. The idea is to put all columns > 2 into
-     the 3. column with html formatting.
-
-
-     - Data Format 2--6 columns:
-       1. lat
-       2. long
-       3. name  (optional)
-       4. text  (optional)
-       5. link  (optional)
-       6. image (optional)
-
-
-     - If < 4 columns, then behaves just as gMap
-     - Only 6 columns will be read, columns > 6 are ignored.
-    */
-    sgvizler.chart.sMap = function (container) { this.container = container; };
-    sgvizler.chart.sMap.prototype = {
-        id:   "sMap",
-        draw: function (data, chartOpt) {
-            var chart,
-                newData,
-                newValue,
-                noColumns = data.getNumberOfColumns(),
-                r,
-                c;
-
-
-            if (noColumns > 3) {
-                newData = data.clone();
-                // drop columns > 3 from new
-                for (c = noColumns - 1; c > 2; c -= 1) {
-                    newData.removeColumn(c);
-                }
-
-
-                // build new 3. column
-                for (r = 0; r < data.getNumberOfRows(); r += 1) {
-                    newValue = "<div class='sgvizler sgvizler-sMap'>";
-                    newValue += "<h1>" + data.getValue(r, 2) + "</h1>";
-                    if (5 < noColumns && data.getValue(r, 5) !== null) {
-                        newValue += "<div class='img'><img src='" + data.getValue(r, 5) + "'/></div>";
-                    }
-                    if (3 < noColumns && data.getValue(r, 3) !== null) {
-                        newValue += "<p class='text'>" + data.getValue(r, 3) + "</p>";
-                    }
-                    if (4 < noColumns && data.getValue(r, 4) !== null) {
-                        newValue += "<p class='link'><a href='" + sgvizler.parser.unprefixify(data.getValue(r, 4)) + "'>" + data.getValue(r, 4) + "</a></p>";
-                    }
-                    newValue += "</div>";
-                    newData.setCell(r, 2, newValue);
-                }
-            } else { // do nothing.
-                newData = data;
-            }
-
-
-            chart = new google.visualization.Map(this.container);
-            chart.draw(newData, chartOpt);
-        }
-    };
-
-
-    /** sTable **
-
-
-     Make a html table.
-
-
-     Available options:
-     'headings'   :  "true" / "false"  (default: "true")
-    */
-    sgvizler.chart.Table = function (container) { this.container = container; };
-    sgvizler.chart.Table.prototype = {
-        id:   "sTable",
-        draw: function (data, chartOpt) {
-            var noColumns = data.getNumberOfColumns(),
-                noRows = data.getNumberOfRows(),
-                opt = $.extend({'headings': true }, chartOpt),
-                table = $(document.createElement('table')),
-                c,
-                r,
-                row;
-
-
-            if (opt.headings) {
-                row = $(document.createElement('tr'));
-                for (c = 0; c < noColumns; c += 1) {
-                    row.append($(document.createElement('th')).html(data.getColumnLabel(c)));
-                }
-                table.append(row);
-            }
-
-
-            for (r = 0; r < noRows; r += 1) {
-                row = $(document.createElement('tr'));
-                for (c = 0; c < noColumns; c += 1) {
-                    row.append($(document.createElement('td')).html(data.getValue(r, c)));
-                }
-                table.append(row);
-            }
-            $(this.container).empty();
-            $(this.container).append(table);
-        }
-    };
-
-    /** sText **
-
-
-     Write text.
-
-
-     Any number of columns. Everything is displayed as text.
-
-
-     Available options:
-     'cellSep'       :  string (can be html) to separate cells in each column. (default: ', ')
-     'cellPrefix     :  string (can be html) to prefix each cell with. (default: '')
-     'cellPostfix    :  string (can be html) to postfix each cell  with. (default: '')
-     'rowPrefix      :  string (can be html) to prefix each row with. (default: '<p>')
-     'rowPostfix     :  string (can be html) to postfix each row with. (default: '</p>')
-     'resultsPrefix  :  string (can be html) to prefix the results with. (default: '<div>')
-     'resultsPostfix :  string (can be html) to postfix the results with. (default: '</div>')
-    */
-    sgvizler.chart.Text = function (container) { this.container = container; };
-    sgvizler.chart.Text.prototype = {
-        id:   "sText",
-        draw: function (data, chartOpt) {
-            var noColumns = data.getNumberOfColumns(),
-                noRows = data.getNumberOfRows(),
-                opt = $.extend({ cellSep: ', ',
-                                 cellPrefix: '', cellPostfix: '',
-                                 rowPrefix: '<p>', rowPostfix: '</p>',
-                                 resultsPrefix: '<div>', resultsPostfix: '</div>' },
-                               chartOpt),
-                text = opt.resultsPrefix,
-                r,
-                c,
-                row;
-
-
-            for (r = 0; r < noRows; r += 1) {
-                row = opt.rowPrefix;
-                for (c = 0; c < noColumns; c += 1) {
-                    row += opt.cellPrefix + data.getValue(r, c) + opt.cellPostfix;
-                    if (c + 1 !== noColumns) {
-                        row += opt.cellSep;
-                    }
-                }
-                text += row + opt.rowPostfix;
-            }
-            text += opt.resultsPostfix;
-
-
-            $(this.container).empty();
-            $(this.container).html(text);
-        }
-    };
-    global.sgvizler = sgvizler;
-}(window));

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/platform/marmotta-core/src/main/resources/web/admin/prefixes.html
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/resources/web/admin/prefixes.html b/platform/marmotta-core/src/main/resources/web/admin/prefixes.html
index 65ae361..cdbe6f2 100644
--- a/platform/marmotta-core/src/main/resources/web/admin/prefixes.html
+++ b/platform/marmotta-core/src/main/resources/web/admin/prefixes.html
@@ -36,6 +36,7 @@
       <tr>
         <th>Prefix</th>
         <th>Namespace</th>
+        <th>&nbsp;</th>
       </tr>
     </table>
     
@@ -59,13 +60,33 @@
         jQuery(document).ready(function() {
 
             function appendPrefix(prefix, namespace) {
-            	$("table#prefixes  > tbody:last").append("<tr><td>" + prefix + "</td><td><a href=\"" + namespace + "\">" + namespace + "</a></td></tr>");
+            	$("table#prefixes  > tbody:last").append("<tr id=\"prefix-" + prefix + "\"><td>" + prefix + "</td><td><a href=\"" + namespace + "\">" + namespace + "</a></td><td><a href=\"#\" class=\"deletePrefix\">delete</a></td></tr>");
             }
             
+            function deletePrefix(prefix) {
+            	$.ajax({
+            	    url: "../../prefix/" + prefix,
+            	    type: "DELETE",	
+            	    dataType: "text",
+            	    statusCode: {
+            	       204: function() {
+		   	        	    	alert("Prefix " + prefix + " deleted!");
+			        	        $("tr#prefix-" + prefix).remove();
+            	          	}
+            	    }
+            	});
+            }              
+            
             $.getJSON("../../prefix", function(data) {
                 $.each(data, function(prefix, namespace) {
                 	appendPrefix(prefix, namespace);
                 });
+                $("a.deletePrefix").click(function() {
+                    var row = $(this).closest("td").closest("tr");
+                    var prefix = row.find("td:first").text();
+                    deletePrefix(prefix);
+                    return false;	
+                });                
             });
 
             $("#add-new-prefix-button").click(function() {

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/platform/marmotta-core/src/main/resources/web/admin/system.html
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/resources/web/admin/system.html b/platform/marmotta-core/src/main/resources/web/admin/system.html
index fd1a3bb..9b54c6b 100644
--- a/platform/marmotta-core/src/main/resources/web/admin/system.html
+++ b/platform/marmotta-core/src/main/resources/web/admin/system.html
@@ -24,11 +24,11 @@
     var _SERVER_URL = "http://localhost:8080/Marmotta/";
 </script>
 <!--###BEGIN_HEAD###-->
-<script type="text/javascript" src="../public/js/lib/jquery-1.6.4.js"></script>
-<script type="text/javascript" src="../public/js/lib/strftime.js"></script>
-<script type="text/javascript" src="js/widgets/system.js"></script>
+    <script type="text/javascript" src="../../webjars/jquery/1.8.2/jquery.min.js"></script>
+    <script type="text/javascript" src="../../webjars/strftime/1.3/strftime.js"></script>
+    <script type="text/javascript" src="js/widgets/system.js"></script>
 
-<link rel="stylesheet" href="css/admin-style.css"/>
+    <link rel="stylesheet" href="css/admin-style.css"/>
 <!--###END_HEAD###-->
 </head>
 <body id="center">

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/platform/marmotta-core/src/main/resources/web/admin/tasks.html
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/resources/web/admin/tasks.html b/platform/marmotta-core/src/main/resources/web/admin/tasks.html
index e0e4030..5efb26b 100644
--- a/platform/marmotta-core/src/main/resources/web/admin/tasks.html
+++ b/platform/marmotta-core/src/main/resources/web/admin/tasks.html
@@ -21,8 +21,8 @@
 <head>
     <!--###BEGIN_HEAD###-->
     <title>Marmotta - Current Tasks</title>
-    <script type="text/javascript" src="../public/js/lib/jquery-1.6.4.js"></script>
-    <script type="text/javascript" src="../public/js/lib/strftime.js"></script>
+    <script type="text/javascript" src="../../webjars/jquery/1.8.2/jquery.min.js"></script>
+    <script type="text/javascript" src="../../webjars/strftime/1.3/strftime.js"></script>
     <script type="text/javascript">
     $(function() {
 		var container = $("#tasks"),

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/platform/marmotta-core/src/main/resources/web/public/html/reasoning.html
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/resources/web/public/html/reasoning.html b/platform/marmotta-core/src/main/resources/web/public/html/reasoning.html
index 818e632..75597af 100644
--- a/platform/marmotta-core/src/main/resources/web/public/html/reasoning.html
+++ b/platform/marmotta-core/src/main/resources/web/public/html/reasoning.html
@@ -25,7 +25,7 @@
            font-size: 0.95em;
         }
     </style>
-    <script type="text/javascript" src="http://code.jquery.com/jquery-1.6.1.min.js"></script>
+    <script type="text/javascript" src="../../../webjars/jquery/1.8.2/jquery.min.js"></script>
     <script type="text/javascript">
         var hash;
         var baseURI;


[002/100] [abbrv] [partial] Reverting the erroneous merge by Sebastian according to the instructions in INFRA-6876

Posted by wi...@apache.org.
http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/platform/marmotta-core/src/main/resources/web/public/js/lib/jquery-1.7.2.js
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/resources/web/public/js/lib/jquery-1.7.2.js b/platform/marmotta-core/src/main/resources/web/public/js/lib/jquery-1.7.2.js
deleted file mode 100644
index 16ad06c..0000000
--- a/platform/marmotta-core/src/main/resources/web/public/js/lib/jquery-1.7.2.js
+++ /dev/null
@@ -1,4 +0,0 @@
-/*! jQuery v1.7.2 jquery.com | jquery.org/license */
-(function(a,b){function cy(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cu(a){if(!cj[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){ck||(ck=c.createElement("iframe"),ck.frameBorder=ck.width=ck.height=0),b.appendChild(ck);if(!cl||!ck.createElement)cl=(ck.contentWindow||ck.contentDocument).document,cl.write((f.support.boxModel?"<!doctype html>":"")+"<html><body>"),cl.close();d=cl.createElement(a),cl.body.appendChild(d),e=f.css(d,"display"),b.removeChild(ck)}cj[a]=e}return cj[a]}function ct(a,b){var c={};f.each(cp.concat.apply([],cp.slice(0,b)),function(){c[this]=a});return c}function cs(){cq=b}function cr(){setTimeout(cs,0);return cq=f.now()}function ci(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ch(){try{return new a.XMLHttpRequest}catch(b){}}function cb(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;
 g<i;g++){if(g===1)for(h in a.converters)typeof h=="string"&&(e[h.toLowerCase()]=a.converters[h]);l=k,k=d[g];if(k==="*")k=l;else if(l!=="*"&&l!==k){m=l+" "+k,n=e[m]||e["* "+k];if(!n){p=b;for(o in e){j=o.split(" ");if(j[0]===l||j[0]==="*"){p=e[j[1]+" "+k];if(p){o=e[o],o===!0?n=p:p===!0&&(n=o);break}}}}!n&&!p&&f.error("No conversion from "+m.replace(" "," to ")),n!==!0&&(c=n?n(c):p(o(c)))}}return c}function ca(a,c,d){var e=a.contents,f=a.dataTypes,g=a.responseFields,h,i,j,k;for(i in g)i in d&&(c[g[i]]=d[i]);while(f[0]==="*")f.shift(),h===b&&(h=a.mimeType||c.getResponseHeader("content-type"));if(h)for(i in e)if(e[i]&&e[i].test(h)){f.unshift(i);break}if(f[0]in d)j=f[0];else{for(i in d){if(!f[0]||a.converters[i+" "+f[0]]){j=i;break}k||(k=i)}j=j||k}if(j){j!==f[0]&&f.unshift(j);return d[j]}}function b_(a,b,c,d){if(f.isArray(b))f.each(b,function(b,e){c||bD.test(a)?d(a,e):b_(a+"["+(typeof e=="object"?b:"")+"]",e,c,d)});else if(!c&&f.type(b)==="object")for(var e in b)b_(a+"["+e+"]",b[e],c,d);e
 lse d(a,b)}function b$(a,c){var d,e,g=f.ajaxSettings.flatOptions||{};for(d in c)c[d]!==b&&((g[d]?a:e||(e={}))[d]=c[d]);e&&f.extend(!0,a,e)}function bZ(a,c,d,e,f,g){f=f||c.dataTypes[0],g=g||{},g[f]=!0;var h=a[f],i=0,j=h?h.length:0,k=a===bS,l;for(;i<j&&(k||!l);i++)l=h[i](c,d,e),typeof l=="string"&&(!k||g[l]?l=b:(c.dataTypes.unshift(l),l=bZ(a,c,d,e,l,g)));(k||!l)&&!g["*"]&&(l=bZ(a,c,d,e,"*",g));return l}function bY(a){return function(b,c){typeof b!="string"&&(c=b,b="*");if(f.isFunction(c)){var d=b.toLowerCase().split(bO),e=0,g=d.length,h,i,j;for(;e<g;e++)h=d[e],j=/^\+/.test(h),j&&(h=h.substr(1)||"*"),i=a[h]=a[h]||[],i[j?"unshift":"push"](c)}}}function bB(a,b,c){var d=b==="width"?a.offsetWidth:a.offsetHeight,e=b==="width"?1:0,g=4;if(d>0){if(c!=="border")for(;e<g;e+=2)c||(d-=parseFloat(f.css(a,"padding"+bx[e]))||0),c==="margin"?d+=parseFloat(f.css(a,c+bx[e]))||0:d-=parseFloat(f.css(a,"border"+bx[e]+"Width"))||0;return d+"px"}d=by(a,b);if(d<0||d==null)d=a.style[b];if(bt.test(d))return d;d
 =parseFloat(d)||0;if(c)for(;e<g;e+=2)d+=parseFloat(f.css(a,"padding"+bx[e]))||0,c!=="padding"&&(d+=parseFloat(f.css(a,"border"+bx[e]+"Width"))||0),c==="margin"&&(d+=parseFloat(f.css(a,c+bx[e]))||0);return d+"px"}function bo(a){var b=c.createElement("div");bh.appendChild(b),b.innerHTML=a.outerHTML;return b.firstChild}function bn(a){var b=(a.nodeName||"").toLowerCase();b==="input"?bm(a):b!=="script"&&typeof a.getElementsByTagName!="undefined"&&f.grep(a.getElementsByTagName("input"),bm)}function bm(a){if(a.type==="checkbox"||a.type==="radio")a.defaultChecked=a.checked}function bl(a){return typeof a.getElementsByTagName!="undefined"?a.getElementsByTagName("*"):typeof a.querySelectorAll!="undefined"?a.querySelectorAll("*"):[]}function bk(a,b){var c;b.nodeType===1&&(b.clearAttributes&&b.clearAttributes(),b.mergeAttributes&&b.mergeAttributes(a),c=b.nodeName.toLowerCase(),c==="object"?b.outerHTML=a.outerHTML:c!=="input"||a.type!=="checkbox"&&a.type!=="radio"?c==="option"?b.selected=a.defaul
 tSelected:c==="input"||c==="textarea"?b.defaultValue=a.defaultValue:c==="script"&&b.text!==a.text&&(b.text=a.text):(a.checked&&(b.defaultChecked=b.checked=a.checked),b.value!==a.value&&(b.value=a.value)),b.removeAttribute(f.expando),b.removeAttribute("_submit_attached"),b.removeAttribute("_change_attached"))}function bj(a,b){if(b.nodeType===1&&!!f.hasData(a)){var c,d,e,g=f._data(a),h=f._data(b,g),i=g.events;if(i){delete h.handle,h.events={};for(c in i)for(d=0,e=i[c].length;d<e;d++)f.event.add(b,c,i[c][d])}h.data&&(h.data=f.extend({},h.data))}}function bi(a,b){return f.nodeName(a,"table")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function U(a){var b=V.split("|"),c=a.createDocumentFragment();if(c.createElement)while(b.length)c.createElement(b.pop());return c}function T(a,b,c){b=b||0;if(f.isFunction(b))return f.grep(a,function(a,d){var e=!!b.call(a,d,a);return e===c});if(b.nodeType)return f.grep(a,function(a,d){return a===b===c});if(typ
 eof b=="string"){var d=f.grep(a,function(a){return a.nodeType===1});if(O.test(b))return f.filter(b,d,!c);b=f.filter(b,d)}return f.grep(a,function(a,d){return f.inArray(a,b)>=0===c})}function S(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function K(){return!0}function J(){return!1}function n(a,b,c){var d=b+"defer",e=b+"queue",g=b+"mark",h=f._data(a,d);h&&(c==="queue"||!f._data(a,e))&&(c==="mark"||!f._data(a,g))&&setTimeout(function(){!f._data(a,e)&&!f._data(a,g)&&(f.removeData(a,d,!0),h.fire())},0)}function m(a){for(var b in a){if(b==="data"&&f.isEmptyObject(a[b]))continue;if(b!=="toJSON")return!1}return!0}function l(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(k,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNumeric(d)?+d:j.test(d)?f.parseJSON(d):d}catch(g){}f.data(a,c,d)}else d=b}return d}function h(a){var b=g[a]={},c,d;a=a.split(/\s+/);for(c=0,d=a.length;c<d;c++)b[a[c]]=!0;return b}var c
 =a.document,d=a.navigator,e=a.location,f=function(){function J(){if(!e.isReady){try{c.documentElement.doScroll("left")}catch(a){setTimeout(J,1);return}e.ready()}}var e=function(a,b){return new e.fn.init(a,b,h)},f=a.jQuery,g=a.$,h,i=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,n=/^[\],:{}\s]*$/,o=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,p=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,q=/(?:^|:|,)(?:\s*\[)+/g,r=/(webkit)[ \/]([\w.]+)/,s=/(opera)(?:.*version)?[ \/]([\w.]+)/,t=/(msie) ([\w.]+)/,u=/(mozilla)(?:.*? rv:([\w.]+))?/,v=/-([a-z]|[0-9])/ig,w=/^-ms-/,x=function(a,b){return(b+"").toUpperCase()},y=d.userAgent,z,A,B,C=Object.prototype.toString,D=Object.prototype.hasOwnProperty,E=Array.prototype.push,F=Array.prototype.slice,G=String.prototype.trim,H=Array.prototype.indexOf,I={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;r
 eturn this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=m.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.7.2",length:0,size:function(){return this.length},toArray:function(){return F.call(this,0)},get:function(a){return a==nu
 ll?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?E.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),A.add(a);return this},eq:function(a){a=+a;return a===-1?this.slice(a):this.slice(a,a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(F.apply(this,arguments),"slice",F.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:E,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),t
 ypeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j<k;j++)if((a=arguments[j])!=null)for(c in a){d=i[c],f=a[c];if(i===f)continue;l&&f&&(e.isPlainObject(f)||(g=e.isArray(f)))?(g?(g=!1,h=d&&e.isArray(d)?d:[]):h=d&&e.isPlainObject(d)?d:{},i[c]=e.extend(l,h,f)):f!==b&&(i[c]=f)}return i},e.extend({noConflict:function(b){a.$===e&&(a.$=g),b&&a.jQuery===e&&(a.jQuery=f);return e},isReady:!1,readyWait:1,holdReady:function(a){a?e.readyWait++:e.ready(!0)},ready:function(a){if(a===!0&&!--e.readyWait||a!==!0&&!e.isReady){if(!c.body)return setTimeout(e.ready,1);e.isReady=!0;if(a!==!0&&--e.readyWait>0)return;A.fireWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").off("ready")}},bindReady:function(){if(!A){A=e.Callbacks("once memory");if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",B,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",B),a.attachEvent("onload",e.ready
 );var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&J()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a!=null&&a==a.window},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return a==null?String(a):I[C.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;try{if(a.constructor&&!D.call(a,"constructor")&&!D.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||D.call(a,d)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw new Error(a)},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(n.test(b.replace(o,"@").replace(p,"]").replace(q,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:functio
 n(c){if(typeof c!="string"||!c)return null;var d,f;try{a.DOMParser?(f=new DOMParser,d=f.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(g){d=b}(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&e.error("Invalid XML: "+c);return d},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(w,"ms-").replace(v,x)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g<h;)if(c.apply(a[g++],d)===!1)break}else if(i){for(f in a)if(c.call(a[f],f,a[f])===!1)break}else for(;g<h;)if(c.call(a[g],g,a[g++])===!1)break;return a},trim:G?function(a){return a==null?"":G.call(a)}:function(a){return a==null?"":(a+"").replace(k,"").replace(l,"")},makeArray:function(a,b){var c=b||[
 ];if(a!=null){var d=e.type(a);a.length==null||d==="string"||d==="function"||d==="regexp"||e.isWindow(a)?E.call(c,a):e.merge(c,a)}return c},inArray:function(a,b,c){var d;if(b){if(H)return H.call(b,a,c);d=b.length,c=c?c<0?Math.max(0,d+c):c:0;for(;c<d;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,c){var d=a.length,e=0;if(typeof c.length=="number")for(var f=c.length;e<f;e++)a[d++]=c[e];else while(c[e]!==b)a[d++]=c[e++];a.length=d;return a},grep:function(a,b,c){var d=[],e;c=!!c;for(var f=0,g=a.length;f<g;f++)e=!!b(a[f],f),c!==e&&d.push(a[f]);return d},map:function(a,c,d){var f,g,h=[],i=0,j=a.length,k=a instanceof e||j!==b&&typeof j=="number"&&(j>0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i<j;i++)f=c(a[i],i,d),f!=null&&(h[h.length]=f);else for(g in a)f=c(a[g],g,d),f!=null&&(h[h.length]=f);return h.concat.apply([],h)},guid:1,proxy:function(a,c){if(typeof c=="string"){var d=a[c];c=a,a=d}if(!e.isFunction(a))return b;var f=F.call(arguments,2),g=function(){return a.apply(c,f
 .concat(F.call(arguments)))};g.guid=a.guid=a.guid||g.guid||e.guid++;return g},access:function(a,c,d,f,g,h,i){var j,k=d==null,l=0,m=a.length;if(d&&typeof d=="object"){for(l in d)e.access(a,c,l,d[l],1,h,f);g=1}else if(f!==b){j=i===b&&e.isFunction(f),k&&(j?(j=c,c=function(a,b,c){return j.call(e(a),c)}):(c.call(a,f),c=null));if(c)for(;l<m;l++)c(a[l],d,j?f.call(a[l],l,c(a[l],d)):f,i);g=1}return g?a:k?c.call(a):m?c(a[0],d):h},now:function(){return(new Date).getTime()},uaMatch:function(a){a=a.toLowerCase();var b=r.exec(a)||s.exec(a)||t.exec(a)||a.indexOf("compatible")<0&&u.exec(a)||[];return{browser:b[1]||"",version:b[2]||"0"}},sub:function(){function a(b,c){return new a.fn.init(b,c)}e.extend(!0,a,this),a.superclass=this,a.fn=a.prototype=this(),a.fn.constructor=a,a.sub=this.sub,a.fn.init=function(d,f){f&&f instanceof e&&!(f instanceof a)&&(f=a(f));return e.fn.init.call(this,d,f,b)},a.fn.init.prototype=a.fn;var b=a(c);return a},browser:{}}),e.each("Boolean Number String Function Array Date 
 RegExp Object".split(" "),function(a,b){I["[object "+b+"]"]=b.toLowerCase()}),z=e.uaMatch(y),z.browser&&(e.browser[z.browser]=!0,e.browser.version=z.version),e.browser.webkit&&(e.browser.safari=!0),j.test(" ")&&(k=/^[\s\xA0]+/,l=/[\s\xA0]+$/),h=e(c),c.addEventListener?B=function(){c.removeEventListener("DOMContentLoaded",B,!1),e.ready()}:c.attachEvent&&(B=function(){c.readyState==="complete"&&(c.detachEvent("onreadystatechange",B),e.ready())});return e}(),g={};f.Callbacks=function(a){a=a?g[a]||h(a):{};var c=[],d=[],e,i,j,k,l,m,n=function(b){var d,e,g,h,i;for(d=0,e=b.length;d<e;d++)g=b[d],h=f.type(g),h==="array"?n(g):h==="function"&&(!a.unique||!p.has(g))&&c.push(g)},o=function(b,f){f=f||[],e=!a.memory||[b,f],i=!0,j=!0,m=k||0,k=0,l=c.length;for(;c&&m<l;m++)if(c[m].apply(b,f)===!1&&a.stopOnFalse){e=!0;break}j=!1,c&&(a.once?e===!0?p.disable():c=[]:d&&d.length&&(e=d.shift(),p.fireWith(e[0],e[1])))},p={add:function(){if(c){var a=c.length;n(arguments),j?l=c.length:e&&e!==!0&&(k=a,o(e[0],
 e[1]))}return this},remove:function(){if(c){var b=arguments,d=0,e=b.length;for(;d<e;d++)for(var f=0;f<c.length;f++)if(b[d]===c[f]){j&&f<=l&&(l--,f<=m&&m--),c.splice(f--,1);if(a.unique)break}}return this},has:function(a){if(c){var b=0,d=c.length;for(;b<d;b++)if(a===c[b])return!0}return!1},empty:function(){c=[];return this},disable:function(){c=d=e=b;return this},disabled:function(){return!c},lock:function(){d=b,(!e||e===!0)&&p.disable();return this},locked:function(){return!d},fireWith:function(b,c){d&&(j?a.once||d.push([b,c]):(!a.once||!e)&&o(b,c));return this},fire:function(){p.fireWith(this,arguments);return this},fired:function(){return!!i}};return p};var i=[].slice;f.extend({Deferred:function(a){var b=f.Callbacks("once memory"),c=f.Callbacks("once memory"),d=f.Callbacks("memory"),e="pending",g={resolve:b,reject:c,notify:d},h={done:b.add,fail:c.add,progress:d.add,state:function(){return e},isResolved:b.fired,isRejected:c.fired,then:function(a,b,c){i.done(a).fail(b).progress(c);re
 turn this},always:function(){i.done.apply(i,arguments).fail.apply(i,arguments);return this},pipe:function(a,b,c){return f.Deferred(function(d){f.each({done:[a,"resolve"],fail:[b,"reject"],progress:[c,"notify"]},function(a,b){var c=b[0],e=b[1],g;f.isFunction(c)?i[a](function(){g=c.apply(this,arguments),g&&f.isFunction(g.promise)?g.promise().then(d.resolve,d.reject,d.notify):d[e+"With"](this===i?d:this,[g])}):i[a](d[e])})}).promise()},promise:function(a){if(a==null)a=h;else for(var b in h)a[b]=h[b];return a}},i=h.promise({}),j;for(j in g)i[j]=g[j].fire,i[j+"With"]=g[j].fireWith;i.done(function(){e="resolved"},c.disable,d.lock).fail(function(){e="rejected"},b.disable,d.lock),a&&a.call(i,i);return i},when:function(a){function m(a){return function(b){e[a]=arguments.length>1?i.call(arguments,0):b,j.notifyWith(k,e)}}function l(a){return function(c){b[a]=arguments.length>1?i.call(arguments,0):c,--g||j.resolveWith(j,b)}}var b=i.call(arguments,0),c=0,d=b.length,e=Array(d),g=d,h=d,j=d<=1&&a&&f
 .isFunction(a.promise)?a:f.Deferred(),k=j.promise();if(d>1){for(;c<d;c++)b[c]&&b[c].promise&&f.isFunction(b[c].promise)?b[c].promise().then(l(c),j.reject,m(c)):--g;g||j.resolveWith(j,b)}else j!==a&&j.resolveWith(j,d?[a]:[]);return k}}),f.support=function(){var b,d,e,g,h,i,j,k,l,m,n,o,p=c.createElement("div"),q=c.documentElement;p.setAttribute("className","t"),p.innerHTML="   <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/>",d=p.getElementsByTagName("*"),e=p.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=p.getElementsByTagName("input")[0],b={leadingWhitespace:p.firstChild.nodeType===3,tbody:!p.getElementsByTagName("tbody").length,htmlSerialize:!!p.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:i.va
 lue==="on",optSelected:h.selected,getSetAttribute:p.className!=="t",enctype:!!c.createElement("form").enctype,html5Clone:c.createElement("nav").cloneNode(!0).outerHTML!=="<:nav></:nav>",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,pixelMargin:!0},f.boxModel=b.boxModel=c.compatMode==="CSS1Compat",i.checked=!0,b.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,b.optDisabled=!h.disabled;try{delete p.test}catch(r){b.deleteExpando=!1}!p.addEventListener&&p.attachEvent&&p.fireEvent&&(p.attachEvent("onclick",function(){b.noCloneEvent=!1}),p.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),b.radioValue=i.value==="t",i.setAttribute("checked","checked"),i.setAttribute("name","t"),p.appendChild(i),j=c.createDocumentFragment(),j.appendChild(p.lastChild),b.checkClone=j.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecke
 d=i.checked,j.removeChild(i),j.appendChild(p);if(p.attachEvent)for(n in{submit:1,change:1,focusin:1})m="on"+n,o=m in p,o||(p.setAttribute(m,"return;"),o=typeof p[m]=="function"),b[n+"Bubbles"]=o;j.removeChild(p),j=g=h=p=i=null,f(function(){var d,e,g,h,i,j,l,m,n,q,r,s,t,u=c.getElementsByTagName("body")[0];!u||(m=1,t="padding:0;margin:0;border:",r="position:absolute;top:0;left:0;width:1px;height:1px;",s=t+"0;visibility:hidden;",n="style='"+r+t+"5px solid #000;",q="<div "+n+"display:block;'><div style='"+t+"0;display:block;overflow:hidden;'></div></div>"+"<table "+n+"' cellpadding='0' cellspacing='0'>"+"<tr><td></td></tr></table>",d=c.createElement("div"),d.style.cssText=s+"width:0;height:0;position:static;top:0;margin-top:"+m+"px",u.insertBefore(d,u.firstChild),p=c.createElement("div"),d.appendChild(p),p.innerHTML="<table><tr><td style='"+t+"0;display:none'></td><td>t</td></tr></table>",k=p.getElementsByTagName("td"),o=k[0].offsetHeight===0,k[0].style.display="",k[1].style.display="no
 ne",b.reliableHiddenOffsets=o&&k[0].offsetHeight===0,a.getComputedStyle&&(p.innerHTML="",l=c.createElement("div"),l.style.width="0",l.style.marginRight="0",p.style.width="2px",p.appendChild(l),b.reliableMarginRight=(parseInt((a.getComputedStyle(l,null)||{marginRight:0}).marginRight,10)||0)===0),typeof p.style.zoom!="undefined"&&(p.innerHTML="",p.style.width=p.style.padding="1px",p.style.border=0,p.style.overflow="hidden",p.style.display="inline",p.style.zoom=1,b.inlineBlockNeedsLayout=p.offsetWidth===3,p.style.display="block",p.style.overflow="visible",p.innerHTML="<div style='width:5px;'></div>",b.shrinkWrapBlocks=p.offsetWidth!==3),p.style.cssText=r+s,p.innerHTML=q,e=p.firstChild,g=e.firstChild,i=e.nextSibling.firstChild.firstChild,j={doesNotAddBorder:g.offsetTop!==5,doesAddBorderForTableAndCells:i.offsetTop===5},g.style.position="fixed",g.style.top="20px",j.fixedPosition=g.offsetTop===20||g.offsetTop===15,g.style.position=g.style.top="",e.style.overflow="hidden",e.style.position=
 "relative",j.subtractsBorderForOverflowNotVisible=g.offsetTop===-5,j.doesNotIncludeMarginInBodyOffset=u.offsetTop!==m,a.getComputedStyle&&(p.style.marginTop="1%",b.pixelMargin=(a.getComputedStyle(p,null)||{marginTop:0}).marginTop!=="1%"),typeof d.style.zoom!="undefined"&&(d.style.zoom=1),u.removeChild(d),l=p=d=null,f.extend(b,j))});return b}();var j=/^(?:\{.*\}|\[.*\])$/,k=/([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!m(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g,h,i,j=f.expando,k=typeof c=="string",l=a.nodeType,m=l?f.cache:a,n=l?a[j]:a[j]&&j,o=c==="events";if((!n||!m[n]||!o&&!e&&!m[n].data)&&k&&d===b)return;n||(l?a[j]=n=++f.uuid:n=j),m[n]||(m[n]={},l||(m[n].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?m[n]=f.extend(m[n],c):m[n].data=f.extend(m[
 n].data,c);g=h=m[n],e||(h.data||(h.data={}),h=h.data),d!==b&&(h[f.camelCase(c)]=d);if(o&&!h[c])return g.events;k?(i=h[c],i==null&&(i=h[f.camelCase(c)])):i=h;return i}},removeData:function(a,b,c){if(!!f.acceptData(a)){var d,e,g,h=f.expando,i=a.nodeType,j=i?f.cache:a,k=i?a[h]:h;if(!j[k])return;if(b){d=c?j[k]:j[k].data;if(d){f.isArray(b)||(b in d?b=[b]:(b=f.camelCase(b),b in d?b=[b]:b=b.split(" ")));for(e=0,g=b.length;e<g;e++)delete d[b[e]];if(!(c?m:f.isEmptyObject)(d))return}}if(!c){delete j[k].data;if(!m(j[k]))return}f.support.deleteExpando||!j.setInterval?delete j[k]:j[k]=null,i&&(f.support.deleteExpando?delete a[h]:a.removeAttribute?a.removeAttribute(h):a[h]=null)}},_data:function(a,b,c){return f.data(a,b,c,!0)},acceptData:function(a){if(a.nodeName){var b=f.noData[a.nodeName.toLowerCase()];if(b)return b!==!0&&a.getAttribute("classid")===b}return!0}}),f.fn.extend({data:function(a,c){var d,e,g,h,i,j=this[0],k=0,m=null;if(a===b){if(this.length){m=f.data(j);if(j.nodeType===1&&!f._data(
 j,"parsedAttrs")){g=j.attributes;for(i=g.length;k<i;k++)h=g[k].name,h.indexOf("data-")===0&&(h=f.camelCase(h.substring(5)),l(j,h,m[h]));f._data(j,"parsedAttrs",!0)}}return m}if(typeof a=="object")return this.each(function(){f.data(this,a)});d=a.split(".",2),d[1]=d[1]?"."+d[1]:"",e=d[1]+"!";return f.access(this,function(c){if(c===b){m=this.triggerHandler("getData"+e,[d[0]]),m===b&&j&&(m=f.data(j,a),m=l(j,a,m));return m===b&&d[1]?this.data(d[0]):m}d[1]=c,this.each(function(){var b=f(this);b.triggerHandler("setData"+e,d),f.data(this,a,c),b.triggerHandler("changeData"+e,d)})},null,c,arguments.length>1,null,!1)},removeData:function(a){return this.each(function(){f.removeData(this,a)})}}),f.extend({_mark:function(a,b){a&&(b=(b||"fx")+"mark",f._data(a,b,(f._data(a,b)||0)+1))},_unmark:function(a,b,c){a!==!0&&(c=b,b=a,a=!1);if(b){c=c||"fx";var d=c+"mark",e=a?0:(f._data(b,d)||1)-1;e?f._data(b,d,e):(f.removeData(b,d,!0),n(b,c,"mark"))}},queue:function(a,b,c){var d;if(a){b=(b||"fx")+"queue",d=f
 ._data(a,b),c&&(!d||f.isArray(c)?d=f._data(a,b,f.makeArray(c)):d.push(c));return d||[]}},dequeue:function(a,b){b=b||"fx";var c=f.queue(a,b),d=c.shift(),e={};d==="inprogress"&&(d=c.shift()),d&&(b==="fx"&&c.unshift("inprogress"),f._data(a,b+".run",e),d.call(a,function(){f.dequeue(a,b)},e)),c.length||(f.removeData(a,b+"queue "+b+".run",!0),n(a,b,"queue"))}}),f.fn.extend({queue:function(a,c){var d=2;typeof a!="string"&&(c=a,a="fx",d--);if(arguments.length<d)return f.queue(this[0],a);return c===b?this:this.each(function(){var b=f.queue(this,a,c);a==="fx"&&b[0]!=="inprogress"&&f.dequeue(this,a)})},dequeue:function(a){return this.each(function(){f.dequeue(this,a)})},delay:function(a,b){a=f.fx?f.fx.speeds[a]||a:a,b=b||"fx";return this.queue(b,function(b,c){var d=setTimeout(b,a);c.stop=function(){clearTimeout(d)}})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,c){function m(){--h||d.resolveWith(e,[e])}typeof a!="string"&&(c=a,a=b),a=a||"fx";var d=f.Deferred(),e=th
 is,g=e.length,h=1,i=a+"defer",j=a+"queue",k=a+"mark",l;while(g--)if(l=f.data(e[g],i,b,!0)||(f.data(e[g],j,b,!0)||f.data(e[g],k,b,!0))&&f.data(e[g],i,f.Callbacks("once memory"),!0))h++,l.add(m);m();return d.promise(c)}});var o=/[\n\t\r]/g,p=/\s+/,q=/\r/g,r=/^(?:button|input)$/i,s=/^(?:button|input|object|select|textarea)$/i,t=/^a(?:rea)?$/i,u=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,v=f.support.getSetAttribute,w,x,y;f.fn.extend({attr:function(a,b){return f.access(this,f.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){f.removeAttr(this,a)})},prop:function(a,b){return f.access(this,f.prop,a,b,arguments.length>1)},removeProp:function(a){a=f.propFix[a]||a;return this.each(function(){try{this[a]=b,delete this[a]}catch(c){}})},addClass:function(a){var b,c,d,e,g,h,i;if(f.isFunction(a))return this.each(function(b){f(this).addClass(a.call(this,b,this.className))});if(a&&typeof
  a=="string"){b=a.split(p);for(c=0,d=this.length;c<d;c++){e=this[c];if(e.nodeType===1)if(!e.className&&b.length===1)e.className=a;else{g=" "+e.className+" ";for(h=0,i=b.length;h<i;h++)~g.indexOf(" "+b[h]+" ")||(g+=b[h]+" ");e.className=f.trim(g)}}}return this},removeClass:function(a){var c,d,e,g,h,i,j;if(f.isFunction(a))return this.each(function(b){f(this).removeClass(a.call(this,b,this.className))});if(a&&typeof a=="string"||a===b){c=(a||"").split(p);for(d=0,e=this.length;d<e;d++){g=this[d];if(g.nodeType===1&&g.className)if(a){h=(" "+g.className+" ").replace(o," ");for(i=0,j=c.length;i<j;i++)h=h.replace(" "+c[i]+" "," ");g.className=f.trim(h)}else g.className=""}}return this},toggleClass:function(a,b){var c=typeof a,d=typeof b=="boolean";if(f.isFunction(a))return this.each(function(c){f(this).toggleClass(a.call(this,c,this.className,b),b)});return this.each(function(){if(c==="string"){var e,g=0,h=f(this),i=b,j=a.split(p);while(e=j[g++])i=d?i:!h.hasClass(e),h[i?"addClass":"removeCla
 ss"](e)}else if(c==="undefined"||c==="boolean")this.className&&f._data(this,"__className__",this.className),this.className=this.className||a===!1?"":f._data(this,"__className__")||""})},hasClass:function(a){var b=" "+a+" ",c=0,d=this.length;for(;c<d;c++)if(this[c].nodeType===1&&(" "+this[c].className+" ").replace(o," ").indexOf(b)>-1)return!0;return!1},val:function(a){var c,d,e,g=this[0];{if(!!arguments.length){e=f.isFunction(a);return this.each(function(d){var g=f(this),h;if(this.nodeType===1){e?h=a.call(this,d,g.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.type]||f.valHooks[this.nodeName.toLowerCase()];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}if(g){c=f.valHooks[g.type]||f.valHooks[g.nodeName.toLowerCase()];if(c&&"get"in c&&(d=c.get(g,"value"))!==b)return d;d=g.value;return typeof d=="string"?d.replace(q,""):d==null?"":d}}}}),f.extend({valHooks:{option:{get:function(a){var b=a
 .attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d,e,g=a.selectedIndex,h=[],i=a.options,j=a.type==="select-one";if(g<0)return null;c=j?g:0,d=j?g+1:i.length;for(;c<d;c++){e=i[c];if(e.selected&&(f.support.optDisabled?!e.disabled:e.getAttribute("disabled")===null)&&(!e.parentNode.disabled||!f.nodeName(e.parentNode,"optgroup"))){b=f(e).val();if(j)return b;h.push(b)}}if(j&&!h.length&&i.length)return f(i[g]).val();return h},set:function(a,b){var c=f.makeArray(b);f(a).find("option").each(function(){this.selected=f.inArray(f(this).val(),c)>=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(a,c,d,e){var g,h,i,j=a.nodeType;if(!!a&&j!==3&&j!==8&&j!==2){if(e&&c in f.attrFn)return f(a)[c](d);if(typeof a.getAttribute=="undefined")return f.prop(a,c,d);i=j!==1||!f.isXMLDoc(a),i&&(c=c.toLowerCase(),h=f.attrHooks[c]||(u.test(c)?x:w));if(d!==b){if(d===null){f.removeAttr(a,c);r
 eturn}if(h&&"set"in h&&i&&(g=h.set(a,d,c))!==b)return g;a.setAttribute(c,""+d);return d}if(h&&"get"in h&&i&&(g=h.get(a,c))!==null)return g;g=a.getAttribute(c);return g===null?b:g}},removeAttr:function(a,b){var c,d,e,g,h,i=0;if(b&&a.nodeType===1){d=b.toLowerCase().split(p),g=d.length;for(;i<g;i++)e=d[i],e&&(c=f.propFix[e]||e,h=u.test(e),h||f.attr(a,e,""),a.removeAttribute(v?e:c),h&&c in a&&(a[c]=!1))}},attrHooks:{type:{set:function(a,b){if(r.test(a.nodeName)&&a.parentNode)f.error("type property can't be changed");else if(!f.support.radioValue&&b==="radio"&&f.nodeName(a,"input")){var c=a.value;a.setAttribute("type",b),c&&(a.value=c);return b}}},value:{get:function(a,b){if(w&&f.nodeName(a,"button"))return w.get(a,b);return b in a?a.value:null},set:function(a,b,c){if(w&&f.nodeName(a,"button"))return w.set(a,b,c);a.value=b}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowsp
 an:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(a,c,d){var e,g,h,i=a.nodeType;if(!!a&&i!==3&&i!==8&&i!==2){h=i!==1||!f.isXMLDoc(a),h&&(c=f.propFix[c]||c,g=f.propHooks[c]);return d!==b?g&&"set"in g&&(e=g.set(a,d,c))!==b?e:a[c]=d:g&&"get"in g&&(e=g.get(a,c))!==null?e:a[c]}},propHooks:{tabIndex:{get:function(a){var c=a.getAttributeNode("tabindex");return c&&c.specified?parseInt(c.value,10):s.test(a.nodeName)||t.test(a.nodeName)&&a.href?0:b}}}}),f.attrHooks.tabindex=f.propHooks.tabIndex,x={get:function(a,c){var d,e=f.prop(a,c);return e===!0||typeof e!="boolean"&&(d=a.getAttributeNode(c))&&d.nodeValue!==!1?c.toLowerCase():b},set:function(a,b,c){var d;b===!1?f.removeAttr(a,c):(d=f.propFix[c]||c,d in a&&(a[d]=!0),a.setAttribute(c,c.toLowerCase()));return c}},v||(y={name:!0,id:!0,coords:!0},w=f.valHooks.button={get:function(a,c){var d;d=a.getAttributeNode(c);return d&&(y[c]?d.nodeValue!=="":d.specified)?d.nodeValue:b}
 ,set:function(a,b,d){var e=a.getAttributeNode(d);e||(e=c.createAttribute(d),a.setAttributeNode(e));return e.nodeValue=b+""}},f.attrHooks.tabindex.set=w.set,f.each(["width","height"],function(a,b){f.attrHooks[b]=f.extend(f.attrHooks[b],{set:function(a,c){if(c===""){a.setAttribute(b,"auto");return c}}})}),f.attrHooks.contenteditable={get:w.get,set:function(a,b,c){b===""&&(b="false"),w.set(a,b,c)}}),f.support.hrefNormalized||f.each(["href","src","width","height"],function(a,c){f.attrHooks[c]=f.extend(f.attrHooks[c],{get:function(a){var d=a.getAttribute(c,2);return d===null?b:d}})}),f.support.style||(f.attrHooks.style={get:function(a){return a.style.cssText.toLowerCase()||b},set:function(a,b){return a.style.cssText=""+b}}),f.support.optSelected||(f.propHooks.selected=f.extend(f.propHooks.selected,{get:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex);return null}})),f.support.enctype||(f.propFix.enctype="encoding"),f.support.checkOn||f.each(["r
 adio","checkbox"],function(){f.valHooks[this]={get:function(a){return a.getAttribute("value")===null?"on":a.value}}}),f.each(["radio","checkbox"],function(){f.valHooks[this]=f.extend(f.valHooks[this],{set:function(a,b){if(f.isArray(b))return a.checked=f.inArray(f(a).val(),b)>=0}})});var z=/^(?:textarea|input|select)$/i,A=/^([^\.]*)?(?:\.(.+))?$/,B=/(?:^|\s)hover(\.\S+)?\b/,C=/^key/,D=/^(?:mouse|contextmenu)|click/,E=/^(?:focusinfocus|focusoutblur)$/,F=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,G=function(
-a){var b=F.exec(a);b&&(b[1]=(b[1]||"").toLowerCase(),b[3]=b[3]&&new RegExp("(?:^|\\s)"+b[3]+"(?:\\s|$)"));return b},H=function(a,b){var c=a.attributes||{};return(!b[1]||a.nodeName.toLowerCase()===b[1])&&(!b[2]||(c.id||{}).value===b[2])&&(!b[3]||b[3].test((c["class"]||{}).value))},I=function(a){return f.event.special.hover?a:a.replace(B,"mouseenter$1 mouseleave$1")};f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3||a.nodeType===8||!c||!d||!(h=f._data(a)))){d.handler&&(p=d,d=p.handler,g=p.selector),d.guid||(d.guid=f.guid++),j=h.events,j||(h.events=j={}),i=h.handle,i||(h.handle=i=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.dispatch.apply(i.elem,arguments):b},i.elem=a),c=f.trim(I(c)).split(" ");for(k=0;k<c.length;k++){l=A.exec(c[k])||[],m=l[1],n=(l[2]||"").split(".").sort(),s=f.event.special[m]||{},m=(g?s.delegateType:s.bindType)||m,s=f.event.special[m]||{},o=f.extend({type:m,origType:l[1],data:e,handler:d,guid:d.gui
 d,selector:g,quick:g&&G(g),namespace:n.join(".")},p),r=j[m];if(!r){r=j[m]=[],r.delegateCount=0;if(!s.setup||s.setup.call(a,e,n,i)===!1)a.addEventListener?a.addEventListener(m,i,!1):a.attachEvent&&a.attachEvent("on"+m,i)}s.add&&(s.add.call(a,o),o.handler.guid||(o.handler.guid=d.guid)),g?r.splice(r.delegateCount++,0,o):r.push(o),f.event.global[m]=!0}a=null}},global:{},remove:function(a,b,c,d,e){var g=f.hasData(a)&&f._data(a),h,i,j,k,l,m,n,o,p,q,r,s;if(!!g&&!!(o=g.events)){b=f.trim(I(b||"")).split(" ");for(h=0;h<b.length;h++){i=A.exec(b[h])||[],j=k=i[1],l=i[2];if(!j){for(j in o)f.event.remove(a,j+b[h],c,d,!0);continue}p=f.event.special[j]||{},j=(d?p.delegateType:p.bindType)||j,r=o[j]||[],m=r.length,l=l?new RegExp("(^|\\.)"+l.split(".").sort().join("\\.(?:.*\\.)?")+"(\\.|$)"):null;for(n=0;n<r.length;n++)s=r[n],(e||k===s.origType)&&(!c||c.guid===s.guid)&&(!l||l.test(s.namespace))&&(!d||d===s.selector||d==="**"&&s.selector)&&(r.splice(n--,1),s.selector&&r.delegateCount--,p.remove&&p.remov
 e.call(a,s));r.length===0&&m!==r.length&&((!p.teardown||p.teardown.call(a,l)===!1)&&f.removeEvent(a,j,g.handle),delete o[j])}f.isEmptyObject(o)&&(q=g.handle,q&&(q.elem=null),f.removeData(a,["events","handle"],!0))}},customEvent:{getData:!0,setData:!0,changeData:!0},trigger:function(c,d,e,g){if(!e||e.nodeType!==3&&e.nodeType!==8){var h=c.type||c,i=[],j,k,l,m,n,o,p,q,r,s;if(E.test(h+f.event.triggered))return;h.indexOf("!")>=0&&(h=h.slice(0,-1),k=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if((!e||f.event.customEvent[h])&&!f.event.global[h])return;c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.isTrigger=!0,c.exclusive=k,c.namespace=i.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)"):null,o=h.indexOf(":")<0?"on"+h:"";if(!e){j=f.cache;for(l in j)j[l].events&&j[l].events[h]&&f.event.trigger(c,d,j[l].handle.elem,!0);return}c.result=b,c.target||(c.target=e),d=d!=null?f.makeArray(d):[],d.unshift(c),p=
 f.event.special[h]||{};if(p.trigger&&p.trigger.apply(e,d)===!1)return;r=[[e,p.bindType||h]];if(!g&&!p.noBubble&&!f.isWindow(e)){s=p.delegateType||h,m=E.test(s+h)?e:e.parentNode,n=null;for(;m;m=m.parentNode)r.push([m,s]),n=m;n&&n===e.ownerDocument&&r.push([n.defaultView||n.parentWindow||a,s])}for(l=0;l<r.length&&!c.isPropagationStopped();l++)m=r[l][0],c.type=r[l][1],q=(f._data(m,"events")||{})[c.type]&&f._data(m,"handle"),q&&q.apply(m,d),q=o&&m[o],q&&f.acceptData(m)&&q.apply(m,d)===!1&&c.preventDefault();c.type=h,!g&&!c.isDefaultPrevented()&&(!p._default||p._default.apply(e.ownerDocument,d)===!1)&&(h!=="click"||!f.nodeName(e,"a"))&&f.acceptData(e)&&o&&e[h]&&(h!=="focus"&&h!=="blur"||c.target.offsetWidth!==0)&&!f.isWindow(e)&&(n=e[o],n&&(e[o]=null),f.event.triggered=h,e[h](),f.event.triggered=b,n&&(e[o]=n));return c.result}},dispatch:function(c){c=f.event.fix(c||a.event);var d=(f._data(this,"events")||{})[c.type]||[],e=d.delegateCount,g=[].slice.call(arguments,0),h=!c.exclusive&&!c.na
 mespace,i=f.event.special[c.type]||{},j=[],k,l,m,n,o,p,q,r,s,t,u;g[0]=c,c.delegateTarget=this;if(!i.preDispatch||i.preDispatch.call(this,c)!==!1){if(e&&(!c.button||c.type!=="click")){n=f(this),n.context=this.ownerDocument||this;for(m=c.target;m!=this;m=m.parentNode||this)if(m.disabled!==!0){p={},r=[],n[0]=m;for(k=0;k<e;k++)s=d[k],t=s.selector,p[t]===b&&(p[t]=s.quick?H(m,s.quick):n.is(t)),p[t]&&r.push(s);r.length&&j.push({elem:m,matches:r})}}d.length>e&&j.push({elem:this,matches:d.slice(e)});for(k=0;k<j.length&&!c.isPropagationStopped();k++){q=j[k],c.currentTarget=q.elem;for(l=0;l<q.matches.length&&!c.isImmediatePropagationStopped();l++){s=q.matches[l];if(h||!c.namespace&&!s.namespace||c.namespace_re&&c.namespace_re.test(s.namespace))c.data=s.data,c.handleObj=s,o=((f.event.special[s.origType]||{}).handle||s.handler).apply(q.elem,g),o!==b&&(c.result=o,o===!1&&(c.preventDefault(),c.stopPropagation()))}}i.postDispatch&&i.postDispatch.call(this,c);return c.result}},props:"attrChange attr
 Name relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){a.which==null&&(a.which=b.charCode!=null?b.charCode:b.keyCode);return a}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,d){var e,f,g,h=d.button,i=d.fromElement;a.pageX==null&&d.clientX!=null&&(e=a.target.ownerDocument||c,f=e.documentElement,g=e.body,a.pageX=d.clientX+(f&&f.scrollLeft||g&&g.scrollLeft||0)-(f&&f.clientLeft||g&&g.clientLeft||0),a.pageY=d.clientY+(f&&f.scrollTop||g&&g.scrollTop||0)-(f&&f.clientTop||g&&g.clientTop||0)),!a.relatedTarget&&i&&(a.relatedTarget=i===a.target?d.toElement:i),!a.which&&h!==b&&(a.which=h&1?1:h&2?3:h&4?2:0);return a}},fix:function(a){if(a[f.expando])return a;var d,e,g=a,h=f.event.fixHooks[a.type]||{},i=h.prop
 s?this.props.concat(h.props):this.props;a=f.Event(g);for(d=i.length;d;)e=i[--d],a[e]=g[e];a.target||(a.target=g.srcElement||c),a.target.nodeType===3&&(a.target=a.target.parentNode),a.metaKey===b&&(a.metaKey=a.ctrlKey);return h.filter?h.filter(a,g):a},special:{ready:{setup:f.bindReady},load:{noBubble:!0},focus:{delegateType:"focusin"},blur:{delegateType:"focusout"},beforeunload:{setup:function(a,b,c){f.isWindow(this)&&(this.onbeforeunload=c)},teardown:function(a,b){this.onbeforeunload===b&&(this.onbeforeunload=null)}}},simulate:function(a,b,c,d){var e=f.extend(new f.Event,c,{type:a,isSimulated:!0,originalEvent:{}});d?f.event.trigger(e,null,b):f.event.dispatch.call(b,e),e.isDefaultPrevented()&&c.preventDefault()}},f.event.handle=f.event.dispatch,f.removeEvent=c.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){a.detachEvent&&a.detachEvent("on"+b,c)},f.Event=function(a,b){if(!(this instanceof f.Event))return new f.Event(a,b);a&&a.
 type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||a.returnValue===!1||a.getPreventDefault&&a.getPreventDefault()?K:J):this.type=a,b&&f.extend(this,b),this.timeStamp=a&&a.timeStamp||f.now(),this[f.expando]=!0},f.Event.prototype={preventDefault:function(){this.isDefaultPrevented=K;var a=this.originalEvent;!a||(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){this.isPropagationStopped=K;var a=this.originalEvent;!a||(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=K,this.stopPropagation()},isDefaultPrevented:J,isPropagationStopped:J,isImmediatePropagationStopped:J},f.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){f.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c=this,d=a.relatedTarget,e=a.handleObj,g=e.selector,h;if(!d||d!==c&&!f.contains(c,d))a.type=e.origType,h=e.handler.apply(this,arguments),a.
 type=b;return h}}}),f.support.submitBubbles||(f.event.special.submit={setup:function(){if(f.nodeName(this,"form"))return!1;f.event.add(this,"click._submit keypress._submit",function(a){var c=a.target,d=f.nodeName(c,"input")||f.nodeName(c,"button")?c.form:b;d&&!d._submit_attached&&(f.event.add(d,"submit._submit",function(a){a._submit_bubble=!0}),d._submit_attached=!0)})},postDispatch:function(a){a._submit_bubble&&(delete a._submit_bubble,this.parentNode&&!a.isTrigger&&f.event.simulate("submit",this.parentNode,a,!0))},teardown:function(){if(f.nodeName(this,"form"))return!1;f.event.remove(this,"._submit")}}),f.support.changeBubbles||(f.event.special.change={setup:function(){if(z.test(this.nodeName)){if(this.type==="checkbox"||this.type==="radio")f.event.add(this,"propertychange._change",function(a){a.originalEvent.propertyName==="checked"&&(this._just_changed=!0)}),f.event.add(this,"click._change",function(a){this._just_changed&&!a.isTrigger&&(this._just_changed=!1,f.event.simulate("ch
 ange",this,a,!0))});return!1}f.event.add(this,"beforeactivate._change",function(a){var b=a.target;z.test(b.nodeName)&&!b._change_attached&&(f.event.add(b,"change._change",function(a){this.parentNode&&!a.isSimulated&&!a.isTrigger&&f.event.simulate("change",this.parentNode,a,!0)}),b._change_attached=!0)})},handle:function(a){var b=a.target;if(this!==b||a.isSimulated||a.isTrigger||b.type!=="radio"&&b.type!=="checkbox")return a.handleObj.handler.apply(this,arguments)},teardown:function(){f.event.remove(this,"._change");return z.test(this.nodeName)}}),f.support.focusinBubbles||f.each({focus:"focusin",blur:"focusout"},function(a,b){var d=0,e=function(a){f.event.simulate(b,a.target,f.event.fix(a),!0)};f.event.special[b]={setup:function(){d++===0&&c.addEventListener(a,e,!0)},teardown:function(){--d===0&&c.removeEventListener(a,e,!0)}}}),f.fn.extend({on:function(a,c,d,e,g){var h,i;if(typeof a=="object"){typeof c!="string"&&(d=d||c,c=b);for(i in a)this.on(i,c,d,a[i],g);return this}d==null&&e=
 =null?(e=c,d=c=b):e==null&&(typeof c=="string"?(e=d,d=b):(e=d,d=c,c=b));if(e===!1)e=J;else if(!e)return this;g===1&&(h=e,e=function(a){f().off(a);return h.apply(this,arguments)},e.guid=h.guid||(h.guid=f.guid++));return this.each(function(){f.event.add(this,a,e,d,c)})},one:function(a,b,c,d){return this.on(a,b,c,d,1)},off:function(a,c,d){if(a&&a.preventDefault&&a.handleObj){var e=a.handleObj;f(a.delegateTarget).off(e.namespace?e.origType+"."+e.namespace:e.origType,e.selector,e.handler);return this}if(typeof a=="object"){for(var g in a)this.off(g,c,a[g]);return this}if(c===!1||typeof c=="function")d=c,c=b;d===!1&&(d=J);return this.each(function(){f.event.remove(this,a,d,c)})},bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},live:function(a,b,c){f(this.context).on(a,this.selector,b,c);return this},die:function(a,b){f(this.context).off(a,this.selector||"**",b);return this},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:funct
 ion(a,b,c){return arguments.length==1?this.off(a,"**"):this.off(b,a,c)},trigger:function(a,b){return this.each(function(){f.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0])return f.event.trigger(a,b,this[0],!0)},toggle:function(a){var b=arguments,c=a.guid||f.guid++,d=0,e=function(c){var e=(f._data(this,"lastToggle"+a.guid)||0)%d;f._data(this,"lastToggle"+a.guid,e+1),c.preventDefault();return b[e].apply(this,arguments)||!1};e.guid=c;while(d<b.length)b[d++].guid=c;return this.click(e)},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}}),f.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){f.fn[b]=function(a,c){c==null&&(c=a,a=null);return arguments.length>0?this.on(b,null,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0),C.test(b)&&(f.event.fixHooks[b]=f.event.keyHooks),D.tes
 t(b)&&(f.event.fixHooks[b]=f.event.mouseHooks)}),function(){function x(a,b,c,e,f,g){for(var h=0,i=e.length;h<i;h++){var j=e[h];if(j){var k=!1;j=j[a];while(j){if(j[d]===c){k=e[j.sizset];break}if(j.nodeType===1){g||(j[d]=c,j.sizset=h);if(typeof b!="string"){if(j===b){k=!0;break}}else if(m.filter(b,[j]).length>0){k=j;break}}j=j[a]}e[h]=k}}}function w(a,b,c,e,f,g){for(var h=0,i=e.length;h<i;h++){var j=e[h];if(j){var k=!1;j=j[a];while(j){if(j[d]===c){k=e[j.sizset];break}j.nodeType===1&&!g&&(j[d]=c,j.sizset=h);if(j.nodeName.toLowerCase()===b){k=j;break}j=j[a]}e[h]=k}}}var a=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d="sizcache"+(Math.random()+"").replace(".",""),e=0,g=Object.prototype.toString,h=!1,i=!0,j=/\\/g,k=/\r\n/g,l=/\W/;[0,0].sort(function(){i=!1;return 0});var m=function(b,d,e,f){e=e||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return e;var i,j,k,
 l,n,q,r,t,u=!0,v=m.isXML(d),w=[],x=b;do{a.exec(""),i=a.exec(x);if(i){x=i[3],w.push(i[1]);if(i[2]){l=i[3];break}}}while(i);if(w.length>1&&p.exec(b))if(w.length===2&&o.relative[w[0]])j=y(w[0]+w[1],d,f);else{j=o.relative[w[0]]?[d]:m(w.shift(),d);while(w.length)b=w.shift(),o.relative[b]&&(b+=w.shift()),j=y(b,j,f)}else{!f&&w.length>1&&d.nodeType===9&&!v&&o.match.ID.test(w[0])&&!o.match.ID.test(w[w.length-1])&&(n=m.find(w.shift(),d,v),d=n.expr?m.filter(n.expr,n.set)[0]:n.set[0]);if(d){n=f?{expr:w.pop(),set:s(f)}:m.find(w.pop(),w.length===1&&(w[0]==="~"||w[0]==="+")&&d.parentNode?d.parentNode:d,v),j=n.expr?m.filter(n.expr,n.set):n.set,w.length>0?k=s(j):u=!1;while(w.length)q=w.pop(),r=q,o.relative[q]?r=w.pop():q="",r==null&&(r=d),o.relative[q](k,r,v)}else k=w=[]}k||(k=j),k||m.error(q||b);if(g.call(k)==="[object Array]")if(!u)e.push.apply(e,k);else if(d&&d.nodeType===1)for(t=0;k[t]!=null;t++)k[t]&&(k[t]===!0||k[t].nodeType===1&&m.contains(d,k[t]))&&e.push(j[t]);else for(t=0;k[t]!=null;t++)k[
 t]&&k[t].nodeType===1&&e.push(j[t]);else s(k,e);l&&(m(l,h,e,f),m.uniqueSort(e));return e};m.uniqueSort=function(a){if(u){h=i,a.sort(u);if(h)for(var b=1;b<a.length;b++)a[b]===a[b-1]&&a.splice(b--,1)}return a},m.matches=function(a,b){return m(a,null,null,b)},m.matchesSelector=function(a,b){return m(b,null,null,[a]).length>0},m.find=function(a,b,c){var d,e,f,g,h,i;if(!a)return[];for(e=0,f=o.order.length;e<f;e++){h=o.order[e];if(g=o.leftMatch[h].exec(a)){i=g[1],g.splice(1,1);if(i.substr(i.length-1)!=="\\"){g[1]=(g[1]||"").replace(j,""),d=o.find[h](g,b,c);if(d!=null){a=a.replace(o.match[h],"");break}}}}d||(d=typeof b.getElementsByTagName!="undefined"?b.getElementsByTagName("*"):[]);return{set:d,expr:a}},m.filter=function(a,c,d,e){var f,g,h,i,j,k,l,n,p,q=a,r=[],s=c,t=c&&c[0]&&m.isXML(c[0]);while(a&&c.length){for(h in o.filter)if((f=o.leftMatch[h].exec(a))!=null&&f[2]){k=o.filter[h],l=f[1],g=!1,f.splice(1,1);if(l.substr(l.length-1)==="\\")continue;s===r&&(r=[]);if(o.preFilter[h]){f=o.preFi
 lter[h](f,s,d,r,e,t);if(!f)g=i=!0;else if(f===!0)continue}if(f)for(n=0;(j=s[n])!=null;n++)j&&(i=k(j,f,n,s),p=e^i,d&&i!=null?p?g=!0:s[n]=!1:p&&(r.push(j),g=!0));if(i!==b){d||(s=r),a=a.replace(o.match[h],"");if(!g)return[];break}}if(a===q)if(g==null)m.error(a);else break;q=a}return s},m.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)};var n=m.getText=function(a){var b,c,d=a.nodeType,e="";if(d){if(d===1||d===9||d===11){if(typeof a.textContent=="string")return a.textContent;if(typeof a.innerText=="string")return a.innerText.replace(k,"");for(a=a.firstChild;a;a=a.nextSibling)e+=n(a)}else if(d===3||d===4)return a.nodeValue}else for(b=0;c=a[b];b++)c.nodeType!==8&&(e+=n(c));return e},o=m.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]
 |\\.)*)|)|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(a){return a.getAttribute("href")},type:function(a){return a.getAttribute("type")}},relative:{"+":function(a,b){var c=typeof b=="string",d=c&&!l.test(b),e=c&&!d;d&&(b=b.toLowerCase());for(var f=0,g=a.length,h;f<g;f++)if(h=a[f]){while((h=h.previousSibling)&&h.nodeType!==1);a[f]=e||h&&h.nodeName.toLowerCase()===b?h||!1:h===b}e&&m.filter(b,a,!0)},">":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!l.test(b)){b=b.toLowerCase();for(;e<f;e++){c=a[e];if(c){var g=c.parentNode;a[e]=g.nodeName.toLowerCase()===b?g:!1}}}else{for(;e<f;e++)c=a[e],c&&(a[e]=d?c.parentNode:c.parentNode=
 ==b);d&&m.filter(b,a,!0)}},"":function(a,b,c){var d,f=e++,g=x;typeof b=="string"&&!l.test(b)&&(b=b.toLowerCase(),d=b,g=w),g("parentNode",b,f,a,d,c)},"~":function(a,b,c){var d,f=e++,g=x;typeof b=="string"&&!l.test(b)&&(b=b.toLowerCase(),d=b,g=w),g("previousSibling",b,f,a,d,c)}},find:{ID:function(a,b,c){if(typeof b.getElementById!="undefined"&&!c){var d=b.getElementById(a[1]);return d&&d.parentNode?[d]:[]}},NAME:function(a,b){if(typeof b.getElementsByName!="undefined"){var c=[],d=b.getElementsByName(a[1]);for(var e=0,f=d.length;e<f;e++)d[e].getAttribute("name")===a[1]&&c.push(d[e]);return c.length===0?null:c}},TAG:function(a,b){if(typeof b.getElementsByTagName!="undefined")return b.getElementsByTagName(a[1])}},preFilter:{CLASS:function(a,b,c,d,e,f){a=" "+a[1].replace(j,"")+" ";if(f)return a;for(var g=0,h;(h=b[g])!=null;g++)h&&(e^(h.className&&(" "+h.className+" ").replace(/[\t\n\r]/g," ").indexOf(a)>=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(j,"")},TAG
 :function(a,b){return a[1].replace(j,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||m.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&m.error(a[0]);a[0]=e++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(j,"");!f&&o.attrMap[g]&&(a[1]=o.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(j,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=m(b[3],null,null,c);else{var g=m.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(o.match.POS.test(b[0])||o.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.
 parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!m(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a)
 {var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return b<c[3]-0},gt:function(a,b,c){return b>c[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=o.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||n([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h<i;h++)if(g[h]===a)return!1;return!0}m.error(e)},CHILD:function(a,b){var c,e,f,g,h,i,j,k=b[1],l=a;switch(k){case"only":case"first":while(l=l.previousSibling)if(l.nodeType===1)return!1;if(k==="first")return!0;l=a;case"last":while(l=l.nextSibling)if(l.nod
 eType===1)return!1;return!0;case"nth":c=b[2],e=b[3];if(c===1&&e===0)return!0;f=b[0],g=a.parentNode;if(g&&(g[d]!==f||!a.nodeIndex)){i=0;for(l=g.firstChild;l;l=l.nextSibling)l.nodeType===1&&(l.nodeIndex=++i);g[d]=f}j=a.nodeIndex-e;return c===0?j===0:j%c===0&&j/c>=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||!!a.nodeName&&a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=m.attr?m.attr(a,c):o.attrHandle[c]?o.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":!f&&m.attr?d!=null:f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=o.setFilters[e];if(f)return f(a,c,b,d)}}},p
 =o.match.POS,q=function(a,b){return"\\"+(b-0+1)};for(var r in o.match)o.match[r]=new RegExp(o.match[r].source+/(?![^\[]*\])(?![^\(]*\))/.source),o.leftMatch[r]=new RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[r].source.replace(/\\(\d+)/g,q));o.match.globalPOS=p;var s=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(t){s=function(a,b){var c=0,d=b||[];if(g.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var e=a.length;c<e;c++)d.push(a[c]);else for(;a[c];c++)d.push(a[c]);return d}}var u,v;c.documentElement.compareDocumentPosition?u=function(a,b){if(a===b){h=!0;return 0}if(!a.compareDocumentPosition||!b.compareDocumentPosition)return a.compareDocumentPosition?-1:1;return a.compareDocumentPosition(b)&4?-1:1}:(u=function(a,b){if(a===b){h=!0;return 0}if(a.sourceIndex&&b.sourceIndex)return a.sourceIndex-b.sourceIndex;var c,d,
 e=[],f=[],g=a.parentNode,i=b.parentNode,j=g;if(g===i)return v(a,b);if(!g)return-1;if(!i)return 1;while(j)e.unshift(j),j=j.parentNode;j=i;while(j)f.unshift(j),j=j.parentNode;c=e.length,d=f.length;for(var k=0;k<c&&k<d;k++)if(e[k]!==f[k])return v(e[k],f[k]);return k===c?v(a,f[k],-1):v(e[k],b,1)},v=function(a,b,c){if(a===b)return c;var d=a.nextSibling;while(d){if(d===b)return-1;d=d.nextSibling}return 1}),function(){var a=c.createElement("div"),d="script"+(new Date).getTime(),e=c.documentElement;a.innerHTML="<a name='"+d+"'/>",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(o.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},o.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElemen
 t("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(o.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="<a href='#'></a>",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(o.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=m,b=c.createElement("div"),d="__sizzle__";b.innerHTML="<p class='TEST'></p>";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){m=function(b,e,f,g){e=e||c;if(!g&&!m.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return s(e.getElementsByTagName(b),f);if(h[2]&&o.find.CLASS&&e.getElementsByClassName)return s(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return s([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]
 );if(!i||!i.parentNode)return s([],f);if(i.id===h[3])return s([i],f)}try{return s(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var k=e,l=e.getAttribute("id"),n=l||d,p=e.parentNode,q=/^\s*[+~]/.test(b);l?n=n.replace(/'/g,"\\$&"):e.setAttribute("id",n),q&&p&&(e=e.parentNode);try{if(!q||p)return s(e.querySelectorAll("[id='"+n+"'] "+b),f)}catch(r){}finally{l||k.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)m[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}m.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!m.isXML(a))try{if(e||!o.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return m(c,null,null,[a]).length>0}}
 }(),function(){var a=c.createElement("div");a.innerHTML="<div class='test e'></div><div class='test'></div>";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;o.order.splice(1,0,"CLASS"),o.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?m.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?m.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:m.contains=function(){return!1},m.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var y=function(a,b,c){var d,e=[],f="",g=b.nodeType?[b]:b;while(d=o.match.PSEUDO.exec(a))f+=d[0],a=a.replace(o.match.PSEUDO,"");a=o.relative[a]?a+"*":a;for(var h=0,i=g.length;h<i;h++)m(a,g[h],e,c);return m.filter(f,e)};m.attr=f.attr,m.select
 ors.attrMap={},f.find=m,f.expr=m.selectors,f.expr[":"]=f.expr.filters,f.unique=m.uniqueSort,f.text=m.getText,f.isXMLDoc=m.isXML,f.contains=m.contains}();var L=/Until$/,M=/^(?:parents|prevUntil|prevAll)/,N=/,/,O=/^.[^:#\[\.,]*$/,P=Array.prototype.slice,Q=f.expr.match.globalPOS,R={children:!0,contents:!0,next:!0,prev:!0};f.fn.extend({find:function(a){var b=this,c,d;if(typeof a!="string")return f(a).filter(function(){for(c=0,d=b.length;c<d;c++)if(f.contains(b[c],this))return!0});var e=this.pushStack("","find",a),g,h,i;for(c=0,d=this.length;c<d;c++){g=e.length,f.find(a,this[c],e);if(c>0)for(h=g;h<e.length;h++)for(i=0;i<g;i++)if(e[i]===e[h]){e.splice(h--,1);break}}return e},has:function(a){var b=f(a);return this.filter(function(){for(var a=0,c=b.length;a<c;a++)if(f.contains(this,b[a]))return!0})},not:function(a){return this.pushStack(T(this,a,!1),"not",a)},filter:function(a){return this.pushStack(T(this,a,!0),"filter",a)},is:function(a){return!!a&&(typeof a=="string"?Q.test(a)?f(a,this.c
 ontext).index(this[0])>=0:f.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h=1;while(g&&g.ownerDocument&&g!==b){for(d=0;d<a.length;d++)f(g).is(a[d])&&c.push({selector:a[d],elem:g,level:h});g=g.parentNode,h++}return c}var i=Q.test(a)||typeof a!="string"?f(a,b||this.context):0;for(d=0,e=this.length;d<e;d++){g=this[d];while(g){if(i?i.index(g)>-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a)return this[0]&&this[0].parentNode?this.prevAll().length:-1;if(typeof a=="string")return f.inArray(this[0],f(a));return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(S(c[0])||S(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({p
 arent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c);L.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!R[a]?f.unique(e):e,(this.length>1||N.test(d))&&M.test(a)&&(e=e.reverse());return this.pushStack(e,a,P
 .call(arguments).join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var V="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",W=/ jQuery\d+="(?:\d+|null)"/g,X=/^\s+/,Y=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Z=/<([\w:]+)/,$=/<tbody/i,_=/<|&#?\w+;/,ba=/<(?:script|style)/i,bb=/<(?:script|object|embed|option|style)/i,bc=new RegExp("<(?:"+V+")[\\s/>]","i"),bd=/checked\s*(?:[^=]|=\s*.checked.)/i,be=/\/(java|ecma)script/i,bf=/^
 \s*<!(?:\[CDATA\[|\-\-)/,bg={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]},bh=U(c);bg.optgroup=bg.option,bg.tbody=bg.tfoot=bg.colgroup=bg.caption=bg.thead,bg.th=bg.td,f.support.htmlSerialize||(bg._default=[1,"div<div>","</div>"]),f.fn.extend({text:function(a){return f.access(this,function(a){return a===b?f.text(this):this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a))},null,a,arguments.length)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChi
 ld;return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=f.isFunction(a);return this.each(function(c){f(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f
-.clean(arguments);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f.clean(arguments));return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){return f.access(this,function(a){var c=this[0]||{},d=0,e=this.length;if(a===b)return c.nodeType===1?c.innerHTML.replace(W,""):null;
 if(typeof a=="string"&&!ba.test(a)&&(f.support.leadingWhitespace||!X.test(a))&&!bg[(Z.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Y,"<$1></$2>");try{for(;d<e;d++)c=this[d]||{},c.nodeType===1&&(f.cleanData(c.getElementsByTagName("*")),c.innerHTML=a);c=0}catch(g){}}c&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(a){if(this[0]&&this[0].parentNode){if(f.isFunction(a))return this.each(function(b){var c=f(this),d=c.html();c.replaceWith(a.call(this,b,d))});typeof a!="string"&&(a=f(a).detach());return this.each(function(){var b=this.nextSibling,c=this.parentNode;f(this).remove(),b?f(b).before(a):f(c).append(a)})}return this.length?this.pushStack(f(f.isFunction(a)?a():a),"replaceWith",a):this},detach:function(a){return this.remove(a,!0)},domManip:function(a,c,d){var e,g,h,i,j=a[0],k=[];if(!f.support.checkClone&&arguments.length===3&&typeof j=="string"&&bd.test(j))return this.each(function(){f(this).domManip(a,c,d,!0)});if(f.isFunction(j))return this.each(functi
 on(e){var g=f(this);a[0]=j.call(this,e,c?g.html():b),g.domManip(a,c,d)});if(this[0]){i=j&&j.parentNode,f.support.parentNode&&i&&i.nodeType===11&&i.childNodes.length===this.length?e={fragment:i}:e=f.buildFragment(a,this,k),h=e.fragment,h.childNodes.length===1?g=h=h.firstChild:g=h.firstChild;if(g){c=c&&f.nodeName(g,"tr");for(var l=0,m=this.length,n=m-1;l<m;l++)d.call(c?bi(this[l],g):this[l],e.cacheable||m>1&&l<n?f.clone(h,!0,!0):h)}k.length&&f.each(k,function(a,b){b.src?f.ajax({type:"GET",global:!1,url:b.src,async:!1,dataType:"script"}):f.globalEval((b.text||b.textContent||b.innerHTML||"").replace(bf,"/*$0*/")),b.parentNode&&b.parentNode.removeChild(b)})}return this}}),f.buildFragment=function(a,b,d){var e,g,h,i,j=a[0];b&&b[0]&&(i=b[0].ownerDocument||b[0]),i.createDocumentFragment||(i=c),a.length===1&&typeof j=="string"&&j.length<512&&i===c&&j.charAt(0)==="<"&&!bb.test(j)&&(f.support.checkClone||!bd.test(j))&&(f.support.html5Clone||!bc.test(j))&&(g=!0,h=f.fragments[j],h&&h!==1&&(e=h))
 ,e||(e=i.createDocumentFragment(),f.clean(a,i,e,d)),g&&(f.fragments[j]=h?e:1);return{fragment:e,cacheable:g}},f.fragments={},f.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){f.fn[a]=function(c){var d=[],e=f(c),g=this.length===1&&this[0].parentNode;if(g&&g.nodeType===11&&g.childNodes.length===1&&e.length===1){e[b](this[0]);return this}for(var h=0,i=e.length;h<i;h++){var j=(h>0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d,e,g,h=f.support.html5Clone||f.isXMLDoc(a)||!bc.test("<"+a.nodeName+">")?a.cloneNode(!0):bo(a);if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bk(a,h),d=bl(a),e=bl(h);for(g=0;d[g];++g)e[g]&&bk(d[g],e[g])}if(b){bj(a,h);if(c){d=bl(a),e=bl(h);for(g=0;d[g];++g)bj(d[g],e[g])}}d=e=null;return h},clean:function(a,b,d,e){var g,h,i,j=[];b=b||c,typeof b.
 createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);for(var k=0,l;(l=a[k])!=null;k++){typeof l=="number"&&(l+="");if(!l)continue;if(typeof l=="string")if(!_.test(l))l=b.createTextNode(l);else{l=l.replace(Y,"<$1></$2>");var m=(Z.exec(l)||["",""])[1].toLowerCase(),n=bg[m]||bg._default,o=n[0],p=b.createElement("div"),q=bh.childNodes,r;b===c?bh.appendChild(p):U(b).appendChild(p),p.innerHTML=n[1]+l+n[2];while(o--)p=p.lastChild;if(!f.support.tbody){var s=$.test(l),t=m==="table"&&!s?p.firstChild&&p.firstChild.childNodes:n[1]==="<table>"&&!s?p.childNodes:[];for(i=t.length-1;i>=0;--i)f.nodeName(t[i],"tbody")&&!t[i].childNodes.length&&t[i].parentNode.removeChild(t[i])}!f.support.leadingWhitespace&&X.test(l)&&p.insertBefore(b.createTextNode(X.exec(l)[0]),p.firstChild),l=p.childNodes,p&&(p.parentNode.removeChild(p),q.length>0&&(r=q[q.length-1],r&&r.parentNode&&r.parentNode.removeChild(r)))}var u;if(!f.support.appendChecked)if(l[0]&&typeof (u=l.length)=="number")for(i=0;
 i<u;i++)bn(l[i]);else bn(l);l.nodeType?j.push(l):j=f.merge(j,l)}if(d){g=function(a){return!a.type||be.test(a.type)};for(k=0;j[k];k++){h=j[k];if(e&&f.nodeName(h,"script")&&(!h.type||be.test(h.type)))e.push(h.parentNode?h.parentNode.removeChild(h):h);else{if(h.nodeType===1){var v=f.grep(h.getElementsByTagName("script"),g);j.splice.apply(j,[k+1,0].concat(v))}d.appendChild(h)}}}return j},cleanData:function(a){var b,c,d=f.cache,e=f.event.special,g=f.support.deleteExpando;for(var h=0,i;(i=a[h])!=null;h++){if(i.nodeName&&f.noData[i.nodeName.toLowerCase()])continue;c=i[f.expando];if(c){b=d[c];if(b&&b.events){for(var j in b.events)e[j]?f.event.remove(i,j):f.removeEvent(i,j,b.handle);b.handle&&(b.handle.elem=null)}g?delete i[f.expando]:i.removeAttribute&&i.removeAttribute(f.expando),delete d[c]}}}});var bp=/alpha\([^)]*\)/i,bq=/opacity=([^)]*)/,br=/([A-Z]|^ms)/g,bs=/^[\-+]?(?:\d*\.)?\d+$/i,bt=/^-?(?:\d*\.)?\d+(?!px)[^\d\s]+$/i,bu=/^([\-+])=([\-+.\de]+)/,bv=/^margin/,bw={position:"absolute",vi
 sibility:"hidden",display:"block"},bx=["Top","Right","Bottom","Left"],by,bz,bA;f.fn.css=function(a,c){return f.access(this,function(a,c,d){return d!==b?f.style(a,c,d):f.css(a,c)},a,c,arguments.length>1)},f.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=by(a,"opacity");return c===""?"1":c}return a.style.opacity}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":f.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,d,e){if(!!a&&a.nodeType!==3&&a.nodeType!==8&&!!a.style){var g,h,i=f.camelCase(c),j=a.style,k=f.cssHooks[i];c=f.cssProps[i]||i;if(d===b){if(k&&"get"in k&&(g=k.get(a,!1,e))!==b)return g;return j[c]}h=typeof d,h==="string"&&(g=bu.exec(d))&&(d=+(g[1]+1)*+g[2]+parseFloat(f.css(a,c)),h="number");if(d==null||h==="number"&&isNaN(d))return;h==="number"&&!f.cssNumber[i]&&(d+="px");if(!k||!("set"in k)||(d=k.set(a,d))!==b)try{j[c]=d}catch(l){}}},css:function(a,c,d){var e,g;c=f.camelCase(c),g=f
 .cssHooks[c],c=f.cssProps[c]||c,c==="cssFloat"&&(c="float");if(g&&"get"in g&&(e=g.get(a,!0,d))!==b)return e;if(by)return by(a,c)},swap:function(a,b,c){var d={},e,f;for(f in b)d[f]=a.style[f],a.style[f]=b[f];e=c.call(a);for(f in b)a.style[f]=d[f];return e}}),f.curCSS=f.css,c.defaultView&&c.defaultView.getComputedStyle&&(bz=function(a,b){var c,d,e,g,h=a.style;b=b.replace(br,"-$1").toLowerCase(),(d=a.ownerDocument.defaultView)&&(e=d.getComputedStyle(a,null))&&(c=e.getPropertyValue(b),c===""&&!f.contains(a.ownerDocument.documentElement,a)&&(c=f.style(a,b))),!f.support.pixelMargin&&e&&bv.test(b)&&bt.test(c)&&(g=h.width,h.width=c,c=e.width,h.width=g);return c}),c.documentElement.currentStyle&&(bA=function(a,b){var c,d,e,f=a.currentStyle&&a.currentStyle[b],g=a.style;f==null&&g&&(e=g[b])&&(f=e),bt.test(f)&&(c=g.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),g.left=b==="fontSize"?"1em":f,f=g.pixelLeft+"px",g.left=c,d&&(a.runtimeStyle.left=d));return f
 ===""?"auto":f}),by=bz||bA,f.each(["height","width"],function(a,b){f.cssHooks[b]={get:function(a,c,d){if(c)return a.offsetWidth!==0?bB(a,b,d):f.swap(a,bw,function(){return bB(a,b,d)})},set:function(a,b){return bs.test(b)?b+"px":b}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return bq.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=f.isNumeric(b)?"alpha(opacity="+b*100+")":"",g=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&f.trim(g.replace(bp,""))===""){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bp.test(g)?g.replace(bp,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){return f.swap(a,{display:"inline-block"},function(){return b?by(a,"margin-right"):a.style.marginRight})}})}),f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.su
 pport.reliableHiddenOffsets&&(a.style&&a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)}),f.each({margin:"",padding:"",border:"Width"},function(a,b){f.cssHooks[a+b]={expand:function(c){var d,e=typeof c=="string"?c.split(" "):[c],f={};for(d=0;d<4;d++)f[a+bx[d]+b]=e[d]||e[d-2]||e[0];return f}}});var bC=/%20/g,bD=/\[\]$/,bE=/\r?\n/g,bF=/#.*$/,bG=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bH=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bI=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,bJ=/^(?:GET|HEAD)$/,bK=/^\/\//,bL=/\?/,bM=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,bN=/^(?:select|textarea)/i,bO=/\s+/,bP=/([?&])_=[^&]*/,bQ=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bR=f.fn.load,bS={},bT={},bU,bV,bW=["*/"]+["*"];try{bU=e.href}catch(bX){bU=c.createElement("a"),bU.href="",bU=bU.href}bV=bQ.exec(bU.toLowerCase())||[],f.fn.extend({load:f
 unction(a,c,d){if(typeof a!="string"&&bR)return bR.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("<div>").append(c.replace(bM,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bN.test(this.nodeName)||bH.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bE,"\r\n")}}):{name:b.name,value:c.replace(bE,"\r\n")}}).get()}}),f.e
 ach("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.on(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?b$(a,f.ajaxSettings):(b=a,a=f.ajaxSettings),b$(a,b);return a},ajaxSettings:{url:bU,isLocal:bI.test(bV[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":bW},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML},flatOptions:{context:!0,url:!0}},
 ajaxPrefilter:bY(bS),ajaxTransport:bY(bT),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a>0?4:0;var o,r,u,w=c,x=l?ca(d,v,l):b,y,z;if(a>=200&&a<300||a===304){if(d.ifModified){if(y=v.getResponseHeader("Last-Modified"))f.lastModified[k]=y;if(z=v.getResponseHeader("Etag"))f.etag[k]=z}if(a===304)w="notmodified",o=!0;else try{r=cb(d,x),w="success",o=!0}catch(A){w="parsererror",u=A}}else{u=w;if(!w||a)w="error",a<0&&(a=0)}v.status=a,v.statusText=""+(c||w),o?h.resolveWith(e,[r,w,v]):h.rejectWith(e,[v,w,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.fireWith(e,[v,w]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f.Callbacks("once memory"),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if
 (!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bG.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.add,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(bF,"").replace(bK,bV[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bO),d.crossDomain==null&&(r=bQ.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bV[1]&&r[2]==bV[2]&&(r[3]||(r[1]==="http:"?80:443))==(bV[3]||(bV[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),bZ(bS,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.
 toUpperCase(),d.hasContent=!bJ.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bL.test(d.url)?"&":"?")+d.data,delete d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bP,"$1_="+x);d.url=y+(y===d.url?(bL.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", "+bW+"; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return!1}for(u in{success:1,error:1,complete:1})v[u](d[u]);p=bZ(bT,d,c,v);if(!p)w(-1,"No Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d
 .async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){if(s<2)w(-1,z);else throw z}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)b_(g,a[g],c,e);return d.join("&").replace(bC,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var cc=f.now(),cd=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+cc++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=typeof b.data=="string"&&/^application\/x\-www\-form\-urlencoded/.test(b.contentType);if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(cd.test(b.url)||e&&cd.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.json
 p!==!1&&(j=j.replace(cd,l),b.url===j&&(e&&(k=k.replace(cd,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||
 /loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var ce=a.ActiveXObject?function(){for(var a in cg)cg[a](0,1)}:!1,cf=0,cg;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ch()||ci()}:ch,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{i
 f(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,ce&&delete cg[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n);try{m.text=h.responseText}catch(a){}try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cf,ce&&(cg||(cg={},f(a).unload(ce)),cg[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var cj={},ck,cl,cm=/^(?:toggle|show|hide)$/,cn=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,co,cp=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cq;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(ct("show",3),a,b,c);for(var g=0,h=this.length;g<h;g++)d=this[g],d.style&&(e=d.style.display,!f._data(d,"olddisplay")&&e==="none"&&(e=d.style.display=""),(e===""&&f.
 css(d,"display")==="none"||!f.contains(d.ownerDocument.documentElement,d))&&f._data(d,"olddisplay",cu(d.nodeName)));for(g=0;g<h;g++){d=this[g];if(d.style){e=d.style.display;if(e===""||e==="none")d.style.display=f._data(d,"olddisplay")||""}}return this},hide:function(a,b,c){if(a||a===0)return this.animate(ct("hide",3),a,b,c);var d,e,g=0,h=this.length;for(;g<h;g++)d=this[g],d.style&&(e=f.css(d,"display"),e!=="none"&&!f._data(d,"olddisplay")&&f._data(d,"olddisplay",e));for(g=0;g<h;g++)this[g].style&&(this[g].style.display="none");return this},_toggle:f.fn.toggle,toggle:function(a,b,c){var d=typeof a=="boolean";f.isFunction(a)&&f.isFunction(b)?this._toggle.apply(this,arguments):a==null||d?this.each(function(){var b=d?a:f(this).is(":hidden");f(this)[b?"show":"hide"]()}):this.animate(ct("toggle",3),a,b,c);return this},fadeTo:function(a,b,c,d){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){function g(){e.queue===!1&&f._mark
 (this);var b=f.extend({},e),c=this.nodeType===1,d=c&&f(this).is(":hidden"),g,h,i,j,k,l,m,n,o,p,q;b.animatedProperties={};for(i in a){g=f.camelCase(i),i!==g&&(a[g]=a[i],delete a[i]);if((k=f.cssHooks[g])&&"expand"in k){l=k.expand(a[g]),delete a[g];for(i in l)i in a||(a[i]=l[i])}}for(g in a){h=a[g],f.isArray(h)?(b.animatedProperties[g]=h[1],h=a[g]=h[0]):b.animatedProperties[g]=b.specialEasing&&b.specialEasing[g]||b.easing||"swing";if(h==="hide"&&d||h==="show"&&!d)return b.complete.call(this);c&&(g==="height"||g==="width")&&(b.overflow=[this.style.overflow,this.style.overflowX,this.style.overflowY],f.css(this,"display")==="inline"&&f.css(this,"float")==="none"&&(!f.support.inlineBlockNeedsLayout||cu(this.nodeName)==="inline"?this.style.display="inline-block":this.style.zoom=1))}b.overflow!=null&&(this.style.overflow="hidden");for(i in a)j=new f.fx(this,b,i),h=a[i],cm.test(h)?(q=f._data(this,"toggle"+i)||(h==="toggle"?d?"show":"hide":0),q?(f._data(this,"toggle"+i,q==="show"?"hide":"show"
 ),j[q]()):j[h]()):(m=cn.exec(h),n=j.cur(),m?(o=parseFloat(m[2]),p=m[3]||(f.cssNumber[i]?"":"px"),p!=="px"&&(f.style(this,i,(o||1)+p),n=(o||1)/j.cur()*n,f.style(this,i,n+p)),m[1]&&(o=(m[1]==="-="?-1:1)*o+n),j.custom(n,o,p)):j.custom(n,h,""));return!0}var e=f.speed(b,c,d);if(f.isEmptyObject(a))return this.each(e.complete,[!1]);a=f.extend({},a);return e.queue===!1?this.each(g):this.queue(e.queue,g)},stop:function(a,c,d){typeof a!="string"&&(d=c,c=a,a=b),c&&a!==!1&&this.queue(a||"fx",[]);return this.each(function(){function h(a,b,c){var e=b[c];f.removeData(a,c,!0),e.stop(d)}var b,c=!1,e=f.timers,g=f._data(this);d||f._unmark(!0,this);if(a==null)for(b in g)g[b]&&g[b].stop&&b.indexOf(".run")===b.length-4&&h(this,g,b);else g[b=a+".run"]&&g[b].stop&&h(this,g,b);for(b=e.length;b--;)e[b].elem===this&&(a==null||e[b].queue===a)&&(d?e[b](!0):e[b].saveState(),c=!0,e.splice(b,1));(!d||!c)&&f.dequeue(this,a)})}}),f.each({slideDown:ct("show",1),slideUp:ct("hide",1),slideToggle:ct("toggle",1),fadeIn:{
 opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){f.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),f.extend({speed:function(a,b,c){var d=a&&typeof a=="object"?f.extend({},a):{complete:c||!c&&b||f.isFunction(a)&&a,duration:a,easing:c&&b||b&&!f.isFunction(b)&&b};d.duration=f.fx.off?0:typeof d.duration=="number"?d.duration:d.duration in f.fx.speeds?f.fx.speeds[d.duration]:f.fx.speeds._default;if(d.queue==null||d.queue===!0)d.queue="fx";d.old=d.complete,d.complete=function(a){f.isFunction(d.old)&&d.old.call(this),d.queue?f.dequeue(this,d.queue):a!==!1&&f._unmark(this)};return d},easing:{linear:function(a){return a},swing:function(a){return-Math.cos(a*Math.PI)/2+.5}},timers:[],fx:function(a,b,c){this.options=b,this.elem=a,this.prop=c,b.orig=b.orig||{}}}),f.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this),(f.fx.step[this.prop]||f.fx.step._default)(this)},cur:function(){if(this.elem[this.prop]!=nul
 l&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];var a,b=f.css(this.elem,this.prop);return isNaN(a=parseFloat(b))?!b||b==="auto"?0:b:a},custom:function(a,c,d){function h(a){return e.step(a)}var e=this,g=f.fx;this.startTime=cq||cr(),this.end=c,this.now=this.start=a,this.pos=this.state=0,this.unit=d||this.unit||(f.cssNumber[this.prop]?"":"px"),h.queue=this.options.queue,h.elem=this.elem,h.saveState=function(){f._data(e.elem,"fxshow"+e.prop)===b&&(e.options.hide?f._data(e.elem,"fxshow"+e.prop,e.start):e.options.show&&f._data(e.elem,"fxshow"+e.prop,e.end))},h()&&f.timers.push(h)&&!co&&(co=setInterval(g.tick,g.interval))},show:function(){var a=f._data(this.elem,"fxshow"+this.prop);this.options.orig[this.prop]=a||f.style(this.elem,this.prop),t

<TRUNCATED>

[008/100] [abbrv] [partial] Reverting the erroneous merge by Sebastian according to the instructions in INFRA-6876

Posted by wi...@apache.org.
http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/config/ConfigurationServiceImpl.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/config/ConfigurationServiceImpl.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/config/ConfigurationServiceImpl.java
index 02cdd81..9642b78 100644
--- a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/config/ConfigurationServiceImpl.java
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/config/ConfigurationServiceImpl.java
@@ -49,6 +49,7 @@ import org.apache.commons.configuration.Configuration;
 import org.apache.commons.configuration.ConfigurationException;
 import org.apache.commons.configuration.MapConfiguration;
 import org.apache.commons.configuration.PropertiesConfiguration;
+import org.apache.commons.lang3.ObjectUtils;
 import org.apache.marmotta.platform.core.api.config.ConfigurationService;
 import org.apache.marmotta.platform.core.events.ConfigurationChangedEvent;
 import org.apache.marmotta.platform.core.events.ConfigurationServiceInitEvent;
@@ -78,7 +79,7 @@ import com.google.common.io.Resources;
 @ApplicationScoped
 public class ConfigurationServiceImpl implements ConfigurationService {
 
-    private String home;
+	private String home;
 
     private static Logger log = LoggerFactory.getLogger(ConfigurationService.class);
 
@@ -180,16 +181,23 @@ public class ConfigurationServiceImpl implements ConfigurationService {
                     f1.mkdirs();
                 }
                 // ensure directory for user configuration files
-                File f2 = new File(getHome() + File.separator + "config");
+                File f2 = new File(getHome() + File.separator + DIR_CONFIG);
                 if(!f2.exists()) {
                     f2.mkdirs();
                 }
 
                 // ensure directory for logging messages
-                File f3 = new File(getHome() + File.separator + "log");
+                File f3 = new File(getHome() + File.separator + DIR_LOG);
                 if(!f3.exists()) {
                     f3.mkdirs();
                 }
+                
+                // ensure directory for importing data
+                File f4 = new File(getHome() + File.separator + DIR_IMPORT);
+                if(!f4.exists()) {
+                    f4.mkdirs();
+                }
+                
             }
 
             // the save configuration will be in the  home directory
@@ -307,14 +315,30 @@ public class ConfigurationServiceImpl implements ConfigurationService {
             log.info("Apache Marmotta Configuration Service: initialisation completed");
 
             configurationInitEvent.fire(new ConfigurationServiceInitEvent());
-
-            initialising = false;
+            
         } finally {
             lock.writeLock().unlock();
         }
 
     }
 
+    @Override
+    public boolean isInitialising() {
+        return initialising;
+    }
+
+    /**
+     * Signal that initialisation of the system has completed and configuration events are now enabled.
+     *
+     * @param initialising
+     */
+    @Override
+    public void setInitialising(boolean initialising) {
+        this.initialising = initialising;
+
+        log.info("Initialisation completed, enabling configuration events");
+    }
+
     /**
      * Initialise the Apache Marmotta Logging Configuration.
      * <ul>
@@ -570,16 +594,18 @@ public class ConfigurationServiceImpl implements ConfigurationService {
         Preconditions.checkNotNull(key);
         Preconditions.checkState(initialised,"ConfigurationService not yet initialised; call initialise() manually");
 
-        lock.writeLock().lock();
-        try {
-            config.setProperty(key, value);
-            save();
-        } finally {
-            lock.writeLock().unlock();
-        }
+        if(!config.containsKey(key) || !ObjectUtils.equals(value,config.getProperty(key))) {
+            lock.writeLock().lock();
+            try {
+                config.setProperty(key, value);
+                save();
+            } finally {
+                lock.writeLock().unlock();
+            }
 
-        if (!initialising) {
-            configurationEvent.fire(new ConfigurationChangedEvent(key));
+            if (!initialising) {
+                configurationEvent.fire(new ConfigurationChangedEvent(key));
+            }
         }
     }
 
@@ -703,16 +729,18 @@ public class ConfigurationServiceImpl implements ConfigurationService {
         Preconditions.checkNotNull(key);
         Preconditions.checkState(initialised,"ConfigurationService not yet initialised; call initialise() manually");
 
-        lock.writeLock().lock();
-        try {
-            config.setProperty(key, value);
-            save();
-        } finally {
-            lock.writeLock().unlock();
-        }
+        if(!config.containsKey(key) || !ObjectUtils.equals(value,config.getDouble(key))) {
+            lock.writeLock().lock();
+            try {
+                config.setProperty(key, value);
+                save();
+            } finally {
+                lock.writeLock().unlock();
+            }
 
-        if (!initialising) {
-            configurationEvent.fire(new ConfigurationChangedEvent(key));
+            if (!initialising) {
+                configurationEvent.fire(new ConfigurationChangedEvent(key));
+            }
         }
     }
 
@@ -752,16 +780,18 @@ public class ConfigurationServiceImpl implements ConfigurationService {
         Preconditions.checkNotNull(key);
         Preconditions.checkState(initialised,"ConfigurationService not yet initialised; call initialise() manually");
 
-        lock.writeLock().lock();
-        try {
-            config.setProperty(key, value);
-            save();
-        } finally {
-            lock.writeLock().unlock();
-        }
+        if(!config.containsKey(key) || !ObjectUtils.equals(value,config.getInt(key))) {
+            lock.writeLock().lock();
+            try {
+                config.setProperty(key, value);
+                save();
+            } finally {
+                lock.writeLock().unlock();
+            }
 
-        if (!initialising) {
-            configurationEvent.fire(new ConfigurationChangedEvent(key));
+            if (!initialising) {
+                configurationEvent.fire(new ConfigurationChangedEvent(key));
+            }
         }
     }
 
@@ -817,16 +847,18 @@ public class ConfigurationServiceImpl implements ConfigurationService {
         Preconditions.checkNotNull(key);
         Preconditions.checkState(initialised,"ConfigurationService not yet initialised; call initialise() manually");
 
-        lock.writeLock().lock();
-        try {
-            config.setProperty(key, value);
-            save();
-        } finally {
-            lock.writeLock().unlock();
-        }
+        if(!config.containsKey(key) || !ObjectUtils.equals(value,config.getLong(key))) {
+            lock.writeLock().lock();
+            try {
+                config.setProperty(key, value);
+                save();
+            } finally {
+                lock.writeLock().unlock();
+            }
 
-        if (!initialising) {
-            configurationEvent.fire(new ConfigurationChangedEvent(key));
+            if (!initialising) {
+                configurationEvent.fire(new ConfigurationChangedEvent(key));
+            }
         }
     }
 
@@ -868,17 +900,20 @@ public class ConfigurationServiceImpl implements ConfigurationService {
         Preconditions.checkNotNull(key);
         Preconditions.checkState(initialised,"ConfigurationService not yet initialised; call initialise() manually");
 
-        lock.writeLock().lock();
-        try {
-            config.setProperty(key, value);
-            save();
-        } finally {
-            lock.writeLock().unlock();
-        }
+        if(!config.containsKey(key) || value != config.getBoolean(key)) {
 
+            lock.writeLock().lock();
+            try {
+                config.setProperty(key, value);
+                save();
+            } finally {
+                lock.writeLock().unlock();
+            }
 
-        if (!initialising) {
-            configurationEvent.fire(new ConfigurationChangedEvent(key));
+
+            if (!initialising) {
+                configurationEvent.fire(new ConfigurationChangedEvent(key));
+            }
         }
     }
 
@@ -961,17 +996,19 @@ public class ConfigurationServiceImpl implements ConfigurationService {
         Preconditions.checkNotNull(key);
         Preconditions.checkState(initialised,"ConfigurationService not yet initialised; call initialise() manually");
 
-        lock.writeLock().lock();
-        try {
-            config.setProperty(key, value);
-            save();
-        } finally {
-            lock.writeLock().unlock();
-        }
+        if(!config.containsKey(key) || !ObjectUtils.equals(value,config.getList(key))) {
+            lock.writeLock().lock();
+            try {
+                config.setProperty(key, value);
+                save();
+            } finally {
+                lock.writeLock().unlock();
+            }
 
 
-        if (!initialising) {
-            configurationEvent.fire(new ConfigurationChangedEvent(key));
+            if (!initialising) {
+                configurationEvent.fire(new ConfigurationChangedEvent(key));
+            }
         }
     }
 
@@ -996,23 +1033,26 @@ public class ConfigurationServiceImpl implements ConfigurationService {
         Preconditions.checkNotNull(key);
         Preconditions.checkState(initialised,"ConfigurationService not yet initialised; call initialise() manually");
 
-        lock.writeLock().lock();
-        try {
-            if (config instanceof AbstractConfiguration) {
-                ((AbstractConfiguration) config).setDelimiterParsingDisabled(true);
-            }
-            config.setProperty(key, value);
-            if (config instanceof AbstractConfiguration) {
-                ((AbstractConfiguration) config).setDelimiterParsingDisabled(false);
+        if(!config.containsKey(key) || !ObjectUtils.equals(value,config.getString(key))) {
+
+            lock.writeLock().lock();
+            try {
+                if (config instanceof AbstractConfiguration) {
+                    ((AbstractConfiguration) config).setDelimiterParsingDisabled(true);
+                }
+                config.setProperty(key, value);
+                if (config instanceof AbstractConfiguration) {
+                    ((AbstractConfiguration) config).setDelimiterParsingDisabled(false);
+                }
+                save();
+            } finally {
+                lock.writeLock().unlock();
             }
-            save();
-        } finally {
-            lock.writeLock().unlock();
-        }
 
 
-        if (!initialising) {
-            configurationEvent.fire(new ConfigurationChangedEvent(key));
+            if (!initialising) {
+                configurationEvent.fire(new ConfigurationChangedEvent(key));
+            }
         }
     }
 
@@ -1077,17 +1117,19 @@ public class ConfigurationServiceImpl implements ConfigurationService {
         Preconditions.checkNotNull(key);
         Preconditions.checkState(initialised,"ConfigurationService not yet initialised; call initialise() manually");
 
-        lock.writeLock().lock();
-        try {
-            config.setProperty(key, values);
-            save();
-        } finally {
-            lock.writeLock().unlock();
-        }
+        if(!config.containsKey(key) || !ObjectUtils.equals(values,config.getList(key))) {
+            lock.writeLock().lock();
+            try {
+                config.setProperty(key, values);
+                save();
+            } finally {
+                lock.writeLock().unlock();
+            }
 
 
-        if (!initialising) {
-            configurationEvent.fire(new ConfigurationChangedEvent(key));
+            if (!initialising) {
+                configurationEvent.fire(new ConfigurationChangedEvent(key));
+            }
         }
     }
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/config/DependenciesServiceImpl.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/config/DependenciesServiceImpl.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/config/DependenciesServiceImpl.java
index 3a0cf94..d004676 100644
--- a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/config/DependenciesServiceImpl.java
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/config/DependenciesServiceImpl.java
@@ -18,7 +18,7 @@
 package org.apache.marmotta.platform.core.services.config;
 
 import org.apache.marmotta.platform.core.api.config.DependenciesService;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.slf4j.Logger;
 
 import javax.annotation.PostConstruct;

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/content/FileSystemContentReader.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/content/FileSystemContentReader.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/content/FileSystemContentReader.java
index d793a1a..3c2510e 100644
--- a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/content/FileSystemContentReader.java
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/content/FileSystemContentReader.java
@@ -134,6 +134,7 @@ public class FileSystemContentReader implements ContentReader {
         try {
             RepositoryConnection conn = sesameService.getConnection();
             try {
+                conn.begin();
                 MediaContentItem mci = FacadingFactory.createFacading(conn).createFacade(resource, MediaContentItem.class);
 
                 String path = mci.getContentPath();
@@ -187,6 +188,7 @@ public class FileSystemContentReader implements ContentReader {
         try {
             RepositoryConnection conn = sesameService.getConnection();
             try {
+                conn.begin();
                 MediaContentItem mci = FacadingFactory.createFacading(conn).createFacade(resource, MediaContentItem.class);
 
                 String path = mci.getContentPath();
@@ -229,6 +231,7 @@ public class FileSystemContentReader implements ContentReader {
         try {
             RepositoryConnection conn = sesameService.getConnection();
             try {
+                conn.begin();
                 MediaContentItem mci = FacadingFactory.createFacading(conn).createFacade(resource, MediaContentItem.class);
 
                 String path = mci.getContentPath();
@@ -285,6 +288,7 @@ public class FileSystemContentReader implements ContentReader {
         try {
             RepositoryConnection conn = sesameService.getConnection();
             try {
+                conn.begin();
                 MediaContentItem mci = FacadingFactory.createFacading(conn).createFacade(resource, MediaContentItem.class);
 
                 String path = mci.getContentPath();

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/content/FileSystemContentWriter.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/content/FileSystemContentWriter.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/content/FileSystemContentWriter.java
index 62935f8..d26f2cc 100644
--- a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/content/FileSystemContentWriter.java
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/content/FileSystemContentWriter.java
@@ -93,6 +93,7 @@ public class FileSystemContentWriter implements ContentWriter {
         try {
             RepositoryConnection conn = sesameService.getConnection();
             try {
+                conn.begin();
                 MediaContentItem mci = FacadingFactory.createFacading(conn).createFacade(resource, MediaContentItem.class);
 
                 String path = mci.getContentPath();
@@ -164,6 +165,7 @@ public class FileSystemContentWriter implements ContentWriter {
         try {
             RepositoryConnection conn = sesameService.getConnection();
             try {
+                conn.begin();
                 MediaContentItem mci = FacadingFactory.createFacading(conn).createFacade(resource, MediaContentItem.class);
 
                 String path = mci.getContentPath();

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/importer/ImportServiceImpl.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/importer/ImportServiceImpl.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/importer/ImportServiceImpl.java
index 5d088ce..2c95d3b 100644
--- a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/importer/ImportServiceImpl.java
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/importer/ImportServiceImpl.java
@@ -17,6 +17,7 @@
  */
 package org.apache.marmotta.platform.core.services.importer;
 
+import org.apache.commons.lang3.StringUtils;
 import org.apache.marmotta.platform.core.api.importer.ImportService;
 import org.apache.marmotta.platform.core.api.importer.Importer;
 import org.apache.marmotta.platform.core.exception.io.MarmottaImportException;
@@ -28,6 +29,7 @@ import javax.enterprise.context.ApplicationScoped;
 import javax.enterprise.inject.Any;
 import javax.enterprise.inject.Instance;
 import javax.inject.Inject;
+
 import java.io.InputStream;
 import java.io.Reader;
 import java.net.URL;
@@ -71,21 +73,39 @@ public class ImportServiceImpl implements ImportService{
 
 	@Override
 	public int importData(URL url, String format, Resource user, URI context) throws MarmottaImportException {
-		return getImporterInstance(format).importData(url,format,user,context);
+        long start = System.currentTimeMillis();
+		int result = getImporterInstance(format).importData(url,format,user,context);
+        long end = System.currentTimeMillis();
+        log.info("data import finished ({} ms}", end-start);
+        return result;
 	}
 
 	@Override
 	public int importData(InputStream is, String format, Resource user, URI context) throws MarmottaImportException {
-		return getImporterInstance(format).importData(is,format,user,context);
+        long start = System.currentTimeMillis();
+        int result = getImporterInstance(format).importData(is,format,user,context);
+        long end = System.currentTimeMillis();
+        log.info("data import finished ({} ms}", end-start);
+        return result;
 	}
 
 	@Override
 	public int importData(Reader reader, String format, Resource user, URI context) throws MarmottaImportException {
-		return getImporterInstance(format).importData(reader,format,user,context);
+        long start = System.currentTimeMillis();
+        int result = getImporterInstance(format).importData(reader,format,user,context);
+        long end = System.currentTimeMillis();
+        log.info("data import finished ({} ms}", end-start);
+        return result;
 	}
 
 	private Importer getImporterInstance(String type) throws MarmottaImportException {
-		if(!importerMap.containsKey(type)) throw new MarmottaImportException("no importer defined for type "+type);
+		if (StringUtils.contains(type, ';')) { 
+			type = type.split(";")[0];
+		}
+		if(!importerMap.containsKey(type)) { 
+			throw new MarmottaImportException("no importer defined for type " + type);
+		}
 		return importerMap.get(type);
 	}
+	
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/importer/ImportWatchServiceImpl.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/importer/ImportWatchServiceImpl.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/importer/ImportWatchServiceImpl.java
new file mode 100644
index 0000000..06e9106
--- /dev/null
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/importer/ImportWatchServiceImpl.java
@@ -0,0 +1,265 @@
+/**
+ * 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.platform.core.services.importer;
+
+import java.io.BufferedInputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.nio.file.StandardWatchEventKinds;
+import java.nio.file.WatchEvent;
+import java.nio.file.WatchEvent.Kind;
+import java.nio.file.WatchKey;
+import java.nio.file.WatchService;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.enterprise.context.ApplicationScoped;
+import javax.enterprise.event.Observes;
+import javax.inject.Inject;
+
+import org.apache.commons.lang3.StringUtils;
+import org.apache.marmotta.platform.core.api.config.ConfigurationService;
+import org.apache.marmotta.platform.core.api.importer.ImportService;
+import org.apache.marmotta.platform.core.api.importer.ImportWatchService;
+import org.apache.marmotta.platform.core.api.task.Task;
+import org.apache.marmotta.platform.core.api.task.TaskManagerService;
+import org.apache.marmotta.platform.core.api.triplestore.ContextService;
+import org.apache.marmotta.platform.core.api.user.UserService;
+import org.apache.marmotta.platform.core.events.SystemStartupEvent;
+import org.apache.marmotta.platform.core.exception.io.MarmottaImportException;
+import org.openrdf.model.URI;
+import org.openrdf.rio.RDFFormat;
+import org.openrdf.rio.Rio;
+import org.slf4j.Logger;
+
+import com.ibm.icu.text.CharsetDetector;
+import com.ibm.icu.text.CharsetMatch;
+
+/**
+ * Implementation for watching import directory
+ * 
+ * @author Sergio Fernández
+ * 
+ */
+@ApplicationScoped
+public class ImportWatchServiceImpl implements ImportWatchService {
+
+	private static final String TASK_GROUP = "Import Watch";
+
+	private static final String TASK_DETAIL_PATH = "path";
+	
+	private static final String TASK_DETAIL_CONTEXT = "context";
+	
+	@Inject
+	private Logger log;
+
+	@Inject
+	private TaskManagerService taskManagerService;
+
+	@Inject
+	private ConfigurationService configurationService;
+
+	@Inject
+	private ImportService importService;
+
+	@Inject
+	private ContextService contextService;
+
+	@Inject
+	private UserService userService;
+	
+	private Map<WatchKey,Path> keys;
+
+	private String path;
+
+	private int count;
+
+	public ImportWatchServiceImpl() {
+		this.keys = new HashMap<WatchKey,Path>();
+		count = 0;
+	}
+
+	@Override
+	public void initialize(@Observes SystemStartupEvent event) {
+		this.path = configurationService.getHome() + File.separator + ConfigurationService.DIR_IMPORT;
+
+		Runnable r = new Runnable() {
+
+			@Override
+			public void run() {
+				final Task task = taskManagerService.createTask("Directory import watch", TASK_GROUP);
+				task.updateMessage("watching...");
+				task.updateDetailMessage(TASK_DETAIL_PATH, path);
+
+				try {
+					Path root = Paths.get(path);
+					WatchService watcher = root.getFileSystem().newWatchService();
+					register(root, watcher, StandardWatchEventKinds.ENTRY_CREATE, StandardWatchEventKinds.ENTRY_DELETE);
+					while (true) {
+						final WatchKey key = watcher.take();
+						for (WatchEvent<?> event : key.pollEvents()) {
+							
+							@SuppressWarnings("unchecked")
+							Path item = ((WatchEvent<Path>) event).context();
+							Path dir = keys.get(key);
+							File file = new File(dir.toString(), item.toString()).getAbsoluteFile();
+							
+							if (StandardWatchEventKinds.ENTRY_CREATE.equals(event.kind())) {
+								if (file.isDirectory()) {
+									//recursive registration of sub-directories
+									register(Paths.get(dir.toString(), item.toString()), watcher, StandardWatchEventKinds.ENTRY_CREATE, StandardWatchEventKinds.ENTRY_DELETE);
+									task.updateProgress(++count);
+								} else {
+									URI context = getTargetContext(file);
+									log.debug("Importing '{}'...", file.getAbsolutePath());
+									task.updateMessage("importing...");
+									task.updateDetailMessage(TASK_DETAIL_PATH, file.getAbsolutePath());
+									task.updateDetailMessage(TASK_DETAIL_CONTEXT, context.stringValue());
+									if (execImport(file, context)) {
+										log.info("Sucessfully imported file '{}' into {}", file.getAbsolutePath(), context.stringValue());
+										try {
+											//delete the imported file
+											log.debug("Deleting {}...", file.getAbsolutePath());
+											file.delete();
+										} catch (Exception ex) {
+											log.error("Error deleing {}: {}", file.getAbsolutePath(), ex.getMessage());
+										}
+									}
+									task.updateProgress(++count);
+									task.updateMessage("watching...");
+									task.updateDetailMessage(TASK_DETAIL_PATH, path);
+									task.removeDetailMessage(TASK_DETAIL_CONTEXT);
+								}
+							} else if (StandardWatchEventKinds.ENTRY_DELETE.equals(event.kind()) && Files.isDirectory(item)) {
+								//TODO: unregister deleted directories?
+								task.updateProgress(++count);
+							}
+							
+						}
+						if (!key.reset()) {
+							// exit loop if the key is not valid
+							// e.g. if the directory was deleted
+							break;
+						}
+					}
+				} catch (IOException e) {
+					log.error("Error registering the import watch service over '{}': {}", path, e.getMessage());
+				} catch (InterruptedException e) {
+					log.error("Import watch service has been interrupted");
+				}
+			}
+
+		};
+
+		Thread t = new Thread(r);
+		t.setName(TASK_GROUP + "(start:" + new Date() + ",path:" + this.path + ")");
+		t.setDaemon(true);
+		t.start();
+
+	}
+
+	@Override
+	public boolean execImport(File file, URI context) {
+		try {
+			String format = detectFormat(file);
+			FileInputStream is = new FileInputStream(file);
+			URI user = userService.getAdminUser();
+			importService.importData(is, format, user, context);
+			return true;
+		} catch (MarmottaImportException e) {
+			log.error("Error importing file {} from the local directory: {}", file.getAbsolutePath(), e.getMessage());
+			return false;
+		} catch (IOException e) {
+			log.error("Error retrieving file {} from the local directory: {}", file.getAbsolutePath(), e.getMessage());
+			return false;
+		}
+	}
+
+	private String detectFormat(File file) throws MarmottaImportException {
+		String format = null;
+		String fileName = file.getName();
+		
+		//mimetype detection
+		RDFFormat rdfFormat = Rio.getParserFormatForFileName(fileName);
+		if (rdfFormat != null && importService.getAcceptTypes().contains(rdfFormat.getDefaultMIMEType())) {
+			format = rdfFormat.getDefaultMIMEType();
+		} else {
+			throw new MarmottaImportException("Suitable RDF parser not found");
+		}
+
+	    //encoding detection
+		try {
+			BufferedInputStream bis = new BufferedInputStream(new FileInputStream(file));
+			CharsetDetector cd = new CharsetDetector();
+			cd.setText(bis);
+			CharsetMatch cm = cd.detect();
+			if (cm != null) {
+				format += "; charset=" + cm.getName();
+			}
+		} catch (IOException e) {
+			log.error("Error detecting charset for '{}': {}", fileName, e.getMessage());
+		}
+
+		return format;
+	}
+	
+	/**
+	 * Get the target context, according the path relative to the base import directory
+	 * 
+	 * @param file
+	 * @return
+	 */
+	private URI getTargetContext(File file) {
+		String subdir = StringUtils.removeStart(file.getParentFile().getAbsolutePath(), this.path);
+		if (StringUtils.isBlank(subdir)) {
+			return contextService.getDefaultContext();
+		} else {
+			subdir = subdir.substring(1); //remove initial slash
+			if (StringUtils.startsWith(subdir, "http%3A%2F%2F")) {
+				try {
+					return contextService.createContext(URLDecoder.decode(subdir, "UTF-8"));
+				} catch (UnsupportedEncodingException e) {
+					log.error("Error url-decoding context name '{}', so using the default one: {}", subdir, e.getMessage());
+					return contextService.getDefaultContext();
+				}
+			} else {
+				return contextService.createContext(configurationService.getBaseContext() + subdir);
+			}
+		}
+	}
+	
+	/**
+	 * Registers a new path in the watcher, keeping the path mapping for future uses
+	 * 
+	 * @param path
+	 * @param watcher
+	 * @param events
+	 * @throws IOException
+	 */
+	private void register(Path path, WatchService watcher, Kind<?>... events) throws IOException {
+		keys.put(path.register(watcher, events), path);
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/importer/rdf/RDFImporterImpl.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/importer/rdf/RDFImporterImpl.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/importer/rdf/RDFImporterImpl.java
index c51c49e..06d869a 100644
--- a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/importer/rdf/RDFImporterImpl.java
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/importer/rdf/RDFImporterImpl.java
@@ -62,7 +62,6 @@ public class RDFImporterImpl implements Importer {
     @Inject
     private Logger log;
 
-
     @Inject
     private ConfigurationService configurationService;
 
@@ -76,9 +75,6 @@ public class RDFImporterImpl implements Importer {
 
     private List<String> acceptTypes;
 
-
-
-
     /**
      * Get a collection of all mime types accepted by this io. Used for automatically
      * selecting the appropriate io in ImportService.

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/io/MarmottaIOServiceImpl.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/io/MarmottaIOServiceImpl.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/io/MarmottaIOServiceImpl.java
index f96de33..3c8d9b6 100644
--- a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/io/MarmottaIOServiceImpl.java
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/io/MarmottaIOServiceImpl.java
@@ -65,12 +65,8 @@ public class MarmottaIOServiceImpl implements MarmottaIOService {
             producedTypes.addAll(format.getMIMETypes());
         }
         log.info(" - available writers: {}", Arrays.toString(producedTypes.toArray()));
-
-
-
     }
 
-
 	/**
 	 * returns a list of all mimetypes which can be parsed by implemented parsers
 	 * @return
@@ -108,4 +104,5 @@ public class MarmottaIOServiceImpl implements MarmottaIOService {
 	public RDFFormat getParser(String mimetype) {
 		return parserRegistry.getFileFormatForMIMEType(mimetype);
 	}
+	
 }

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/jaxrs/ExceptionMapperServiceImpl.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/jaxrs/ExceptionMapperServiceImpl.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/jaxrs/ExceptionMapperServiceImpl.java
new file mode 100644
index 0000000..0b6e93b
--- /dev/null
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/jaxrs/ExceptionMapperServiceImpl.java
@@ -0,0 +1,73 @@
+/*
+ * 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.platform.core.services.jaxrs;
+
+import org.apache.marmotta.platform.core.api.jaxrs.ExceptionMapperService;
+import org.apache.marmotta.platform.core.events.SystemStartupEvent;
+import org.apache.marmotta.platform.core.jaxrs.CDIExceptionMapper;
+import org.jboss.resteasy.spi.ResteasyProviderFactory;
+import org.slf4j.Logger;
+
+import javax.annotation.PostConstruct;
+import javax.enterprise.context.ApplicationScoped;
+import javax.enterprise.event.Observes;
+import javax.enterprise.inject.Instance;
+import javax.inject.Inject;
+
+/**
+ * This service auto-registers JAX-RS exception mappers implementing the CDIExceptionMapper interface and
+ * registers them with RESTEasy. This allows applications based on Marmotta to easily implement and register their
+ * own ExceptionMapppers without needing to go into RESTEasy.
+ * <p/>
+ * Note that ExceptionMappers that are injected via CDI need to be annotated with @Dependent, or otherwise
+ * they will be proxied by the CDI implementation and then the generic type cannot be determined.
+ *
+ * @author Sebastian Schaffert (sschaffert@apache.org)
+ */
+@ApplicationScoped
+public class ExceptionMapperServiceImpl implements ExceptionMapperService {
+
+    @Inject
+    private Logger log;
+
+    @Inject
+    private Instance<CDIExceptionMapper<?>> mappers;
+
+    /**
+     * Register Exception Mappers
+     */
+    @PostConstruct
+    public void initialise() {
+        log.info("initialising JAX-RS exception mappers");
+
+        ResteasyProviderFactory factory = ResteasyProviderFactory.getInstance();
+
+        for(CDIExceptionMapper<?> mapper : mappers) {
+            log.debug("registering exception mapper: {}", mapper.getClass().getName());
+
+            factory.registerProviderInstance(mapper);
+        }
+    }
+
+    // trigger startup once configuration service is finished with initialisation
+    public void initEvent(@Observes SystemStartupEvent e) {
+
+    }
+
+
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/modules/ModuleServiceImpl.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/modules/ModuleServiceImpl.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/modules/ModuleServiceImpl.java
index b7e4d63..c54ffa1 100644
--- a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/modules/ModuleServiceImpl.java
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/modules/ModuleServiceImpl.java
@@ -37,13 +37,7 @@ import java.net.JarURLConnection;
 import java.net.MalformedURLException;
 import java.net.URL;
 import java.net.URLConnection;
-import java.util.Collection;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
+import java.util.*;
 
 /**
  * Add file description here!
@@ -53,16 +47,29 @@ import java.util.Set;
 @ApplicationScoped
 public class ModuleServiceImpl implements ModuleService {
 
+    private String default_container_name = "Others";
+
     private Logger log = LoggerFactory.getLogger(ModuleServiceImpl.class);
 
     private Set<String> modules;
 
+    private HashMap<String,ArrayList<String>> containers;
+
+    private HashMap<String,Integer> container_weight;
+
     private Map<String,Configuration> configurationMap;
     private Map<String, Configuration> jarURLs;
 
     @PostConstruct
     public void initialize() {
+
+        //default_container_name = configurationService.getStringConfiguration("kiwi.pages.default_container.name",default_container_name);
+        //default_container_number = configurationService.getIntConfiguration("kiwi.pages.default_container.number",default_container_number);
+
         modules = new HashSet<String>();
+        containers = new HashMap<String,ArrayList<String>>();
+        container_weight = new HashMap<String, Integer>();
+
         configurationMap = new HashMap<String, Configuration>();
         jarURLs = new HashMap<String, Configuration>();
 
@@ -83,6 +90,20 @@ public class ModuleServiceImpl implements ModuleService {
                     String moduleName = moduleProperties.getString("name");
                     modules.add(moduleName);
 
+                    String c_name = moduleProperties.getString("container") != null ? moduleProperties.getString("container") : default_container_name;
+
+                    if(containers.get(c_name) == null) {
+                        containers.put(c_name, new ArrayList<String>());
+                    }
+                    containers.get(c_name).add(moduleName);
+
+                    if(container_weight.get(c_name) == null ) {
+                        container_weight.put(c_name,-1);
+                    }
+
+                    if(moduleProperties.getString("container.weight") != null) {
+                        container_weight.put(c_name,Math.max(container_weight.get(c_name),moduleProperties.getInt("container.weight",-1)));
+                    }
 
                     URLConnection urlConnection = moduleUrl.openConnection();
                     URL jarUrl;
@@ -112,8 +133,6 @@ public class ModuleServiceImpl implements ModuleService {
                     } catch(ConfigurationException ex) {
                     }
 
-
-
                     // create runtime configuration
                     MapConfiguration runtimeConfiguration = new MapConfiguration(new HashMap<String, Object>());
                     runtimeConfiguration.setProperty("runtime.jarfile", jarUrl.toString());
@@ -130,6 +149,7 @@ public class ModuleServiceImpl implements ModuleService {
 
 
             }
+            //TODO container should be sortable
         } catch (IOException ex) {
             log.error("I/O error while trying to retrieve kiwi-module.properties file",ex);
         }
@@ -173,6 +193,7 @@ public class ModuleServiceImpl implements ModuleService {
      * @param moduleName
      * @return
      */
+    @Deprecated
     @Override
     public Collection<String> getEntities(String moduleName) {
         Configuration config = getModuleConfiguration(moduleName).getConfiguration();
@@ -191,6 +212,64 @@ public class ModuleServiceImpl implements ModuleService {
         return modules;
     }
 
+    public List<String> listSortedModules() {
+        return sortModules(modules);
+    }
+
+    /**
+     * returns all modules within a container
+     * @param container
+     * @return
+     */
+    public Collection<String> listModules(String container) {
+        if(containers.containsKey(container)) {
+            return containers.get(container);
+        } else return null;
+    }
+
+    @Override
+    public List<String> listSortedModules(String container) {
+        if(containers.containsKey(container)) {
+            return sortModules(containers.get(container));
+        } else return null;
+    }
+
+    /**
+     * sort modules
+     * @param m
+     * @return
+     */
+    private List<String> sortModules(Collection<String> m) {
+        List<String> sorted = new ArrayList<String>(m);
+        Collections.sort(sorted,new Comparator<String>() {
+            @Override
+            public int compare(String o, String o2) {
+                return ((Integer) getWeight(o)).compareTo(getWeight(o2));
+            }
+        });
+        return sorted;
+    }
+
+    /**
+     * Lists containers and underlying modules
+     * @return
+     */
+    public Collection<String> listContainers() {
+        return containers.keySet();
+    }
+
+    @Override
+    public List<String> listSortedContainers() {
+        List sorted = new ArrayList(containers.keySet());
+        Collections.sort(sorted,new Comparator<String>() {
+            @Override
+            public int compare(String o, String o2) {
+                return container_weight.get(o2).compareTo(container_weight.get(o));
+            }
+        });
+        return sorted;
+    }
+
     /**
      * Return the configuration for the module identified by the name given as argument. Returns an
      * immutable Apache Commons Configuration object, or null if the module is not found.
@@ -269,18 +348,73 @@ public class ModuleServiceImpl implements ModuleService {
     }
 
     /**
-     * Return a list of admin pages (paths)
+     * returns the icon (if set), null otherwise
      * @param moduleName
      * @return
      */
     @Override
-    public List<String> getAdminPages(String moduleName) {
+    public String getIcon(String moduleName) {
         Configuration config = getModuleConfiguration(moduleName).getConfiguration();
-        if(config != null) return ImmutableList.copyOf(config.getStringArray("adminpages"));
+        if(config != null) return config.getString("icon");
         else
             return null;
     }
 
+    /**
+     * Return a list of admin pages (links)
+     * @param moduleName
+     * @return
+     */
+    @Override
+    public List<String> getAdminPages(String moduleName) {
+        Configuration config = getModuleConfiguration(moduleName).getConfiguration();
+        if(config != null) {
+            if(!config.subset("adminpage.").isEmpty()) {
+                ArrayList<String> l = new ArrayList<String>();
+                while(config.getString("adminpage."+l.size()+".link") != null) {
+                    l.add(config.getString("adminpage."+l.size()+".link"));
+                }
+                return l;
+            } else return ImmutableList.copyOf(config.getStringArray("adminpages"));
+        } else
+            return null;
+    }
+
+    /**
+     * returns  more complex admin page description
+     * @param moduleName
+     * @return
+     */
+    @Override
+    public List<HashMap<String,String>> getAdminPageObjects(String moduleName) {
+        Configuration config = getModuleConfiguration(moduleName).getConfiguration();
+        if(config != null) {
+            ArrayList<HashMap<String,String>> l = new ArrayList<HashMap<String,String>>();
+            if(!config.subset("adminpage").isEmpty()) {
+                while(config.getString("adminpage."+l.size()+".link") != null) {
+                    HashMap<String,String> map = new HashMap<String, String>();
+                    map.put("link",config.getString("baseurl")+config.getString("adminpage."+l.size()+".link"));
+                    map.put("title",config.getString("adminpage."+l.size()+".title"));
+                    l.add(map);
+                }
+            } else {
+                for(String path : config.getStringArray("adminpages")) {
+                    HashMap<String,String> map = new HashMap<String, String>();
+                    map.put("link",config.getString("baseurl")+path);
+                    String title;
+                    if(path.lastIndexOf(".") > path.lastIndexOf("/")+1)
+                        title = path.substring(path.lastIndexOf("/")+1,path.lastIndexOf(".")).replaceAll("_"," ");
+                    else
+                        title = path.substring(path.lastIndexOf("/")+1);
+                    map.put("title",title);
+                    l.add(map);
+                }
+            }
+            return l;
+        } else
+            return null;
+    }
+
     @Override
     public int getWeight(String moduleName) {
         Configuration config = getModuleConfiguration(moduleName).getConfiguration();
@@ -290,4 +424,4 @@ public class ModuleServiceImpl implements ModuleService {
             return 50;
     }
 
-}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/prefix/PrefixCC.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/prefix/PrefixCC.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/prefix/PrefixCC.java
index d80e055..b231800 100644
--- a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/prefix/PrefixCC.java
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/prefix/PrefixCC.java
@@ -18,31 +18,29 @@
 package org.apache.marmotta.platform.core.services.prefix;
 
 import java.io.IOException;
-import java.util.HashMap;
+import java.net.URLEncoder;
+import java.nio.charset.Charset;
 
 import javax.enterprise.context.ApplicationScoped;
 import javax.inject.Inject;
 
-import org.apache.http.Header;
+import org.apache.commons.io.IOUtils;
+import org.apache.commons.io.LineIterator;
 import org.apache.http.HttpEntity;
 import org.apache.http.HttpResponse;
 import org.apache.http.client.ClientProtocolException;
 import org.apache.http.client.ResponseHandler;
 import org.apache.http.client.methods.HttpGet;
-import org.apache.http.client.methods.HttpHead;
-import org.apache.http.util.EntityUtils;
 import org.apache.marmotta.platform.core.api.http.HttpClientService;
 import org.apache.marmotta.platform.core.api.prefix.PrefixProvider;
 import org.apache.marmotta.platform.core.util.http.HttpRequestUtil;
-import org.codehaus.jackson.JsonFactory;
-import org.codehaus.jackson.map.ObjectMapper;
-import org.codehaus.jackson.type.TypeReference;
 import org.slf4j.Logger;
 
 /**
  * Prefix.cc Provider
  * 
  * @author Sergio Fernández
+ * @author Jakob Frank <ja...@apache.org>
  *
  */
 @ApplicationScoped
@@ -59,9 +57,9 @@ public class PrefixCC implements PrefixProvider {
 
     @Override
     public String getNamespace(final String prefix) {
-        HttpGet get = new HttpGet(URI + prefix + ".file.json");
+        HttpGet get = new HttpGet(URI + prefix + ".file.txt");
         HttpRequestUtil.setUserAgentString(get, USER_AGENT);
-        get.setHeader("Accept", "application/json");
+        get.setHeader("Accept", "text/plain");
         try {
             return httpClientService.execute(get, new ResponseHandler<String>() {
 
@@ -69,20 +67,21 @@ public class PrefixCC implements PrefixProvider {
                 public String handleResponse(HttpResponse response) throws ClientProtocolException, IOException {
                     if (200 == response.getStatusLine().getStatusCode()) {
                         HttpEntity entity = response.getEntity();
-                        JsonFactory factory = new JsonFactory(); 
-                        ObjectMapper mapper = new ObjectMapper(factory); 
-                        TypeReference<HashMap<String,String>> typeRef = new TypeReference<HashMap<String,String>>() {}; 
-                        HashMap<String,String> result = mapper.readValue(EntityUtils.toString(entity), typeRef); 
-                        if (result.containsKey(prefix)) {
-                        	return result.get(prefix);
-                        } else {
-                        	log.error("Error: prefix '" + prefix + "' not found at prefix.cc");
-                            return null;
+
+                        final LineIterator it = IOUtils.lineIterator(entity.getContent(), Charset.defaultCharset());
+                        try {
+                            while (it.hasNext()) {
+                                final String l = it.next();
+                                if (l.startsWith(prefix + "\t")) {
+                                    return l.substring(prefix.length()+1);
+                                }
+                            }
+                        } finally {
+                            it.close();
                         }
-                    } else {
-                        log.error("Error: prefix '" + prefix + "' not found at prefix.cc");
-                        return null;
                     }
+                    log.error("Error: prefix '" + prefix + "' not found at prefix.cc");
+                    return null;
                 }
             });
         } catch (Exception e) {
@@ -93,20 +92,32 @@ public class PrefixCC implements PrefixProvider {
 
     @Override
     public String getPrefix(final String namespace) {
-        HttpHead head = new HttpHead(URI + "reverse?uri=" + namespace);
-        HttpRequestUtil.setFollowRedirect(head, false);
-        HttpRequestUtil.setUserAgentString(head, USER_AGENT);
         try {
-            return httpClientService.execute(head, new ResponseHandler<String>() {
+            HttpGet get = new HttpGet(URI + "reverse?format=txt&uri=" + URLEncoder.encode(namespace, "utf-8"));
+            HttpRequestUtil.setUserAgentString(get, USER_AGENT);
+            get.setHeader("Accept", "text/plain");
+
+            return httpClientService.execute(get, new ResponseHandler<String>() {
+
                 @Override
                 public String handleResponse(HttpResponse response) throws ClientProtocolException, IOException {
-                    if (response.containsHeader("location")) {
-                        Header location = response.getFirstHeader("location");
-                        return location.getValue().substring(URI.length());
-                    } else {
-                    	log.error("Error: reverse namespace lookup for '" + namespace + "' not found at prefix.cc");
-                        return null;
+                    if (200 == response.getStatusLine().getStatusCode()) {
+                        HttpEntity entity = response.getEntity();
+
+                        final LineIterator it = IOUtils.lineIterator(entity.getContent(), Charset.defaultCharset());
+                        try {
+                            while (it.hasNext()) {
+                                final String l = it.next();
+                                if (l.endsWith("\t" + namespace)) {
+                                    return l.substring(0, l.indexOf("\t"));
+                                }
+                            }
+                        } finally {
+                            it.close();
+                        }
                     }
+                    log.error("Error: reverse namespace lookup for '" + namespace + "' not found at prefix.cc");
+                    return null;
                 }
             });
         } catch (Exception e) {

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/prefix/PrefixServiceCC.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/prefix/PrefixServiceCC.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/prefix/PrefixServiceCC.java
index bc1d667..5442d60 100644
--- a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/prefix/PrefixServiceCC.java
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/prefix/PrefixServiceCC.java
@@ -20,7 +20,7 @@ package org.apache.marmotta.platform.core.services.prefix;
 import java.net.URISyntaxException;
 
 import org.apache.marmotta.platform.core.api.prefix.PrefixProvider;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 
 import javax.enterprise.context.ApplicationScoped;
 import javax.enterprise.inject.Alternative;

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/prefix/PrefixServiceImpl.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/prefix/PrefixServiceImpl.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/prefix/PrefixServiceImpl.java
index ac136fe..b26afe3 100644
--- a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/prefix/PrefixServiceImpl.java
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/prefix/PrefixServiceImpl.java
@@ -29,7 +29,7 @@ import org.apache.marmotta.platform.core.api.config.ConfigurationService;
 import org.apache.marmotta.platform.core.api.prefix.PrefixService;
 import org.apache.marmotta.platform.core.events.ConfigurationChangedEvent;
 import org.apache.marmotta.platform.core.events.SesameStartupEvent;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.apache.marmotta.commons.http.UriUtil;
 import org.slf4j.Logger;
 
@@ -127,6 +127,17 @@ public class PrefixServiceImpl implements PrefixService {
     public Map<String, String> getMappings() {
         return Collections.unmodifiableMap(cache);
     }
+    
+	@Override
+	public boolean remove(String prefix) {
+		if (cache.containsKey(prefix)) {
+			cache.remove(prefix);
+			configurationService.removeConfiguration(CONFIGURATION_PREFIX + "." + prefix);
+			return true;
+		} else {
+			return false;
+		}
+	}
 
     @Override
     public boolean containsPrefix(String prefix) {

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/task/TaskImpl.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/task/TaskImpl.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/task/TaskImpl.java
index 56db715..f0ce2b5 100644
--- a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/task/TaskImpl.java
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/task/TaskImpl.java
@@ -20,7 +20,6 @@ package org.apache.marmotta.platform.core.services.task;
 import org.apache.marmotta.platform.core.api.task.Task;
 import org.apache.marmotta.platform.core.api.task.TaskManagerService;
 
-
 class TaskImpl extends Task {
 
     private static final String WAITING_DETAIL = "Waiting in status";
@@ -49,4 +48,5 @@ class TaskImpl extends Task {
     public void subTaskEnded() {
         updateMessage(detailMessages.remove(WAITING_DETAIL));
     }
+    
 }

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/task/TaskManagerServiceImpl.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/task/TaskManagerServiceImpl.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/task/TaskManagerServiceImpl.java
index 69d9d12..13d874c 100644
--- a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/task/TaskManagerServiceImpl.java
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/task/TaskManagerServiceImpl.java
@@ -17,17 +17,6 @@
  */
 package org.apache.marmotta.platform.core.services.task;
 
-import org.apache.marmotta.platform.core.api.task.Task;
-import org.apache.marmotta.platform.core.api.task.TaskInfo;
-import org.apache.marmotta.platform.core.api.task.TaskManagerService;
-
-import org.apache.marmotta.commons.util.HashUtils;
-import org.slf4j.Logger;
-
-import javax.annotation.PostConstruct;
-import javax.annotation.PreDestroy;
-import javax.enterprise.context.ApplicationScoped;
-import javax.inject.Inject;
 import java.lang.ref.WeakReference;
 import java.util.Collections;
 import java.util.Date;
@@ -37,23 +26,36 @@ import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
 import java.util.Stack;
-import java.util.WeakHashMap;
+import java.util.concurrent.ConcurrentMap;
+
+import javax.annotation.PostConstruct;
+import javax.annotation.PreDestroy;
+import javax.enterprise.context.ApplicationScoped;
+import javax.inject.Inject;
+
+import org.apache.marmotta.commons.util.HashUtils;
+import org.apache.marmotta.platform.core.api.task.Task;
+import org.apache.marmotta.platform.core.api.task.TaskInfo;
+import org.apache.marmotta.platform.core.api.task.TaskManagerService;
+import org.slf4j.Logger;
+
+import com.google.common.collect.MapMaker;
 
 @ApplicationScoped
 public class TaskManagerServiceImpl implements TaskManagerService {
 
-    private static final String                        DEFAULT_GROUP = "default";
+    private static final String  DEFAULT_GROUP = "default";
 
-    private final WeakHashMap<Thread, Stack<TaskImpl>> tasks;
+    private final ConcurrentMap<Thread, Stack<TaskImpl>> tasks;
 
     private final ThreadWatchdog watchdog;
 
     @Inject
-    private Logger                                     log;
+    private Logger log;
 
     @Inject
     public TaskManagerServiceImpl() {
-        tasks = new WeakHashMap<Thread, Stack<TaskImpl>>();
+        tasks = new MapMaker().makeMap();
         watchdog = new ThreadWatchdog(15000);
     }
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/templating/AdminTemplatingServiceImpl.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/templating/AdminTemplatingServiceImpl.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/templating/AdminTemplatingServiceImpl.java
index 2a0279d..86c3d4e 100644
--- a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/templating/AdminTemplatingServiceImpl.java
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/templating/AdminTemplatingServiceImpl.java
@@ -38,6 +38,7 @@ import org.apache.marmotta.platform.core.api.templating.AdminInterfaceService;
 import org.apache.marmotta.platform.core.api.templating.TemplatingService;
 import org.apache.marmotta.platform.core.exception.TemplatingException;
 import org.apache.marmotta.platform.core.model.template.MenuItem;
+import org.apache.marmotta.platform.core.model.template.MenuItemType;
 
 /**
  * User: Thomas Kurz
@@ -53,7 +54,7 @@ public class AdminTemplatingServiceImpl implements AdminInterfaceService {
 
     @Inject
     private ModuleService moduleService;
-    
+
     @Inject
     private TemplatingService templatingService;
 
@@ -61,15 +62,11 @@ public class AdminTemplatingServiceImpl implements AdminInterfaceService {
     private ConfigurationService configurationService;
 
     //some statics
-    private static final String TEMPLATE_STRING = "admin.ftl";
-    private static final String DEFAULT_REST_PATH = "/doc/rest/";
-    private static final String DEFAULT_REST_FILE = "overview-summary.html";
-    private static final String DEFAULT_TITLE_FOR_WEBSERVICES = "webservices";
-
+    private static final String DEFAULT_ICON = "icon-beaker";
 
     //pattern to filter comments content
     private static final Pattern PATTERN = Pattern.compile("\\<!--###BEGIN_([^#]+)###--\\>(.+)\\<!--###END_\\1###--\\>",Pattern.DOTALL);
-    private Menu menu;
+    private MenuItem menu;
 
     /**
      * inits a freemarker template service with a servlet context
@@ -77,31 +74,17 @@ public class AdminTemplatingServiceImpl implements AdminInterfaceService {
      */
     @Override
     public void init(ServletContext context) throws TemplatingException {
-    	menu = new Menu();
+        menu = buildMenu();
         this.context = context;
         try {
-        	 //try-run to check it from the very beginning
-            templatingService.getTemplate(TEMPLATE_STRING);
+            //try-run to check it from the very beginning
+            templatingService.getTemplate(TemplatingService.ADMIN_TPL);
         } catch (Exception e) {
             throw new TemplatingException("Severe Error: admin template cannot be found: " + e.getMessage());
         }
     }
 
     /**
-     * Check whether the templating service considers the resource passed in the path as a menu entry it is
-     * responsible for.
-     *
-     * @param path a url path
-     * @return if the give path points to an admin page
-     */
-    @Override
-    public boolean isMenuEntry(String path) {
-        if(menu.path_titles.keySet().contains(configurationService.getPath()+path)) return true;
-        if(path.contains(DEFAULT_REST_PATH)) return true;
-        else return false;
-    }
-
-    /**
      * this method wraps a file with a specified admin template. If the file is not a admin page,
      * the bytes are returned unprocessed
      * @param bytes content represented in a byte array
@@ -113,21 +96,21 @@ public class AdminTemplatingServiceImpl implements AdminInterfaceService {
         if(!configurationService.getBooleanConfiguration("templating.cache.enabled",true) && context!=null) {
             init(context);
         }
-        //apply template
-        if(!isMenuEntry(path)) return bytes;
-        //activate
-        String module = menu.getCurrentModule(configurationService.getPath() + path);
+
+        //set active
+        menu.setActive(path);
+
         //fill data model
         Map<String, Object> datamodel = new HashMap<String,Object>();
-    	for(Properties p : Properties.values()) {
-    		datamodel.put(p.name(),"<!-- "+p.name()+" not defined -->");
-    	}
+        for(Properties p : Properties.values()) {
+            datamodel.put(p.name(),"<!-- "+p.name()+" not defined -->");
+        }
         //begin hack!!!
         datamodel.put("USER_MODULE_IS_ACTIVE", moduleService.listModules().contains("Users"));
         //end hack!!!
-        datamodel.put("MODULE_MENU",menu.menuItems);
-        datamodel.put("CURRENT_TITLE", getNameFromPath(path));
-        datamodel.put("CURRENT_MODULE", module);
+
+        //add menu
+        datamodel.put("MENU",menu.getProperties());
         try {
             String s = new String(bytes);
             Matcher m = PATTERN.matcher(s);
@@ -141,7 +124,7 @@ public class AdminTemplatingServiceImpl implements AdminInterfaceService {
         //make magic happen
         try {
             ByteArrayOutputStream bos = new ByteArrayOutputStream();
-        	templatingService.process(TEMPLATE_STRING, datamodel, new OutputStreamWriter(bos));
+            templatingService.process(TemplatingService.ADMIN_TPL, datamodel, new OutputStreamWriter(bos));
             bytes = bos.toByteArray();
             bos.flush();
             bos.close();
@@ -151,133 +134,49 @@ public class AdminTemplatingServiceImpl implements AdminInterfaceService {
         return bytes;
     }
 
+    @Override
+    public boolean isMenuEntry(String path) {
+        return menu.setActive(path);
+    }
+
     /**
-     * This object represents a menu for the admin interface. It is build using the ModuleService.
+     * build menu
+     * @return
      */
-    class Menu {
-
-        public List<MenuItem> menuItems;
-        public Map<String,String> path_titles;
-
-        public Menu() {
-            //instantiate
-            menuItems = new ArrayList<MenuItem>();
-            path_titles = new HashMap<String, String>();
-            //sort menu
-            ArrayList<String> menuSorted = new ArrayList<String>(moduleService.listModules());
-            if(configurationService.getBooleanConfiguration("templating.sort_by_weight", true)) {
-                Collections.sort(menuSorted, new Comparator<String>() {
-                    @Override
-                    public int compare(String o1, String o2) {
-                        final int w1 = moduleService.getWeight(o1), w2 = moduleService.getWeight(o2);
-                        if (w1 == w2) return o1.compareTo(o2);
-                        return w1 - w2;
-                    }
-                });
-            } else {
-                Collections.sort(menuSorted);
-            }
-
-            //build structure
-            for(String module : menuSorted) {
-                String path = configurationService.getPath() + moduleService.getModuleWeb(module);
-                if(moduleHasAdminPages(module)) {
-                    MenuItem menu_item = new MenuItem();
-                    menu_item.getProperties().put("title",module);
-                    menu_item.getProperties().put("baseurl",moduleService.getModuleConfiguration(module).getConfiguration().getString("baseurl","/"+module));
-                    for(String page : moduleService.getAdminPages(module)) {
-                        if(page.equals("")) {
-                            continue;
-                        }
-                        MenuItem submenu = new MenuItem();
-                        submenu.getProperties().put("title",getNameFromPath(page));
-                        submenu.getProperties().put("path",path+page);
-                        //test if it is active
-                        menu_item.getSubmenu().add(submenu);
-                        path_titles.put(path+page,page);
-                    }
-                    if(moduleService.getWebservices(module)!=null &&
-                            !moduleService.getWebservices(module).isEmpty() &&
-                            !moduleService.getWebservices(module).iterator().next().equals("")) {
-                        MenuItem submenu = new MenuItem();
-                        submenu.getProperties().put("title",DEFAULT_TITLE_FOR_WEBSERVICES);
-                        submenu.getProperties().put("path",path+DEFAULT_REST_PATH+DEFAULT_REST_FILE);
-                        //test if it is active
-                        menu_item.getSubmenu().add(submenu);
-                        path_titles.put(path+DEFAULT_REST_PATH+DEFAULT_REST_FILE,DEFAULT_TITLE_FOR_WEBSERVICES);
-                    }
-                    menuItems.add(menu_item);
+    private MenuItem buildMenu() {
+        MenuItem menu = new MenuItem("MENU", MenuItemType.ROOT);
+
+        for(String container_string : moduleService.listSortedContainers()) {
+            MenuItem container = new MenuItem(container_string, MenuItemType.CONTAINER);
+
+            //add modules
+            for(String module_string : moduleService.listSortedModules(container_string)) {
+                MenuItem module = new MenuItem(module_string, MenuItemType.MODULE);
+                module.set("path",moduleService.getModuleWeb(module_string));
+                if(moduleService.getIcon(module_string) != null)
+                    module.set("icon",moduleService.getIcon(module_string));
+
+                //add pages
+                for(HashMap<String,String> page_object : moduleService.getAdminPageObjects(module_string)) {
+                    MenuItem page = new MenuItem(page_object.get("title"), MenuItemType.PAGE);
+                    page.set("path",page_object.get("link"));
+                    module.addItem(page);
                 }
-            }
-        }
 
-        /**
-         * get current module and set submenu to active
-         * @param path the current system path
-         * @return current module name
-         */
-        public String getCurrentModule(String path) {
-            String module = "";
-            boolean active = false;
-            //test with module and submenu must be active
-            for(MenuItem menuItem : menuItems) {
-                if(path.startsWith((String)menuItem.getProperties().get("baseurl"))) {
-                    module = (String)menuItem.getProperties().get("title");
-                }
-                menuItem.getProperties().put("active",false);
-                for(MenuItem submenu : menuItem.getSubmenu()) {
-                    if(submenu.getProperties().get("path").equals(path)) {
-                        submenu.getProperties().put("active",true);
-                        menuItem.getProperties().put("active",true);
-                        module = (String)menuItem.getProperties().get("title");
-                        active = true;
-                    } else {
-                        submenu.getProperties().put("active",false);
-                    }
-                }
-            }
-            //workaround for webservices (autogenerated pages that are nit fix stored in the menu structure)
-            if(!active) {
-                for(MenuItem menuItem : menuItems) {
-                    if(module.equals(menuItem.getProperties().get("title"))) {
-                        for(MenuItem submenu : menuItem.getSubmenu()) {
-                            if(submenu.getProperties().get("title").equals(DEFAULT_TITLE_FOR_WEBSERVICES)) {
-                                submenu.getProperties().put("active",true);
-                                menuItem.getProperties().put("active",true);
-                            }
-                        }
-                    }
+                //add webservice
+                if(!moduleService.getWebservices(module_string).isEmpty()) {
+                    MenuItem page = new MenuItem(TemplatingService.DEFAULT_WEBSERVICE_TITLE, MenuItemType.WEBSERVICE);
+                    page.set("path",module.get("path")+TemplatingService.DEFAULT_REST_PATH+TemplatingService.DEFAULT_REST_FILE);
+                    module.addItem(page);
                 }
-            }
-            return module;
-        }
 
-        /**
-         * Tests if a module should appear in the menu
-         * @param module a module name
-         * @return true is module should appear, false if not
-         */
-        private boolean moduleHasAdminPages(String module) {
-            if(moduleService.getAdminPages(module)!=null &&
-                    !moduleService.getAdminPages(module).isEmpty() &&
-                    !moduleService.getAdminPages(module).get(0).equals(""))
-                return true;
-            else if(moduleService.getWebservices(module)!=null &&
-                    !moduleService.getWebservices(module).isEmpty() &&
-                    !moduleService.getWebservices(module).iterator().next().equals("")) return true;
-            return false;
+                //add if there are pages to display
+                if(!module.isEmpty()) container.addItem(module);
+            }
+            menu.addItem(container);
         }
 
+        return menu;
     }
 
-    /**
-     * returns a proper name for a path by using the filename.
-     * @param path
-     * @return
-     */
-    private String getNameFromPath(String path) {
-        if(path.contains(DEFAULT_REST_PATH)) return DEFAULT_TITLE_FOR_WEBSERVICES;
-        return path.substring(path.lastIndexOf("/")).replaceAll("/"," ").replaceAll("_"," ").replaceAll(".html","").replaceAll(".jsp","");
-    }
-
-}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/templating/TemplatingServiceImpl.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/templating/TemplatingServiceImpl.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/templating/TemplatingServiceImpl.java
index 56728cc..6942443 100644
--- a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/templating/TemplatingServiceImpl.java
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/templating/TemplatingServiceImpl.java
@@ -31,6 +31,7 @@ import javax.enterprise.context.ApplicationScoped;
 import javax.enterprise.event.Observes;
 import javax.inject.Inject;
 
+import com.google.common.base.Preconditions;
 import org.apache.marmotta.platform.core.api.config.ConfigurationService;
 import org.apache.marmotta.platform.core.api.templating.TemplatingService;
 import org.apache.marmotta.platform.core.events.ConfigurationChangedEvent;
@@ -38,6 +39,7 @@ import org.apache.marmotta.platform.core.events.ConfigurationChangedEvent;
 import freemarker.template.Configuration;
 import freemarker.template.Template;
 import freemarker.template.TemplateException;
+import org.apache.marmotta.platform.core.startup.MarmottaStartupService;
 
 /**
  * Template Service Implementation
@@ -52,13 +54,18 @@ public class TemplatingServiceImpl implements TemplatingService {
     @Inject
     private ConfigurationService configurationService;
 
+    @Inject
+    private MarmottaStartupService startupService;
+
 	public TemplatingServiceImpl() {
 		super();
 		common = new HashMap<String,String>();
 	}
 
 	@PostConstruct
-	public void initDataModel() {        
+	public void initDataModel() {
+        Preconditions.checkState(startupService.isHostStarted());
+
         String project = configurationService.getStringConfiguration("kiwi.pages.project", DEFAULT_PROJECT);
         common.put("PROJECT", project);
         common.put("DEFAULT_STYLE", configurationService.getStringConfiguration("kiwi.pages.style_path", DEFAULT_STYLE));

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/triplestore/ContextServiceImpl.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/triplestore/ContextServiceImpl.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/triplestore/ContextServiceImpl.java
index 189c566..afe1792 100644
--- a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/triplestore/ContextServiceImpl.java
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/triplestore/ContextServiceImpl.java
@@ -30,7 +30,7 @@ import javax.enterprise.inject.Produces;
 import javax.inject.Inject;
 import javax.inject.Named;
 
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.apache.marmotta.commons.sesame.repository.ResourceUtils;
 import org.apache.marmotta.platform.core.api.config.ConfigurationService;
 import org.apache.marmotta.platform.core.api.importer.ImportService;
@@ -45,6 +45,8 @@ import org.apache.marmotta.platform.core.qualifiers.kspace.InferredKnowledgeSpac
 import org.apache.marmotta.platform.core.qualifiers.kspace.SystemKnowledgeSpace;
 import org.openrdf.model.Resource;
 import org.openrdf.model.URI;
+import org.openrdf.model.ValueFactory;
+import org.openrdf.model.util.Literals;
 import org.openrdf.model.vocabulary.RDFS;
 import org.openrdf.repository.RepositoryConnection;
 import org.openrdf.repository.RepositoryException;
@@ -178,9 +180,10 @@ public class ContextServiceImpl implements ContextService {
             try {
                 conn.begin();
                 checkConnectionNamespace(conn);
-                URI ctx = conn.getValueFactory().createURI(uri);
+                ValueFactory valueFactory = conn.getValueFactory();
+				URI ctx = valueFactory.createURI(uri);
                 if (StringUtils.isNotBlank(label)) {
-                    conn.add(ctx, RDFS.LABEL, conn.getValueFactory().createLiteral(label), ctx);
+                    conn.add(ctx, RDFS.LABEL, Literals.createLiteral(valueFactory, label), ctx);
                 }
                 return ctx;
             } finally {


[020/100] [abbrv] [partial] Reverting the erroneous merge by Sebastian according to the instructions in INFRA-6876

Posted by wi...@apache.org.
http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/kiwi/kiwi-sparql/src/main/java/org/apache/marmotta/kiwi/sparql/sqlmapper/SparqlToSQLMapper.java
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-sparql/src/main/java/org/apache/marmotta/kiwi/sparql/sqlmapper/SparqlToSQLMapper.java b/libraries/kiwi/kiwi-sparql/src/main/java/org/apache/marmotta/kiwi/sparql/sqlmapper/SparqlToSQLMapper.java
deleted file mode 100644
index 8bf0677..0000000
--- a/libraries/kiwi/kiwi-sparql/src/main/java/org/apache/marmotta/kiwi/sparql/sqlmapper/SparqlToSQLMapper.java
+++ /dev/null
@@ -1,2427 +0,0 @@
-/**
- * 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.platform.sparql.services.evaluation.sql;
-
-import org.apache.marmotta.platform.sparql.model.Tables;
-import org.apache.marmotta.platform.sparql.model.tables.TNodes;
-import org.apache.marmotta.platform.sparql.model.tables.TTriples;
-import org.apache.marmotta.platform.sparql.model.tables.records.RNodes;
-import org.apache.marmotta.commons.sesame.model.Namespaces;
-import org.apache.marmotta.commons.util.DateUtils;
-import at.newmedialab.sesame.commons.util.HashUtils;
-import com.google.common.collect.Sets;
-import org.apache.marmotta.platform.core.api.config.ConfigurationService;
-import org.apache.marmotta.platform.core.api.triplestore.ResourceService;
-import org.apache.marmotta.platform.core.model.rdf.KiWiNode;
-import org.apache.marmotta.platform.core.model.rdf.KiWiUriResource;
-import org.apache.marmotta.platform.core.util.KiWiContext;
-import org.jooq.*;
-import org.jooq.conf.RenderNameStyle;
-import org.jooq.conf.StatementType;
-import org.jooq.impl.Factory;
-import org.jooq.impl.SQLDataType;
-import org.openrdf.model.BNode;
-import org.openrdf.model.Literal;
-import org.openrdf.model.URI;
-import org.openrdf.model.Value;
-import org.openrdf.model.impl.CalendarLiteralImpl;
-import org.openrdf.model.impl.DecimalLiteralImpl;
-import org.openrdf.model.impl.IntegerLiteralImpl;
-import org.openrdf.query.algebra.*;
-import org.openrdf.query.algebra.helpers.QueryModelVisitorBase;
-import org.openrdf.query.parser.sparql.ast.VisitorException;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.sql.Connection;
-import java.sql.Timestamp;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-/**
- * A class implementing the query model visitor to translate a SPARQL algebra model to a SQL query using the JOOQ
- * Java to SQL mapper. Takes a JDBC database connection and a SQLDialect as argument, based on which the
- * translation takes place. The resulting SQL query can be retrieved by calling the getQuery() method.
- * <p/>
- * The SPARQL->SQL mapper translates the major SPARQL constructs as follows:
- * <ul>
- *     <li>a triple pattern is translated into a join of the TRIPLES table with the subject,
- *         property, object, and optionally context nodes; each variable occurring in the pattern
- *         represents a separate query to the KIWINODES table; variables with the same name
- *         are reused to ensure SPARQL joins to be translated into SQL JOINs</li>
- *     <li>a JOIN between triple patterns is translated into an SQL INNER JOIN, using the variables used
- *         in the triple patterns as JOIN conditions</li>
- *     <li>an OPTIONAL between triple patterns is translated into an SQL LEFT OUTER JOIN, using the
- *         variables occurring in the optional pattern as join conditions</li>
- *     <li>a UNION is translated into an SQL UNION; since SPARQL untions occur inside
- *         the WHERE part of the query, the UnionOptimizer moves them out to the top level
- *         so the UNION is always calculated properly over SQL queries</li>
- *     <li>INTERSECTION and DIFFERENCE are translated similar to UNION queries to INTERSECTION and EXCEPT
- *         in SQL</li>
- *     <li>variables are named queries to the KIWINODES table; in case the value of a variable is
- *         needed, the getValue() method below translates the table representation into either the
- *         content, uri, or anonId fields of the table; in case the variable is returned by the
- *         projection, the mapping translates it into the ID field of the table to be able to
- *         load the complete RDF node; specialised methods are implemented for accessing the
- *         double, integer, or date content of a variable</li>
- *     <li>SPARQL functions and operators are translated as far as possible directly into their
- *         SQL counterparts; for constructs where a SQL equivalent does not exist, an exception
- *         is thrown</li>
- * </ul>
- * <p/>
- * Author: Sebastian Schaffert
- */
-public class SparqlToSQLMapper  {
-
-    private static Logger log = LoggerFactory.getLogger(SparqlToSQLMapper.class);
-
-    // TODO: implement language tag matches using this regular expression
-    static final String langtag_ex =
-            "(\\A[xX]([\\x2d]\\p{Alnum}{1,8})*\\z)"
-                    + "|(((\\A\\p{Alpha}{2,8}(?=\\x2d|\\z)){1}"
-                    + "(([\\x2d]\\p{Alpha}{3})(?=\\x2d|\\z)){0,3}"
-                    + "([\\x2d]\\p{Alpha}{4}(?=\\x2d|\\z))?"
-                    + "([\\x2d](\\p{Alpha}{2}|\\d{3})(?=\\x2d|\\z))?"
-                    + "([\\x2d](\\d\\p{Alnum}{3}|\\p{Alnum}{5,8})(?=\\x2d|\\z))*)"
-                    + "(([\\x2d]([a-wyzA-WYZ](?=\\x2d))([\\x2d](\\p{Alnum}{2,8})+)*))*"
-                    + "([\\x2d][xX]([\\x2d]\\p{Alnum}{1,8})*)?)\\z";
-
-
-    private Factory create;
-
-    /** jOOQ representation of the triples table */
-    private TTriples T_TRIPLES;
-
-    /** jOOQ representation of the nodes table */
-    private TNodes T_NODES;
-
-    /** jOOQ representation of the namespaces table */
-    private Table<Record> T_NAMESPACES;
-
-
-    private SQLDialect dialect;
-
-    // keep track of the variables that have so far been used in the query;
-    // currentVariables is used by sub queries
-    private Map<String,TNodes> variables;
-    private Map<String,TNodes> currentVariables;
-
-    // map from URI resources to nodes table, to avoid unnecessary joins
-    private Map<String,TNodes> uriNodes;
-
-
-    // keep track of SPARQL extension values used in the query; extension values are bound e.g. to
-    // function results
-    private Map<String,Field> extensions;
-
-    // count current triple; used for naming triple patterns
-    private int tripleCounter = 0;
-
-    // the set of variables that are actually projected by this query
-    private Set<String> projectedVariables;
-
-    // the set of extensions that are projected by this query (together with type information for proper casting)
-    private HashMap<String,Class> extensionVariables;
-
-
-    // collect mappings from internal variable name to result variable name; filled by Projection
-    private Map<String,String> variableMappings;
-    private Map<String,String> revVariableMappings;
-
-    // fields used for sorting the results
-    private Map<String,Field> sortFields;
-    private Map<String,Set<String>> sortDependencies;
-
-
-    // store variables that can only be used as resources; for such variables, we can detect the getValue
-    // method, because in this case we only need to return the URI as string value
-    private Set<String> resourceVariables;
-
-    private Select query;
-
-    private CastType typeCast;
-
-    // collection of fields on which to group the query; collected by group(), used by projection() ...
-    private Set<String> groupBy;
-
-    private ResourceService resourceService;
-
-    private ConfigurationService configurationService;
-
-    public SparqlToSQLMapper(Connection connection, SQLDialect dialect, CastType typeCast) {
-        create = new Factory(connection,dialect);
-        create.getSettings().setRenderFormatted(true);
-        create.getSettings().setRenderNameStyle(RenderNameStyle.LOWER);
-        create.getSettings().setStatementType(StatementType.STATIC_STATEMENT);
-
-        this.dialect = dialect;
-
-        T_TRIPLES    = Tables.TRIPLES;
-        T_NODES      = Tables.KIWINODE;
-        T_NAMESPACES = create.table("KIWINAMESPACE");
-
-        variables = new HashMap<String, TNodes>();
-        currentVariables = new HashMap<String, TNodes>();
-        projectedVariables = new HashSet<String>();
-        extensionVariables = new HashMap<String, Class>();
-
-        extensions = new HashMap<String, Field>();
-
-        variableMappings = new HashMap<String, String>();
-        revVariableMappings = new HashMap<String, String>();
-        sortFields = new HashMap<String, Field>();
-        sortDependencies = new HashMap<String, Set<String>>();
-
-        resourceVariables = new HashSet<String>();
-
-        uriNodes = new HashMap<String, TNodes>();
-
-        groupBy = new HashSet<String>();
-
-        this.typeCast = typeCast;
-
-        // require some beans to get additional information
-        this.resourceService = KiWiContext.getInstance(ResourceService.class);
-        this.configurationService = KiWiContext.getInstance(ConfigurationService.class);
-    }
-
-    public SparqlToSQLMapper(Connection connection, SQLDialect dialect, TupleExpr queryRoot, CastType typeCast) {
-        this(connection,dialect, typeCast);
-
-        query = meetTupleExpression(queryRoot, create.selectQuery(), new HashSet<Condition>(), new HashSet<String>());
-    }
-
-    public SparqlToSQLMapper(Connection connection, SQLDialect dialect, ValueExpr queryRoot, CastType typeCast) {
-        this(connection,dialect, typeCast);
-
-        query = create.select((Field)meetValueExpression(queryRoot));
-    }
-
-
-
-    public Select getQuery() {
-        return query;
-    }
-
-
-    public Set<String> getProjectedVariables() {
-        return projectedVariables;
-    }
-
-    public HashMap<String, Class> getExtensionVariables() {
-        return extensionVariables;
-    }
-
-    public Condition meet(And node)  {
-        QueryPart leftPart = meetValueExpression(node.getLeftArg());
-        QueryPart rightPart = meetValueExpression(node.getRightArg());
-
-        if(! (leftPart instanceof Condition) || !(rightPart instanceof Condition)) {
-            throw new IllegalStateException("the left or right part of the AND condition are not boolean: "+node);
-        }
-
-        return ((Condition)leftPart).and((Condition)rightPart);
-
-    }
-
-
-    public SelectQuery arbitraryLengthPath(ArbitraryLengthPath node, SelectQuery query)  {
-        throw new UnsupportedOperationException(node.getClass().getName()+" not supported");    //To change body of overridden methods use File | Settings | File Templates.
-    }
-
-
-    public Field avg(Avg node)  {
-        QueryPart part = meetValueExpression(node.getArg());
-
-
-        return getDoubleValue(part, true).avg();
-    }
-
-
-    public SelectQuery bindingSetAssignment(BindingSetAssignment node, SelectQuery query, Collection<Condition> conditions, Collection<String> projections)  {
-        throw new UnsupportedOperationException(node.getClass().getName()+" not supported");    //To change body of overridden methods use File | Settings | File Templates.
-    }
-
-
-
-    public QueryPart bound(Bound node)  {
-        QueryPart part = meetValueExpression(node.getArg());
-
-        // variable
-        if(part instanceof TNodes) {
-            return create.condition(part + ".id is not null") ;
-        } else {
-            throw new IllegalArgumentException("NOT NULL can only be computed for the node table; type was: "+part.getClass().getName());
-        }
-    }
-
-
-
-    public Field coalesce(Coalesce node)  {
-
-        /*
-        if(node.getArguments().size() > 0) {
-            Field part1;
-            Field[] parts2_n = new Field[node.getArguments().size()-1];
-            for(int i=0; i<node.getArguments().size(); i++) {
-                QueryPart part = meetValueExpression(node.getArguments().get(i));
-                if(part instanceof Table && ((Table) part).getName().equals(T_NODES.getName())) {
-                    if(i == 0) {
-                        part1 = ((Table)part).getField("");
-                    } else {
-                        parts2_n[i-1] = (Table)part;
-                    }
-                } else {
-                    throw new IllegalArgumentException("COALESCE can only be computed for the node table; type was: "+part.getClass().getName());
-                }
-
-            }
-            return create.coalesce()
-        }
-        */
-
-
-        throw new UnsupportedOperationException(node.getClass().getName()+" not supported");    //To change body of overridden methods use File | Settings | File Templates.
-    }
-
-
-    public Condition compare(Compare node)  {
-        QueryPart leftArg = meetValueExpression(node.getLeftArg());
-        QueryPart rightArg = meetValueExpression(node.getRightArg());
-
-        Field left, right;
-
-        // type negotiation:
-        // 1. if both are variables, casting should take place based on the type field, or if no type is given, we use
-        // the value returned by getValue (might be the URI)
-        if(leftArg instanceof TNodes && rightArg instanceof TNodes) {
-            TNodes tleft  = (TNodes) leftArg;
-            TNodes tright = (TNodes) rightArg;
-
-            switch (node.getOperator()) {
-                case EQ:
-                    return create.decode().when(tleft.NODETYPE.equal("DOUBLE").and(tright.NODETYPE.equal("DOUBLE")), tleft.DOUBLECONTENT.equal(tright.DOUBLECONTENT))
-                            .when(tleft.NODETYPE.equal("INTEGER").and(tright.NODETYPE.equal("INTEGER")), tleft.INTCONTENT.equal(tright.INTCONTENT))
-                            .when(tleft.NODETYPE.equal("STRING").and(tright.NODETYPE.equal("STRING")),tleft.CONTENT.equal(tright.CONTENT))
-                            .when(tleft.NODETYPE.equal("DATE").and(tright.NODETYPE.equal("DATE")),tleft.DATECONTENT.equal(tright.DATECONTENT))
-                            .when(tleft.NODETYPE.equal("URI").and(tright.NODETYPE.equal("URI")),tleft.URI.equal(tright.URI))
-                            .when(tleft.NODETYPE.equal("ANON").and(tright.NODETYPE.equal("ANON")),tleft.ID.equal(tright.ID))
-                            .otherwise(create.falseCondition()).isTrue();
-                case GE:
-                    return create.decode().when(tleft.NODETYPE.equal("DOUBLE").and(tright.NODETYPE.equal("DOUBLE")), tleft.DOUBLECONTENT.greaterOrEqual(tright.DOUBLECONTENT))
-                            .when(tleft.NODETYPE.equal("INTEGER").and(tright.NODETYPE.equal("INTEGER")), tleft.INTCONTENT.greaterOrEqual(tright.INTCONTENT))
-                            .when(tleft.NODETYPE.equal("DATE").and(tright.NODETYPE.equal("DATE")),tleft.DATECONTENT.greaterOrEqual(tright.DATECONTENT))
-                            .when(tleft.NODETYPE.equal("STRING").and(tright.NODETYPE.equal("STRING")),tleft.CONTENT.greaterOrEqual(tright.CONTENT))
-                            .otherwise(create.falseCondition()).isTrue();
-                case GT:
-                    return create.decode().when(tleft.NODETYPE.equal("DOUBLE").and(tright.NODETYPE.equal("DOUBLE")), tleft.DOUBLECONTENT.greaterThan(tright.DOUBLECONTENT))
-                            .when(tleft.NODETYPE.equal("INTEGER").and(tright.NODETYPE.equal("INTEGER")), tleft.INTCONTENT.greaterThan(tright.INTCONTENT))
-                            .when(tleft.NODETYPE.equal("STRING").and(tright.NODETYPE.equal("STRING")),tleft.CONTENT.greaterThan(tright.CONTENT))
-                            .when(tleft.NODETYPE.equal("DATE").and(tright.NODETYPE.equal("DATE")),tleft.DATECONTENT.greaterThan(tright.DATECONTENT))
-                            .otherwise(create.falseCondition()).isTrue();
-                case LE:
-                    return create.decode().when(tleft.NODETYPE.equal("DOUBLE").and(tright.NODETYPE.equal("DOUBLE")), tleft.DOUBLECONTENT.lessOrEqual(tright.DOUBLECONTENT))
-                            .when(tleft.NODETYPE.equal("INTEGER").and(tright.NODETYPE.equal("INTEGER")), tleft.INTCONTENT.lessOrEqual(tright.INTCONTENT))
-                            .when(tleft.NODETYPE.equal("STRING").and(tright.NODETYPE.equal("STRING")),tleft.CONTENT.lessOrEqual(tright.CONTENT))
-                            .when(tleft.NODETYPE.equal("DATE").and(tright.NODETYPE.equal("DATE")),tleft.DATECONTENT.lessOrEqual(tright.DATECONTENT))
-                            .otherwise(create.falseCondition()).isTrue();
-                case LT:
-                    return create.decode().when(tleft.NODETYPE.equal("DOUBLE").and(tright.NODETYPE.equal("DOUBLE")), tleft.DOUBLECONTENT.lessThan(tright.DOUBLECONTENT))
-                            .when(tleft.NODETYPE.equal("INTEGER").and(tright.NODETYPE.equal("INTEGER")), tleft.INTCONTENT.lessThan(tright.INTCONTENT))
-                            .when(tleft.NODETYPE.equal("STRING").and(tright.NODETYPE.equal("STRING")),tleft.CONTENT.lessThan(tright.CONTENT))
-                            .when(tleft.NODETYPE.equal("DATE").and(tright.NODETYPE.equal("DATE")),tleft.DATECONTENT.lessThan(tright.DATECONTENT))
-                            .otherwise(create.falseCondition()).isTrue();
-                case NE:
-                    return create.decode()  .when(tleft.NODETYPE.equal("DOUBLE").and(tright.NODETYPE.equal("DOUBLE")), tleft.DOUBLECONTENT.notEqual(tright.DOUBLECONTENT))
-                            .when(tleft.NODETYPE.equal("INTEGER").and(tright.NODETYPE.equal("INTEGER")), tleft.INTCONTENT.notEqual(tright.INTCONTENT))
-                            .when(tleft.NODETYPE.equal("STRING").and(tright.NODETYPE.equal("STRING")),tleft.CONTENT.notEqual(tright.CONTENT))
-                            .when(tleft.NODETYPE.equal("URI").and(tright.NODETYPE.equal("URI")),tleft.URI.notEqual(tright.URI))
-                            .when(tleft.NODETYPE.equal("ANON").and(tright.NODETYPE.equal("ANON")),tleft.ID.notEqual(tright.ID))
-                            .when(tleft.NODETYPE.equal("DATE").and(tright.NODETYPE.equal("DATE")),tleft.DATECONTENT.notEqual(tright.DATECONTENT))
-                            .otherwise(create.falseCondition()).isTrue();
-
-            }
-
-            throw new IllegalArgumentException("unknown operator for comparison: "+node.getOperator());
-
-            // 2. if only one is a variable, we take the type of the other argument and cast the variable to either string or
-            // double for comparison
-        } else if(leftArg instanceof TNodes && rightArg instanceof Field) {
-            if(((Field) rightArg).getType().equals(Long.class)) {
-                left = getIntegerValue(leftArg, typeCast == CastType.STRICT);
-                right = getIntegerValue(rightArg, typeCast == CastType.STRICT);
-            } else if(((Field) rightArg).getType().equals(Double.class)) {
-                left = getDoubleValue(leftArg, typeCast == CastType.STRICT);
-                right = getDoubleValue(rightArg, typeCast == CastType.STRICT);
-            } else if(((Field) rightArg).getType().equals(Timestamp.class)) {
-                left = getDateValue(leftArg, typeCast == CastType.STRICT);
-                right = getDateValue(rightArg, typeCast == CastType.STRICT);
-            } else {
-                left = getValue(leftArg, typeCast == CastType.STRICT);
-                right = getValue(rightArg, typeCast == CastType.STRICT);
-            }
-        } else if(rightArg instanceof TNodes && leftArg instanceof Field) {
-            if(((Field) leftArg).getType().equals(Long.class)) {
-                left = getIntegerValue(leftArg, typeCast == CastType.STRICT);
-                right = getIntegerValue(rightArg, typeCast == CastType.STRICT);
-            } else if(((Field) leftArg).getType().equals(Double.class)) {
-                left = getDoubleValue(leftArg, typeCast == CastType.STRICT);
-                right = getDoubleValue(rightArg, typeCast == CastType.STRICT);
-            } else if(((Field) leftArg).getType().equals(Timestamp.class)) {
-                left = getDateValue(leftArg, typeCast == CastType.STRICT);
-                right = getDateValue(rightArg, typeCast == CastType.STRICT);
-            } else {
-                left = getValue(leftArg, typeCast == CastType.STRICT);
-                right = getValue(rightArg, typeCast == CastType.STRICT);
-            }
-        } else {
-            left   = getValue(leftArg, true);
-            right  = getValue(rightArg, true);
-        }
-
-
-
-        // TODO: here we could possibly also work with getAlternativeValues, but it is unclear to me what comparison with null fields will yield!
-        // maybe we need sth like (x is not null AND x < y)
-
-
-        switch(node.getOperator()) {
-            case EQ:
-                return left.equal(right);
-            case GE:
-                return left.greaterOrEqual(right);
-            case GT:
-                return left.greaterThan(right);
-            case LE:
-                return left.lessOrEqual(right);
-            case LT:
-                return left.lessThan(right);
-            case NE:
-                return left.notEqual(right);
-        }
-
-        throw new IllegalArgumentException("unknown operator for comparison: "+node.getOperator());
-    }
-
-
-    public QueryPart compareAll(CompareAll node)  {
-        throw new UnsupportedOperationException(node.getClass().getName()+" not supported");    //To change body of overridden methods use File | Settings | File Templates.
-    }
-
-
-    public QueryPart compareAny(CompareAny node)  {
-        throw new UnsupportedOperationException(node.getClass().getName()+" not supported");    //To change body of overridden methods use File | Settings | File Templates.
-    }
-
-
-
-    public Field count(Count node)  {
-        QueryPart part = meetValueExpression(node.getArg());
-
-        if(part instanceof TNodes) {
-            return ((TNodes)part).ID.count();
-
-        } else {
-            throw new IllegalArgumentException("COUNT is only supported for variables, was: "+part.getClass().getName());
-        }
-    }
-
-
-    public Field datatype(Datatype node)  {
-        QueryPart part = meetValueExpression(node.getArg());
-
-        if(part instanceof TNodes) {
-            return ((TNodes)part).TYPE;
-
-        } else {
-            throw new IllegalArgumentException("DATATYPE is only supported for variables, was: "+part.getClass().getName());
-        }
-    }
-
-
-
-    public List<JoinTable> difference(Difference node, SelectQuery query, Collection<Condition> conditions, Collection<String> projections,Collection<Table> tables)  {
-        return merge(node,query,MergeType.DIFFERENCE, conditions,  projections, tables);
-    }
-
-
-    public Select distinct(Distinct node, SelectQuery query, Collection<Condition> conditions, Collection<String> projections)  {
-
-        Select subQuery = meetTupleExpression(node.getArg(), query,  conditions,  projections);
-
-        if(subQuery instanceof SelectQuery) {
-            ((SelectQuery) subQuery).setDistinct(true);
-            return subQuery;
-        } else {
-            return create.selectDistinct().from(subQuery);
-        }
-
-        /*
-        try {
-            // distinct and order by is not possible in SQL
-            if(! (new HasOrderBy(node).isTrue())) {
-                query.setDistinct(true);
-                return meetTupleExpression(node.getArg(), query, type);
-            } else {
-                // we have to do a subquery first and then select the distinct values
-                Select subquery = meetTupleExpression(node.getArg(), query, type);
-
-                return create.selectDistinct().from(subquery);
-            }
-        } catch (VisitorException e) {
-            return meetTupleExpression(node.getArg(),query,type);
-        }
-        */
-    }
-
-
-    public SelectQuery emptySet(EmptySet node, SelectQuery query, Collection<Condition> conditions, Collection<String> projections)  {
-        query.addConditions(create.falseCondition());
-        return query;
-    }
-
-
-    public Condition exists(Exists node)  {
-        // save previous state
-        Map<String,TNodes> oldVars = currentVariables;
-
-        currentVariables = new HashMap<String, TNodes>(oldVars);   // copy over old variable mappings so modifications have no influence to the rest of the evaluation
-        SelectQuery subQuery = create.selectQuery();
-        Set<Condition> conditions = new HashSet<Condition>();
-        List<Table> tables = new ArrayList<Table>();
-
-        Table from = null;
-        for(JoinTable tbl : meetTableLike(node.getSubQuery(),subQuery, conditions, new HashSet<String>(), tables)) {
-            if(from == null) {
-                from = tbl.getTable();
-                subQuery.addConditions(tbl.getConditions());
-            } else {
-                from = from.join(tbl.getTable()).on(tbl.getConditions().toArray(new Condition[0]));
-            }
-        }
-        subQuery.addFrom(from);
-        subQuery.addConditions(conditions);
-        if(tables.size() > 0 && tables.get(0) instanceof TTriples) {
-            subQuery.addSelect(((TTriples)tables.get(0)).ID.as("_singlevalue"));
-        }
-        subQuery.addLimit(1);
-
-        // reload previous state
-        currentVariables = oldVars;
-
-        return create.exists(subQuery);
-    }
-
-
-    public List<JoinTable> extension(Extension node, SelectQuery query, Collection<Condition> conditions, Collection<String> projections, Collection<Table> tables)  {
-        List<JoinTable> select;
-        if(node.getArg() instanceof SingletonSet) {
-            // TODO: optimization would be to not run against the database at all ...
-            select = new ArrayList<JoinTable>();
-        } else {
-            select = meetTableLike(node.getArg(), query, conditions, projections, tables);
-        }
-
-        for(ExtensionElem elem : node.getElements()) {
-            extensionElem(elem);
-        }
-
-        return select;
-    }
-
-    public void extensionElem(ExtensionElem elem) {
-        if(elem.getExpr() instanceof Var) {
-            // do nothing, declaration
-        } else {
-            extensions.put(elem.getName().replace("-","_"), getValue(meetValueExpression(elem.getExpr()), true));
-        }
-    }
-
-
-    public List<JoinTable> filter(Filter node, SelectQuery query, Collection<Condition> conditions, Collection<String> projections, Collection<Table> tables)  {
-        List<JoinTable> tableList = meetTableLike(node.getArg(), query, conditions, projections, tables); // ensure the tables are evaluated before the conditions
-
-        QueryPart condition = meetValueExpression(node.getCondition());
-        if(condition instanceof Condition) {
-            conditions.add((Condition)condition);
-        } else {
-            throw new IllegalStateException("the transformation of the value expression did not result in a Condition");
-        }
-
-
-
-        return tableList;
-    }
-
-
-    public QueryPart functionCall(FunctionCall node)  {
-        if(node.getURI().equals(Namespaces.NS_XSD+"double") && node.getArgs().size() == 1) {
-            QueryPart arg = meetValueExpression(node.getArgs().get(0));
-
-            return getDoubleValue(arg, true);
-        } else if(node.getURI().equals(Namespaces.NS_XSD+"float") && node.getArgs().size() == 1) {
-            QueryPart arg = meetValueExpression(node.getArgs().get(0));
-
-            return getDoubleValue(arg, true);
-        } else if(node.getURI().equals(Namespaces.NS_XSD+"decimal") && node.getArgs().size() == 1) {
-            QueryPart arg = meetValueExpression(node.getArgs().get(0));
-
-            return getIntegerValue(arg, true);
-        } else if(node.getURI().equals(Namespaces.NS_XSD+"integer") && node.getArgs().size() == 1) {
-            QueryPart arg = meetValueExpression(node.getArgs().get(0));
-
-            return getIntegerValue(arg, true);
-        } else if(node.getURI().equals(Namespaces.NS_XSD+"boolean") && node.getArgs().size() == 1) {
-            QueryPart arg = meetValueExpression(node.getArgs().get(0));
-
-            return getValue(arg, true).cast(SQLDataType.BOOLEAN);
-        } else if(node.getURI().equals(Namespaces.NS_XSD+"string") && node.getArgs().size() == 1) {
-            QueryPart arg = meetValueExpression(node.getArgs().get(0));
-
-            return getValue(arg, true);
-        } else if(node.getURI().equals(Namespaces.NS_XSD+"dateTime") && node.getArgs().size() == 1) {
-            QueryPart arg = meetValueExpression(node.getArgs().get(0));
-
-            return getDateValue(arg, true);
-        } else if(node.getURI().equalsIgnoreCase("ABS") && node.getArgs().size() == 1) {
-            QueryPart arg = meetValueExpression(node.getArgs().get(0));
-
-            return getDoubleValue(arg,typeCast == CastType.STRICT).abs();
-        } else if(node.getURI().equalsIgnoreCase("CEIL") && node.getArgs().size() == 1) {
-            QueryPart arg = meetValueExpression(node.getArgs().get(0));
-
-            return getDoubleValue(arg,typeCast == CastType.STRICT).ceil();
-        } else if(node.getURI().equalsIgnoreCase("FLOOR") && node.getArgs().size() == 1) {
-            QueryPart arg = meetValueExpression(node.getArgs().get(0));
-
-            return getDoubleValue(arg,typeCast == CastType.STRICT).floor();
-        } else if(node.getURI().equalsIgnoreCase("RAND") && node.getArgs().size() == 0) {
-            return create.rand();
-        } else if(node.getURI().equalsIgnoreCase("ROUND") && node.getArgs().size() == 1) {
-            QueryPart arg = meetValueExpression(node.getArgs().get(0));
-
-            return getDoubleValue(arg,typeCast == CastType.STRICT).round();
-        } else if(node.getURI().equalsIgnoreCase("DAY") && node.getArgs().size() == 1) {
-            QueryPart arg = meetValueExpression(node.getArgs().get(0));
-
-            return create.extract(getDateValue(arg,true),DatePart.DAY);
-        } else if(node.getURI().equalsIgnoreCase("HOURS") && node.getArgs().size() == 1) {
-            QueryPart arg = meetValueExpression(node.getArgs().get(0));
-
-            return create.extract(getDateValue(arg,true),DatePart.HOUR);
-        } else if(node.getURI().equalsIgnoreCase("MINUTES") && node.getArgs().size() == 1) {
-            QueryPart arg = meetValueExpression(node.getArgs().get(0));
-
-            return create.extract(getDateValue(arg,true),DatePart.MINUTE);
-        } else if(node.getURI().equalsIgnoreCase("MONTH") && node.getArgs().size() == 1) {
-            QueryPart arg = meetValueExpression(node.getArgs().get(0));
-
-            return create.extract(getDateValue(arg,true),DatePart.MONTH);
-        } else if(node.getURI().equalsIgnoreCase("NOW") && node.getArgs().size() == 0) {
-            QueryPart arg = meetValueExpression(node.getArgs().get(0));
-
-            return create.currentTimestamp();
-        } else if(node.getURI().equalsIgnoreCase("SECONDS") && node.getArgs().size() == 1) {
-            QueryPart arg = meetValueExpression(node.getArgs().get(0));
-
-            return create.extract(getDateValue(arg,true),DatePart.SECOND);
-        } else if(node.getURI().equalsIgnoreCase("YEAR") && node.getArgs().size() == 1) {
-            QueryPart arg = meetValueExpression(node.getArgs().get(0));
-
-            return create.extract(getDateValue(arg,true),DatePart.YEAR);
-        } else if(node.getURI().equalsIgnoreCase("CONCAT") && node.getArgs().size() >= 1) {
-            ArrayList<Field> fields = new ArrayList<Field>(node.getArgs().size());
-            for(ValueExpr expr : node.getArgs()) {
-                Field result = getValue(meetValueExpression(node.getArgs().get(0)),true);
-                fields.add(result);
-            }
-
-            return create.concat(fields.toArray(new Field[0]));
-        } else if(node.getURI().equalsIgnoreCase("STRLEN") && node.getArgs().size() == 1) {
-            QueryPart arg = meetValueExpression(node.getArgs().get(0));
-
-            return create.length(getValue(arg, typeCast == CastType.STRICT));
-        } else if(node.getURI().equalsIgnoreCase("SUBSTR") && node.getArgs().size() >= 2) {
-            QueryPart arg = meetValueExpression(node.getArgs().get(0));
-            Field<Long> startPos = getIntegerValue(meetValueExpression(node.getArgs().get(1)),true);
-
-            if(node.getArgs().size() == 3) {
-                Field<Long> endPos = getIntegerValue(meetValueExpression(node.getArgs().get(2)),true);
-                return create.substring(getValue(arg,typeCast == CastType.STRICT),startPos,endPos);
-            } else {
-                return create.substring(getValue(arg, typeCast == CastType.STRICT), startPos);
-            }
-        } else if(node.getURI().equalsIgnoreCase("UCASE") && node.getArgs().size() == 1) {
-            QueryPart arg = meetValueExpression(node.getArgs().get(0));
-
-            return create.upper(getValue(arg, typeCast == CastType.STRICT));
-        } else if(node.getURI().equalsIgnoreCase("LCASE") && node.getArgs().size() == 1) {
-            QueryPart arg = meetValueExpression(node.getArgs().get(0));
-
-            return create.lower(getValue(arg, typeCast == CastType.STRICT));
-        } else if(node.getURI().equalsIgnoreCase("STRSTARTS") && node.getArgs().size() == 2) {
-            QueryPart arg1 = meetValueExpression(node.getArgs().get(0));
-            QueryPart arg2 = meetValueExpression(node.getArgs().get(1));
-
-            return getValue(arg1,typeCast == CastType.STRICT).startsWith(getValue(arg2, typeCast == CastType.STRICT));
-        } else if(node.getURI().equalsIgnoreCase("STRENDS") && node.getArgs().size() == 2) {
-            QueryPart arg1 = meetValueExpression(node.getArgs().get(0));
-            QueryPart arg2 = meetValueExpression(node.getArgs().get(1));
-
-            return getValue(arg1,typeCast == CastType.STRICT).endsWith(getValue(arg2, typeCast == CastType.STRICT));
-        } else if(node.getURI().equalsIgnoreCase("STRENDS") && node.getArgs().size() == 2) {
-            QueryPart arg1 = meetValueExpression(node.getArgs().get(0));
-            QueryPart arg2 = meetValueExpression(node.getArgs().get(1));
-
-            return getValue(arg1,typeCast == CastType.STRICT).contains(getValue(arg2, typeCast == CastType.STRICT));
-        } else if(node.getURI().equalsIgnoreCase("STRBEFORE") && node.getArgs().size() == 2) {
-            QueryPart arg1 = meetValueExpression(node.getArgs().get(0));
-            QueryPart arg2 = meetValueExpression(node.getArgs().get(1));
-
-            return create.substring(getValue(arg1, typeCast == CastType.STRICT), create.val(0), create.position(getValue(arg1, typeCast == CastType.STRICT), getValue(arg2, typeCast == CastType.STRICT)));
-        } else if(node.getURI().equalsIgnoreCase("STRAFTER") && node.getArgs().size() == 2) {
-            QueryPart arg1 = meetValueExpression(node.getArgs().get(0));
-            QueryPart arg2 = meetValueExpression(node.getArgs().get(1));
-
-            Field val1 = getValue(arg1,typeCast == CastType.STRICT);
-            Field val2 = getValue(arg2,typeCast == CastType.STRICT);
-
-            return create.substring(val1,create.position(val1,val2).add(create.length(val2)),create.length(val1));
-        } else if(node.getURI().equalsIgnoreCase("MD5") && node.getArgs().size() == 1) {
-            if(dialect == SQLDialect.MYSQL || dialect == SQLDialect.POSTGRES) {
-                QueryPart arg = meetValueExpression(node.getArgs().get(0));
-
-                return create.field("MD5({0})",String.class,getValue(arg,typeCast == CastType.STRICT));
-            } else {
-                throw new UnsupportedOperationException("computing MD5 sum is only supported by PostgreSQL and MySQL backends");
-            }
-        }
-
-
-        throw new UnsupportedOperationException("function call "+node.getURI()+" not supported");    //To change body of overridden methods use File | Settings | File Templates.
-    }
-
-
-    public List<JoinTable> group(Group node, SelectQuery query, Collection<Condition> conditions, Collection<String> projections, Collection<Table> tables)  {
-         for(String elem : node.getGroupBindingNames()) {
-            groupBy.add(elem);
-        }
-        return meetTableLike(node.getArg(), query, conditions, projections, tables);
-    }
-
-
-    public QueryPart groupConcat(GroupConcat node)  {
-        throw new UnsupportedOperationException(node.getClass().getName()+" not supported");    //To change body of overridden methods use File | Settings | File Templates.
-    }
-
-
-
-    public Field ifCond(If node)  {
-        QueryPart condition = meetValueExpression(node.getCondition());
-        QueryPart result    = meetValueExpression(node.getResult());
-        QueryPart alternative = meetValueExpression(node.getAlternative());
-
-        if(condition instanceof Condition) {
-            Field resultValue = null, alternativeValue = null;
-            if(result instanceof Table) {
-                resultValue = getValue((Table)result, true);
-            } else if(result instanceof Field) {
-                resultValue = (Field) result;
-            }
-            if(alternative instanceof Table) {
-                alternativeValue = getValue((Table)alternative, true);
-            } else if(alternative instanceof Field) {
-                alternativeValue = (Field)alternative;
-            }
-            if(resultValue != null && alternativeValue != null) {
-                return create.decode().when((Condition)condition, resultValue).otherwise(alternativeValue);
-            }
-        }
-
-        throw new IllegalArgumentException("incorrect argument types for IF .. THEN .. ELSE");
-    }
-
-
-    public QueryPart inCond(In node)  {
-        // TODO: how to deal with values vs. ids of a subselect?
-        /*
-        QueryPart subquery = meetTupleExpression(node.getSubQuery());
-        QueryPart value    = meetValueExpression(node.getArg());
-        */
-        throw new UnsupportedOperationException(node.getClass().getName()+" not supported");    //To change body of overridden methods use File | Settings | File Templates.
-    }
-
-
-
-    public List<JoinTable> intersection(Intersection node, SelectQuery query, Collection<Condition> conditions, Collection<String> projections,Collection<Table> tables)  {
-        return merge(node,query,MergeType.INTERSECTION, conditions,  projections, tables);
-    }
-
-
-    public QueryPart iriFunction(IRIFunction node)  {
-        throw new UnsupportedOperationException(node.getClass().getName()+" not supported");    //To change body of overridden methods use File | Settings | File Templates.
-    }
-
-
-    public Condition isBNode(IsBNode node)  {
-        QueryPart part = meetValueExpression(node.getArg());
-
-        if(part instanceof TNodes) {
-            Field<String> nodetype = ((TNodes)part).NODETYPE;
-
-            return nodetype.equal("ANON");
-        } else {
-            throw new IllegalArgumentException("argument of IsBNode must be a variable");
-        }
-    }
-
-
-    public Condition isLiteral(IsLiteral node)  {
-        QueryPart part = meetValueExpression(node.getArg());
-
-        if(part instanceof Table) {
-            Field<String> nodetype = ((TNodes)part).NODETYPE;
-
-            return nodetype.equal("STRING").or(nodetype.equal("INTEGER")).or(nodetype.equal("DOUBLE"));
-        } else if(part instanceof Field) {
-            return create.trueCondition();
-        } else {
-            throw new IllegalArgumentException("argument of IsLiteral must be a variable or a constant");
-        }
-    }
-
-
-    public Condition isNumeric(IsNumeric node)  {
-        QueryPart part = meetValueExpression(node.getArg());
-
-        if(part instanceof Table) {
-            Field<String> nodetype = ((TNodes)part).NODETYPE;
-
-            return nodetype.equal("INTEGER").or(nodetype.equal("DOUBLE"));
-        } else {
-            throw new IllegalArgumentException("argument of IsNumeric must be a variable");
-        }
-    }
-
-
-    public Condition isResource(IsResource node)  {
-        QueryPart part = meetValueExpression(node.getArg());
-
-        if(part instanceof Table) {
-            Field<String> nodetype = ((TNodes)part).NODETYPE;
-
-            return nodetype.equal("URI").or(nodetype.equal("ANON"));
-        } else {
-            throw new IllegalArgumentException("argument of IsResource must be a variable");
-        }
-    }
-
-
-    public Condition isURI(IsURI node)  {
-        QueryPart part = meetValueExpression(node.getArg());
-
-        if(part instanceof Table) {
-            Field<String> nodetype = ((TNodes)part).NODETYPE;
-
-            return nodetype.equal("URI");
-        } else {
-            throw new IllegalArgumentException("argument of IsURI must be a variable");
-        }
-    }
-
-
-    public List<JoinTable> join(Join node, SelectQuery query, Collection<Condition> conditions, Collection<String> projections, Collection<Table> tables)  {
-
-        List<JoinTable> resultTables = new ArrayList<JoinTable>();
-
-        resultTables.addAll(meetTableLike(node.getLeftArg(), query, conditions,  projections, tables));
-        resultTables.addAll(meetTableLike(node.getRightArg(), query, conditions, projections, tables));
-
-        return resultTables;
-    }
-
-
-    public Field label(Label node)  {
-        QueryPart part = meetValueExpression(node.getArg());
-
-        if(part instanceof Table) {
-            return getValue((Table) part, true);
-        } else if(part instanceof Field) {
-            return (Field)part;
-        } else {
-            throw new IllegalArgumentException("argument of IsURI must be a variable");
-        }
-    }
-
-
-    public Field lang(Lang node)  {
-        QueryPart part = meetValueExpression(node.getArg());
-
-        if(part instanceof TNodes) {
-            Field lang = ((TNodes)part).LANGUAGE;
-
-            return create.coalesce(lang, create.val(""));
-        } else if(part instanceof Field) {
-            return create.val("");
-        } else {
-            throw new IllegalArgumentException("argument of Lang must be a variable or constant");
-        }
-    }
-
-
-    public Condition langMatches(LangMatches node)  {
-        QueryPart leftPart = meetValueExpression(node.getLeftArg());
-        QueryPart rightPart = meetValueExpression(node.getRightArg());
-
-        if(dialect == SQLDialect.POSTGRES) {
-            // Postgres supports ILIKE
-            return create.condition(getValue(leftPart, true)+" ILIKE "+create.decode().value(getValue(rightPart, true)).when("*", create.val("%")).otherwise(getValue(rightPart, true).concat("%")));
-        } else {
-            return getValue(leftPart, true).lower().like(create.decode().value(getValue(rightPart, true)).when("*", create.val("%")).otherwise(getValue(rightPart, true).lower().concat("%")));
-        }
-    }
-
-
-    public List<JoinTable> leftJoin(LeftJoin node, SelectQuery query, Collection<Condition> conditions, Collection<String> projections,Collection<Table> tables)  {
-        Set<Condition> conditions2 = new HashSet<Condition>();
-        // this belongs to the join condition!
-        if(node.getCondition() != null) {
-            QueryPart conditionPart = meetValueExpression(node.getCondition());
-            conditions2.add((Condition)conditionPart);
-        }
-
-        List<JoinTable> leftTables = meetTableLike(node.getLeftArg(), query, conditions,  projections, tables);
-
-        Table left = null;
-        for(JoinTable joinTable : leftTables) {
-            if(left == null) {
-                left = joinTable.getTable();
-                conditions.addAll(joinTable.getConditions());
-            } else {
-                left = left.join(joinTable.getTable()).on(joinTable.getConditions().toArray(new Condition[0]));
-            }
-        }
-
-        List<JoinTable> rightTables = meetTableLike(node.getRightArg(), query, conditions2,  projections, tables);
-        Table right = null;
-        for(JoinTable joinTable : rightTables) {
-            if(right == null) {
-                right = joinTable.getTable();
-                conditions2.addAll(joinTable.getConditions());
-            } else {
-                Set<Condition> onConditions = new HashSet<Condition>();
-                Set<Condition> backConditions = joinTable.getBackConditions();
-                for(Condition c : joinTable.getConditions()) {
-                    if(!backConditions.contains(c)) {
-                        onConditions.add(c);
-                    }
-                }
-
-                right = right.join(joinTable.getTable()).on(onConditions.toArray(new Condition[0]));
-                conditions2.addAll(backConditions);
-            }
-        }
-
-        if(left != null && right != null) {
-            return Collections.singletonList(new JoinTable((Table)left.leftOuterJoin(right).on(conditions2.toArray(new Condition[0]))));
-        } else {
-            conditions.addAll(conditions2);
-            return Collections.singletonList(new JoinTable((Table) left != null? left : right));
-        }
-
-
-    }
-
-
-    public Condition like(Like node)  {
-        QueryPart part = meetValueExpression(node.getArg());
-
-        Condition result = null;
-        for(Field f : getAlternativeValues(part, true)) {
-            if(result == null) {
-                result = f.like(node.getOpPattern());
-            } else {
-                result = result.or(f.like(node.getOpPattern()));
-            }
-        }
-
-        return result;
-    }
-
-
-
-
-    /**
-     * Mathematical expression on the values of the two arguments of the expression. We implement this by
-     * always retrieving the double value of the two arguments and then performing the corresponding mathematical
-     * operation on the SQL level.
-     * @param node
-     * @return
-     */
-    public Field mathExpr(MathExpr node)  {
-        QueryPart leftPart = meetValueExpression(node.getLeftArg());
-        QueryPart rightPart = meetValueExpression(node.getRightArg());
-
-        Field left, right;
-
-        left = getDoubleValue(leftPart,typeCast == CastType.STRICT);
-        right = getDoubleValue(rightPart,typeCast == CastType.STRICT);
-
-        switch (node.getOperator()) {
-            case DIVIDE:
-                return left.div(right);
-            case MINUS:
-                return left.sub(right);
-            case MULTIPLY:
-                return left.mul(right);
-            case PLUS:
-                return left.add(right);
-            default:
-                throw new IllegalArgumentException("unknown operator: "+node.getOperator());
-        }
-
-
-    }
-
-
-    /**
-     * Return the maximum value of the arguments. Translated to SQL max() function
-     * @param node
-     * @return
-     */
-    public Field max(Max node)  {
-        QueryPart part = meetValueExpression(node.getArg());
-
-        if(part instanceof Table && ((Table) part).getName().equals(T_NODES.getName())) {
-            return getValue((Table)part, true).max();
-        } else {
-            throw new IllegalArgumentException("MAX can only be computed for the node table; type was: "+part.getClass().getName());
-        }
-    }
-
-
-    /**
-     * Return the minimum value of the arguments. Translated to SQL min() function
-     * @param node
-     * @return
-     */
-    public Field min(Min node)  {
-        QueryPart part = meetValueExpression(node.getArg());
-
-        if(part instanceof Table && ((Table) part).getName().equals(T_NODES.getName())) {
-            return getValue((Table)part, true).min();
-        } else {
-            throw new IllegalArgumentException("MAX can only be computed for the node table; type was: "+part.getClass().getName());
-        }
-    }
-
-
-
-
-    public Select multiProjection(MultiProjection node, SelectQuery query, Collection<Condition> conditions, Collection<String> projections)  {
-        throw new UnsupportedOperationException(node.getClass().getName()+" not supported");    //To change body of overridden methods use File | Settings | File Templates.
-    }
-
-    /**
-     * Namespace querying. Currently not supported by the translator. Could be implemented either by using
-     * SQL string operations on the URI of the argument, or by joining with the namespace table and trying to
-     * find a prefix.
-     * @param node
-     * @return
-     */
-    public QueryPart namespace(Namespace node)  {
-        throw new UnsupportedOperationException(node.getClass().getName()+" not supported");    //To change body of overridden methods use File | Settings | File Templates.
-    }
-
-    /**
-     * Namespace querying. Currently not supported by the translator. Could be implemented either by using
-     * SQL string operations on the URI of the argument, or by joining with the namespace table and trying to
-     * find a prefix.
-     * @param node
-     * @return
-     */
-    public QueryPart localName(LocalName node)  {
-        // todo: would require querying against the namespace table as well!
-
-        throw new UnsupportedOperationException(node.getClass().getName()+" not supported");    //To change body of overridden methods use File | Settings | File Templates.
-    }
-
-
-    /**
-     * NOT of a value expression. Translated into a NOT in case the argument is a condition, or
-     * a NEG in case the argument is a value.
-     * @param node
-     * @return
-     */
-    public QueryPart not(Not node)  {
-        QueryPart subPart = meetValueExpression(node.getArg());
-
-        if(subPart instanceof Condition) {
-            return ((Condition)subPart).not();
-        } else if(subPart instanceof Field) {
-            return ((Field)subPart).neg();
-        }
-
-        throw new IllegalStateException("the argument of the NOT condition is not boolean: "+node);
-    }
-
-    /**
-     * OR between value expressions; translated into a disjunction at the SQL level.
-     * @param node
-     * @return
-     */
-    public Condition or(Or node)  {
-        QueryPart leftPart = meetValueExpression(node.getLeftArg());
-        QueryPart rightPart = meetValueExpression(node.getRightArg());
-
-        if(! (leftPart instanceof Condition) || !(rightPart instanceof Condition)) {
-            throw new IllegalStateException("the left or right part of the OR condition are not boolean: "+node);
-        }
-
-        return ((Condition)leftPart).or((Condition) rightPart);
-    }
-
-    /**
-     * Ordering of query results. For each ordering used in the query, we keep track of a value expression
-     * that needs to be projected by all subqueries so we can later sort over the results of several subqueries
-     * (otherwise the SQL database might complain about ordering over non-projected variables, which is semantically
-     * not allowed in SQL).
-     *
-     * @param node
-     * @param query
-     * @param conditions
-     * @param projections
-     * @return
-     */
-    public Select order(Order node, SelectQuery query, Collection<Condition> conditions, Collection<String> projections)  {
-        int i=0;
-        for(OrderElem elem : node.getElements()) {
-            QueryPart expr = meetValueExpression(elem.getExpr());
-            String name = "_order_" + (++i);
-            sortFields.put(name, getValue(expr, true).as(name));
-            sortDependencies.put(name,getValueExpressionVariables(elem.getExpr()));
-        }
-
-
-        Select select = meetTupleExpression(node.getArg(),query,conditions,  projections);
-        if(select instanceof SelectQuery) {
-            i=0;
-            for(OrderElem elem : node.getElements()) {
-                String name = "_order_" + (++i);
-                if(elem.isAscending()) {
-                    ((SelectQuery)select).addOrderBy(sortFields.get(name).asc());
-                } else {
-                    ((SelectQuery)select).addOrderBy(sortFields.get(name).desc());
-                }
-            }
-            return select;
-        } else {
-            List<SortField<?>> fields = new ArrayList<SortField<?>>();
-            i=0;
-            for(OrderElem elem : node.getElements()) {
-                String name = "_order_" + Math.abs(query.hashCode()) + "_" + (++i);
-                if(elem.isAscending()) {
-                    fields.add(sortFields.get(name).asc());
-                } else {
-                    fields.add(sortFields.get(name).desc());
-                }
-            }
-            return create.select().from(select).orderBy(fields);
-        }
-    }
-
-    /**
-     * Projection: for all variables (table KiWiNode) in the projection we select all fields and add them to the select
-     * part of the SQL query; this allows us to reconstruct KiWiNode instances in the query results
-     * @param node
-     * @param query
-     * @return
-     */
-    public Select projection(Projection node, SelectQuery query, Collection<Condition> origConditions, Collection<String> projections)  {
-        Set<String> projections2 = new HashSet<String>();
-
-        // collect mappings before running recursively so they are available to child expressions
-        for(ProjectionElem elem : node.getProjectionElemList().getElements()) {
-            variableMappings.put(elem.getSourceName().replace("-","_"),elem.getTargetName());
-            revVariableMappings.put(elem.getTargetName(),elem.getSourceName().replace("-","_"));
-            projections2.add(elem.getSourceName());
-        }
-
-
-        Set<Condition> conditions = new HashSet<Condition>();
-
-/*
-        Table from = null;
-        for(JoinTable tbl : meetTableLike(node.getArg(), query, conditions,  projections2, new HashSet<Table>())) {
-            if(from == null) {
-                from = tbl.getTable();
-                query.addConditions(tbl.getConditions());
-            } else {
-                from = from.join(tbl.getTable()).on(tbl.getConditions().toArray(new Condition[0]));
-            }
-        }
-        if(from != null)
-            query.addFrom(from);
-*/
-
-        for(JoinTable tbl : meetTableLike(node.getArg(), query, conditions,  projections2, new HashSet<Table>())) {
-                query.addFrom(tbl.getTable());
-                query.addConditions(tbl.getConditions());
-        }
-
-
-        query.addConditions(conditions);
-
-        if(groupBy.size() > 0) {
-            for(String group : groupBy) {
-                Field variable = extensions.get(group.replace("-","_"));
-                if(variable == null) {
-                    TNodes table = getVariable(group);
-                    if(table != null) {
-                        query.addGroupBy(table.ID);
-                        query.addGroupBy(table.URI);
-                        query.addGroupBy(table.ANONID);
-                        query.addGroupBy(table.CONTENT);
-                    }
-
-                } else {
-                    query.addGroupBy(variable);
-                }
-            }
-        }
-
-        if(node.getArg() instanceof Union || node.getArg() instanceof Intersection || node.getArg() instanceof Difference) {
-            // union, difference, intersection: we take all results, as the merge operation already does the projection
-            projectedVariables.addAll(node.getBindingNames());
-        } else {
-            for(ProjectionElem elem : node.getProjectionElemList().getElements()) {
-                projectionElem(elem, query);
-            }
-            for(Map.Entry<String,Field> entry : sortFields.entrySet()) {
-                if(!hasSelectionVariable(query,entry.getKey())) {
-                    Set<String> dependencies = sortDependencies.get(entry.getKey());
-                    boolean containsAll = true;
-                    for(String dep : dependencies) {
-                        if(!currentVariables.containsKey(dep) && !extensions.containsKey(dep)) {
-                            containsAll = false;
-                        }
-                    }
-                    if(containsAll) {
-                        query.addSelect(entry.getValue());
-                    } else {
-                        query.addSelect(create.value(null).as(entry.getKey()));
-                    }
-                }
-            }
-        }
-
-        return query;
-    }
-
-
-    public void projectionElem(ProjectionElem node, SelectQuery query)  {
-        // renaming needs to take place in the result construction!
-        TNodes var = getVariable(node.getSourceName());
-
-        // if var is null, then we have an extension
-        if(var != null) {
-            query.addSelect(var.ID.as(node.getTargetName())); // just the ID for now, we will use Hibernate to load the complete node
-            projectedVariables.add(node.getTargetName());
-        } else {
-            Field extension = extensions.get(node.getSourceName().replace("-","_"));
-            query.addSelect(extension.as(node.getTargetName()));
-            extensionVariables.put(node.getTargetName(), extension.getType());
-        }
-
-        // extension bindings need to be treated differently in result construction!
-    }
-
-
-
-
-    public Select queryRoot(QueryRoot node, SelectQuery query, Collection<Condition> conditions, Collection<String> projections)  {
-        this.resourceVariables = new FindResourceVariables(node).getResourceVariables();
-
-        return meetTupleExpression(node.getArg(),query, conditions,  projections);
-    }
-
-
-    /**
-     * Reduced is a strange construct that means "sometimes distinct". We translate it into distinct in all cases.
-     * @param node
-     * @param query
-     * @param conditions
-     * @param projections
-     * @return
-     */
-    public Select reduced(Reduced node, SelectQuery query, Collection<Condition> conditions, Collection<String> projections)  {
-
-        if(configurationService.getBooleanConfiguration("sparql.native.reduced_as_distinct",false)) {
-
-            Select subQuery = meetTupleExpression(node.getArg(), query, conditions,  projections);
-
-            if(subQuery instanceof SelectQuery) {
-                ((SelectQuery) subQuery).setDistinct(true);
-                return subQuery;
-            } else {
-                return create.selectDistinct().from(subQuery);
-            }
-        } else {
-            return meetTupleExpression(node.getArg(), query, conditions,  projections);
-        }
-    }
-
-    /**
-     * Translate a regular expression into a corresponding database operator. Regular expressions are only supported
-     * in some databases (currently: Postgres, H2, Oracle, MySQL) and are in some implementations comparably slow, so
-     * use them with care.
-     * <p/>
-     * This method tries to translate simple regular expressions into LIKE operators, which are considerably more
-     * efficient to evaluate in many database systems. Currently, this is done for regular expressions that do not
-     * contain any special constructs, i.e. consist of alphanumeric characters and blanks only.
-     * @param node
-     * @return
-     */
-    public Condition regex(Regex node)  {
-        QueryPart argPart = meetValueExpression(node.getArg());
-
-        if(node.getPatternArg() instanceof ValueConstant) {
-            ValueConstant pat = (ValueConstant)node.getPatternArg();
-            String pattern = pat.getValue().stringValue();
-
-            Condition result = null;
-            Field f = getValue(argPart,typeCast == CastType.STRICT);
-
-            // simple cases can be handled by LIKE
-            if(pattern.matches("^\\^?[\\p{Alnum}\\p{Blank}]+$")) {
-                if(pattern.startsWith("^")) {
-                    result = f.like(pattern.substring(1) + "%");
-                } else {
-                    result = f.like("%" + pattern + "%");
-                }
-            } else {
-                switch (dialect) {
-                    case POSTGRES:
-                        result = create.condition(f + " ~ ?",pattern);
-                        break;
-                    case H2:
-                        result = create.condition(f + " REGEXP ?",pattern);
-                        break;
-                    case MYSQL:
-                        result = create.condition(f + " REGEXP ?",pattern);
-                        break;
-                    case ORACLE:
-                        result = create.condition("REGEXP_LIKE("+f + ",?)" ,pattern);
-                        break;
-                }
-            }
-            return result;
-        } else {
-            QueryPart patPart = meetValueExpression(node.getPatternArg());
-            switch (dialect) {
-                case POSTGRES:
-                    return create.condition(getValue(argPart, typeCast == CastType.STRICT) + " ~ " + getValue(patPart, typeCast == CastType.STRICT));
-                case H2:
-                    return create.condition(getValue(argPart, typeCast == CastType.STRICT) + " REGEXP " + getValue(patPart, typeCast == CastType.STRICT));
-                case MYSQL:
-                    return create.condition(getValue(argPart, typeCast == CastType.STRICT) + " REGEXP " + getValue(patPart, typeCast == CastType.STRICT));
-                case ORACLE:
-                    return create.condition("REGEXP_LIKE("+getValue(argPart, typeCast == CastType.STRICT) + "," + getValue(patPart, typeCast == CastType.STRICT)+")");
-
-            }
-        }
-        throw new UnsupportedOperationException("database "+dialect+" not supported for regular expression matches");
-    }
-
-    /**
-     * Check whether the left and the right argument are the same term. In case both arguments identify variables,
-     * we translate this into a check for equality of database identifiers, as this is most efficient. In all other
-     * cases we check equality of the content
-     * @param node
-     * @return
-     */
-    public QueryPart sameTerm(SameTerm node)  {
-        QueryPart leftPart = meetValueExpression(node.getLeftArg());
-        QueryPart rightPart = meetValueExpression(node.getRightArg());
-
-        if(leftPart instanceof TNodes && rightPart instanceof TNodes) {
-            return ((TNodes) leftPart).ID.equal(((TNodes) rightPart).ID);
-        } else if(leftPart instanceof TNodes && rightPart instanceof Field) {
-            // check if one of the value-holding fields of leftpart matches rightpart
-            Condition result = null;
-            for(Field f : getAlternativeValues(leftPart,false)) {
-                if(result == null) {
-                    result = f.equal((Field)rightPart);
-                } else {
-                    result = result.or(f.equal((Field)rightPart));
-                }
-            }
-            return result;
-        } else if(rightPart instanceof TNodes && leftPart instanceof Field) {
-            // check if one of the value-holding fields of leftpart matches rightpart
-            Condition result = null;
-            for(Field f : getAlternativeValues(rightPart,false)) {
-                if(result == null) {
-                    result = f.equal((Field)leftPart);
-                } else {
-                    result = result.or(f.equal((Field)leftPart));
-                }
-            }
-            return result;
-        } else {
-            // TODO: language tags for literals?
-            return getValue(leftPart, true).equal(getValue(rightPart, true));
-        }
-    }
-
-
-    public QueryPart sample(Sample node)  {
-        throw new UnsupportedOperationException(node.getClass().getName()+" not supported");    //To change body of overridden methods use File | Settings | File Templates.
-    }
-
-
-    public Select service(Service node, SelectQuery query, Collection<Condition> conditions, Collection<String> projections)  {
-        throw new UnsupportedOperationException(node.getClass().getName()+" not supported");    //To change body of overridden methods use File | Settings | File Templates.
-    }
-
-
-    public Select singletonSet(SingletonSet node, SelectQuery query, Collection<Condition> conditions, Collection<String> projections)  {
-        query.addConditions(create.trueCondition());
-        return query;
-    }
-
-
-    public Select slice(Slice node, SelectQuery query, Collection<Condition> conditions, Collection<String> projections)  {
-        query.addLimit(node.hasOffset() ? (int) node.getOffset() : 0, node.hasLimit() ? (int) node.getLimit() : 0);
-        if(node.getArg() instanceof Projection || node.getArg() instanceof Distinct || node.getArg() instanceof Reduced || node.getArg() instanceof Order) {
-            return meetTupleExpression(node.getArg(), query, conditions,  projections);
-        } else {
-            List<Table> tables = new ArrayList<Table>();
-            Table from = null;
-            for(JoinTable tbl : meetTableLike(node.getArg(), query, conditions,  node.getBindingNames(),tables)) {
-                if(from == null) {
-                    from = tbl.getTable();
-                    query.addConditions(tbl.getConditions());
-                } else {
-                    from = from.join(tbl.getTable()).on(tbl.getConditions().toArray(new Condition[0]));
-                }
-            }
-            query.addFrom(from);
-            query.addConditions(conditions);
-            if(tables.size() > 0 && tables.get(0) instanceof TTriples) {
-                query.addSelect(((TTriples) tables.get(0)).ID.as("_firsttable"));
-            }
-            return query;
-        }
-    }
-
-
-    public List<JoinTable> statementPattern(StatementPattern p, SelectQuery query, Collection<Condition> conditions, Collection<String> projections, Collection<Table> tables)  {
-        String name = "t"+ Math.abs(++tripleCounter);
-
-        // statement pattern; we add a triple to the from clause and require it is not deleted; then we add
-        // conditions for subject, predicate, object, context depending on whether they are variable or
-        // constant values
-
-        TTriples triple = T_TRIPLES.as(name);
-        JoinTable j_triple = new JoinTable(triple);
-        j_triple.addCondition(triple.DELETED.isFalse());
-        tables.add(triple);
-
-        TNodes t_subject = null, t_property = null, t_object = null, t_context = null;
-        JoinTable j_subject = null, j_property = null, j_object = null, j_context = null;
-
-        List<JoinTable> resultTables = new ArrayList<JoinTable>();
-
-
-        resultTables.add(j_triple);
-
-
-        // conditions for subject:
-        // - if there is a value, and the value is a KiWiNode, simply check the ID (most efficient query)
-        // - if there is a value, but it is not a KiWiNode, check the properties depending on the type of value
-        // - if there is no value, add a variable to the from clause and add a join condition
-        Var subj = p.getSubjectVar();
-        if(subj.hasValue()) {
-            Value v = subj.getValue();
-            t_subject =  T_NODES.as(name+"_subject");
-            j_subject = new JoinTable(t_subject);
-
-            if(v instanceof KiWiNode && ((KiWiNode) v).getId() != null) {
-                KiWiNode n = (KiWiNode) v;
-                j_triple.addCondition(triple.SUBJECT_ID.equal((Field) create.val(n.getId())));
-            } else if(v instanceof URI) {
-
-                if(configurationService.getBooleanConfiguration("sparql.native.preload_constants",true)) {
-                    KiWiUriResource r_subject = resourceService.getUriResource(v.stringValue());
-                    if(r_subject != null) {
-                        j_triple.addCondition(triple.SUBJECT_ID.equal((Field) create.val(r_subject.getId())));
-                    } else {
-                        j_triple.addCondition(create.falseCondition());
-                    }
-                } else {
-                    // performance improvement: if uri already was used, reuse the node instead of doing a new join
-                    if(uriNodes.containsKey(v.stringValue())) {
-                        t_subject = uriNodes.get(v.stringValue());
-                        Condition c_subject = triple.SUBJECT_ID.equal((Field) t_subject.ID);
-                        j_triple.addCondition(c_subject);
-                        j_triple.addBackCondition(c_subject);
-                    } else {
-                        resultTables.add(j_subject);
-                        j_subject.addCondition(t_subject.URI.equal((Field) create.val(v.stringValue())));
-                        j_subject.addCondition(triple.SUBJECT_ID.equal((Field) t_subject.ID));
-                        uriNodes.put(v.stringValue(),t_subject);
-                    }
-                }
-
-            } else if(v instanceof BNode) {
-                resultTables.add(j_subject);
-                j_subject.addCondition(t_subject.ANONID.equal((Field) create.val(((BNode) v).getID())));
-                j_subject.addCondition(triple.SUBJECT_ID.equal((Field) t_subject.ID));
-            } else {
-                throw new UnsupportedOperationException("value of type "+v.getClass()+" not supported!");
-            }
-        } else {
-            String varname = subj.getName().replace("-", "_");
-
-            t_subject = getVariable(varname);
-            if(!hasQueryVariable(query,varname)) {
-                // variable does not exist yet, so we create it and join it to the current from clause ...
-                t_subject = createVariable(varname);
-                addQueryVariable(query,varname,t_subject);
-                j_subject = new JoinTable(t_subject);
-                j_subject.addCondition(triple.SUBJECT_ID.equal((Field) t_subject.ID));
-                resultTables.add(j_subject);
-            } else {
-                // variable already exists in FROM, we simply add a join condition
-                Condition c_subject = triple.SUBJECT_ID.equal((Field) t_subject.ID);
-                j_triple.addCondition(c_subject);
-                j_triple.addBackCondition(c_subject);
-            }
-        }
-
-        Var prop = p.getPredicateVar();
-        if(prop.hasValue()) {
-            Value v = prop.getValue();
-            t_property = T_NODES.as(name+"_property");
-            j_property = new JoinTable(t_property);
-
-            if(v instanceof KiWiNode && ((KiWiNode) v).getId() != null) {
-                KiWiNode n = (KiWiNode) v;
-                j_triple.addCondition(triple.PROPERTY_ID.equal((Field) create.val(n.getId())));
-            } else if(v instanceof URI) {
-                if(configurationService.getBooleanConfiguration("sparql.native.preload_constants",true)) {
-                    KiWiUriResource r_property = resourceService.getUriResource(v.stringValue());
-                    if(r_property != null) {
-                        j_triple.addCondition(triple.PROPERTY_ID.equal((Field) create.val(r_property.getId())));
-                    } else {
-                        j_triple.addCondition(create.falseCondition());
-                    }
-                } else {
-                    // performance improvement: if uri already was used, reuse the node instead of doing a new join
-                    if(uriNodes.containsKey(v.stringValue())) {
-                        t_property = uriNodes.get(v.stringValue());
-                        Condition c_property = triple.PROPERTY_ID.equal((Field) t_property.ID);
-                        j_triple.addCondition(c_property);
-                        j_triple.addBackCondition(c_property);
-                    } else {
-                        resultTables.add(j_property);
-                        j_property.addCondition(t_property.URI.equal((Field) create.val(v.stringValue())));
-                        j_property.addCondition(triple.PROPERTY_ID.equal((Field) t_property.ID));
-                        uriNodes.put(v.stringValue(),t_property);
-                    }
-                }
-
-
-            } else {
-                throw new UnsupportedOperationException("value of type "+v.getClass()+" not supported!");
-            }
-        } else {
-            String varname = prop.getName().replace("-","_");
-
-            t_property = getVariable(varname);
-            if(!hasQueryVariable(query,varname)) {
-                // variable does not exist yet, so we create it and join it to the current from clause ...
-                t_property = createVariable(varname);
-                addQueryVariable(query,varname,t_property);
-                j_property = new JoinTable(t_property);
-                j_property.addCondition(triple.PROPERTY_ID.equal((Field) t_property.ID));
-                resultTables.add(j_property);
-            } else {
-                // variable already exists in FROM, we simply add a join condition
-                Condition c_property = triple.PROPERTY_ID.equal((Field) t_property.ID);
-                j_triple.addCondition(c_property);
-                j_triple.addBackCondition(c_property);
-            }
-        }
-
-        Var obj  = p.getObjectVar();
-        if(obj.hasValue()) {
-            Value v = obj.getValue();
-            t_object = T_NODES.as(name+"_object");
-            j_object = new JoinTable(t_object);
-
-            if(v instanceof KiWiNode && ((KiWiNode) v).getId() != null) {
-                KiWiNode n = (KiWiNode) v;
-                j_triple.addCondition(triple.OBJECT_ID.equal((Field) create.val(n.getId())));
-            } else if(v instanceof URI) {
-                if(configurationService.getBooleanConfiguration("sparql.native.preload_constants",true)) {
-                    KiWiUriResource r_object = resourceService.getUriResource(v.stringValue());
-                    if(r_object != null) {
-                        j_triple.addCondition(triple.OBJECT_ID.equal((Field) create.val(r_object.getId())));
-                    } else {
-                        j_triple.addCondition(create.falseCondition());
-                    }
-                } else {
-                    // performance improvement: if uri already was used, reuse the node instead of doing a new join
-                    if(uriNodes.containsKey(v.stringValue())) {
-                        t_object = uriNodes.get(v.stringValue());
-                        Condition c_object = triple.OBJECT_ID.equal((Field) t_object.ID);
-                        j_triple.addCondition(c_object);
-                        j_triple.addBackCondition(c_object);
-                    } else {
-                        resultTables.add(j_object);
-                        j_object.addCondition(t_object.URI.equal((Field) create.val(v.stringValue())));
-                        j_object.addCondition(triple.OBJECT_ID.equal((Field) t_object.ID));
-                        uriNodes.put(v.stringValue(),t_object);
-                    }
-                }
-
-            } else if(v instanceof BNode) {
-                resultTables.add(j_object);
-                j_object.addCondition(t_object.ANONID.equal((Field) create.val(((BNode) v).getID())));
-                j_object.addCondition(triple.OBJECT_ID.equal((Field) t_object.ID));
-            } else if(v instanceof Literal) {
-                resultTables.add(j_object);
-                j_object.addCondition(t_object.CONTENTMD5.equal((Field) create.val(HashUtils.md5sum(v.stringValue()))));
-                j_object.addCondition(triple.OBJECT_ID.equal((Field) t_object.ID));
-            } else {
-                throw new UnsupportedOperationException("value of type "+v.getClass()+" not supported!");
-            }
-        } else  {
-            String varname = obj.getName().replace("-","_");
-
-            t_object = getVariable(varname);
-            if(!hasQueryVariable(query,varname)) {
-                // variable does not exist yet, so we create it and join it to the current from clause ...
-                t_object = createVariable(varname);
-                addQueryVariable(query,varname,t_object);
-                j_object = new JoinTable(t_object);
-                j_object.addCondition(triple.OBJECT_ID.equal((Field) t_object.ID));
-                resultTables.add(j_object);
-            } else {
-                // variable already exists in FROM, we simply add a join condition
-                Condition c_object = triple.OBJECT_ID.equal((Field) t_object.ID);
-                j_triple.addCondition(c_object);
-                j_triple.addBackCondition(c_object);
-            }
-        }
-
-        Var ctx  = p.getContextVar();
-        if(ctx != null) {
-            if(ctx.hasValue()) {
-                Value v = ctx.getValue();
-                t_context =  T_NODES.as(name+"_context");
-                j_context = new JoinTable(t_context);
-
-                if(v instanceof KiWiNode && ((KiWiNode) v).getId() != null) {
-                    KiWiNode n = (KiWiNode) v;
-                    j_triple.addCondition(triple.CONTEXT_ID.equal((Field) create.val(n.getId())));
-                } else if(v instanceof URI) {
-                    if(configurationService.getBooleanConfiguration("sparql.native.preload_constants",true)) {
-                        KiWiUriResource r_context = resourceService.getUriResource(v.stringValue());
-                        if(r_context != null) {
-                            j_triple.addCondition(triple.CONTEXT_ID.equal((Field) create.val(r_context.getId())));
-                        } else {
-                            j_triple.addCondition(create.falseCondition());
-                        }
-                    } else {
-                        // performance improvement: if uri already was used, reuse the node instead of doing a new join
-                        if(uriNodes.containsKey(v.stringValue())) {
-                            t_context = uriNodes.get(v.stringValue());
-                            Condition c_context = triple.CONTEXT_ID.equal((Field) t_context.ID);
-                            j_triple.addCondition(c_context);
-                            j_triple.addBackCondition(c_context);
-                        } else {
-                            resultTables.add(j_context);
-                            j_context.addCondition(t_context.URI.equal((Field) create.val(v.stringValue())));
-                            j_context.addCondition(triple.CONTEXT_ID.equal((Field) t_context.ID));
-                            uriNodes.put(v.stringValue(),t_context);
-                        }
-                    }
-
-                } else if(v instanceof BNode) {
-                    resultTables.add(j_context);
-                    j_context.addCondition(t_context.ANONID.equal((Field) create.val(((BNode) v).getID())));
-                    j_context.addCondition(triple.CONTEXT_ID.equal((Field) t_context.ID));
-                } else {
-                    throw new UnsupportedOperationException("value of type "+v.getClass()+" not supported!");
-                }
-            } else {
-                String varname = ctx.getName().replace("-","_");
-
-                t_context = getVariable(varname);
-                if(!hasQueryVariable(query,varname)) {
-                    // variable does not exist yet, so we create it and join it to the current from clause ...
-                    t_context = createVariable(varname);
-                    addQueryVariable(query,varname,t_context);
-                    j_context = new JoinTable(t_context);
-                    j_context.addCondition(triple.CONTEXT_ID.equal((Field) t_context.ID));
-                    resultTables.add(j_context);
-                } else {
-                    // variable already exists in FROM, we simply add a join condition
-                    Condition c_context = triple.CONTEXT_ID.equal((Field) t_context.ID);
-                    j_triple.addCondition(c_context);
-                    j_triple.addBackCondition(c_context);
-                }
-            }
-        }
-
-        return resultTables;
-
-    }
-
-
-    public Field str(Str node)  {
-        QueryPart part = meetValueExpression(node.getArg());
-
-        return getValue(part, true);
-    }
-
-
-    public Field sum(Sum node)  {
-        QueryPart part = meetValueExpression(node.getArg());
-
-        return getDoubleValue(part, typeCast == CastType.STRICT).sum();
-    }
-
-
-    private List<JoinTable> unionTable(Union node, SelectQuery query, Collection<Condition> conditions, Collection<String> projections, Collection<Table> tables)  {
-        return merge(node, query, MergeType.UNION, conditions, projections, tables);
-    }
-
-
-    // special case: union occurring as tuple expression, not as table; this is typically the result of a multi-projection
-    private Select unionQuery(Union node, SelectQuery query,Collection<Condition> conditions, Collection<String> projections) {
-        // the bindings in proper order
-        List<String> bindings = new ArrayList<String>();
-        for(String b : node.getBindingNames()) {
-            if(!b.startsWith("-const") && projections.contains(b)) {
-                bindings.add(b);
-            }
-        }
-
-        Map<String,TNodes> contextVars = currentVariables;
-        Map<String,TNodes> contextUris = uriNodes;
-
-        // build subquery for left part of the binary tuple query
-        currentVariables = new HashMap<String, TNodes>();
-        uriNodes         = new HashMap<String, TNodes>();
-        Set<Condition> leftConditions = new HashSet<Condition>();
-        SelectQuery leftQuery = create.selectQuery();
-        leftQuery.addFrom(meetTupleExpression(node.getLeftArg(), create.selectQuery(), leftConditions,  projections));
-        if(leftConditions.size() > 0) {
-            leftQuery.addConditions(leftConditions);
-        }
-
-        // for each of the projected variables of the main query, add a projection to the subquery; if the projection
-        // variable is not bound in this subquery, bind it explicitly to NULL
-        for(String var : bindings) {
-            var = var.replace("-","_");
-            String revVar = revVariableMappings.get(var);
-
-            if(!hasSelectionVariable(leftQuery,var)) {
-
-                if(currentVariables.containsKey(var)) {
-                    leftQuery.addSelect(currentVariables.get(var).ID.as(variableMappings.containsKey(var)?variableMappings.get(var):var));
-                } else if(extensions.containsKey(var)) {
-                    leftQuery.addSelect(extensions.get(var).as(variableMappings.containsKey(var)?variableMappings.get(var):var));
-                } else if(revVar != null && extensions.containsKey(revVar)) {
-                    leftQuery.addSelect(extensions.get(revVar).as(variableMappings.containsKey(var)?variableMappings.get(var):var));
-                } else {
-                    leftQuery.addSelect(create.value(null,Long.class).as(variableMappings.containsKey(var)?variableMappings.get(var):var));
-                }
-            }
-        }
-        // for each of the fields used in sorting the overall result, add an additional column to the projection so
-        // that we can afterwards sort easily over the UNION
-        for(Map.Entry<String,Field> entry : sortFields.entrySet()) {
-            if(!hasSelectionVariable(leftQuery,entry.getKey())) {
-                Set<String> dependencies = sortDependencies.get(entry.getKey());
-                boolean containsAll = true;
-                for(String dep : dependencies) {
-                    if(!currentVariables.containsKey(dep) && !extensions.containsKey(dep)) {
-                        containsAll = false;
-                    }
-                }
-                if(containsAll) {
-                    leftQuery.addSelect(entry.getValue());
-                } else {
-                    leftQuery.addSelect(create.value(null).as(entry.getKey()));
-                }
-            }
-        }
-
-        currentVariables = new HashMap<String, TNodes>();
-        uriNodes         = new HashMap<String, TNodes>();
-        Set<Condition> rightConditions = new HashSet<Condition>();
-        SelectQuery rightQuery = create.selectQuery();
-        rightQuery.addFrom(meetTupleExpression(node.getRightArg(), create.selectQuery(), rightConditions,  projections));
-        rightQuery.addConditions(rightConditions);
-
-        for(String var : bindings) {
-            var = var.replace("-","_");
-            String revVar = revVariableMappings.get(var);
-
-            if(!hasSelectionVariable(rightQuery,var)) {
-
-                if(currentVariables.containsKey(var)) {
-                    rightQuery.addSelect(currentVariables.get(var).ID.as(variableMappings.containsKey(var)?variableMappings.get(var):var));
-                } else if(extensions.containsKey(var)) {
-                    rightQuery.addSelect(extensions.get(var).as(variableMappings.containsKey(var)?variableMappings.get(var):var));
-                } else if(revVar != null && extensions.containsKey(revVar)) {
-                    rightQuery.addSelect(extensions.get(revVar).as(variableMappings.containsKey(var)?variableMappings.get(var):var));
-                } else {
-                    rightQuery.addSelect(create.value(null,Long.class).as(variableMappings.containsKey(var)?variableMappings.get(var):var));
-                }
-            }
-        }
-        for(Map.Entry<String,Field> entry : sortFields.entrySet()) {
-            if(!hasSelectionVariable(rightQuery,entry.getKey())) {
-                Set<String> dependencies = sortDependencies.get(entry.getKey());
-                boolean containsAll = true;
-                for(String dep : dependencies) {
-                    if(!currentVariables.containsKey(dep) && !extensions.containsKey(dep)) {
-                        containsAll = false;
-                    }
-                }
-                if(containsAll) {
-                    rightQuery.addSelect(entry.getValue());
-                } else {
-                    rightQuery.addSelect(create.value(null).as(entry.getKey()));
-                }
-            }
-        }
-
-        currentVariables = contextVars;
-        uriNodes         = contextUris;
-
-        return leftQuery.union(rightQuery);
-     }
-
-    /**
-     * Merge the results of two subqueries using either UNION, DIFFERENCE, or INTERSECTION.
-     * Note that UNION & co in SPARQL and SQL have slightly different semantics: whereas SQL requires an equal number
-     * of columns (of equal types) in the subqueries to carry out the UNION, SPARQL performs the UNION on the names of
-     * the variables; it does not require that all variables are bound in all query parts.
-     * <p/>
-     * In order to model this behaviour in SQL, this method performs the following steps:
-     * <ul>
-     *     <li>build separate subqueries for each of the parts of the union</li>
-     *     <li>find out which variables to project in which order, and which variables need to be bound to NULL
-     *         in one of the subqueries because they are not otherwise bound</li>
-     *     <li>find out which of the variables that are NOT projected might be required for sorting the overall
-     *         result, and add these to the projections of the subqueries</li>
-     * </ul>
-     * @param node
-     * @param query
-     * @param op
-     * @param conditions
-     * @param projections
-     * @param tables
-     * @return
-     */
-    public List<JoinTable> merge(BinaryTupleOperator node, SelectQuery query, MergeType op, Collection<Condition> conditions, Collection<String> projections, Collection<Table> tables )  {
-        // the bindings in proper order
-        List<String> bindings = new ArrayList<String>();
-        for(String b : node.getBindingNames()) {
-            if(!b.startsWith("-const") && projections.contains(b)) {
-                bindings.add(b);
-            }
-        }
-
-        Map<String,TNodes> contextVars = currentVariables;
-        Map<String,TNodes> contextUris = uriNodes;
-
-        // build subquery for left part of the binary tuple query
-        currentVariables = new HashMap<String, TNodes>();
-        uriNodes         = new HashMap<String, TNodes>();
-        Set<Condition> leftConditions = new HashSet<Condition>();
-        SelectQuery leftQuery = create.selectQuery();
-
-        // the FROM and CONDITION are retrieved from the subquery
-/*
-        Table left = null;
-   

<TRUNCATED>

[080/100] [abbrv] git commit: MARMOTTA-438: improved resource management to have the base url from each test case

Posted by wi...@apache.org.
MARMOTTA-438: improved resource management to have the base url from each test case


Project: http://git-wip-us.apache.org/repos/asf/marmotta/repo
Commit: http://git-wip-us.apache.org/repos/asf/marmotta/commit/def9d41f
Tree: http://git-wip-us.apache.org/repos/asf/marmotta/tree/def9d41f
Diff: http://git-wip-us.apache.org/repos/asf/marmotta/diff/def9d41f

Branch: refs/heads/ldp
Commit: def9d41f9a911032c6833c9747c6e7d6b8ca8d9e
Parents: 477ccd3
Author: Sergio Fernández <wi...@apache.org>
Authored: Mon Apr 14 18:32:09 2014 +0200
Committer: Sergio Fernández <wi...@apache.org>
Committed: Mon Apr 14 18:32:09 2014 +0200

----------------------------------------------------------------------
 .../platform/ldp/testsuite/LdpTestCase.java     |  4 +-
 .../ldp/testsuite/LdpTestCaseRunner.java        | 44 ++++++++++++++++--
 .../platform/ldp/testsuite/LdpTestCases.java    | 49 ++++++++------------
 .../ldp/testsuite/LdpTestCasesRunner.java       | 38 +++++++++++----
 4 files changed, 88 insertions(+), 47 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/marmotta/blob/def9d41f/platform/marmotta-ldp/src/test/java/org/apache/marmotta/platform/ldp/testsuite/LdpTestCase.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-ldp/src/test/java/org/apache/marmotta/platform/ldp/testsuite/LdpTestCase.java b/platform/marmotta-ldp/src/test/java/org/apache/marmotta/platform/ldp/testsuite/LdpTestCase.java
index 176494b..e293d71 100644
--- a/platform/marmotta-ldp/src/test/java/org/apache/marmotta/platform/ldp/testsuite/LdpTestCase.java
+++ b/platform/marmotta-ldp/src/test/java/org/apache/marmotta/platform/ldp/testsuite/LdpTestCase.java
@@ -88,10 +88,8 @@ public class LdpTestCase /* extends TestCase */ {
      */
     private URI testAssertion;
 
-    public LdpTestCase(URI uri, String label) {
-        //super(label);
+    public LdpTestCase(URI uri) {
         this.uri = uri;
-        this.label = label;
     }
 
     public URI getUri() {

http://git-wip-us.apache.org/repos/asf/marmotta/blob/def9d41f/platform/marmotta-ldp/src/test/java/org/apache/marmotta/platform/ldp/testsuite/LdpTestCaseRunner.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-ldp/src/test/java/org/apache/marmotta/platform/ldp/testsuite/LdpTestCaseRunner.java b/platform/marmotta-ldp/src/test/java/org/apache/marmotta/platform/ldp/testsuite/LdpTestCaseRunner.java
index 051952b..79a6079 100644
--- a/platform/marmotta-ldp/src/test/java/org/apache/marmotta/platform/ldp/testsuite/LdpTestCaseRunner.java
+++ b/platform/marmotta-ldp/src/test/java/org/apache/marmotta/platform/ldp/testsuite/LdpTestCaseRunner.java
@@ -17,11 +17,24 @@
 
 package org.apache.marmotta.platform.ldp.testsuite;
 
+import com.jayway.restassured.RestAssured;
+import org.apache.marmotta.platform.core.exception.io.MarmottaImportException;
+import org.apache.marmotta.platform.core.test.base.JettyMarmotta;
+import org.apache.marmotta.platform.ldp.webservices.LdpWebService;
+import org.junit.*;
+import org.junit.rules.TestName;
 import org.junit.runner.Description;
 import org.junit.runner.Runner;
 import org.junit.runner.notification.RunNotifier;
+import org.junit.runners.Suite;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
-import static org.junit.Assert.assertEquals;
+import javax.ws.rs.core.UriBuilder;
+import java.io.IOException;
+import java.net.URISyntaxException;
+
+import static org.junit.Assert.assertNotNull;
 
 /**
  * LDP Test Case JUnit Runner
@@ -30,7 +43,11 @@ import static org.junit.Assert.assertEquals;
  */
 public class LdpTestCaseRunner extends Runner {
 
-    private LdpTestCase testCase;
+    private static Logger log = LoggerFactory.getLogger(LdpTestCaseRunner.class);
+
+    private final LdpTestCase testCase;
+
+    private String baseUrl;
 
     public LdpTestCaseRunner(LdpTestCase testCase) {
         this.testCase = testCase;
@@ -38,7 +55,7 @@ public class LdpTestCaseRunner extends Runner {
 
     @Override
     public Description getDescription() {
-        return Description.createSuiteDescription(testCase.getLabel());
+        return Description.createSuiteDescription(testCase.getUri().getLocalName());
     }
 
     @Override
@@ -54,8 +71,25 @@ public class LdpTestCaseRunner extends Runner {
     }
 
     private void run() {
-        assertEquals(testCase.getLabel().substring(3), testCase.getUri().getLocalName().substring(2));
-        //TODO: actual execution
+        Assume.assumeNotNull(baseUrl);
+        assertNotNull(testCase);
+        assertNotNull(testCase.getUri());
+        String context = buildContext(testCase);
+        log.info("Executing LDP Test Case {} over context {}...", testCase.getUri().getLocalName(), context);
+
+        //TODO: actual test case execution
+    }
+
+    private String buildContext(LdpTestCase testCase) {
+        return baseUrl + "/" + testCase.getUri().getLocalName().toLowerCase();
+    }
+
+    public String getBaseUrl() {
+        return baseUrl;
+    }
+
+    public void setBaseUrl(String baseUrl) {
+        this.baseUrl = baseUrl;
     }
 
 }

http://git-wip-us.apache.org/repos/asf/marmotta/blob/def9d41f/platform/marmotta-ldp/src/test/java/org/apache/marmotta/platform/ldp/testsuite/LdpTestCases.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-ldp/src/test/java/org/apache/marmotta/platform/ldp/testsuite/LdpTestCases.java b/platform/marmotta-ldp/src/test/java/org/apache/marmotta/platform/ldp/testsuite/LdpTestCases.java
index ddffa8f..c60aba4 100644
--- a/platform/marmotta-ldp/src/test/java/org/apache/marmotta/platform/ldp/testsuite/LdpTestCases.java
+++ b/platform/marmotta-ldp/src/test/java/org/apache/marmotta/platform/ldp/testsuite/LdpTestCases.java
@@ -18,17 +18,13 @@
 package org.apache.marmotta.platform.ldp.testsuite;
 
 import com.jayway.restassured.RestAssured;
-import org.apache.marmotta.platform.core.exception.io.MarmottaImportException;
 import org.apache.marmotta.platform.core.test.base.JettyMarmotta;
 import org.apache.marmotta.platform.ldp.webservices.LdpWebService;
-import org.junit.*;
+import org.junit.ClassRule;
+import org.junit.rules.ExternalResource;
 import org.junit.runner.RunWith;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 import javax.ws.rs.core.UriBuilder;
-import java.io.IOException;
-import java.net.URISyntaxException;
 
 /**
  * LDP Test Cases
@@ -46,35 +42,30 @@ public class LdpTestCases {
 
     public final static String MANIFEST_CACHE = "LDP-Test-Cases-WD-live";
 
-    private static Logger log = LoggerFactory.getLogger(LdpTestCases.class);
+    @ClassRule
+    public static ExternalResource marmotta = new MarmottaResource();
 
-    private static JettyMarmotta marmotta;
+    public static class MarmottaResource extends ExternalResource {
 
-    private static String baseUrl;
+        JettyMarmotta marmotta;
 
-    @BeforeClass
-    public static void setup() throws MarmottaImportException, URISyntaxException, IOException {
-        marmotta = new JettyMarmotta("/marmotta", LdpWebService.class);
-        RestAssured.baseURI = "http://localhost";
-        RestAssured.port = marmotta.getPort();
-        RestAssured.basePath = marmotta.getContext();
-        baseUrl = UriBuilder.fromUri("http://localhost").port(marmotta.getPort()).path(marmotta.getContext()).build().toString();
-    }
+        String baseUrl;
 
-    @Before
-    public void before() {
-        log.warn("before");
-    }
+        @Override
+        protected void before() throws Throwable {
+            marmotta = new JettyMarmotta("/marmotta-ldp", LdpWebService.class);
+            RestAssured.baseURI = "http://localhost";
+            RestAssured.port = marmotta.getPort();
+            RestAssured.basePath = marmotta.getContext();
+            baseUrl = UriBuilder.fromUri("http://localhost").port(marmotta.getPort()).path(marmotta.getContext()).build().toString();
+        }
 
-    @After
-    public void after() {
-        log.warn("after");
-    }
+        @Override
+        protected void after() {
+            //marmotta.shutdown();
+            marmotta = null;
+        }
 
-    @AfterClass
-    public static void shutdown() {
-        //marmotta.shutdown();
-        marmotta = null;
     }
 
 }

http://git-wip-us.apache.org/repos/asf/marmotta/blob/def9d41f/platform/marmotta-ldp/src/test/java/org/apache/marmotta/platform/ldp/testsuite/LdpTestCasesRunner.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-ldp/src/test/java/org/apache/marmotta/platform/ldp/testsuite/LdpTestCasesRunner.java b/platform/marmotta-ldp/src/test/java/org/apache/marmotta/platform/ldp/testsuite/LdpTestCasesRunner.java
index 31fee36..f9fc57a 100644
--- a/platform/marmotta-ldp/src/test/java/org/apache/marmotta/platform/ldp/testsuite/LdpTestCasesRunner.java
+++ b/platform/marmotta-ldp/src/test/java/org/apache/marmotta/platform/ldp/testsuite/LdpTestCasesRunner.java
@@ -17,8 +17,12 @@
 
 package org.apache.marmotta.platform.ldp.testsuite;
 
+import org.apache.commons.lang3.StringUtils;
+import org.junit.rules.TestRule;
 import org.junit.runner.Runner;
+import org.junit.runner.notification.RunNotifier;
 import org.junit.runners.Suite;
+import org.junit.runners.model.FrameworkField;
 import org.openrdf.model.URI;
 import org.openrdf.query.*;
 import org.openrdf.repository.Repository;
@@ -30,6 +34,8 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import java.io.IOException;
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Field;
 import java.util.ArrayList;
 import java.util.List;
 
@@ -42,11 +48,29 @@ public class LdpTestCasesRunner extends Suite {
 
     private static Logger log = LoggerFactory.getLogger(LdpTestCasesRunner.class);
 
+    private LdpTestCases.MarmottaResource marmotta;
+
     public LdpTestCasesRunner(Class<?> klass) throws Throwable {
         super(klass, buildTestCasesFromManifest());
+
+        //TODO: it should be an easier way to do it...
+        for (TestRule rule : this.classRules()) {
+            if (LdpTestCases.MarmottaResource.class.equals(rule.getClass())) {
+                marmotta = (LdpTestCases.MarmottaResource)rule;
+                break;
+            }
+        }
+    }
+
+    @Override
+    protected void runChild(Runner runner, RunNotifier notifier) {
+        if (runner instanceof LdpTestCaseRunner) {
+            ((LdpTestCaseRunner)runner).setBaseUrl(marmotta.baseUrl);
+        }
+        super.runChild(runner, notifier);
     }
 
-    private static List<Runner> buildTestCasesFromManifest() {
+    private static List<Runner> buildTestCasesFromManifest() throws Throwable {
         List<Runner> runners = new ArrayList<>();
 
         String path = LdpTestCases.ROOT_PATH + LdpTestCases.MANIFEST_CACHE + ".ttl";
@@ -56,20 +80,14 @@ public class LdpTestCasesRunner extends Suite {
             try {
                 conn.begin();
 
-                //TODO: this query is not final, it needs to evolve in parallel with the test cases
-                String testCasesQuery = LdpTestCasesUtils.getNormativeNamespacesSparql() + "\n" +
-                        "SELECT ?tc ?label \n" +
-                        "WHERE { \n" +
-                        "  ?tc a td:TestCase ; \n" +
-                        "      rdfs:label ?label . \n" +
-                        "}";
+                String testCasesQuery = LdpTestCasesUtils.getNormativeNamespacesSparql()+ "\n"
+                        + "SELECT ?tc WHERE { ?tc a td:TestCase }";
                 TupleQuery tupleQuery = conn.prepareTupleQuery(QueryLanguage.SPARQL, testCasesQuery);
                 TupleQueryResult results = tupleQuery.evaluate();
                 try {
                     while (results.hasNext()) {
                         BindingSet bindings = results.next();
-                        LdpTestCase testCase = new LdpTestCase((URI)bindings.getValue("tc"), bindings.getValue("label").stringValue());
-                        //TODO: set more data to the test case
+                        LdpTestCase testCase = new LdpTestCase((URI)bindings.getValue("tc"));
                         runners.add(new LdpTestCaseRunner(testCase));
                     }
                 } finally {


[050/100] [abbrv] [partial] Reverting the erroneous merge by Sebastian according to the instructions in INFRA-6876

Posted by wi...@apache.org.
http://git-wip-us.apache.org/repos/asf/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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


[023/100] [abbrv] [partial] Reverting the erroneous merge by Sebastian according to the instructions in INFRA-6876

Posted by wi...@apache.org.
http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/kiwi/kiwi-reasoner/src/main/java/org/apache/marmotta/kiwi/reasoner/engine/ReasoningEngine.java
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-reasoner/src/main/java/org/apache/marmotta/kiwi/reasoner/engine/ReasoningEngine.java b/libraries/kiwi/kiwi-reasoner/src/main/java/org/apache/marmotta/kiwi/reasoner/engine/ReasoningEngine.java
index dd42ae5..69d6cde 100644
--- a/libraries/kiwi/kiwi-reasoner/src/main/java/org/apache/marmotta/kiwi/reasoner/engine/ReasoningEngine.java
+++ b/libraries/kiwi/kiwi-reasoner/src/main/java/org/apache/marmotta/kiwi/reasoner/engine/ReasoningEngine.java
@@ -17,22 +17,22 @@
  */
 package org.apache.marmotta.kiwi.reasoner.engine;
 
+import com.google.common.base.Equivalence;
+import com.google.common.collect.HashMultimap;
+import com.google.common.collect.Multimap;
 import info.aduna.iteration.CloseableIteration;
 import info.aduna.iteration.EmptyIteration;
 import info.aduna.iteration.Iterations;
 import info.aduna.iteration.SingletonIteration;
+import org.apache.marmotta.commons.sesame.model.StatementCommons;
 import org.apache.marmotta.kiwi.model.caching.TripleTable;
 import org.apache.marmotta.kiwi.model.rdf.KiWiNode;
 import org.apache.marmotta.kiwi.model.rdf.KiWiResource;
 import org.apache.marmotta.kiwi.model.rdf.KiWiTriple;
 import org.apache.marmotta.kiwi.model.rdf.KiWiUriResource;
-import org.apache.marmotta.kiwi.reasoner.model.program.Justification;
-import org.apache.marmotta.kiwi.reasoner.model.program.LiteralField;
-import org.apache.marmotta.kiwi.reasoner.model.program.Pattern;
-import org.apache.marmotta.kiwi.reasoner.model.program.Program;
-import org.apache.marmotta.kiwi.reasoner.model.program.ResourceField;
-import org.apache.marmotta.kiwi.reasoner.model.program.Rule;
-import org.apache.marmotta.kiwi.reasoner.model.program.VariableField;
+import org.apache.marmotta.kiwi.reasoner.model.exception.ReasoningException;
+import org.apache.marmotta.kiwi.reasoner.model.exception.UnjustifiedTripleException;
+import org.apache.marmotta.kiwi.reasoner.model.program.*;
 import org.apache.marmotta.kiwi.reasoner.model.query.QueryResult;
 import org.apache.marmotta.kiwi.reasoner.persistence.KiWiReasoningConnection;
 import org.apache.marmotta.kiwi.reasoner.persistence.KiWiReasoningPersistence;
@@ -51,14 +51,7 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import java.sql.SQLException;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
+import java.util.*;
 import java.util.concurrent.LinkedBlockingQueue;
 import java.util.concurrent.locks.Lock;
 import java.util.concurrent.locks.ReentrantLock;
@@ -121,24 +114,32 @@ public class ReasoningEngine implements TransactionListener {
      * In-memory cache to store all patterns that are candidates for matching triples and accessing the rules
      * they belong to.
      */
-    private Map<Pattern,Rule> patternRuleMap;
+    private Multimap<Pattern,Rule> patternRuleMap;
 
     /**
      * Internal counter to count executions of the reasoner (informational purposes only)
      */
     private static long taskCounter = 0;
 
+    private boolean isshutdown = false;
 
     /**
      * The worker thread for the reasoner.
      */
     private SKWRLReasoner reasonerThread;
 
+    protected static Equivalence<Statement> equivalence = StatementCommons.quadrupleEquivalence();
+
     /**
      * A lock to ensure that only once thread at a time is carrying out persistence
      */
     private Lock persistenceLock;
 
+    // for mocking
+    protected ReasoningEngine() {
+
+    }
+
     public ReasoningEngine(KiWiReasoningPersistence persistence, TransactionalSail store, ReasoningConfiguration config) {
         this.persistence = persistence;
         this.store = store;
@@ -153,7 +154,7 @@ public class ReasoningEngine implements TransactionListener {
 
     public void loadPrograms() {
         log.info("program configuration changed, reloading ...");
-        patternRuleMap = new HashMap<Pattern, Rule>();
+        patternRuleMap = HashMultimap.<Pattern,Rule>create();
 
         try {
             KiWiReasoningConnection connection = persistence.getConnection();
@@ -311,7 +312,6 @@ public class ReasoningEngine implements TransactionListener {
 
     /**
      * Stop the currently active reasoning task. Informational purposes only.
-     * @param name
      */
     protected void endTask() {
 
@@ -344,58 +344,59 @@ public class ReasoningEngine implements TransactionListener {
     }
 
     private void executeReasoner(TransactionData data) {
-        updateTaskStatus("fetching worklist");
-        Set<KiWiTriple> newTriples = new HashSet<KiWiTriple>();
-        for(Statement stmt : data.getAddedTriples()) {
-            KiWiTriple t = (KiWiTriple)stmt;
-            if(t.isMarkedForReasoning()) {
-                newTriples.add(t);
-                t.setMarkedForReasoning(false);
+        try {
+            updateTaskStatus("fetching worklist");
+            Set<KiWiTriple> newTriples = StatementCommons.newQuadrupleSet();
+            for(Statement stmt : data.getAddedTriples()) {
+                KiWiTriple t = (KiWiTriple)stmt;
+                if(t.isMarkedForReasoning()) {
+                    newTriples.add(t);
+                    t.setMarkedForReasoning(false);
+                }
             }
-        }
 
-        //taskManagerService.setTaskSteps(newTriples.size() + data.getRemovedTriples().size());
-        // evaluate the rules for all added triples
-        if(newTriples.size() > 0) {
-            long start2 = System.currentTimeMillis();
-            updateTaskStatus("reasoning over " + newTriples.size() + " new triples");
-            processRules(newTriples);
-            log.debug("REASONER: reasoning for {} new triples took {} ms overall",newTriples.size(),System.currentTimeMillis()-start2);
-        }
+            //taskManagerService.setTaskSteps(newTriples.size() + data.getRemovedTriples().size());
+            // evaluate the rules for all added triples
+            if(newTriples.size() > 0) {
+                long start2 = System.currentTimeMillis();
+                updateTaskStatus("reasoning over " + newTriples.size() + " new triples");
+                processRules(newTriples);
+                log.debug("REASONER: reasoning for {} new triples took {} ms overall", newTriples.size(), System.currentTimeMillis() - start2);
+            }
 
-        if(data.getRemovedTriples().size() > 0) {
-            log.debug("cleaning up justifications and inferences for {} triples",data.getRemovedTriples().size());
-            try {
-                KiWiReasoningConnection connection = persistence.getConnection();
+            if(data.getRemovedTriples().size() > 0) {
+                log.debug("cleaning up justifications and inferences for {} triples",data.getRemovedTriples().size());
                 try {
-                    // first clean up justifications that are no longer supported
-                    cleanupJustifications(connection, data.getRemovedTriples());
-
-
-                    // then remove all inferred triples that are no longer supported
-                    cleanupUnsupported(connection);
-
-                    // and finally garbage collect those triples that are inferred and deleted
-                    // garbage collection is now carried out by a thread in the triple store
-                    //garbageCollectTriples();
-                    connection.commit();
-                } catch (SQLException ex) {
-                    connection.rollback();
+                    KiWiReasoningConnection connection = persistence.getConnection();
+                    try {
+                        // first clean up justifications that are no longer supported
+                        cleanupJustifications(connection, data.getRemovedTriples());
+
+
+                        // then remove all inferred triples that are no longer supported
+                        cleanupUnsupported(connection);
+
+                        // and finally garbage collect those triples that are inferred and deleted
+                        // garbage collection is now carried out by a thread in the triple store
+                        //garbageCollectTriples();
+                        connection.commit();
+                    } catch (SQLException ex) {
+                        connection.rollback();
+                        throw ex;
+                    } finally {
+                        connection.close();
+                    }
+                } catch (SailException | SQLException ex) {
+                    log.error("REASONING ERROR: could not clean up unsupported triples, database state will be inconsistent! Message: {}", ex.getMessage());
+                    log.debug("Exception details:", ex);
                     throw ex;
-                } finally {
-                    connection.close();
                 }
-            } catch (SailException ex) {
-                log.error("REPOSITORY ERROR: could not clean up unsupported triples, database state will be inconsistent! Message: {}", ex.getMessage());
-                log.debug("Exception details:", ex);
-            } catch (SQLException ex) {
-                log.error("DATABASE ERROR: could not clean up justifications for triples, database state will be inconsistent! Message: {}", ex.getMessage());
-                log.debug("Exception details:", ex);
-            }
 
 
+            }
+        } catch (SQLException | SailException | ReasoningException ex) {
+            log.error("REASONER: processing of transaction data with ID {} aborted; reason: {}", data.getTransactionId(), ex.getMessage());
         }
-
     }
 
     /**
@@ -483,40 +484,12 @@ public class ReasoningEngine implements TransactionListener {
 
     }
 
-    /**
-     * Store new justifications in the database. The method performs a batched operation to avoid
-     * excessive resource use.
-     *
-     * @param justifications
-     */
-    private void storeJustifications(Iterable<Justification> justifications) {
-        // persist the justifications that have been created in the rule processing
-        long counter = 0;
-        updateTaskStatus("storing new justifications ...");
-
-        try {
-            KiWiReasoningConnection connection = persistence.getConnection();
-            try {
-                connection.storeJustifications(justifications);
-                connection.commit();
-            } catch (SQLException ex) {
-                connection.rollback();
-                throw ex;
-            } finally {
-                connection.close();
-            }
-        } catch (SQLException ex) {
-            log.error("DATABASE ERROR: could not add new justifications for triples, database state will be inconsistent! Message: {}",ex.getMessage());
-            log.debug("Exception details:",ex);
-        }
-    }
-
 
     /**
      * This method iterates over all triples that are passed as argument and
      * checks whether they are used as supporting triples justifications. All
      * such justifications are removed. Triples that are no longer supported
-     * will later be cleaned up by {@link #cleanupUnsupported()}
+     * will later be cleaned up by {@link #cleanupUnsupported(org.apache.marmotta.kiwi.reasoner.persistence.KiWiReasoningConnection)}
      *
      * @param removedTriples
      */
@@ -541,24 +514,30 @@ public class ReasoningEngine implements TransactionListener {
         updateTaskStatus("loading unsupported triples");
 
         CloseableIteration<KiWiTriple,SQLException> tripleIterator = connection.listUnsupportedTriples();
-
-        updateTaskStatus("deleting unsupported triples");
-        SailConnection tc = store.getConnection();
-        KiWiSailConnection ic = getWrappedConnection(tc);
         try {
-            tc.begin();
-            while(tripleIterator.hasNext()) {
-                ic.removeInferredStatement(tripleIterator.next());
-                count++;
+            if(tripleIterator.hasNext()) {
+
+                updateTaskStatus("deleting unsupported triples");
+                SailConnection tc = store.getConnection();
+                KiWiSailConnection ic = getWrappedConnection(tc);
+                try {
+                    tc.begin();
+                    while(tripleIterator.hasNext()) {
+                        ic.removeInferredStatement(tripleIterator.next());
+                        count++;
+                    }
+                    log.debug("removed {} unsupported triples",count);
+                    tc.commit();
+                } catch(SailException ex) {
+                    ic.rollback();
+                    throw ex;
+                } finally {
+                    ic.close();
+                }
             }
-            log.debug("removed {} unsupported triples",count);
-            tc.commit();
-        } catch(SailException ex) {
-            ic.rollback();
-            throw ex;
         } finally {
             Iterations.closeCloseable(tripleIterator);
-            ic.close();
+
         }
     }
 
@@ -567,43 +546,20 @@ public class ReasoningEngine implements TransactionListener {
      *
      * @param addedTriples
      */
-    private void processRules(final Set<KiWiTriple> addedTriples) {
-        try {
-            updateTaskStatus("processing rules ...");
-            // select the rules that have at least one matching pattern; the match method will
-            // return a set of variable bindings that we will be used to prepopulate the bindings
-//            Set<Callable<Boolean>> tasks = new HashSet<Callable<Boolean>>();
-            for(final Pattern pattern : patternRuleMap.keySet()) {
-                for(KiWiTriple triple : addedTriples) {
-                    QueryResult match = matches(pattern,triple);
-                    if(match != null) {
-                        log.debug("pattern {} matched with triple {}", pattern.toString(), triple.toString());
-                        processRule(patternRuleMap.get(pattern), match, pattern);
+    private void processRules(final Set<KiWiTriple> addedTriples) throws SQLException, SailException, ReasoningException {
+        updateTaskStatus("processing rules ...");
+        // select the rules that have at least one matching pattern; the match method will
+        // return a set of variable bindings that we will be used to prepopulate the bindings
+        for(final Pattern pattern : patternRuleMap.keySet()) {
+            for(KiWiTriple triple : addedTriples) {
+                QueryResult match = matches(pattern,triple);
+                if(match != null) {
+                    for(Rule rule : patternRuleMap.get(pattern)) {
+                        log.debug("REASONER(rule '{}'): pattern {} matched with triple {}", rule.getName(), pattern.toString(), triple.toString());
+                        processRule(rule, match, pattern);
                     }
                 }
-                // TODO: for parallel reasoning, the problem is that we should only create one thread per rule and not
-                // one per pattern, otherwise we can get duplicates because the same rule is evaluated twice
-/*
-                tasks.add(new Callable<Boolean>() {
-                    @Override
-                    public Boolean call() throws Exception {
-                        for(KiWiTriple triple : addedTriples) {
-                            QueryResult match = matches(pattern,triple);
-                            if(match != null) {
-                                log.debug("pattern {} matched with triple {}", pattern.toString(), triple.toString());
-                                processRule(patternRuleMap.get(pattern), match, pattern);
-                            }
-                        }
-
-                        return Boolean.TRUE;
-                    }
-                });
-*/
             }
-            //workers.invokeAll(tasks);
-
-        } catch(Exception ex) {
-            log.error("error while processing rules",ex);
         }
     }
 
@@ -615,10 +571,10 @@ public class ReasoningEngine implements TransactionListener {
      * @param rule
      * @param match
      */
-    private void processRule(Rule rule, QueryResult match, Pattern p) {
+    private void processRule(Rule rule, QueryResult match, Pattern p) throws SQLException, SailException, ReasoningException {
 
         // get the variable bindings for the rule evaluation
-        log.debug("REASONER: evaluating rule body for rule {} ...", rule);
+        log.debug("REASONER(rule '{}'): evaluating rule body {} ...", rule.getName() != null ? rule.getName() : rule.getId(), rule);
 
         // create a collection consisting of the body minus the pattern that already matched
         Set<Pattern> body = new HashSet<Pattern>(rule.getBody());
@@ -629,153 +585,143 @@ public class ReasoningEngine implements TransactionListener {
 
         CloseableIteration<QueryResult, SQLException> bodyResult;
 
+        KiWiReasoningConnection connection = persistence.getConnection();
+        SailConnection     sail = store.getConnection();
+        KiWiSailConnection isail = getWrappedConnection(sail);
         try {
-            KiWiReasoningConnection connection = persistence.getConnection();
-            SailConnection     sail = store.getConnection();
-            KiWiSailConnection isail = getWrappedConnection(sail);
-            try {
 
-                // if there are further patterns, evaluate them; if the matched pattern was the only pattern, then
-                // simply take the match as binding
-                if(body.size() > 0) {
-                    bodyResult = connection.query(body,match,null,null,true);
-                } else if(match != null) {
-                    bodyResult = new SingletonIteration<QueryResult, SQLException>(match);
-                } else {
-                    bodyResult = new EmptyIteration<QueryResult, SQLException>();
-                }
+            // if there are further patterns, evaluate them; if the matched pattern was the only pattern, then
+            // simply take the match as binding
+            if(body.size() > 0) {
+                bodyResult = connection.query(body,match,null,null,true);
+            } else if(match != null) {
+                bodyResult = new SingletonIteration<QueryResult, SQLException>(match);
+            } else {
+                bodyResult = new EmptyIteration<QueryResult, SQLException>();
+            }
 
-                // construct triples out of the bindings and the rule heads
-                long counter = 0;
+            // construct triples out of the bindings and the rule heads
+            long counter = 0;
 
-                // initialise a new set of justifications
-                Set<Justification> justifications = new HashSet<Justification>();
+            // initialise a new set of justifications
+            Set<Justification> justifications = new HashSet<Justification>();
 
-                sail.begin();
-                while(bodyResult.hasNext()) {
-                    QueryResult row = bodyResult.next();
-                    Map<VariableField,KiWiNode> binding = row.getBindings();
+            sail.begin();
+            while(bodyResult.hasNext()) {
+                QueryResult row = bodyResult.next();
+                Map<VariableField,KiWiNode> binding = row.getBindings();
 
-                    Resource subject = null;
-                    URI property = null;
-                    Value object;
+                Resource subject = null;
+                URI property = null;
+                Value object;
 
-                    if(rule.getHead().getSubject() != null && rule.getHead().getSubject().isVariableField()) {
-                        if(!binding.get(rule.getHead().getSubject()).isUriResource() && !binding.get(rule.getHead().getSubject()).isAnonymousResource()) {
-                            log.info("cannot use value {} as subject, because it is not a resource",binding.get(rule.getHead().getSubject()));
-                            continue;
-                        }
-                        subject = (KiWiResource)binding.get(rule.getHead().getSubject());
-                    } else if(rule.getHead().getSubject() != null && rule.getHead().getSubject().isResourceField()) {
-                        subject = ((ResourceField)rule.getHead().getSubject()).getResource();
-                    } else
-                        throw new IllegalArgumentException("Subject of rule head may only be a variable or a resource; rule: "+rule);
-
-                    if(rule.getHead().getProperty() != null && rule.getHead().getProperty().isVariableField()) {
-                        if(!binding.get(rule.getHead().getProperty()).isUriResource()) {
-                            log.info("cannot use value {} as property, because it is not a URI resource",binding.get(rule.getHead().getProperty()));
-                            continue;
+                if(rule.getHead().getSubject() != null && rule.getHead().getSubject().isVariableField()) {
+                    if(!binding.get(rule.getHead().getSubject()).isUriResource() && !binding.get(rule.getHead().getSubject()).isAnonymousResource()) {
+                        log.info("cannot use value {} as subject, because it is not a resource",binding.get(rule.getHead().getSubject()));
+                        continue;
+                    }
+                    subject = (KiWiResource)binding.get(rule.getHead().getSubject());
+                } else if(rule.getHead().getSubject() != null && rule.getHead().getSubject().isResourceField()) {
+                    subject = ((ResourceField)rule.getHead().getSubject()).getResource();
+                } else
+                    throw new IllegalArgumentException("Subject of rule head may only be a variable or a resource; rule: "+rule);
+
+                if(rule.getHead().getProperty() != null && rule.getHead().getProperty().isVariableField()) {
+                    if(!binding.get(rule.getHead().getProperty()).isUriResource()) {
+                        log.info("cannot use value {} as property, because it is not a URI resource",binding.get(rule.getHead().getProperty()));
+                        continue;
+                    }
+                    property = (KiWiUriResource)binding.get(rule.getHead().getProperty());
+                } else if(rule.getHead().getProperty() != null && rule.getHead().getProperty().isResourceField()) {
+                    property = (KiWiUriResource)((ResourceField)rule.getHead().getProperty()).getResource();
+                } else
+                    throw new IllegalArgumentException("Property of rule head may only be a variable or a resource; rule: "+rule);
+
+                if(rule.getHead().getObject() != null && rule.getHead().getObject().isVariableField()) {
+                    object = binding.get(rule.getHead().getObject());
+                } else if(rule.getHead().getObject() != null && rule.getHead().getObject().isResourceField()) {
+                    object = ((ResourceField)rule.getHead().getObject()).getResource();
+                } else if(rule.getHead().getObject() != null && rule.getHead().getObject().isLiteralField()) {
+                    object = ((LiteralField)rule.getHead().getObject()).getLiteral();
+                } else
+                    throw new IllegalArgumentException("Object of rule head may only be a variable, a literal, or a resource; rule: "+rule);
+
+
+                KiWiTriple triple = isail.addInferredStatement(subject, property, object);
+
+                Justification justification = new Justification();
+                justification.setTriple(triple);
+                justification.getSupportingRules().add(rule);
+                justification.getSupportingTriples().addAll(row.getJustifications());
+                justifications.add(justification);
+
+                // when the batch size is reached, commit the transaction, save the justifications, and start a new
+                // transaction and new justification set
+                if(++counter % config.getBatchSize() == 0) {
+                    persistenceLock.lock();
+
+                    try {
+
+                        sail.commit();
+
+                        log.debug("adding {} justifications",justifications.size());
+
+                        updateTaskStatus("storing justifications ...");
+                        Set<Justification> baseJustifications = getBaseJustifications(connection,justifications);
+
+                        if(config.isRemoveDuplicateJustifications()) {
+                            removeDuplicateJustifications(connection,baseJustifications);
                         }
-                        property = (KiWiUriResource)binding.get(rule.getHead().getProperty());
-                    } else if(rule.getHead().getProperty() != null && rule.getHead().getProperty().isResourceField()) {
-                        property = (KiWiUriResource)((ResourceField)rule.getHead().getProperty()).getResource();
-                    } else
-                        throw new IllegalArgumentException("Property of rule head may only be a variable or a resource; rule: "+rule);
-
-                    if(rule.getHead().getObject() != null && rule.getHead().getObject().isVariableField()) {
-                        object = binding.get(rule.getHead().getObject());
-                    } else if(rule.getHead().getObject() != null && rule.getHead().getObject().isResourceField()) {
-                        object = ((ResourceField)rule.getHead().getObject()).getResource();
-                    } else if(rule.getHead().getObject() != null && rule.getHead().getObject().isLiteralField()) {
-                        object = ((LiteralField)rule.getHead().getObject()).getLiteral();
-                    } else
-                        throw new IllegalArgumentException("Object of rule head may only be a variable, a literal, or a resource; rule: "+rule);
-
-
-                    KiWiTriple triple = isail.addInferredStatement(subject, property, object);
-
-                    Justification justification = new Justification();
-                    justification.setTriple(triple);
-                    justification.getSupportingRules().add(rule);
-                    justification.getSupportingTriples().addAll(row.getJustifications());
-                    justifications.add(justification);
-
-                    // when the batch size is reached, commit the transaction, save the justifications, and start a new
-                    // transaction and new justification set
-                    if(++counter % config.getBatchSize() == 0) {
-                        persistenceLock.lock();
-
-                        try {
-
-                            sail.commit();
-
-                            log.debug("adding {} justifications",justifications.size());
-
-                            updateTaskStatus("storing justifications ...");
-                            Set<Justification> baseJustifications = getBaseJustifications(connection,justifications);
-
-                            if(config.isRemoveDuplicateJustifications()) {
-                                removeDuplicateJustifications(connection,baseJustifications);
-                            }
-
-                            log.debug("{} justifications added after resolving inferred triples", baseJustifications.size());
-
-                            // persist the justifications that have been created in the rule processing
-                            if(baseJustifications.size() > 0) {
-                                connection.storeJustifications(baseJustifications);
-                            }
-                            connection.commit();
-                            sail.begin();
-                        } finally {
-                            persistenceLock.unlock();
+
+                        log.debug("{} justifications added after resolving inferred triples", baseJustifications.size());
+
+                        // persist the justifications that have been created in the rule processing
+                        if(baseJustifications.size() > 0) {
+                            connection.storeJustifications(baseJustifications);
                         }
-                        justifications.clear();
+                        connection.commit();
+                        sail.begin();
+                    } finally {
+                        persistenceLock.unlock();
                     }
+                    justifications.clear();
                 }
+            }
 
-                persistenceLock.lock();
-                try {
-                    sail.commit();
+            persistenceLock.lock();
+            try {
+                sail.commit();
 
-                    log.debug("adding {} justifications",justifications.size());
-                    updateTaskStatus("storing justifications ...");
-                    Set<Justification> baseJustifications = getBaseJustifications(connection,justifications);
+                log.debug("adding {} justifications",justifications.size());
+                updateTaskStatus("storing justifications ...");
+                Set<Justification> baseJustifications = getBaseJustifications(connection,justifications);
 
-                    if(config.isRemoveDuplicateJustifications()) {
-                        removeDuplicateJustifications(connection,baseJustifications);
-                    }
+                if(config.isRemoveDuplicateJustifications()) {
+                    removeDuplicateJustifications(connection,baseJustifications);
+                }
 
-                    // persist the justifications that have been created in the rule processing
-                    if(baseJustifications.size() > 0) {
-                        connection.storeJustifications(baseJustifications);
-                    }
+                // persist the justifications that have been created in the rule processing
+                if(baseJustifications.size() > 0) {
+                    connection.storeJustifications(baseJustifications);
+                }
 
-                    log.debug("{} justifications added after resolving inferred triples", baseJustifications.size());
+                log.debug("{} justifications added after resolving inferred triples", baseJustifications.size());
 
-                    Iterations.closeCloseable(bodyResult);
-                    connection.commit();
-                } finally {
-                    persistenceLock.unlock();
-                }
-            } catch(SailException ex) {
-                connection.rollback();
-                sail.rollback();
-                throw ex;
-            } catch(SQLException ex) {
-                sail.rollback();
-                connection.rollback();
-                throw ex;
+                Iterations.closeCloseable(bodyResult);
+                connection.commit();
             } finally {
-                connection.close();
-                sail.close();
+                persistenceLock.unlock();
             }
-
-        } catch(SQLException ex) {
-            log.error("DATABASE ERROR: could not process rule, database state will be inconsistent! Message: {}",ex.getMessage());
+        } catch(SailException | SQLException | ReasoningException ex) {
+            log.error("REASONING ERROR: could not process rule, database state will be inconsistent! Message: {}",ex.getMessage());
             log.debug("Exception details:",ex);
-        } catch (SailException ex) {
-            log.error("REPOSITORY ERROR: could not process rule, database state will be inconsistent! Message: {}",ex.getMessage());
-            log.debug("Exception details:", ex);
+
+            connection.rollback();
+            sail.rollback();
+            throw ex;
+        } finally {
+            connection.close();
+            sail.close();
         }
 
     }
@@ -785,12 +731,11 @@ public class ReasoningEngine implements TransactionListener {
      * @param t
      * @return
      */
-    private Collection<Justification> getJustifications(KiWiReasoningConnection connection, KiWiTriple t, Set<Justification> transactionJustifications) throws SQLException {
-        // TODO: transactionJustifications are ignored
+    protected Collection<Justification> getJustifications(KiWiReasoningConnection connection, KiWiTriple t, Set<Justification> transactionJustifications) throws SQLException {
         HashSet<Justification> justifications = new HashSet<Justification>();
         Iterations.addAll(connection.listJustificationsForTriple(t), justifications);
         for(Justification j : transactionJustifications) {
-            if(j.getTriple().equals(t)) {
+            if(equivalence.equivalent(j.getTriple(), t)) {
                 justifications.add(j);
             }
         }
@@ -804,9 +749,9 @@ public class ReasoningEngine implements TransactionListener {
      * @param justifications
      * @return
      */
-    private Set<Justification> getBaseJustifications(KiWiReasoningConnection connection, Set<Justification> justifications) throws SQLException {
+    protected Set<Justification> getBaseJustifications(KiWiReasoningConnection connection, Set<Justification> justifications) throws SQLException, ReasoningException {
         Set<Justification> baseJustifications = new HashSet<Justification>();
-        Map<KiWiTriple,Collection<Justification>> justificationCache = new HashMap<KiWiTriple, Collection<Justification>>();
+        Map<KiWiTriple,Collection<Justification>> justificationCache = StatementCommons.newQuadrupleMap();
 
         for(Justification justification : justifications) {
             KiWiTriple triple = justification.getTriple();
@@ -828,7 +773,7 @@ public class ReasoningEngine implements TransactionListener {
                     }
 
                     if(supportJustifications.size() == 0) {
-                        log.error("error: inferred triple {} is not justified!",support);
+                        throw new UnjustifiedTripleException("error: inferred triple is not justified!", support);
                     }
 
                     // mix the two sets
@@ -864,7 +809,7 @@ public class ReasoningEngine implements TransactionListener {
      */
     private void removeDuplicateJustifications(KiWiReasoningConnection connection, Set<Justification> justifications) throws SQLException {
         // remove duplicate justifications
-        HashMap<KiWiTriple,Collection<Justification>> justificationCache = new HashMap<KiWiTriple, Collection<Justification>>();
+        Map<KiWiTriple,Collection<Justification>> justificationCache = StatementCommons.newQuadrupleMap();
         for(Iterator<Justification> it = justifications.iterator(); it.hasNext(); ) {
             Justification j = it.next();
 
@@ -882,7 +827,7 @@ public class ReasoningEngine implements TransactionListener {
     }
 
 
-    private QueryResult matches(Pattern pattern, KiWiTriple triple) {
+    protected static QueryResult matches(Pattern pattern, KiWiTriple triple) {
         boolean result = true;
 
         QueryResult match = new QueryResult();
@@ -950,8 +895,45 @@ public class ReasoningEngine implements TransactionListener {
     }
 
     public void shutdown() {
-        log.info("shutting down reasoning service ...");
-        reasonerThread.shutdown();
+        shutdown(false);
+    }
+
+    public void shutdown(boolean force) {
+        if(isshutdown)
+            return;
+
+        if(force) {
+            log.warn("forced shutdown of reasoning service initiated, state will be inconsistent ...");
+
+            reasoningQueue.clear();
+            reasonerThread.shutdown(true);
+
+            for(int i = 0; i<5 && isRunning(); i++) {
+                log.warn("reasoner not yet finished, waiting for 100 ms (try={})", i+1);
+                try {
+                    Thread.sleep(100);
+                } catch (InterruptedException e) {
+                }
+            }
+
+            // yes, I know it is unsafe; it is only used when forcefully shutting down on test ends before the database is deleted...
+            reasonerThread.stop();
+
+        } else {
+            log.info("graceful shutdown of reasoning service initiated ...");
+
+            for(int i = 0; i<20 && isRunning(); i++) {
+                log.warn("reasoner not yet finished, waiting for 1 seconds (try={})", i+1);
+                try {
+                    Thread.sleep(1000);
+                } catch (InterruptedException e) {
+                }
+            }
+
+            reasonerThread.shutdown(false);
+        }
+
+        isshutdown = true;
     }
 
     /**
@@ -976,6 +958,7 @@ public class ReasoningEngine implements TransactionListener {
     private class SKWRLReasoner extends Thread {
         private boolean shutdown = false;
         private boolean running  = false;
+        private boolean forceshutdown = false;
 
         private SKWRLReasoner() {
             super("SKWRL Reasoner " + ++indexerCounter);
@@ -983,8 +966,10 @@ public class ReasoningEngine implements TransactionListener {
             start();
         }
 
-        public void shutdown() {
+        public void shutdown(boolean force) {
+            log.info("REASONER: signalling shutdown to reasoner thread");
             shutdown = true;
+            forceshutdown = force;
             this.interrupt();
         }
 
@@ -998,7 +983,7 @@ public class ReasoningEngine implements TransactionListener {
 
             startTask(getName(), TASK_GROUP);
 
-            while (!shutdown || reasoningQueue.size() > 0) {
+            while (!forceshutdown && (!shutdown || reasoningQueue.size() > 0)) {
                 running = false;
                 try {
                     updateTaskStatus("idle");
@@ -1011,10 +996,13 @@ public class ReasoningEngine implements TransactionListener {
                     executeReasoner(data);
                 } catch (InterruptedException ex) {
 
+                } catch (RuntimeException ex) {
+                    // can happen on forced shutdown
                 } catch (Exception ex) {
                     log.warn("reasoning task threw an exception",ex);
                 }
             }
+            running = false;
             try {
                 endTask();
             } catch (Exception ex) {

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/kiwi/kiwi-reasoner/src/main/java/org/apache/marmotta/kiwi/reasoner/model/exception/ReasoningException.java
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-reasoner/src/main/java/org/apache/marmotta/kiwi/reasoner/model/exception/ReasoningException.java b/libraries/kiwi/kiwi-reasoner/src/main/java/org/apache/marmotta/kiwi/reasoner/model/exception/ReasoningException.java
new file mode 100644
index 0000000..bc25d22
--- /dev/null
+++ b/libraries/kiwi/kiwi-reasoner/src/main/java/org/apache/marmotta/kiwi/reasoner/model/exception/ReasoningException.java
@@ -0,0 +1,100 @@
+/*
+ * 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.kiwi.reasoner.model.exception;
+
+/**
+ * Add file description here!
+ *
+ * @author Sebastian Schaffert (sschaffert@apache.org)
+ */
+public class ReasoningException extends Exception {
+
+    /**
+     * Constructs a new exception with {@code null} as its detail message.
+     * The cause is not initialized, and may subsequently be initialized by a
+     * call to {@link #initCause}.
+     */
+    public ReasoningException() {
+    }
+
+    /**
+     * Constructs a new exception with the specified cause and a detail
+     * message of <tt>(cause==null ? null : cause.toString())</tt> (which
+     * typically contains the class and detail message of <tt>cause</tt>).
+     * This constructor is useful for exceptions that are little more than
+     * wrappers for other throwables (for example, {@link
+     * java.security.PrivilegedActionException}).
+     *
+     * @param cause the cause (which is saved for later retrieval by the
+     *              {@link #getCause()} method).  (A <tt>null</tt> value is
+     *              permitted, and indicates that the cause is nonexistent or
+     *              unknown.)
+     * @since 1.4
+     */
+    public ReasoningException(Throwable cause) {
+        super(cause);
+    }
+
+    /**
+     * Constructs a new exception with the specified detail message.  The
+     * cause is not initialized, and may subsequently be initialized by
+     * a call to {@link #initCause}.
+     *
+     * @param message the detail message. The detail message is saved for
+     *                later retrieval by the {@link #getMessage()} method.
+     */
+    public ReasoningException(String message) {
+        super(message);
+    }
+
+    /**
+     * Constructs a new exception with the specified detail message and
+     * cause.  <p>Note that the detail message associated with
+     * {@code cause} is <i>not</i> automatically incorporated in
+     * this exception's detail message.
+     *
+     * @param message the detail message (which is saved for later retrieval
+     *                by the {@link #getMessage()} method).
+     * @param cause   the cause (which is saved for later retrieval by the
+     *                {@link #getCause()} method).  (A <tt>null</tt> value is
+     *                permitted, and indicates that the cause is nonexistent or
+     *                unknown.)
+     * @since 1.4
+     */
+    public ReasoningException(String message, Throwable cause) {
+        super(message, cause);
+    }
+
+    /**
+     * Constructs a new exception with the specified detail message,
+     * cause, suppression enabled or disabled, and writable stack
+     * trace enabled or disabled.
+     *
+     * @param message            the detail message.
+     * @param cause              the cause.  (A {@code null} value is permitted,
+     *                           and indicates that the cause is nonexistent or unknown.)
+     * @param enableSuppression  whether or not suppression is enabled
+     *                           or disabled
+     * @param writableStackTrace whether or not the stack trace should
+     *                           be writable
+     * @since 1.7
+     */
+    public ReasoningException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
+        super(message, cause, enableSuppression, writableStackTrace);
+    }
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/kiwi/kiwi-reasoner/src/main/java/org/apache/marmotta/kiwi/reasoner/model/exception/UnjustifiedTripleException.java
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-reasoner/src/main/java/org/apache/marmotta/kiwi/reasoner/model/exception/UnjustifiedTripleException.java b/libraries/kiwi/kiwi-reasoner/src/main/java/org/apache/marmotta/kiwi/reasoner/model/exception/UnjustifiedTripleException.java
new file mode 100644
index 0000000..853db1c
--- /dev/null
+++ b/libraries/kiwi/kiwi-reasoner/src/main/java/org/apache/marmotta/kiwi/reasoner/model/exception/UnjustifiedTripleException.java
@@ -0,0 +1,44 @@
+/*
+ * 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.kiwi.reasoner.model.exception;
+
+import org.apache.marmotta.kiwi.model.rdf.KiWiTriple;
+
+/**
+ * Add file description here!
+ *
+ * @author Sebastian Schaffert (sschaffert@apache.org)
+ */
+public class UnjustifiedTripleException extends ReasoningException {
+
+    private KiWiTriple triple;
+
+    /**
+     * Constructs a new exception with the specified detail message.  The
+     * cause is not initialized, and may subsequently be initialized by
+     * a call to {@link #initCause}.
+     *
+     * @param message the detail message. The detail message is saved for
+     *                later retrieval by the {@link #getMessage()} method.
+     */
+    public UnjustifiedTripleException(String message, KiWiTriple triple) {
+        super(message);
+
+        this.triple = triple;
+    }
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/kiwi/kiwi-reasoner/src/main/java/org/apache/marmotta/kiwi/reasoner/model/program/Justification.java
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-reasoner/src/main/java/org/apache/marmotta/kiwi/reasoner/model/program/Justification.java b/libraries/kiwi/kiwi-reasoner/src/main/java/org/apache/marmotta/kiwi/reasoner/model/program/Justification.java
index c338c86..5de904e 100644
--- a/libraries/kiwi/kiwi-reasoner/src/main/java/org/apache/marmotta/kiwi/reasoner/model/program/Justification.java
+++ b/libraries/kiwi/kiwi-reasoner/src/main/java/org/apache/marmotta/kiwi/reasoner/model/program/Justification.java
@@ -18,7 +18,10 @@
 package org.apache.marmotta.kiwi.reasoner.model.program;
 
 
+import com.google.common.base.Equivalence;
+import org.apache.marmotta.commons.sesame.model.StatementCommons;
 import org.apache.marmotta.kiwi.model.rdf.KiWiTriple;
+import org.openrdf.model.Statement;
 
 import java.util.Date;
 import java.util.HashSet;
@@ -63,8 +66,11 @@ public class Justification  {
      */
     private Date createdAt;
 
+
+    private static Equivalence<Statement> equivalence = StatementCommons.quadrupleEquivalence();
+
     public Justification() {
-        supportingTriples = new HashSet<KiWiTriple>();
+        supportingTriples = StatementCommons.newQuadrupleSet();
         supportingRules   = new HashSet<Rule>();
     }
 
@@ -118,7 +124,7 @@ public class Justification  {
         //if (id != null ? !id.equals(that.id) : that.id != null) return false;
         if (!supportingRules.equals(that.supportingRules)) return false;
         if (!supportingTriples.equals(that.supportingTriples)) return false;
-        if (!triple.equals(that.triple)) return false;
+        if (!equivalence.equivalent(this.triple, that.triple)) return false;
 
         return true;
     }
@@ -126,7 +132,7 @@ public class Justification  {
     @Override
     public int hashCode() {
         int result = 0; // id != null ? id.hashCode() : 0;
-        result = 31 * result + triple.hashCode();
+        result = 31 * result + equivalence.hash(triple);
         result = 31 * result + supportingTriples.hashCode();
         result = 31 * result + supportingRules.hashCode();
         return result;

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/kiwi/kiwi-reasoner/src/main/java/org/apache/marmotta/kiwi/reasoner/model/program/Pattern.java
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-reasoner/src/main/java/org/apache/marmotta/kiwi/reasoner/model/program/Pattern.java b/libraries/kiwi/kiwi-reasoner/src/main/java/org/apache/marmotta/kiwi/reasoner/model/program/Pattern.java
index 91c9aa4..6fd96f9 100644
--- a/libraries/kiwi/kiwi-reasoner/src/main/java/org/apache/marmotta/kiwi/reasoner/model/program/Pattern.java
+++ b/libraries/kiwi/kiwi-reasoner/src/main/java/org/apache/marmotta/kiwi/reasoner/model/program/Pattern.java
@@ -17,6 +17,8 @@
  */
 package org.apache.marmotta.kiwi.reasoner.model.program;
 
+import com.google.common.base.Objects;
+
 import java.util.Map;
 
 /**
@@ -93,28 +95,23 @@ public class Pattern  {
     @Override
     public boolean equals(Object o) {
         if (this == o) return true;
-        if (o == null || getClass() != o.getClass()) return false;
 
-        if(context == null && object == null && subject == null && property == null) {
-            return super.equals(o);
+        if(! (o instanceof Pattern)) {
+            return false;
         }
 
         Pattern pattern = (Pattern) o;
 
-        if (context != null ? !context.equals(pattern.context) : pattern.context != null) return false;
-        if (object != null ? !object.equals(pattern.object) : pattern.object != null) return false;
-        if (property != null ? !property.equals(pattern.property) : pattern.property != null) return false;
-        if (subject != null ? !subject.equals(pattern.subject) : pattern.subject != null) return false;
+        if(!Objects.equal(this.context, pattern.context)) return false;
+        if(!Objects.equal(this.object, pattern.object)) return false;
+        if(!Objects.equal(this.property, pattern.property)) return false;
+        if(!Objects.equal(this.subject, pattern.subject)) return false;
 
         return true;
     }
 
     @Override
     public int hashCode() {
-        int result = subject != null ? subject.hashCode() : 0;
-        result = 31 * result + (property != null ? property.hashCode() : 0);
-        result = 31 * result + (object != null ? object.hashCode() : 0);
-        result = 31 * result + (context != null ? context.hashCode() : 0);
-        return result;
+        return Objects.hashCode(subject, property, object, context);
     }
 }

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/kiwi/kiwi-reasoner/src/main/java/org/apache/marmotta/kiwi/reasoner/model/query/QueryResult.java
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-reasoner/src/main/java/org/apache/marmotta/kiwi/reasoner/model/query/QueryResult.java b/libraries/kiwi/kiwi-reasoner/src/main/java/org/apache/marmotta/kiwi/reasoner/model/query/QueryResult.java
index 94e73ed..5dbf0af 100644
--- a/libraries/kiwi/kiwi-reasoner/src/main/java/org/apache/marmotta/kiwi/reasoner/model/query/QueryResult.java
+++ b/libraries/kiwi/kiwi-reasoner/src/main/java/org/apache/marmotta/kiwi/reasoner/model/query/QueryResult.java
@@ -17,6 +17,7 @@
  */
 package org.apache.marmotta.kiwi.reasoner.model.query;
 
+import org.apache.marmotta.commons.sesame.model.StatementCommons;
 import org.apache.marmotta.kiwi.model.rdf.KiWiNode;
 import org.apache.marmotta.kiwi.model.rdf.KiWiTriple;
 import org.apache.marmotta.kiwi.reasoner.model.program.VariableField;
@@ -27,7 +28,7 @@ import java.util.Map;
 import java.util.Set;
 
 /**
- * Add file description here!
+ * Represent the result of a pattern query of a rule body against the triple store.
  * <p/>
  * User: sschaffe
  */
@@ -39,7 +40,7 @@ public class QueryResult {
 
     public QueryResult() {
         bindings       = new HashMap<VariableField, KiWiNode>();
-        justifications = new HashSet<KiWiTriple>();
+        justifications = StatementCommons.newQuadrupleSet();
     }
 
     public QueryResult(Map<VariableField, KiWiNode> bindings, Set<KiWiTriple> justifications) {
@@ -51,15 +52,8 @@ public class QueryResult {
         return bindings;
     }
 
-    public void setBindings(Map<VariableField, KiWiNode> bindings) {
-        this.bindings = bindings;
-    }
-
     public Set<KiWiTriple> getJustifications() {
         return justifications;
     }
 
-    public void setJustifications(Set<KiWiTriple> justifications) {
-        this.justifications = justifications;
-    }
 }

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/kiwi/kiwi-reasoner/src/main/java/org/apache/marmotta/kiwi/reasoner/parser/KWRLProgramParserBase.java
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-reasoner/src/main/java/org/apache/marmotta/kiwi/reasoner/parser/KWRLProgramParserBase.java b/libraries/kiwi/kiwi-reasoner/src/main/java/org/apache/marmotta/kiwi/reasoner/parser/KWRLProgramParserBase.java
index 550da32..0074b4c 100644
--- a/libraries/kiwi/kiwi-reasoner/src/main/java/org/apache/marmotta/kiwi/reasoner/parser/KWRLProgramParserBase.java
+++ b/libraries/kiwi/kiwi-reasoner/src/main/java/org/apache/marmotta/kiwi/reasoner/parser/KWRLProgramParserBase.java
@@ -128,14 +128,13 @@ public abstract class KWRLProgramParserBase {
         return valueFactory.createURI(uri);
     }
 
-
     protected Literal resolveLiteral(Object content, Locale loc, String typeUri) {
         if(typeUri != null) {
             return valueFactory.createLiteral(content.toString(),valueFactory.createURI(typeUri));
         } else if(loc != null) {
             return valueFactory.createLiteral(content.toString(), loc.getLanguage());
         } else {
-            return valueFactory.createLiteral(content);
+            return valueFactory.createLiteral(content.toString());
         }
     }
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/kiwi/kiwi-reasoner/src/main/java/org/apache/marmotta/kiwi/reasoner/util/JustificationUtils.java
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-reasoner/src/main/java/org/apache/marmotta/kiwi/reasoner/util/JustificationUtils.java b/libraries/kiwi/kiwi-reasoner/src/main/java/org/apache/marmotta/kiwi/reasoner/util/JustificationUtils.java
new file mode 100644
index 0000000..8503816
--- /dev/null
+++ b/libraries/kiwi/kiwi-reasoner/src/main/java/org/apache/marmotta/kiwi/reasoner/util/JustificationUtils.java
@@ -0,0 +1,26 @@
+/*
+ * 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.kiwi.reasoner.util;
+
+/**
+ * Add file description here!
+ *
+ * @author Sebastian Schaffert (sschaffert@apache.org)
+ */
+public class JustificationUtils {
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/kiwi/kiwi-reasoner/src/main/resources/org/apache/marmotta/kiwi/persistence/mysql/statements.properties
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-reasoner/src/main/resources/org/apache/marmotta/kiwi/persistence/mysql/statements.properties b/libraries/kiwi/kiwi-reasoner/src/main/resources/org/apache/marmotta/kiwi/persistence/mysql/statements.properties
index 68e60f8..499b934 100644
--- a/libraries/kiwi/kiwi-reasoner/src/main/resources/org/apache/marmotta/kiwi/persistence/mysql/statements.properties
+++ b/libraries/kiwi/kiwi-reasoner/src/main/resources/org/apache/marmotta/kiwi/persistence/mysql/statements.properties
@@ -19,12 +19,15 @@
 # get sequence numbers
 seq.rules.prep         = UPDATE seq_rules SET id=LAST_INSERT_ID(id+1);
 seq.rules              = SELECT LAST_INSERT_ID();
+seq.rules.set          = UPDATE seq_rules SET id=?;
 
 seq.programs.prep      = UPDATE seq_programs SET id=LAST_INSERT_ID(id+1);
 seq.programs           = SELECT LAST_INSERT_ID();
+seq.programs.set       = UPDATE seq_programs SET id=?;
 
 seq.justifications.prep= UPDATE seq_justifications SET id=LAST_INSERT_ID(id+1);
 seq.justifications     = SELECT LAST_INSERT_ID();
+seq.justifications.set = UPDATE seq_justifications SET id=?;
 
 
 # rules

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/kiwi/kiwi-reasoner/src/main/resources/org/apache/marmotta/kiwi/persistence/pgsql/statements.properties
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-reasoner/src/main/resources/org/apache/marmotta/kiwi/persistence/pgsql/statements.properties b/libraries/kiwi/kiwi-reasoner/src/main/resources/org/apache/marmotta/kiwi/persistence/pgsql/statements.properties
index 2d7d788..2f3fa5c 100644
--- a/libraries/kiwi/kiwi-reasoner/src/main/resources/org/apache/marmotta/kiwi/persistence/pgsql/statements.properties
+++ b/libraries/kiwi/kiwi-reasoner/src/main/resources/org/apache/marmotta/kiwi/persistence/pgsql/statements.properties
@@ -18,8 +18,11 @@
 
 # get sequence numbers
 seq.rules             = SELECT nextval('seq_rules')
+seq.rules.set         = SELECT setval('seq_rules',?);
 seq.programs          = SELECT nextval('seq_programs')
+seq.programs.set      = SELECT setval('seq_programs',?);
 seq.justifications    = SELECT nextval('seq_justifications')
+seq.justifications.set= SELECT setval('seq_justifications',?);
 
 # rules
 rules.insert          = INSERT INTO reasoner_rules (id,name,description,body,createdAt) VALUES (?,?,?,?,now())

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/kiwi/kiwi-reasoner/src/test/java/org/apache/marmotta/kiwi/reasoner/test/engine/JustificationResolutionTest.java
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-reasoner/src/test/java/org/apache/marmotta/kiwi/reasoner/test/engine/JustificationResolutionTest.java b/libraries/kiwi/kiwi-reasoner/src/test/java/org/apache/marmotta/kiwi/reasoner/test/engine/JustificationResolutionTest.java
new file mode 100644
index 0000000..3f1aa48
--- /dev/null
+++ b/libraries/kiwi/kiwi-reasoner/src/test/java/org/apache/marmotta/kiwi/reasoner/test/engine/JustificationResolutionTest.java
@@ -0,0 +1,316 @@
+/*
+ * 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.kiwi.reasoner.test.engine;
+
+import com.google.common.collect.Sets;
+import info.aduna.iteration.Iterations;
+import org.apache.commons.lang3.RandomStringUtils;
+import org.apache.marmotta.commons.sesame.model.Namespaces;
+import org.apache.marmotta.commons.sesame.model.StatementCommons;
+import org.apache.marmotta.kiwi.model.rdf.*;
+import org.apache.marmotta.kiwi.reasoner.engine.ReasoningEngine;
+import org.apache.marmotta.kiwi.reasoner.model.exception.ReasoningException;
+import org.apache.marmotta.kiwi.reasoner.model.program.Justification;
+import org.apache.marmotta.kiwi.reasoner.model.program.Rule;
+import org.apache.marmotta.kiwi.reasoner.persistence.KiWiReasoningConnection;
+import org.hamcrest.Matcher;
+import org.hamcrest.Matchers;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+import org.openrdf.model.Statement;
+
+import java.sql.SQLException;
+import java.util.*;
+
+import static org.hamcrest.Matchers.*;
+
+/**
+ * Test if the ReasoningEngine's way of resolving base justifications works. Mocks the lookup for base justifications.
+ *
+ * @author Sebastian Schaffert (sschaffert@apache.org)
+ */
+public class JustificationResolutionTest {
+
+    private MockReasoningEngine engine;
+
+    private Map<Statement,Set<Justification>> baseJustifications;
+
+
+    protected static Random rnd = new Random();
+
+
+    private KiWiTriple t1, t2, t3, t4, t5; // base
+    private KiWiTriple i1, i2, i3, i4, i5, i6; // inferred
+    private Justification j1, j2, j3, j4, j5, tj1, tj2, tj3;
+    private Rule r1, r2;
+
+    private KiWiUriResource ctx_inferred;
+
+    @Before
+    public void setup() {
+        engine = new MockReasoningEngine();
+
+        baseJustifications = StatementCommons.newQuadrupleMap();
+
+
+        KiWiUriResource s1 = randomURI();
+        KiWiUriResource s2 = randomURI();
+        KiWiUriResource s3 = randomURI();
+        KiWiUriResource s4 = randomURI();
+        KiWiUriResource p1 = randomURI();
+        KiWiUriResource p2 = randomURI();
+        KiWiNode o1 = randomObject();
+        KiWiNode o2 = randomObject();
+        KiWiNode o3 = randomObject();
+        KiWiNode o4 = randomObject();
+
+        ctx_inferred = randomURI();
+
+        t1 = new KiWiTriple(s1,p1,o1, null);
+        t2 = new KiWiTriple(s1,p1,o2, null);
+        t3 = new KiWiTriple(s2,p1,o3, null);
+        t4 = new KiWiTriple(s1,p1,o1, randomURI());
+        t5 = new KiWiTriple(s3,p1,o1, randomURI());
+
+
+        i1 = new KiWiTriple(s1,p2,o1, ctx_inferred); i1.setInferred(true);
+        i2 = new KiWiTriple(s1,p1,o2, ctx_inferred); i2.setInferred(true);
+        i3 = new KiWiTriple(s3,p1,o3, ctx_inferred); i3.setInferred(true);
+        i4 = new KiWiTriple(s1,p2,o1, ctx_inferred); i4.setInferred(true);
+        i5 = new KiWiTriple(s1,p2,o3, ctx_inferred); i5.setInferred(true);
+
+        // assume i1 is justified by t1 and t2;
+        j1 = new Justification();
+        j1.setTriple(i1);
+        j1.getSupportingTriples().add(t1);
+        j1.getSupportingTriples().add(t2);
+
+        baseJustifications.put(i1, Collections.singleton(j1));
+
+        // assume i2 is justified by t3 and t4, as well as by t2 and t4
+        j2 = new Justification();
+        j2.setTriple(i2);
+        j2.getSupportingTriples().add(t3);
+        j2.getSupportingTriples().add(t4);
+
+
+        j3 = new Justification();
+        j3.setTriple(i2);
+        j3.getSupportingTriples().add(t2);
+        j3.getSupportingTriples().add(t4);
+
+        baseJustifications.put(i2, Sets.newHashSet(j2,j3));
+
+        // assume that i5 as well is justified by two justifications
+        j4 = new Justification();
+        j4.setTriple(i5);
+        j4.getSupportingTriples().add(t1);
+        j4.getSupportingTriples().add(t4);
+
+
+        j5 = new Justification();
+        j5.setTriple(i5);
+        j5.getSupportingTriples().add(t2);
+        j5.getSupportingTriples().add(t5);
+
+
+        baseJustifications.put(i5, Sets.newHashSet(j4,j5));
+
+        // i3 justified by i1 and t3
+        tj1 = new Justification();
+        tj1.setTriple(i3);
+        tj1.getSupportingTriples().add(i1);
+        tj1.getSupportingTriples().add(t3);
+
+
+        // i4 justified by i1 and i2
+        tj2 = new Justification();
+        tj2.setTriple(i4);
+        tj2.getSupportingTriples().add(i1);
+        tj2.getSupportingTriples().add(i2);
+
+
+        // i6 is justified by i2 and i5 (so multiplexing needed)
+        tj3 = new Justification();
+        tj3.setTriple(i6);
+        tj3.getSupportingTriples().add(i2);
+        tj3.getSupportingTriples().add(i5);
+
+    }
+
+    /**
+     * Test substitution of a single inferred triple supporting the triple by a single justification, so
+     * the number of new justifications will be the same as before, but the new justification will only
+     * contain base triples.
+     *
+     * @throws Exception
+     */
+    @Test
+    public void testResolveBaseTriplesSingle() throws Exception {
+
+        Collection<Justification> r1 = engine.getBaseJustifications(null,Collections.singleton(tj1));
+        Assert.assertEquals(1, r1.size());
+
+        Justification tj1r = r1.iterator().next();
+        Assert.assertEquals(3,tj1r.getSupportingTriples().size());
+        Assert.assertTrue(tj1r.getSupportingTriples().contains(t1));
+        Assert.assertTrue(tj1r.getSupportingTriples().contains(t2));
+        Assert.assertTrue(tj1r.getSupportingTriples().contains(t3));
+
+
+
+    }
+
+    /**
+     * Test the substitution of an inferred triple that has several justifications itself; in this case the
+     * result will be split according to the number of justifications of the inferred triple
+     * @throws Exception
+     */
+    @Test
+    public void testResolveBaseTriplesMulti() throws Exception {
+        Collection<Justification> r2 = engine.getBaseJustifications(null,Collections.singleton(tj2));
+
+        // since i2 is justified by two justifications, the result for i4 also needs to have two
+        Assert.assertEquals(2, r2.size());
+
+        Assert.assertThat(r2,Matchers.<Justification>hasItem(hasProperty("supportingTriples", hasItems(t1,t2,t3,t4))));
+        Assert.assertThat(r2,Matchers.<Justification>hasItem(hasProperty("supportingTriples", hasItems(t1,t2,t4))));
+    }
+
+    /**
+     * Test the substitution of more than one justification, the result should include the new base justificatoins for
+     * all justifications in the set
+     * @throws Exception
+     */
+    @Test
+    public void testResolveBaseTriplesSet() throws Exception {
+        Collection<Justification> r3 = engine.getBaseJustifications(null,Sets.newHashSet(tj1, tj2));
+
+        // since i2 is justified by two justifications, the result for i4 also needs to have two
+        Assert.assertEquals(3, r3.size());
+
+        Assert.assertThat(r3,Matchers.<Justification>hasItem(allOf(hasProperty("triple", is(i3)),hasProperty("supportingTriples", hasItems(t1, t2, t3)))));
+        Assert.assertThat(r3,Matchers.<Justification>hasItem(allOf(hasProperty("triple", is(i4)),hasProperty("supportingTriples", hasItems(t1, t2, t3, t4)))));
+        Assert.assertThat(r3,Matchers.<Justification>hasItem(allOf(hasProperty("triple", is(i4)),hasProperty("supportingTriples", hasItems(t1,t2,t4)))));
+    }
+
+    /**
+     * Test the substitution of several inferred triple that have several justifications itself; the result needs to be
+     * multiplexed.
+     * @throws Exception
+     */
+    @Test
+    public void testResolveBaseTriplesMultiplex() throws Exception {
+        Collection<Justification> r4 = engine.getBaseJustifications(null,Collections.singleton(tj3));
+
+        // since i2 is justified by two justifications, the result for i4 also needs to have two
+        Assert.assertEquals(4, r4.size());
+
+        Assert.assertThat(r4,Matchers.<Justification>hasItem(hasProperty("supportingTriples", hasItems(t1,t3,t4))));
+        Assert.assertThat(r4,Matchers.<Justification>hasItem(hasProperty("supportingTriples", hasItems(t2,t3,t4,t5))));
+        Assert.assertThat(r4,Matchers.<Justification>hasItem(hasProperty("supportingTriples", hasItems(t1, t2, t4))));
+        Assert.assertThat(r4,Matchers.<Justification>hasItem(hasProperty("supportingTriples", allOf(hasItems(t2, t4, t5), not(hasItem(t3))))));
+    }
+
+
+    // TODO: a test taking into account transaction justifications
+
+    /**
+     * Test resolution against justifications that are not yet "persisted" but are taken from the current transaction
+     * @throws Exception
+     */
+    @Test
+    public void testTransactionJustifications() throws Exception {
+
+    }
+
+
+    /**
+     * Return a random URI, with a 10% chance of returning a URI that has already been used.
+     * @return
+     */
+    protected KiWiUriResource randomURI() {
+        KiWiUriResource resource = new KiWiUriResource("http://localhost/" + RandomStringUtils.randomAlphanumeric(8));
+        return resource;
+    }
+
+    /**
+     * Return a random RDF value, either a reused object (10% chance) or of any other kind.
+     * @return
+     */
+    protected KiWiNode randomObject() {
+        KiWiNode object;
+        switch(rnd.nextInt(6)) {
+            case 0: object = new KiWiUriResource("http://localhost/" + RandomStringUtils.randomAlphanumeric(8));
+                break;
+            case 1: object = new KiWiAnonResource(RandomStringUtils.randomAscii(8));
+                break;
+            case 2: object = new KiWiStringLiteral(RandomStringUtils.randomAscii(40));
+                break;
+            case 3: object = new KiWiIntLiteral(rnd.nextLong(), new KiWiUriResource(Namespaces.NS_XSD + "integer"));
+                break;
+            case 4: object = new KiWiDoubleLiteral(rnd.nextDouble(), new KiWiUriResource(Namespaces.NS_XSD + "double"));
+                break;
+            case 5: object = new KiWiBooleanLiteral(rnd.nextBoolean(), new KiWiUriResource(Namespaces.NS_XSD + "boolean"));
+                break;
+            default: object = new KiWiUriResource("http://localhost/" + RandomStringUtils.randomAlphanumeric(8));
+                break;
+
+        }
+        return object;
+    }
+
+
+
+    private class MockReasoningEngine extends ReasoningEngine {
+        private MockReasoningEngine() {
+        }
+
+
+        /**
+         * Return the justifications for the triple passed as argument.
+         *
+         * @param t
+         * @return
+         */
+        @Override
+        protected Collection<Justification> getJustifications(KiWiReasoningConnection connection, KiWiTriple t, Set<Justification> transactionJustifications) throws SQLException {
+            HashSet<Justification> justifications = new HashSet<Justification>();
+            justifications.addAll(baseJustifications.get(t));
+            for(Justification j : transactionJustifications) {
+                if(equivalence.equivalent(j.getTriple(), t)) {
+                    justifications.add(j);
+                }
+            }
+            return justifications;
+        }
+
+        /**
+         * For all justifications contained in the set passed as argument, create corresponding base justifications,
+         * i.e. justifications that only contain base triples and no inferred triples.
+         *
+         * @param justifications
+         * @return
+         */
+        @Override
+        public Set<Justification> getBaseJustifications(KiWiReasoningConnection connection, Set<Justification> justifications) throws SQLException, ReasoningException {
+            return super.getBaseJustifications(connection, justifications);
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/kiwi/kiwi-reasoner/src/test/java/org/apache/marmotta/kiwi/reasoner/test/engine/ReasoningEngineTest.java
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-reasoner/src/test/java/org/apache/marmotta/kiwi/reasoner/test/engine/ReasoningEngineTest.java b/libraries/kiwi/kiwi-reasoner/src/test/java/org/apache/marmotta/kiwi/reasoner/test/engine/ReasoningEngineTest.java
index af6bc81..fb2c497 100644
--- a/libraries/kiwi/kiwi-reasoner/src/test/java/org/apache/marmotta/kiwi/reasoner/test/engine/ReasoningEngineTest.java
+++ b/libraries/kiwi/kiwi-reasoner/src/test/java/org/apache/marmotta/kiwi/reasoner/test/engine/ReasoningEngineTest.java
@@ -17,13 +17,18 @@
  */
 package org.apache.marmotta.kiwi.reasoner.test.engine;
 
+import static org.hamcrest.Matchers.hasItem;
+import static org.junit.Assert.fail;
+import info.aduna.iteration.CloseableIteration;
 import info.aduna.iteration.Iterations;
+
+import java.sql.SQLException;
+import java.util.Iterator;
+import java.util.List;
+
+import org.apache.marmotta.kiwi.config.KiWiConfiguration;
 import org.apache.marmotta.kiwi.model.rdf.KiWiTriple;
-import org.apache.marmotta.kiwi.persistence.KiWiDialect;
 import org.apache.marmotta.kiwi.persistence.KiWiPersistence;
-import org.apache.marmotta.kiwi.persistence.h2.H2Dialect;
-import org.apache.marmotta.kiwi.persistence.mysql.MySQLDialect;
-import org.apache.marmotta.kiwi.persistence.pgsql.PostgreSQLDialect;
 import org.apache.marmotta.kiwi.reasoner.engine.ReasoningConfiguration;
 import org.apache.marmotta.kiwi.reasoner.engine.ReasoningEngine;
 import org.apache.marmotta.kiwi.reasoner.model.program.Justification;
@@ -34,7 +39,7 @@ import org.apache.marmotta.kiwi.reasoner.parser.KWRLProgramParserBase;
 import org.apache.marmotta.kiwi.reasoner.persistence.KiWiReasoningConnection;
 import org.apache.marmotta.kiwi.reasoner.persistence.KiWiReasoningPersistence;
 import org.apache.marmotta.kiwi.sail.KiWiStore;
-import org.apache.marmotta.kiwi.test.helper.DBConnectionChecker;
+import org.apache.marmotta.kiwi.test.junit.KiWiDatabaseRunner;
 import org.apache.marmotta.kiwi.transactions.api.TransactionalSail;
 import org.apache.marmotta.kiwi.transactions.model.TransactionData;
 import org.apache.marmotta.kiwi.transactions.sail.KiWiTransactionalSail;
@@ -45,99 +50,34 @@ import org.junit.Test;
 import org.junit.rules.TestWatcher;
 import org.junit.runner.Description;
 import org.junit.runner.RunWith;
-import org.junit.runners.Parameterized;
 import org.openrdf.model.Resource;
 import org.openrdf.model.Statement;
 import org.openrdf.model.URI;
 import org.openrdf.repository.Repository;
 import org.openrdf.repository.RepositoryConnection;
+import org.openrdf.repository.RepositoryResult;
 import org.openrdf.repository.sail.SailRepository;
 import org.openrdf.rio.RDFFormat;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import static org.hamcrest.Matchers.hasItem;
-
 /**
  * This test verifies the functionality of the KiWi Reasonong Engine. Based on a small sample program, it will test
  * both incremental reasoning (by manually adding triples) and full reasoning. After reasoning completes, it will
  * check if the expected inferred triples as well as their justifications are present.
- * <p/>
- * It will try running over all available databases. Except for in-memory databases like H2 or Derby, database
- * URLs must be passed as system property, or otherwise the test is skipped for this database. Available system properties:
- * <ul>
- *     <li>PostgreSQL:
- *     <ul>
- *         <li>postgresql.url, e.g. jdbc:postgresql://localhost:5433/kiwitest?prepareThreshold=3</li>
- *         <li>postgresql.user (default: lmf)</li>
- *         <li>postgresql.pass (default: lmf)</li>
- *     </ul>
- *     </li>
- *     <li>MySQL:
- *     <ul>
- *         <li>mysql.url, e.g. jdbc:mysql://localhost:3306/kiwitest?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull</li>
- *         <li>mysql.user (default: lmf)</li>
- *         <li>mysql.pass (default: lmf</li>
- *     </ul>
- *     </li>
- *     <li>H2:
- *     <ul>
- *         <li>h2.url, e.g. jdbc:h2:mem;MVCC=true;DB_CLOSE_ON_EXIT=FALSE;DB_CLOSE_DELAY=10</li>
- *         <li>h2.user (default: lmf)</li>
- *         <li>h2.pass (default: lmf</li>
- *     </ul>
- *     </li>
- * </ul>
  *
  * @see org.apache.marmotta.kiwi.persistence.KiWiConnection
  * @see org.apache.marmotta.kiwi.persistence.KiWiPersistence
- * <p/>
- * Author: Sebastian Schaffert
+ * @author Sebastian Schaffert (sschaffert@apache.org)
  */
-@RunWith(Parameterized.class)
+@RunWith(KiWiDatabaseRunner.class)
 public class ReasoningEngineTest {
 
     private static Logger log = LoggerFactory.getLogger(ReasoningEngineTest.class);
 
     private static final String NS = "http://localhost/resource/";
 
-    /**
-     * Return database configurations if the appropriate parameters have been set.
-     *
-     * @return an array (database name, url, user, password)
-     */
-    @Parameterized.Parameters(name="Database Test {index}: {0} at {1}")
-    public static Iterable<Object[]> databases() {
-        String[] databases = {"H2", "PostgreSQL", "MySQL"};
-
-        List<Object[]> result = new ArrayList<Object[]>(databases.length);
-        for(String database : databases) {
-            if(System.getProperty(database.toLowerCase()+".url") != null) {
-                result.add(new Object[] {
-                        database,
-                        System.getProperty(database.toLowerCase()+".url"),
-                        System.getProperty(database.toLowerCase()+".user","lmf"),
-                        System.getProperty(database.toLowerCase()+".pass","lmf")
-                });
-            }
-        }
-        return result;
-    }
-
-
-    private KiWiDialect dialect;
-
-    private String jdbcUrl;
-
-    private String jdbcUser;
-
-    private String jdbcPass;
-
-    private KiWiStore store;
+     private KiWiStore store;
     private TransactionalSail tsail;
     private KiWiPersistence persistence;
     private KiWiReasoningPersistence rpersistence;
@@ -145,36 +85,23 @@ public class ReasoningEngineTest {
 
     private Repository repository;
 
+    private final KiWiConfiguration config;
 
-    public ReasoningEngineTest(String database, String jdbcUrl, String jdbcUser, String jdbcPass) {
-        this.jdbcPass = jdbcPass;
-        this.jdbcUrl = jdbcUrl;
-        this.jdbcUser = jdbcUser;
-
-        if("H2".equals(database)) {
-            this.dialect = new H2Dialect();
-        } else if("MySQL".equals(database)) {
-            this.dialect = new MySQLDialect();
-        } else if("PostgreSQL".equals(database)) {
-            this.dialect = new PostgreSQLDialect();
-        }
 
-        DBConnectionChecker.checkDatabaseAvailability(jdbcUrl, jdbcUser, jdbcPass, dialect);
+    public ReasoningEngineTest(KiWiConfiguration config) {
+        this.config = config;
     }
 
 
     @Before
     public void initDatabase() throws Exception {
-
-        persistence = new KiWiPersistence("test",jdbcUrl,jdbcUser,jdbcPass,dialect);
-        persistence.initDatabase();
-
-
-        store      = new KiWiStore("test",jdbcUrl,jdbcUser,jdbcPass,dialect, "http://localhost/context/default", "http://localhost/context/inferred");
+        store      = new KiWiStore(config);
         tsail      = new KiWiTransactionalSail(store);
         repository = new SailRepository(tsail);
         repository.initialize();
 
+        persistence = store.getPersistence();
+
         rpersistence = new KiWiReasoningPersistence(persistence, repository.getValueFactory());
         rpersistence.initDatabase();
 
@@ -202,26 +129,14 @@ public class ReasoningEngineTest {
 
     @After
     public void dropDatabase() throws Exception {
-        engine.shutdown();
+        engine.shutdown(true);
 
         rpersistence.dropDatabase();
-
         persistence.dropDatabase();
-        persistence.shutdown();
 
         repository.shutDown();
     }
 
-    @org.junit.Rule
-    public TestWatcher watchman = new TestWatcher() {
-        /**
-         * Invoked when a test is about to start
-         */
-        @Override
-        protected void starting(Description description) {
-            log.info("{} being run...", description.getMethodName());
-        }
-    };
 
     /**
      * Test the reasoning engine by incrementally adding and later removing triples through explicit calls to the
@@ -411,6 +326,9 @@ public class ReasoningEngineTest {
                 log.debug("sleeping for 100ms to let engine finish processing ... ");
                 Thread.sleep(100);
             }
+
+            log.debug("reasoning finished, running tests");
+
             con.begin();
 
             List<Statement> inferred4 = Iterations.asList(con.getStatements(a,property,d, true));
@@ -469,6 +387,26 @@ public class ReasoningEngineTest {
             Assert.assertTrue("expected inferred triple not found", con.hasStatement(b,t,d,true));
             Assert.assertTrue("expected inferred triple not found", con.hasStatement(b,s,a,true));
 
+
+            // we also expect that there are justifications for all inferred triples
+            Resource[][] patterns = new Resource[][] {
+                    new Resource[] { a, t, c },
+                    new Resource[] { b, t, d },
+                    new Resource[] { b, s, a }
+            };
+
+
+            RepositoryResult<Statement> result = con.getStatements(null,null,null,true, con.getValueFactory().createURI(store.getInferredContext()));
+            if(result.hasNext()) {
+                while (result.hasNext()) {
+                    Statement stmt1 = result.next();
+
+                    CloseableIteration<Justification, SQLException> justs1 = rcon.listJustificationsForTriple((KiWiTriple) stmt1);
+                    Assert.assertTrue(justs1.hasNext());
+                }
+            } else {
+                fail("no inferred statements found");
+            }
             con.commit();
         } finally {
             con.close();

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/kiwi/kiwi-reasoner/src/test/java/org/apache/marmotta/kiwi/reasoner/test/model/JustificationTest.java
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-reasoner/src/test/java/org/apache/marmotta/kiwi/reasoner/test/model/JustificationTest.java b/libraries/kiwi/kiwi-reasoner/src/test/java/org/apache/marmotta/kiwi/reasoner/test/model/JustificationTest.java
new file mode 100644
index 0000000..f3a1cb7
--- /dev/null
+++ b/libraries/kiwi/kiwi-reasoner/src/test/java/org/apache/marmotta/kiwi/reasoner/test/model/JustificationTest.java
@@ -0,0 +1,196 @@
+/*
+ * 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.kiwi.reasoner.test.model;
+
+import org.apache.commons.lang3.RandomStringUtils;
+import org.apache.marmotta.commons.sesame.model.Namespaces;
+import org.apache.marmotta.kiwi.model.rdf.*;
+import org.apache.marmotta.kiwi.reasoner.model.program.Justification;
+import org.apache.marmotta.kiwi.reasoner.model.program.Rule;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+import org.openrdf.model.URI;
+import org.openrdf.model.Value;
+
+import java.util.*;
+
+/**
+ * Test critical functionality of justification objects, primarily equals and similar
+ *
+ * @author Sebastian Schaffert (sschaffert@apache.org)
+ */
+public class JustificationTest {
+
+    protected static Random rnd = new Random();
+
+
+    private KiWiTriple t1, t2, t3, t4; // base
+    private KiWiTriple i1, i2, i3, i4; // inferred
+    private Rule r1, r2;
+
+    private KiWiUriResource ctx_inferred;
+
+    @Before
+    public void setup() {
+        KiWiUriResource s1 = randomURI();
+        KiWiUriResource s2 = randomURI();
+        KiWiUriResource s3 = randomURI();
+        KiWiUriResource s4 = randomURI();
+        KiWiUriResource p1 = randomURI();
+        KiWiUriResource p2 = randomURI();
+        KiWiNode o1 = randomObject();
+        KiWiNode o2 = randomObject();
+        KiWiNode o3 = randomObject();
+        KiWiNode o4 = randomObject();
+
+        ctx_inferred = randomURI();
+
+        t1 = new KiWiTriple(s1,p1,o1, null);
+        t2 = new KiWiTriple(s1,p1,o2, null);
+        t3 = new KiWiTriple(s2,p1,o3, null);
+        t4 = new KiWiTriple(s1,p1,o1, randomURI());
+
+
+        i1 = new KiWiTriple(s1,p2,o1, ctx_inferred); i1.setInferred(true);
+        i2 = new KiWiTriple(s1,p1,o2, ctx_inferred); i2.setInferred(true);
+        i3 = new KiWiTriple(s3,p1,o3, ctx_inferred); i3.setInferred(true);
+        i4 = new KiWiTriple(s1,p2,o1, ctx_inferred); i4.setInferred(true);
+
+
+    }
+
+
+    @Test
+    public void testJustificationEquals() {
+        Justification j1 = new Justification();
+        j1.setTriple(i1);
+        j1.getSupportingTriples().add(t1);
+        j1.getSupportingTriples().add(t4);
+
+        Justification j2 = new Justification();
+        j2.setTriple(i4);
+        j2.getSupportingTriples().add(t4);
+        j2.getSupportingTriples().add(t1);
+
+        Assert.assertEquals(j1,j2);
+
+        // j3 differs in the inferred triple
+        Justification j3 = new Justification();
+        j3.setTriple(i2);
+        j3.getSupportingTriples().add(t4);
+        j3.getSupportingTriples().add(t1);
+
+        Assert.assertNotEquals(j1, j3);
+
+        // j4 differs in the supporting triples
+        Justification j4 = new Justification();
+        j4.setTriple(i1);
+        j4.getSupportingTriples().add(t2);
+        j4.getSupportingTriples().add(t4);
+
+        Assert.assertNotEquals(j1, j4);
+    }
+
+
+    @Test
+    public void testJustificationSet() {
+        Set<Justification> set = new HashSet<>();
+
+        Justification j1 = new Justification();
+        j1.setTriple(i1);
+        j1.getSupportingTriples().add(t1);
+        j1.getSupportingTriples().add(t4);
+        set.add(j1);
+
+        Justification j2 = new Justification();
+        j2.setTriple(i4);
+        j2.getSupportingTriples().add(t4);
+        j2.getSupportingTriples().add(t1);
+
+        Assert.assertTrue(set.contains(j2));
+
+        set.add(j2);
+
+        Assert.assertEquals(1, set.size());
+
+
+        // j3 differs in the inferred triple
+        Justification j3 = new Justification();
+        j3.setTriple(i2);
+        j3.getSupportingTriples().add(t4);
+        j3.getSupportingTriples().add(t1);
+
+        Assert.assertFalse(set.contains(j3));
+
+        set.add(j3);
+
+        Assert.assertEquals(2, set.size());
+
+
+        // j4 differs in the supporting triples
+        Justification j4 = new Justification();
+        j4.setTriple(i1);
+        j4.getSupportingTriples().add(t2);
+        j4.getSupportingTriples().add(t4);
+
+        Assert.assertFalse(set.contains(j4));
+
+        set.add(j4);
+
+        Assert.assertEquals(3, set.size());
+    }
+
+
+
+    /**
+     * Return a random URI, with a 10% chance of returning a URI that has already been used.
+     * @return
+     */
+    protected KiWiUriResource randomURI() {
+        KiWiUriResource resource = new KiWiUriResource("http://localhost/" + RandomStringUtils.randomAlphanumeric(8));
+        return resource;
+    }
+
+    /**
+     * Return a random RDF value, either a reused object (10% chance) or of any other kind.
+     * @return
+     */
+    protected KiWiNode randomObject() {
+        KiWiNode object;
+        switch(rnd.nextInt(6)) {
+            case 0: object = new KiWiUriResource("http://localhost/" + RandomStringUtils.randomAlphanumeric(8));
+                break;
+            case 1: object = new KiWiAnonResource(RandomStringUtils.randomAscii(8));
+                break;
+            case 2: object = new KiWiStringLiteral(RandomStringUtils.randomAscii(40));
+                break;
+            case 3: object = new KiWiIntLiteral(rnd.nextLong(), new KiWiUriResource(Namespaces.NS_XSD + "integer"));
+                break;
+            case 4: object = new KiWiDoubleLiteral(rnd.nextDouble(), new KiWiUriResource(Namespaces.NS_XSD + "double"));
+                break;
+            case 5: object = new KiWiBooleanLiteral(rnd.nextBoolean(), new KiWiUriResource(Namespaces.NS_XSD + "boolean"));
+                break;
+            default: object = new KiWiUriResource("http://localhost/" + RandomStringUtils.randomAlphanumeric(8));
+                break;
+
+        }
+        return object;
+    }
+
+}


[029/100] [abbrv] [partial] Reverting the erroneous merge by Sebastian according to the instructions in INFRA-6876

Posted by wi...@apache.org.
http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/extras/webjars/sgvizler/src/main/resources/sgvizler.js
----------------------------------------------------------------------
diff --git a/extras/webjars/sgvizler/src/main/resources/sgvizler.js b/extras/webjars/sgvizler/src/main/resources/sgvizler.js
new file mode 100644
index 0000000..d512d65
--- /dev/null
+++ b/extras/webjars/sgvizler/src/main/resources/sgvizler.js
@@ -0,0 +1,1277 @@
+/*  Sgvizler JavaScript SPARQL result set visualizer, version 0.5.1
+ *  (c) 2011--2012 Martin G. Skjæveland
+ *
+ *  Sgvizler is freely distributable under the terms of an MIT-style license.
+ *  Sgvizler web site: https://code.google.com/p/sgvizler/
+ *--------------------------------------------------------------------------*/
+(function (global) {
+    "use strict";
+
+    /*global google, $, jQuery */
+    /*jslint browser: true */
+
+    var sgvizler = {
+
+        go: function (callback) {
+            google.load('visualization',
+                        '1.0',
+                        {'packages':
+                         ['annotatedtimeline',
+                          'corechart',
+                          'gauge',
+                          'geomap',
+                          'geochart',
+                          'imagesparkline',
+                          'map',
+                          'orgchart',
+                          'table',
+                          'motionchart',
+                          'treemap'
+                         ]
+                        }
+                       );
+
+            google.setOnLoadCallback(function () {
+                sgvizler.charts.loadCharts();
+                sgvizler.drawFormQuery();
+                sgvizler.drawContainerQueries();
+                callback();
+            });
+        },
+
+        drawFormQuery: function () {
+            var query = new sgvizler.query(sgvizler.ui.id.chartCon),
+                params = sgvizler.ui.getUrlParams();
+            $.extend(query,
+                     sgvizler.option.query,
+                     { query: params.query, chart: params.chart });
+
+            if (sgvizler.ui.isElement(query.container) && query.query) {
+                $.extend(query.chartOptions,
+                         { width: params.width, height: params.height });
+                query.draw();
+            }
+            sgvizler.ui.displayUI(query);
+        },
+
+        drawContainerQueries: function () {
+            $('[' + this.ui.attr.prefix + 'query]').each(function () {
+                var query = new sgvizler.query();
+                $.extend(query,
+                         sgvizler.option.query,
+                         sgvizler.ui.getQueryOptionAttr(this));
+                $.extend(query.chartOptions,
+                         sgvizler.ui.getChartOptionAttr(this));
+                query.draw();
+            });
+        },
+
+        // kept in separate files:
+        option: {},   // settings, global variables.
+        chart: {},    // the set of user-defined rendering functions.
+        charts: {},   // functions for handling rendering functions.
+        parser: {},   // SPARQL results XML/JSON parser.
+        ui: {}       // html get/set functions.
+    };
+
+    jQuery.ajaxSetup({
+        accepts: {
+            xml:  "application/sparql-results+xml",
+            json: "application/sparql-results+json"
+        }
+    });
+    sgvizler.option = {
+
+        home: (window.location.href).replace(window.location.search, ""),
+        homefolder: "",
+        libfolder: "/lib/",
+
+        stylepath:"",
+
+        //// Prefixes included in queries:
+        namespace: {
+            'rdf' : "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
+            'rdfs': "http://www.w3.org/2000/01/rdf-schema#",
+            'owl' : "http://www.w3.org/2002/07/owl#",
+            'xsd' : "http://www.w3.org/2001/XMLSchema#"
+        },
+
+        query: {}, // holds options set by user in html file.
+        chart: {}  // ditto.
+    };
+    sgvizler.ui = {
+
+        //// #id's to html elements:
+        id: {
+            script:       'sgvzlr_script',    // #id to the script tag for this file
+            chartCon:     'sgvzlr_gchart',    // #id to the container to hold the chart
+            queryForm:    'sgvzlr_formQuery', //
+            queryTxt:     'sgvzlr_cQuery',    // query text area.
+            formQuery:    'sgvzlr_strQuery',  // hidden query string. "trick" taken from snorql.
+            formWidth:    'sgvzlr_strWidth',  //
+            formHeight:   'sgvzlr_strHeight', //
+            formChart:    'sgvzlr_optChart',  //
+            prefixCon:    'sgvzlr_cPrefix',   // print prefixes
+            messageCon:   'sgvzlr_cMessage'  // print messages
+        },
+
+        attr: {
+            prefix:      'data-sgvizler-',
+            prefixChart: 'data-sgvizler-chart-options',
+
+            valueAssign: '=',
+            valueSplit:  '|'
+        },
+
+        params: [ 'query', 'chart', 'width', 'height' ], // permissible URL parameters.
+
+        displayUI: function (queryOpt) {
+            this.displayPrefixes();
+            this.displayChartTypesMenu();
+            this.displayUserInput(queryOpt);
+        },
+        displayPrefixes: function () {
+            this.setElementText(this.id.prefixCon, sgvizler.query.prototype.getPrefixes());
+        },
+        displayUserInput: function (queryOpt) {
+            this.setElementValue(this.id.queryTxt, queryOpt.query);
+            this.setElementValue(this.id.formChart, queryOpt.chart);
+            this.setElementValue(this.id.formWidth, queryOpt.chartOptions.width);
+            this.setElementValue(this.id.formHeight, queryOpt.chartOptions.height);
+        },
+        displayChartTypesMenu: function () {
+            var chart,
+                i;
+            if (this.isElement(this.id.formChart)) {
+                chart = sgvizler.charts.all;
+                for (i = 0; i < chart.length; i += 1) {
+                    $('#' + this.id.formChart)
+                        .append($('<option/>')
+                                .val(chart[i].id)
+                                .html(chart[i].id));
+                }
+            }
+        },
+
+        displayFeedback: function (queryOpt, messageName) {
+            var message,
+                container = queryOpt.container;
+            if (queryOpt.container === this.id.chartCon && this.isElement(this.id.messageCon)) {
+                container = this.id.messageCon;
+            }
+
+            if (queryOpt.loglevel === 0) {
+                message = "";
+            } else if (queryOpt.loglevel === 1) {
+                if (messageName === "LOADING") {
+                    message = "Loading...";
+                } else if (messageName === "ERROR_ENDPOINT" || messageName === "ERROR_UNKNOWN") {
+                    message = "Error.";
+                }
+            } else {
+                if (messageName === "LOADING") {
+                    message = "Sending query...";
+                } else if (messageName === "ERROR_ENDPOINT") {
+                    message = "Error querying endpoint. Possible errors:" +
+                        this.html.ul(
+                            this.html.a(queryOpt.endpoint, "SPARQL endpoint") + " down? " +
+                                this.html.a(queryOpt.endpoint + queryOpt.endpoint_query_url + queryOpt.encodedQuery,
+                                            "Check if query runs at the endpoint") + ".",
+                            "Malformed SPARQL query? " +
+                                this.html.a(queryOpt.validator_query_url + queryOpt.encodedQuery, "Check if it validates") + ".",
+                            "CORS supported and enabled? Read more about " +
+                                this.html.a("http://code.google.com/p/sgvizler/wiki/Compatibility", "CORS and compatibility") + ".",
+                            "Is your " + this.html.a("http://code.google.com/p/sgvizler/wiki/Compatibility", "browser support") + "ed?",
+                            "Hmm.. it might be a bug! Please file a report to " +
+                                this.html.a("http://code.google.com/p/sgvizler/issues/", "the issues") + "."
+                        );
+                } else if (messageName === "ERROR_UNKNOWN") {
+                    message = "Unknown error.";
+                } else if (messageName === "NO_RESULTS") {
+                    message = "Query returned no results.";
+                } else if (messageName === "DRAWING") {
+                    message = "Received " + queryOpt.noRows + " rows. Drawing chart...<br/>" +
+                        this.html.a(queryOpt.endpoint + queryOpt.endpoint_query_url + queryOpt.encodedQuery,
+                                    "View query results", "target='_blank'") + " (in new window).";
+                }
+            }
+            this.setElementHTML(container, this.html.tag("p", message));
+        },
+
+        setElementValue: function (elementID, value) {
+            if (this.isElement(elementID)) {
+                $('#' + elementID).val(value);
+            }
+        },
+        setElementText: function (elementID, value) {
+            if (this.isElement(elementID)) {
+                $('#' + elementID).text(value);
+            }
+        },
+        setElementHTML: function (elementID, value) {
+            if (this.isElement(elementID)) {
+                $('#' + elementID).html(value);
+            }
+        },
+        isElement: function (elementID) {
+            return $('#' + elementID).length > 0;
+        },
+
+        getQueryOptionAttr: function (element) {
+            var i,
+                queryOpt = {container: $(element).attr('id')},
+                attr = element.attributes;
+            for (i = 0; i < attr.length; i += 1) {
+                if (attr[i].name.lastIndexOf(this.attr.prefix, 0) === 0) { // starts-with attr.prefix.
+                    queryOpt[attr[i].name.substring(this.attr.prefix.length)] = attr[i].value;
+                }
+            }
+            return queryOpt;
+        },
+        getChartOptionAttr: function (element) {
+            var i,
+                options,
+                assignment,
+                path,
+                o,
+                j,
+                chartOpt = {},
+                attrValue = $(element).attr(sgvizler.ui.attr.prefixChart);
+            if (typeof attrValue !== 'undefined') {
+                options = attrValue.split(this.attr.valueSplit);
+                for (i = 0; i < options.length; i += 1) {
+                    assignment = options[i].split(this.attr.valueAssign);
+                    path = assignment[0].split(".");
+                    o = chartOpt;
+                    for (j = 0; j < path.length - 1; j += 1) {
+                        if (typeof o[path[j]] === 'undefined') {
+                            o[path[j]] = {};
+                        }
+                        o = o[path[j]];
+                    }
+                    o[path[j]] = assignment[1];
+                }
+            }
+            // get width and heigth from css. take only numbers.
+            chartOpt.width = /(\d+)/.exec($(element).css('width'))[1];
+            chartOpt.height = /(\d+)/.exec($(element).css('height'))[1];
+            return chartOpt;
+        },
+
+        getUrlParams: function () {
+            /*jslint regexp: true */
+            var urlParams = {},
+                e,
+                r = /([^&=]+)=?([^&]*)/g, // parameter, value pairs.
+                d = function (s) { return decodeURIComponent(s.replace(/\+/g, " ")); }, // replace '+' with space.
+                q = window.location.search.substring(1); // URL query string part.
+
+            while ((e = r.exec(q))) {
+                if (e[2].length > 0 && this.params.indexOf(e[1]) !== -1) {
+                    urlParams[d(e[1])] = d(e[2]);
+                }
+            }
+            return urlParams;
+        },
+
+        resetPage: function () {
+            document.location = sgvizler.home;
+        },
+        submitQuery: function () {
+            $('#' + this.id.formQuery).val($('#' + this.id.queryTxt).val());
+            $('#' + this.id.queryForm).submit();
+        },
+
+        html: {
+            a: function (href, link, attr) {
+                if (typeof attr === 'undefined') { attr = ""; }
+                if (typeof href !== 'undefined' && typeof link !== 'undefined') {
+                    return "<a " + attr + " href='" + href + "'>" + link + "</a>";
+                }
+            },
+            ul: function () {
+                var i,
+                    txt;
+                if (arguments.length) {
+                    txt = "<ul>";
+                    for (i = 0; i < arguments.length; i += 1) {
+                        txt += "<li>" + arguments[i] + "</li>";
+                    }
+                    return txt + "</ul>";
+                }
+            },
+            tag: function (tag, content) {
+                return "<" + tag + ">" + content + "</" + tag + ">";
+            }
+        }
+    };
+
+    sgvizler.parser = {
+
+        // variable notation: xtable, xcol(s), xrow(s) -- x is 's'(parql) or 'g'(oogle).
+
+        defaultGDatatype: 'string',
+
+        countRowsSparqlXML: function (sxml) {
+            return $(sxml).find('sparql').find('results').find('result').length;
+        },
+
+        countRowsSparqlJSON: function (stable) {
+            if (typeof stable.results.bindings !== 'undefined') {
+                return stable.results.bindings.length;
+            }
+        },
+
+        SparqlXML2GoogleJSON: function (sxml) {
+            var c,
+                r,
+                gcols = [],
+                grows = [],
+                gdatatype = [], // for easy reference of datatypes
+                sresults = $(sxml).find('sparql').find('results').find('result');
+
+            // gcols
+            c = 0;
+            $(sxml).find('sparql').find('head').find('variable').each(function () {
+                var stype = null,
+                    sdatatype = null,
+                    name = $(this).attr('name'),
+                    scell = null,
+                    scells = $(sresults).find('binding[name="' + name + '"]');
+                if (scells.length) {
+                    scell = $(scells).first().children().first()[0]; // uri, literal element
+                    stype = scell.nodeName;
+                    sdatatype = $(scell).attr('datatype');
+                }
+                gdatatype[c] = sgvizler.parser.getGoogleJsonDatatype(stype, sdatatype);
+                gcols[c] = {'id': name, 'label': name, 'type': gdatatype[c]};
+                c += 1;
+            });
+
+            // grows
+            r = 0;
+            $(sresults).each(function () {
+                var gvalue,
+                    scells,
+                    scell,
+                    stype,
+                    svalue,
+                    grow = [];
+                for (c = 0; c < gcols.length; c += 1) {
+                    gvalue = null;
+                    scells = $(this).find('binding[name="' + gcols[c].id + '"]');
+                    if (scells.length &&
+                            typeof $(scells).first().children().first() !== 'undefined' &&
+                            $(scells).first().children().first().firstChild !== null) {
+                        scell = $(scells).first().children().first()[0]; // uri, literal element
+                        stype = scell.nodeName;
+                        svalue = $(scell).first().text();
+                        gvalue = sgvizler.parser.getGoogleJsonValue(svalue, gdatatype[c], stype);
+                    }
+                    grow[c] = {'v': gvalue};
+                }
+                grows[r] = {'c': grow};
+                r += 1;
+            });
+            return {'cols': gcols, 'rows': grows};
+        },
+
+        SparqlJSON2GoogleJSON: function (stable) {
+            var c,
+                r,
+                srow,
+                grow,
+                gvalue,
+                stype,
+                sdatatype,
+                gcols = [],
+                grows = [],
+                gdatatype = [], // for easy reference of datatypes
+                scols = stable.head.vars,
+                srows = stable.results.bindings;
+
+            for (c = 0; c < scols.length; c += 1) {
+                r = 0;
+                stype = null;
+                sdatatype = null;
+                // find a row where there is a value for this column
+                while (typeof srows[r][scols[c]] === 'undefined' && r + 1 < srows.length) { r += 1; }
+                if (typeof srows[r][scols[c]] !== 'undefined') {
+                    stype = srows[r][scols[c]].type;
+                    sdatatype = srows[r][scols[c]].datatype;
+                }
+                gdatatype[c] = this.getGoogleJsonDatatype(stype, sdatatype);
+                gcols[c] = {'id': scols[c], 'label': scols[c], 'type': gdatatype[c]};
+            }
+
+            // loop rows
+            for (r = 0; r < srows.length; r += 1) {
+                srow = srows[r];
+                grow = [];
+                // loop cells
+                for (c = 0; c < scols.length; c += 1) {
+                    gvalue = null;
+                    if (typeof srow[scols[c]] !== 'undefined' &&
+                            typeof srow[scols[c]].value !== 'undefined') {
+                        gvalue = this.getGoogleJsonValue(srow[scols[c]].value, gdatatype[c], srow[scols[c]].type);
+                    }
+                    grow[c] = { 'v': gvalue };
+                }
+                grows[r] = {'c': grow};
+            }
+            return {'cols': gcols, 'rows': grows};
+        },
+
+        getGoogleJsonValue: function (value, gdatatype, stype) {
+            var newvalue;
+            if (gdatatype === 'number') {
+                newvalue = Number(value);
+            } else if (gdatatype === 'date') {
+                //assume format yyyy-MM-dd
+                newvalue = new Date(value.substr(0, 4),
+                                value.substr(5, 2),
+                                value.substr(8, 2));
+            } else if (gdatatype === 'datetime') {
+                //assume format yyyy-MM-ddZHH:mm:ss
+                newvalue = new Date(value.substr(0, 4),
+                                value.substr(5, 2),
+                                value.substr(8, 2),
+                                value.substr(11, 2),
+                                value.substr(14, 2),
+                                value.substr(17, 2));
+            } else if (gdatatype === 'timeofday') {
+                //assume format HH:mm:ss
+                newvalue = [value.substr(0, 2),
+                        value.substr(3, 2),
+                        value.substr(6, 2)];
+            } else { // datatype === 'string' || datatype === 'boolean'
+                if (stype === 'uri') { // replace namespace with prefix
+                    newvalue = this.prefixify(value);
+                }
+                newvalue = value;
+            }
+            return newvalue;
+        },
+
+        getGoogleJsonDatatype: function (stype, sdatatype) {
+            var gdatatype = this.defaultGDatatype,
+                xsdns = sgvizler.option.namespace.xsd;
+            if (typeof stype !== 'undefined' && (stype === 'typed-literal' || stype === 'literal')) {
+                if (sdatatype === xsdns + "float"   ||
+                        sdatatype === xsdns + "double"  ||
+                        sdatatype === xsdns + "decimal" ||
+                        sdatatype === xsdns + "int"     ||
+                        sdatatype === xsdns + "long"    ||
+                        sdatatype === xsdns + "integer") {
+                    gdatatype =  'number';
+                } else if (sdatatype === xsdns + "boolean") {
+                    gdatatype =  'boolean';
+                } else if (sdatatype === xsdns + "date") {
+                    gdatatype =  'date';
+                } else if (sdatatype === xsdns + "dateTime") {
+                    gdatatype =  'datetime';
+                } else if (sdatatype === xsdns + "time") {
+                    gdatatype =  'timeofday';
+                }
+            }
+            return gdatatype;
+        },
+
+        prefixify: function (url) {
+            var ns;
+            for (ns in sgvizler.option.namespace) {
+                if (sgvizler.option.namespace.hasOwnProperty(ns) &&
+                        url.lastIndexOf(sgvizler.option.namespace[ns], 0) === 0) {
+                    return url.replace(sgvizler.option.namespace[ns], ns + ":");
+                }
+            }
+            return url;
+        },
+        unprefixify: function (qname) {
+            var ns;
+            for (ns in sgvizler.option.namespace) {
+                if (sgvizler.option.namespace.hasOwnProperty(ns) &&
+                        qname.lastIndexOf(ns + ":", 0) === 0) {
+                    return qname.replace(ns + ":", sgvizler.option.namespace[ns]);
+                }
+            }
+            return qname;
+        }
+    };
+
+
+    /*global XDomainRequest */
+
+    sgvizler.query = function (container) {
+        this.container = container;
+
+        //defaults
+        this.query = "SELECT ?class (count(?instance) AS ?noOfInstances)\nWHERE{ ?instance a ?class }\nGROUP BY ?class\nORDER BY ?class";
+        this.endpoint = "http://sws.ifi.uio.no/sparql/world";
+        this.endpoint_output = 'json';  // xml, json, jsonp
+        this.endpoint_query_url = "?output=text&amp;query=";
+        this.validator_query_url = "http://www.sparql.org/query-validator?languageSyntax=SPARQL&amp;outputFormat=sparql&amp;linenumbers=true&amp;query=";
+        this.chart = 'gLineChart';
+        this.loglevel = 2;
+
+        this.chartOptions = {
+            'width':           '800',
+            'height':          '400',
+            'chartArea':       { left: '5%', top: '5%', width: '75%', height: '80%' },
+            'gGeoMap': {
+                'dataMode':           'markers'
+            },
+            'gMap': {
+                'dataMode':           'markers'
+            },
+            'sMap': {
+                'dataMode':           'markers',
+                'showTip':            true,
+                'useMapTypeControl':  true
+            },
+            'gSparkline': {
+                'showAxisLines':      false
+            }
+        };
+    };
+
+    sgvizler.query.prototype.draw = function (listeners,options,callback) {
+        var that = this,
+            chartFunc = sgvizler.charts.getChart(this.container, this.chart);
+        this.setChartSpecificOptions();
+        this.insertFrom();
+        $.extend(this.chartOptions,options);
+        this.runQuery(function (data) {
+            var dataTable = new google.visualization.DataTable(that.processQueryResults(data));
+            for(var listener in listeners) {
+                google.visualization.events.addListener(chartFunc, listener, function(){
+                    listeners[listener](chartFunc,dataTable);
+                });
+            }
+            chartFunc.draw(dataTable,that.chartOptions);
+            if(callback)callback(dataTable);
+        });
+    };
+
+    sgvizler.query.prototype.runQuery = function (callback) {
+        var xdr,
+            url,
+            endpoint_output = this.endpoint_output;
+        sgvizler.ui.displayFeedback(this, "LOADING");
+        this.encodedQuery = encodeURIComponent(this.getPrefixes() + this.query);
+        if (this.endpoint_output !== 'jsonp' && $.browser.msie && window.XDomainRequest) {
+            xdr = new XDomainRequest();
+            url = this.endpoint +
+                "?query=" + this.encodedQuery +
+                "&output=" + this.endpoint_output;
+            xdr.open("GET", url);
+            xdr.onload = function () {
+                var data;
+                if (endpoint_output === "xml") {
+                    data = $.parseXML(xdr.responseText);
+                } else {
+                    data = $.parseJSON(xdr.responseText);
+                }
+                callback(data);
+            };
+            xdr.send();
+        } else {
+            $.get(this.endpoint,
+                  { query: this.getPrefixes() + this.query,
+                    output: (this.endpoint_output === 'jsonp') ? 'json' : this.endpoint_output },
+                  function (data) { callback(data); },
+                  this.endpoint_output)
+                .error(function () {
+                    sgvizler.ui.displayFeedback(this, "ERROR_ENDPOINT");
+                });
+        }
+    };
+
+    sgvizler.query.prototype.processQueryResults = function (data) {
+        this.setResultRowCount(data);
+        if (this.noRows === null) {
+            sgvizler.ui.displayFeedback(this, "ERROR_UNKNOWN");
+        } else if (this.noRows === 0) {
+            sgvizler.ui.displayFeedback(this, "NO_RESULTS");
+        } else {
+            sgvizler.ui.displayFeedback(this, "DRAWING");
+            return this.getGoogleJSON(data);
+        }
+    };
+
+    sgvizler.query.prototype.setResultRowCount = function (data) {
+        if (this.endpoint_output === 'xml') {
+            this.noRows = sgvizler.parser.countRowsSparqlXML(data);
+        } else {
+            this.noRows = sgvizler.parser.countRowsSparqlJSON(data);
+        }
+    };
+
+    sgvizler.query.prototype.getGoogleJSON = function (data) {
+        if (this.endpoint_output === 'xml') {
+            data = sgvizler.parser.SparqlXML2GoogleJSON(data);
+        } else {
+            data = sgvizler.parser.SparqlJSON2GoogleJSON(data);
+        }
+        return data;
+    };
+
+    sgvizler.query.prototype.insertFrom = function () {
+        if (typeof this.rdf !== 'undefined') {
+            var i,
+                froms = this.rdf.split(sgvizler.ui.attr.valueSplit),
+                from = "";
+            for (i = 0; i < froms.length; i += 1) {
+                from += 'FROM <' + froms[i] + '>\n';
+            }
+            this.query = this.query.replace(/(WHERE)?(\s)*\{/, '\n' + from + 'WHERE {');
+        }
+    };
+
+    sgvizler.query.prototype.getPrefixes = function () {
+        var prefix,
+            prefixes = "";
+        for (prefix in sgvizler.option.namespace) {
+            if (sgvizler.option.namespace.hasOwnProperty(prefix)) {
+                prefixes += "PREFIX " + prefix + ": <" + sgvizler.option.namespace[prefix] + ">\n";
+            }
+        }
+        return prefixes;
+    };
+
+    sgvizler.query.prototype.setChartSpecificOptions = function () {
+        var level1,
+            level2;
+        for (level1 in this.chartOptions) {
+            if (this.chartOptions.hasOwnProperty(level1) &&
+                    level1 === this.chart) {
+                for (level2 in this.chartOptions[level1]) {
+                    if (this.chartOptions[level1].hasOwnProperty(level2)) {
+                        this.chartOptions[level2] = this.chartOptions[level1][level2];
+                    }
+                }
+            }
+        }
+    };
+
+    sgvizler.charts = {
+        // Package for handling rendering functions. The rendering
+        // functions themselves are kept in sgvizler.chart.*
+
+        all: [],
+
+        loadCharts: function () {
+            var googlecharts = [
+                { 'id': "gLineChart",        'func': google.visualization.LineChart },
+                { 'id': "gAreaChart",        'func': google.visualization.AreaChart },
+                { 'id': "gSteppedAreaChart", 'func': google.visualization.SteppedAreaChart },
+                { 'id': "gPieChart",         'func': google.visualization.PieChart },
+                { 'id': "gBubbleChart",      'func': google.visualization.BubbleChart },
+                { 'id': "gColumnChart",      'func': google.visualization.ColumnChart },
+                { 'id': "gBarChart",         'func': google.visualization.BarChart },
+                { 'id': "gSparkline",        'func': google.visualization.ImageSparkLine },
+                { 'id': "gScatterChart",     'func': google.visualization.ScatterChart },
+                { 'id': "gCandlestickChart", 'func': google.visualization.CandlestickChart },
+                { 'id': "gGauge",            'func': google.visualization.Gauge },
+                { 'id': "gOrgChart",         'func': google.visualization.OrgChart },
+                { 'id': "gTreeMap",          'func': google.visualization.TreeMap },
+                { 'id': "gTimeline",         'func': google.visualization.AnnotatedTimeLine },
+                { 'id': "gMotionChart",      'func': google.visualization.MotionChart },
+                { 'id': "gGeoChart",         'func': google.visualization.GeoChart },
+                { 'id': "gGeoMap",           'func': google.visualization.GeoMap },
+                { 'id': "gMap",              'func': google.visualization.Map },
+                { 'id': "gTable",            'func': google.visualization.Table }
+            ],
+                chart;
+
+            $.merge(this.all, googlecharts);
+            for (chart in sgvizler.chart) {
+                if (sgvizler.chart.hasOwnProperty(chart)) {
+                    this.register(
+                        sgvizler.chart[chart].prototype.id,
+                        sgvizler.chart[chart]
+                    );
+                }
+            }
+        },
+
+        register: function (id, func) {
+            this.all.push({'id': id, 'func': func});
+        },
+
+        getChart: function (containerId, chartId) {
+            var i,
+                container = document.getElementById(containerId);
+            for (i = 0; i < this.all.length; i += 1) {
+                if (chartId === this.all[i].id) {
+                    return new this.all[i].func(container);
+                }
+            }
+        }
+    };
+
+
+    /*global d3 */
+    /** dForceGraph **
+
+
+        D3 force directed graph. Under development.
+    */
+    sgvizler.chart.dForceGraph = function (container) { this.container = container; };
+    sgvizler.chart.dForceGraph.prototype = {
+        id:   "dForceGraph",
+        draw: function (data, chartOpt) {
+            var noColumns = data.getNumberOfColumns(),
+                noRows = data.getNumberOfRows(),
+                opt = $.extend({'maxnodesize': 15, 'minnodesize': 2 }, chartOpt), // set defaults
+                colors = d3.scale.category20(),
+                w = chartOpt.width,
+                h = chartOpt.height,
+                isNumber = function (n) {  return !isNaN(parseFloat(n)) && isFinite(n); },
+
+                // build arrays of nodes and links.
+                nodes = [],
+                edges = [],
+                t_color = {},
+                t_size = {},
+                t_maxnodesize = 0,
+
+                r,
+                source,
+                target,
+
+                nodesizeratio,
+                i,
+                color,
+                size,
+
+                vis,
+                force,
+                link,
+                node,
+                ticks;
+
+            for (r = 0; r < noRows; r += 1) {
+                source = data.getValue(r, 0);
+                target = data.getValue(r, 1);
+                // nodes
+                if (source !== null && $.inArray(source, nodes) === -1) {
+                    nodes.push(source);
+                    t_size[source] = (noColumns > 2) ? Math.sqrt(data.getValue(r, 2)) : 0;
+                    t_color[source] = (noColumns > 3) ? data.getValue(r, 3) : 0;
+                    if (t_size[source] > t_maxnodesize) {
+                        t_maxnodesize = t_size[source];
+                    }
+                }
+                if (target !== null && $.inArray(target, nodes) === -1) {
+                    nodes.push(target);
+                }
+                // edges
+                if (source !== null && target !== null) {
+                    edges.push({'source': $.inArray(source, nodes),
+                                'target': $.inArray(target, nodes)
+                            }
+                        );
+                }
+            }
+            if (t_maxnodesize === 0) {
+                t_maxnodesize = 1;
+            }
+            nodesizeratio = opt.maxnodesize / t_maxnodesize;
+            for (i = 0; i < nodes.length; i += 1) {
+                color = typeof t_color[nodes[i]] !== 'undefined' ?
+                        t_color[nodes[i]] :
+                        1;
+                size = isNumber(t_size[nodes[i]]) ?
+                        opt.minnodesize + t_size[nodes[i]] * nodesizeratio :
+                        opt.minnodesize;
+
+                nodes[i] = {'name': nodes[i], 'color': color, 'size': size };
+            }
+
+            $(this.container).empty();
+
+            vis = d3.select(this.container)
+                .append("svg:svg")
+                .attr("width", w)
+                .attr("height", h)
+                .attr("pointer-events", "all")
+                .append('svg:g')
+                .call(d3.behavior.zoom().on("zoom", function () {
+                    vis.attr("transform", "translate(" + d3.event.translate + ")" +
+                         " scale(" + d3.event.scale + ")");
+                }))
+                .append('svg:g');
+
+            vis.append('svg:rect')
+                .attr('width', w)
+                .attr('height', h)
+                .attr('fill', 'white');
+
+            force = d3.layout.force()
+                .gravity(0.05)
+                .distance(100)
+                .charge(-100)
+                .nodes(nodes)
+                .links(edges)
+                .size([w, h])
+                .start();
+
+            link = vis.selectAll("line.link")
+                .data(edges)
+                .enter().append("svg:line")
+                .attr("class", "link")
+                //.style("stroke-width", function (d) { return Math.sqrt(d.value); })
+                .attr("x1", function (d) { return d.source.x; })
+                .attr("y1", function (d) { return d.source.y; })
+                .attr("x2", function (d) { return d.target.x; })
+                .attr("y2", function (d) { return d.target.y; });
+
+            node = vis.selectAll("g.node")
+                .data(nodes)
+                .enter().append("svg:g")
+                .attr("class", "node")
+                .call(force.drag);
+
+            node.append("svg:circle")
+                .style("fill", function (d) { return colors(d.color); })
+                .attr("class", "node")
+                .attr("r", function (d) { return d.size; });
+
+            node.append("svg:title")
+                .text(function (d) { return d.name; });
+
+            node.append("svg:text")
+                .attr("class", "nodetext")
+                .attr("dx", 12)
+                .attr("dy", ".35em")
+                .text(function (d) { return d.name; });
+
+            ticks = 0;
+            force.on("tick", function () {
+                ticks += 1;
+                if (ticks > 250) {
+                    force.stop();
+                    force.charge(0)
+                        .linkStrength(0)
+                        .linkDistance(0)
+                        .gravity(0)
+                        .start();
+                }
+
+                link.attr("x1", function (d) { return d.source.x; })
+                    .attr("y1", function (d) { return d.source.y; })
+                    .attr("x2", function (d) { return d.target.x; })
+                    .attr("y2", function (d) { return d.target.y; });
+
+                node.attr("transform", function (d) {
+                    return "translate(" + d.x + "," + d.y + ")";
+                });
+            });
+        }
+    };
+
+
+    /*global Graph */
+    /** rdGraph **
+
+      Original version written by Magnus Stuhr.
+
+      Draws a graph with clickable and movable nodes. 
+
+      Input format:
+      - 7 columns, last three are optional.
+      - each row represents a source node, a target node and an edge from source to target.
+      - the URIs are the id's for the nodes, and make the nodes clickable.
+      
+      1             2         3         4             5           6             7
+      sourceURI sourceLabel   targetURI targetLabel   edgeLabel   sourceColor   targetColor
+
+    */
+    sgvizler.chart.rdGraph = function (container) { this.container = container; };
+    sgvizler.chart.rdGraph.prototype = {
+        id: "rdGraph",
+        draw: function (data, chartOpt) {
+
+            var numberOfColumns = data.getNumberOfColumns(),
+                numberOfRows = data.getNumberOfRows(),
+
+                // set defaults.
+                opt = $.extend({
+                    noderadius: 0.5,
+                    nodefontsize: "10px",
+                    nodeheight: 20,
+                    nodestrokewidth: "1px",
+                    nodecornerradius: "1px",
+                    nodepadding: 7,
+                    nodecolor: "green",
+                    edgestroke: "blue",
+                    edgefill: "blue",
+                    edgestrokewidth: 1,
+                    edgefontsize: "10px",
+                    edgeseparator: ", "
+                }, chartOpt),
+
+                graph = new Graph(),
+                layouter,
+                renderer,
+                row,
+                i,
+                edge,
+                source,
+                target,
+                label,
+
+                // custom node rendering using Raphael.
+                nodeRenderer = function (color, URL) {
+                    return function (r, n) {
+                        return r.set()
+                            // rectangle
+                            .push(r.rect(n.point[0],
+                                        n.point[1],
+                                        n.label.length * opt.nodepadding,
+                                        opt.nodeheight)
+                                 .attr({"fill": color,
+                                        "stroke-width": opt.nodestrokewidth,
+                                        "r" : opt.nodecornerradius}))
+                           // label inside rectangle
+                            .push(r.text(n.point[0] + n.label.length * opt.nodepadding / 2,
+                                        n.point[1] + opt.nodeheight / 2,
+                                        n.label)
+                                 .attr({"font-size": opt.nodefontsize})
+                                 .click(function () { if (URL) { window.open(sgvizler.parser.unprefixify(URL)); } })
+                                );
+                    };
+                },
+
+                // helper function.
+                addNode = function (URL, name, color) {
+                    graph.addNode(URL, {label: name, render: nodeRenderer(color, URL)});
+                    //console.log("add node - name: " + name + ", URL: " + URL);
+                },
+                edges = {},
+                keys_edges = [];
+
+            for (row = 0; row < numberOfRows; row += 1) {
+                source = data.getValue(row, 0);
+                target = data.getValue(row, 2);
+
+                // add source node
+                // Note: dracula library takes care of duplicates?
+                if (source) {
+                    addNode(source,
+                            data.getValue(row, 1) || source,
+                            numberOfColumns > 5 ? data.getValue(row, 5) : opt.nodecolor);
+                }
+                // add target node
+                if (target) {
+                    addNode(target,
+                            data.getValue(row, 3) || target,
+                            numberOfColumns > 6 ? data.getValue(row, 6) : opt.nodecolor);
+                }
+
+                // collect edge labels. Only one edge per pair of nodes,
+                // so we concatinate labels of multiple edges into one.
+                if (source && target) {
+                    label = "";
+                    // test if source--target pair is seen before:
+                    if (typeof edges[source + target] !== 'undefined') {
+                        label = edges[source + target].label; // retrieve accumulated label.
+                    } else {
+                        keys_edges.push(source + target);
+                    }
+
+                    if (numberOfColumns > 4 && data.getValue(row, 4).length > 0) {
+                        if (label.length > 0) {
+                            label += opt.edgeseparator;
+                        }
+                        label += data.getValue(row, 4);
+                    }
+
+                    edges[source + target] = {
+                        'source': source,
+                        'target': target,
+                        'label': label
+                    };
+                }
+            }
+
+            // add edges
+            for (i = 0; i < keys_edges.length; i += 1) {
+                edge = edges[keys_edges[i]];
+                //console.log("add edge - source: " + edge.source + ", target " + edge.target);
+                graph.addEdge(edge.source, edge.target,
+                              { "stroke": opt.edgestroke,
+                                "fill": opt.edgefill,
+                                "label": edge.label,
+                                "width": opt.edgestrokewidth,
+                                "fontsize": opt.edgefontsize
+                              });
+            }
+
+            layouter = new Graph.Layout.Spring(graph);
+            layouter.layout();
+
+            $(this.container).empty();
+            renderer = new Graph.Renderer.Raphael(this.container, graph, opt.width, opt.height, {"noderadius": opt.nodeheight * opt.noderadius});
+            renderer.draw();
+        }
+    };    /** sDefList **
+
+
+     Make a html dt list.
+
+
+     Format, 2--N columns:
+     1. Term
+     2--N. Definition
+
+
+     Available options:
+     'cellSep'   :  string (can be html) to separate cells in definition columns. (default: ' ')
+     'termPrefix  :  string (can be html) to prefix each term with. (default: '')
+     'termPostfix :  string (can be html) to postfix each term with. (default: ':')
+     'definitionPrefix  :  string (can be html) to prefix each definition with. (default: '')
+     'definitionPostfix :  string (can be html) to postfix each definition with. (default: '')
+    */
+    sgvizler.chart.DefList = function (container) { this.container = container; };
+    sgvizler.chart.DefList.prototype = {
+        id:   "sDefList",
+        draw: function (data, chartOpt) {
+            var r,
+                c,
+                term,
+                definition,
+                noColumns = data.getNumberOfColumns(),
+                noRows = data.getNumberOfRows(),
+                opt = $.extend({ cellSep: ' ', termPrefix: '', termPostfix: ':', definitionPrefix: '', definitionPostfix: '' }, chartOpt),
+                list = $(document.createElement('dl'));
+
+
+            for (r = 0; r < noRows; r += 1) {
+                term = opt.termPrefix + data.getValue(r, 0) + opt.termPostfix;
+                list.append($(document.createElement('dt')).html(term));
+                definition = opt.definitionPrefix;
+                for (c = 1; c < noColumns; c += 1) {
+                    definition += data.getValue(r, c);
+                    if (c + 1 !== noColumns) {
+                        definition += opt.cellSep;
+                    }
+                }
+                definition += opt.definitionPostfix;
+                list.append($(document.createElement('dd')).html(definition));
+            }
+            $(this.container).empty();
+            $(this.container).append(list);
+        }
+    };
+    /** sList **
+
+
+     Make a html list, either numbered (ol) or bullets (ul). Each row
+     becomes a list item.
+
+
+     Any number of columns in any format. Everything is displayed as text.
+
+
+     Available options:
+     'list'      :  "ol" / "ul"  (default: "ul")
+     'cellSep'   :  string (can be html) to separate cells in row. (default: ', ')
+     'rowPrefix  :  string (can be html) to prefix each row with. (default: '')
+     'rowPostfix :  string (can be html) to postfix each row with. (default: '')
+    */
+    sgvizler.chart.List = function (container) { this.container = container; };
+    sgvizler.chart.List.prototype = {
+        id:   "sList",
+        draw: function (data, chartOpt) {
+            var noColumns = data.getNumberOfColumns(),
+                noRows = data.getNumberOfRows(),
+                opt = $.extend({ list: 'ul', cellSep: ', ', rowPrefix: '', rowPostfix: '' }, chartOpt),
+                list = $(document.createElement(opt.list)),
+                r,
+                c,
+                rowtext;
+
+
+            for (r = 0; r < noRows; r += 1) {
+                rowtext = opt.rowPrefix;
+                for (c = 0; c < noColumns; c += 1) {
+                    rowtext += data.getValue(r, c);
+                    if (c + 1 !== noColumns) {
+                        rowtext += opt.cellSep;
+                    }
+                }
+                rowtext += opt.rowPostfix;
+                list.append($(document.createElement('li')).html(rowtext));
+            }
+            $(this.container).empty();
+            $(this.container).append(list);
+        }
+    };
+
+
+    /** sMap **
+
+
+     Extends gMap in markers dataMode. Draws textboxes with heading,
+     paragraph, link and image. The idea is to put all columns > 2 into
+     the 3. column with html formatting.
+
+
+     - Data Format 2--6 columns:
+       1. lat
+       2. long
+       3. name  (optional)
+       4. text  (optional)
+       5. link  (optional)
+       6. image (optional)
+
+
+     - If < 4 columns, then behaves just as gMap
+     - Only 6 columns will be read, columns > 6 are ignored.
+    */
+    sgvizler.chart.sMap = function (container) { this.container = container; };
+    sgvizler.chart.sMap.prototype = {
+        id:   "sMap",
+        draw: function (data, chartOpt) {
+            var chart,
+                newData,
+                newValue,
+                noColumns = data.getNumberOfColumns(),
+                r,
+                c;
+
+
+            if (noColumns > 3) {
+                newData = data.clone();
+                // drop columns > 3 from new
+                for (c = noColumns - 1; c > 2; c -= 1) {
+                    newData.removeColumn(c);
+                }
+
+
+                // build new 3. column
+                for (r = 0; r < data.getNumberOfRows(); r += 1) {
+                    newValue = "<div class='sgvizler sgvizler-sMap'>";
+                    newValue += "<h1>" + data.getValue(r, 2) + "</h1>";
+                    if (5 < noColumns && data.getValue(r, 5) !== null) {
+                        newValue += "<div class='img'><img src='" + data.getValue(r, 5) + "'/></div>";
+                    }
+                    if (3 < noColumns && data.getValue(r, 3) !== null) {
+                        newValue += "<p class='text'>" + data.getValue(r, 3) + "</p>";
+                    }
+                    if (4 < noColumns && data.getValue(r, 4) !== null) {
+                        newValue += "<p class='link'><a href='" + sgvizler.parser.unprefixify(data.getValue(r, 4)) + "'>" + data.getValue(r, 4) + "</a></p>";
+                    }
+                    newValue += "</div>";
+                    newData.setCell(r, 2, newValue);
+                }
+            } else { // do nothing.
+                newData = data;
+            }
+
+
+            chart = new google.visualization.Map(this.container);
+            chart.draw(newData, chartOpt);
+        }
+    };
+
+
+    /** sTable **
+
+
+     Make a html table.
+
+
+     Available options:
+     'headings'   :  "true" / "false"  (default: "true")
+    */
+    sgvizler.chart.Table = function (container) { this.container = container; };
+    sgvizler.chart.Table.prototype = {
+        id:   "sTable",
+        draw: function (data, chartOpt) {
+            var noColumns = data.getNumberOfColumns(),
+                noRows = data.getNumberOfRows(),
+                opt = $.extend({'headings': true }, chartOpt),
+                table = $(document.createElement('table')),
+                c,
+                r,
+                row;
+
+
+            if (opt.headings) {
+                row = $(document.createElement('tr'));
+                for (c = 0; c < noColumns; c += 1) {
+                    row.append($(document.createElement('th')).html(data.getColumnLabel(c)));
+                }
+                table.append(row);
+            }
+
+
+            for (r = 0; r < noRows; r += 1) {
+                row = $(document.createElement('tr'));
+                for (c = 0; c < noColumns; c += 1) {
+                    row.append($(document.createElement('td')).html(data.getValue(r, c)));
+                }
+                table.append(row);
+            }
+            $(this.container).empty();
+            $(this.container).append(table);
+        }
+    };
+
+    /** sText **
+
+
+     Write text.
+
+
+     Any number of columns. Everything is displayed as text.
+
+
+     Available options:
+     'cellSep'       :  string (can be html) to separate cells in each column. (default: ', ')
+     'cellPrefix     :  string (can be html) to prefix each cell with. (default: '')
+     'cellPostfix    :  string (can be html) to postfix each cell  with. (default: '')
+     'rowPrefix      :  string (can be html) to prefix each row with. (default: '<p>')
+     'rowPostfix     :  string (can be html) to postfix each row with. (default: '</p>')
+     'resultsPrefix  :  string (can be html) to prefix the results with. (default: '<div>')
+     'resultsPostfix :  string (can be html) to postfix the results with. (default: '</div>')
+    */
+    sgvizler.chart.Text = function (container) { this.container = container; };
+    sgvizler.chart.Text.prototype = {
+        id:   "sText",
+        draw: function (data, chartOpt) {
+            var noColumns = data.getNumberOfColumns(),
+                noRows = data.getNumberOfRows(),
+                opt = $.extend({ cellSep: ', ',
+                                 cellPrefix: '', cellPostfix: '',
+                                 rowPrefix: '<p>', rowPostfix: '</p>',
+                                 resultsPrefix: '<div>', resultsPostfix: '</div>' },
+                               chartOpt),
+                text = opt.resultsPrefix,
+                r,
+                c,
+                row;
+
+
+            for (r = 0; r < noRows; r += 1) {
+                row = opt.rowPrefix;
+                for (c = 0; c < noColumns; c += 1) {
+                    row += opt.cellPrefix + data.getValue(r, c) + opt.cellPostfix;
+                    if (c + 1 !== noColumns) {
+                        row += opt.cellSep;
+                    }
+                }
+                text += row + opt.rowPostfix;
+            }
+            text += opt.resultsPostfix;
+
+
+            $(this.container).empty();
+            $(this.container).html(text);
+        }
+    };
+    global.sgvizler = sgvizler;
+}(window));

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/extras/webjars/snorql/pom.xml
----------------------------------------------------------------------
diff --git a/extras/webjars/snorql/pom.xml b/extras/webjars/snorql/pom.xml
new file mode 100644
index 0000000..0f8831e
--- /dev/null
+++ b/extras/webjars/snorql/pom.xml
@@ -0,0 +1,106 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ 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.
+  -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>org.apache.marmotta</groupId>
+        <artifactId>marmotta-parent</artifactId>
+        <version>3.1.0-incubating</version>
+        <relativePath>../../../parent/</relativePath> 
+    </parent>
+
+    <properties>
+        <webjar.version>1.0</webjar.version>
+    </properties>
+
+
+    <groupId>org.apache.marmotta.webjars</groupId>
+    <artifactId>snorql</artifactId>
+    <packaging>jar</packaging>
+
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.sonatype.plugins</groupId>
+                <artifactId>yuicompressor-maven-plugin</artifactId>
+                <version>1.0.0</version>
+                <executions>
+                    <execution>
+                        <id>assemble-javascript</id>
+                        <goals>
+                            <goal>aggregate</goal>
+                        </goals>
+                        <configuration>
+                            <nomunge>true</nomunge>
+                            <sourceDirectory>${project.basedir}/src/main/resources</sourceDirectory>
+                            <output>${project.build.outputDirectory}/META-INF/resources/webjars/${project.artifactId}/${webjar.version}/snorql.js</output>
+                            <includes>
+                                <include>prototype.js</include>
+                                <include>scriptaculous/scriptaculous.js</include>
+                                <include>scriptaculous/builder.js</include>
+                                <include>scriptaculous/effects.js</include>
+                                <include>scriptaculous/dragdrop.js</include>
+                                <include>scriptaculous/controls.js</include>
+                                <include>scriptaculous/slider.js</include>
+                                <include>scriptaculous/sound.js</include>
+                                <include>snorql.js</include>
+                                <include>sparql.js</include>
+                                <include>namespaces.js</include>
+                            </includes>
+                        </configuration>
+                    </execution>
+                    <execution>
+                        <id>assemble-css</id>
+                        <goals>
+                            <goal>aggregate-css</goal>
+                        </goals>
+                        <configuration>
+                            <sourceDirectory>${project.basedir}/src/main/resources</sourceDirectory>
+                            <output>${project.build.outputDirectory}/META-INF/resources/webjars/${project.artifactId}/${webjar.version}/snorql.css</output>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <!-- these are "extras", so they come from 3rd parties, no RAT check! -->
+                <groupId>org.apache.rat</groupId>
+                <artifactId>apache-rat-plugin</artifactId>
+                <configuration>
+                    <excludes>
+                        <exclude>src/**</exclude>
+                    </excludes>
+                </configuration>
+            </plugin>
+        </plugins>
+        <resources>
+            <resource>
+                <directory>src/main/resources</directory>
+                <excludes>
+                    <exclude>**/*.js</exclude>
+                    <exclude>**/*.css</exclude>
+                </excludes>
+                <filtering>false</filtering>
+                <targetPath>${project.build.outputDirectory}/META-INF/resources/webjars/${project.artifactId}/${webjar.version}</targetPath>
+            </resource>
+        </resources>
+    </build>
+
+</project>

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/extras/webjars/snorql/src/main/resources/LICENSE
----------------------------------------------------------------------
diff --git a/extras/webjars/snorql/src/main/resources/LICENSE b/extras/webjars/snorql/src/main/resources/LICENSE
new file mode 100755
index 0000000..d645695
--- /dev/null
+++ b/extras/webjars/snorql/src/main/resources/LICENSE
@@ -0,0 +1,202 @@
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed 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.

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/extras/webjars/snorql/src/main/resources/README
----------------------------------------------------------------------
diff --git a/extras/webjars/snorql/src/main/resources/README b/extras/webjars/snorql/src/main/resources/README
new file mode 100755
index 0000000..87a5827
--- /dev/null
+++ b/extras/webjars/snorql/src/main/resources/README
@@ -0,0 +1,11 @@
+SNORQL is an AJAXy front-end for exploring RDF SPARQL endpoints
+
+It was originally created by Richard Cyganaik ( http://richard.cyganiak.de/ )
+for the D2R server project ( http://www4.wiwiss.fu-berlin.de/bizer/d2r-server/ ).
+
+SNORQL can be used with just about any SPARQL endpoint that supports JSON. To
+use SNORQL simply put the ./snorql directory somwhere sensible in the Apache
+web directory and modify ./snorql/snorql.js to conform with your setup.  You
+can also modify the pre-defined namespaces in ./snorql/namespaces.js
+
+SNORQL is licensed under Apache-2 license (see ./LICENSE ).
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/extras/webjars/snorql/src/main/resources/link.png
----------------------------------------------------------------------
diff --git a/extras/webjars/snorql/src/main/resources/link.png b/extras/webjars/snorql/src/main/resources/link.png
new file mode 100755
index 0000000..419c06f
Binary files /dev/null and b/extras/webjars/snorql/src/main/resources/link.png differ

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/extras/webjars/snorql/src/main/resources/namespaces.js
----------------------------------------------------------------------
diff --git a/extras/webjars/snorql/src/main/resources/namespaces.js b/extras/webjars/snorql/src/main/resources/namespaces.js
new file mode 100755
index 0000000..7db1f83
--- /dev/null
+++ b/extras/webjars/snorql/src/main/resources/namespaces.js
@@ -0,0 +1,26 @@
+/*
+ * 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.
+ */
+var D2R_namespacePrefixes = {
+    rdf: 'http://www.w3.org/1999/02/22-rdf-syntax-ns#',
+    rdfs: 'http://www.w3.org/2000/01/rdf-schema#',
+    owl: 'http://www.w3.org/2002/07/owl#',
+    skos: 'http://www.w3.org/2004/02/skos/core#',
+    dc: 'http://purl.org/dc/elements/1.1/',
+    foaf: 'http://xmlns.com/foaf/0.1/',
+    xsd: 'http://www.w3.org/2001/XMLSchema#'
+};


[016/100] [abbrv] [partial] Reverting the erroneous merge by Sebastian according to the instructions in INFRA-6876

Posted by wi...@apache.org.
http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/kiwi/kiwi-triplestore/src/main/resources/org/apache/marmotta/kiwi/persistence/h2/statements.properties
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-triplestore/src/main/resources/org/apache/marmotta/kiwi/persistence/h2/statements.properties b/libraries/kiwi/kiwi-triplestore/src/main/resources/org/apache/marmotta/kiwi/persistence/h2/statements.properties
index 2fc9afc..092cfcb 100644
--- a/libraries/kiwi/kiwi-triplestore/src/main/resources/org/apache/marmotta/kiwi/persistence/h2/statements.properties
+++ b/libraries/kiwi/kiwi-triplestore/src/main/resources/org/apache/marmotta/kiwi/persistence/h2/statements.properties
@@ -36,10 +36,10 @@ load.literal_by_v     = SELECT id,ntype,svalue,ivalue,dvalue,tvalue,bvalue,lang,
 load.literal_by_vl    = SELECT id,ntype,svalue,ivalue,dvalue,tvalue,bvalue,lang,ltype,createdAt FROM nodes WHERE svalue = ? AND lang = ?
 load.literal_by_vt    = SELECT id,ntype,svalue,ivalue,dvalue,tvalue,bvalue,lang,ltype,createdAt FROM nodes WHERE svalue = ? AND ltype = ?
 
-load.literal_by_iv     = SELECT id,ntype,svalue,ivalue,dvalue,tvalue,bvalue,lang,ltype,createdAt FROM nodes WHERE ivalue = ? AND lang IS NULL AND ltype = ?
-load.literal_by_dv     = SELECT id,ntype,svalue,ivalue,dvalue,tvalue,bvalue,lang,ltype,createdAt FROM nodes WHERE dvalue = ? AND lang IS NULL AND ltype = ?
-load.literal_by_tv     = SELECT id,ntype,svalue,ivalue,dvalue,tvalue,bvalue,lang,ltype,createdAt FROM nodes WHERE tvalue = ? AND lang IS NULL AND ltype = ?
-load.literal_by_bv     = SELECT id,ntype,svalue,ivalue,dvalue,tvalue,bvalue,lang,ltype,createdAt FROM nodes WHERE bvalue = ? AND lang IS NULL AND ltype = ?
+load.literal_by_iv     = SELECT id,ntype,svalue,ivalue,dvalue,tvalue,bvalue,ltype,createdAt FROM nodes WHERE ivalue = ? AND lang IS NULL AND ltype = ?
+load.literal_by_dv     = SELECT id,ntype,svalue,ivalue,dvalue,tvalue,bvalue,ltype,createdAt FROM nodes WHERE dvalue = ? AND lang IS NULL AND ltype = ?
+load.literal_by_tv     = SELECT id,ntype,svalue,ivalue,dvalue,tvalue,bvalue,ltype,createdAt FROM nodes WHERE tvalue = ? AND lang IS NULL AND ltype = ?
+load.literal_by_bv     = SELECT id,ntype,svalue,ivalue,dvalue,tvalue,bvalue,ltype,createdAt FROM nodes WHERE bvalue = ? AND lang IS NULL AND ltype = ?
 
 
 load.namespace_prefix  = SELECT id,prefix,uri,createdAt FROM namespaces WHERE prefix = ?;
@@ -60,16 +60,22 @@ store.tliteral       = INSERT INTO nodes (id,ntype,svalue,tvalue,ltype,createdAt
 
 store.namespace      = INSERT INTO namespaces (id,prefix,uri,createdAt) VALUES (?,?,?,?)
 
-store.triple         = INSERT INTO triples (id,subject,predicate,object,context,inferred,createdAt) VALUES (?,?,?,?,?,?,?)
+#store.triple         = INSERT INTO triples (id,subject,predicate,object,context,inferred,createdAt) VALUES (?,?,?,?,?,?,?)
+store.triple         = MERGE INTO triples (id,subject,predicate,object,context,inferred,createdAt) KEY(id) VALUES (?,?,?,?,?,?,?)
+load.triple          = SELECT id FROM triples WHERE subject = ? AND predicate = ? AND object = ? AND context = ? AND deleted = false AND inferred = true
 
 
-query.size           = SELECT count(*) FROM triples WHERE deleted = false
-query.size_ctx       = SELECT count(*) FROM triples WHERE context = ? AND deleted = false
+query.size           = SELECT count(*) FROM triples WHERE deleted = false AND inferred = false
+query.size_ctx       = SELECT count(*) FROM triples WHERE context = ? AND deleted = false AND inferred = false
 query.contexts       = SELECT DISTINCT context FROM triples WHERE deleted = false
 query.namespaces     = SELECT id,prefix,uri,createdAt FROM namespaces
-
+query.resources        = SELECT id,ntype,svalue,createdAt FROM nodes WHERE ntype = 'uri' OR ntype = 'bnode'
+query.resources_prefix = SELECT id,ntype,svalue,createdAt FROM nodes WHERE ntype = 'uri' AND svalue LIKE ?
 
 # delete entities
 delete.triple        = UPDATE triples SET deleted = true, deletedAt = now() WHERE id = ?
 undelete.triple      = UPDATE triples SET deleted = false, deletedAt = NULL WHERE id = ?
 delete.namespace     = DELETE FROM namespaces WHERE id = ?
+
+gc.check_consistency = SELECT svalue, ntype, count(id), max(id) FROM nodes group by svalue, ntype having count(id) > 1
+gc.list_node_ids     = SELECT id FROM nodes WHERE svalue = ? AND ntype = ? AND id != ?

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/kiwi/kiwi-triplestore/src/main/resources/org/apache/marmotta/kiwi/persistence/h2/upgrade_base_001_002.sql
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-triplestore/src/main/resources/org/apache/marmotta/kiwi/persistence/h2/upgrade_base_001_002.sql b/libraries/kiwi/kiwi-triplestore/src/main/resources/org/apache/marmotta/kiwi/persistence/h2/upgrade_base_001_002.sql
new file mode 100644
index 0000000..3143ac3
--- /dev/null
+++ b/libraries/kiwi/kiwi-triplestore/src/main/resources/org/apache/marmotta/kiwi/persistence/h2/upgrade_base_001_002.sql
@@ -0,0 +1,20 @@
+-- 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.
+
+UPDATE METADATA SET mvalue = '2' WHERE mkey = 'version';
+
+-- drop not null on triples.context
+ALTER TABLE triples ALTER COLUMN context bigint;
+ALTER TABLE nodes ALTER COLUMN svalue varchar(2147483647) NOT NULL;

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/kiwi/kiwi-triplestore/src/main/resources/org/apache/marmotta/kiwi/persistence/mysql/create_base_tables.sql
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-triplestore/src/main/resources/org/apache/marmotta/kiwi/persistence/mysql/create_base_tables.sql b/libraries/kiwi/kiwi-triplestore/src/main/resources/org/apache/marmotta/kiwi/persistence/mysql/create_base_tables.sql
index 9cc39d3..67425ac 100644
--- a/libraries/kiwi/kiwi-triplestore/src/main/resources/org/apache/marmotta/kiwi/persistence/mysql/create_base_tables.sql
+++ b/libraries/kiwi/kiwi-triplestore/src/main/resources/org/apache/marmotta/kiwi/persistence/mysql/create_base_tables.sql
@@ -12,13 +12,13 @@
 -- 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.
-CREATE TABLE seq_nodes (id BIGINT NOT NULL);
+CREATE TABLE seq_nodes (id BIGINT NOT NULL) ENGINE=InnoDB;
 INSERT INTO seq_nodes(id) VALUES (0);
 
-CREATE TABLE seq_triples (id BIGINT NOT NULL);
+CREATE TABLE seq_triples (id BIGINT NOT NULL) ENGINE=InnoDB;
 INSERT INTO seq_triples VALUES (0);
 
-CREATE TABLE seq_namespaces (id BIGINT NOT NULL);
+CREATE TABLE seq_namespaces (id BIGINT NOT NULL) ENGINE=InnoDB;
 INSERT INTO seq_namespaces(id) VALUES (0);
 
 -- Sequences in MySQL:
@@ -29,7 +29,7 @@ INSERT INTO seq_namespaces(id) VALUES (0);
 CREATE TABLE nodes (
   id        bigint     NOT NULL,
   ntype     char(8)    NOT NULL,
-  svalue    text       NOT NULL,
+  svalue    longtext   NOT NULL,
   dvalue    double precision,
   ivalue    bigint,
   tvalue    datetime   DEFAULT NULL,
@@ -38,21 +38,21 @@ CREATE TABLE nodes (
   lang      varchar(5),
   createdAt timestamp  NOT NULL DEFAULT CURRENT_TIMESTAMP,
   PRIMARY KEY(id)
-) CHARACTER SET utf8 COLLATE utf8_bin;
+) CHARACTER SET utf8 COLLATE utf8_bin  ENGINE=InnoDB;
 
 CREATE TABLE triples (
   id        bigint     NOT NULL,
   subject   bigint     NOT NULL REFERENCES nodes(id),
   predicate bigint     NOT NULL REFERENCES nodes(id),
   object    bigint     NOT NULL REFERENCES nodes(id),
-  context   bigint     NOT NULL REFERENCES nodes(id),
+  context   bigint     REFERENCES nodes(id),
   creator   bigint     REFERENCES nodes(id),
   inferred  boolean    DEFAULT false,
   deleted   boolean    DEFAULT false,
   createdAt timestamp  NOT NULL DEFAULT now(),
   deletedAt timestamp,
   PRIMARY KEY(id)
-) CHARACTER SET utf8 COLLATE utf8_bin;
+) CHARACTER SET utf8 COLLATE utf8_bin  ENGINE=InnoDB;
 
 CREATE TABLE namespaces (
   id        bigint        NOT NULL,
@@ -60,7 +60,7 @@ CREATE TABLE namespaces (
   uri       varchar(2048) NOT NULL,
   createdAt timestamp     NOT NULL DEFAULT now(),
   PRIMARY KEY(id)
-) CHARACTER SET utf8 COLLATE utf8_bin;
+) CHARACTER SET utf8 COLLATE utf8_bin  ENGINE=InnoDB;
 
 
 -- A table for storing metadata about the current database, e.g. version numbers for each table
@@ -69,24 +69,19 @@ CREATE TABLE metadata (
   mkey      varchar(16)   NOT NULL,
   mvalue    varchar(256)  NOT NULL,
   PRIMARY KEY(id)
-) CHARACTER SET utf8 COLLATE utf8_bin;
+) CHARACTER SET utf8 COLLATE utf8_bin  ENGINE=InnoDB;
 
 -- Indexes for accessing nodes and triples efficiently
 CREATE INDEX idx_node_content ON nodes(svalue(256));
 CREATE INDEX idx_literal_lang ON nodes(lang);
 
-CREATE INDEX idx_triples_s ON triples(subject);
-CREATE INDEX idx_triples_o ON triples(object);
-CREATE INDEX idx_triples_sp ON triples(subject,predicate);
-CREATE INDEX idx_triples_po ON triples(predicate,object);
+CREATE INDEX idx_triples_op ON triples(object,predicate);
 CREATE INDEX idx_triples_spo ON triples(subject,predicate,object);
-CREATE INDEX idx_triples_cs ON triples(context,subject);
-CREATE INDEX idx_triples_csp ON triples(context,subject,predicate);
 CREATE INDEX idx_triples_cspo ON triples(context,subject,predicate,object);
 
 CREATE INDEX idx_namespaces_uri ON namespaces(uri);
 CREATE INDEX idx_namespaces_prefix ON namespaces(prefix);
 
 -- insert initial metadata
-INSERT INTO metadata(mkey,mvalue) VALUES ('version','1');
+INSERT INTO metadata(mkey,mvalue) VALUES ('version','2');
 INSERT INTO metadata(mkey,mvalue) VALUES ('created',DATE_FORMAT(now(),'%Y-%m-%d %H:%i:%s') );

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/kiwi/kiwi-triplestore/src/main/resources/org/apache/marmotta/kiwi/persistence/mysql/drop_base_tables.sql
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-triplestore/src/main/resources/org/apache/marmotta/kiwi/persistence/mysql/drop_base_tables.sql b/libraries/kiwi/kiwi-triplestore/src/main/resources/org/apache/marmotta/kiwi/persistence/mysql/drop_base_tables.sql
index fb16fcd..5a91f23 100644
--- a/libraries/kiwi/kiwi-triplestore/src/main/resources/org/apache/marmotta/kiwi/persistence/mysql/drop_base_tables.sql
+++ b/libraries/kiwi/kiwi-triplestore/src/main/resources/org/apache/marmotta/kiwi/persistence/mysql/drop_base_tables.sql
@@ -16,13 +16,8 @@
 DROP INDEX idx_node_content ON nodes;
 DROP INDEX idx_literal_lang ON nodes;
 
-DROP INDEX idx_triples_s ON triples;
-DROP INDEX idx_triples_o ON triples;
-DROP INDEX idx_triples_sp ON triples;
-DROP INDEX idx_triples_po ON triples;
+DROP INDEX idx_triples_op ON triples;
 DROP INDEX idx_triples_spo ON triples;
-DROP INDEX idx_triples_cs ON triples;
-DROP INDEX idx_triples_csp ON triples;
 DROP INDEX idx_triples_cspo ON triples;
 
 DROP INDEX idx_namespaces_uri ON namespaces;

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/kiwi/kiwi-triplestore/src/main/resources/org/apache/marmotta/kiwi/persistence/mysql/statements.properties
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-triplestore/src/main/resources/org/apache/marmotta/kiwi/persistence/mysql/statements.properties b/libraries/kiwi/kiwi-triplestore/src/main/resources/org/apache/marmotta/kiwi/persistence/mysql/statements.properties
index fae51bc..a94272a 100644
--- a/libraries/kiwi/kiwi-triplestore/src/main/resources/org/apache/marmotta/kiwi/persistence/mysql/statements.properties
+++ b/libraries/kiwi/kiwi-triplestore/src/main/resources/org/apache/marmotta/kiwi/persistence/mysql/statements.properties
@@ -23,12 +23,15 @@ meta.version           = SELECT mvalue FROM metadata WHERE mkey = 'version';
 # get sequence numbers
 seq.nodes.prep         = UPDATE seq_nodes SET id=LAST_INSERT_ID(id+1);
 seq.nodes              = SELECT LAST_INSERT_ID();
+seq.nodes.set          = UPDATE seq_nodes SET id=?;
 
 seq.triples.prep       = UPDATE seq_triples SET id=LAST_INSERT_ID(id+1);
 seq.triples            = SELECT LAST_INSERT_ID();
+seq.triples.set        = UPDATE seq_triples SET id=?;
 
 seq.namespaces.prep    = UPDATE seq_namespaces SET id=LAST_INSERT_ID(id+1);
 seq.namespaces         = SELECT LAST_INSERT_ID();
+seq.namespaces.set     = UPDATE seq_namespaces SET id=?;
 
 # load entities
 load.node_by_id        = SELECT id,ntype,svalue,ivalue,dvalue,tvalue,bvalue,lang,ltype,createdAt FROM nodes WHERE id = ?
@@ -41,10 +44,10 @@ load.literal_by_v     = SELECT id,ntype,svalue,ivalue,dvalue,tvalue,bvalue,lang,
 load.literal_by_vl    = SELECT id,ntype,svalue,ivalue,dvalue,tvalue,bvalue,lang,ltype,createdAt FROM nodes WHERE svalue = ? AND lang = ?
 load.literal_by_vt    = SELECT id,ntype,svalue,ivalue,dvalue,tvalue,bvalue,lang,ltype,createdAt FROM nodes WHERE svalue = ? AND ltype = ?
 
-load.literal_by_iv     = SELECT id,ntype,svalue,ivalue,dvalue,tvalue,bvalue,lang,ltype,createdAt FROM nodes WHERE ivalue = ? AND lang IS NULL AND ltype = ?
-load.literal_by_dv     = SELECT id,ntype,svalue,ivalue,dvalue,tvalue,bvalue,lang,ltype,createdAt FROM nodes WHERE dvalue = ? AND lang IS NULL AND ltype = ?
-load.literal_by_tv     = SELECT id,ntype,svalue,ivalue,dvalue,tvalue,bvalue,lang,ltype,createdAt FROM nodes WHERE tvalue = ? AND lang IS NULL AND ltype = ?
-load.literal_by_bv     = SELECT id,ntype,svalue,ivalue,dvalue,tvalue,bvalue,lang,ltype,createdAt FROM nodes WHERE bvalue = ? AND lang IS NULL AND ltype = ?
+load.literal_by_iv     = SELECT id,ntype,svalue,ivalue,dvalue,tvalue,bvalue,ltype,createdAt FROM nodes WHERE ivalue = ? AND lang IS NULL AND ltype = ?
+load.literal_by_dv     = SELECT id,ntype,svalue,ivalue,dvalue,tvalue,bvalue,ltype,createdAt FROM nodes WHERE dvalue = ? AND lang IS NULL AND ltype = ?
+load.literal_by_tv     = SELECT id,ntype,svalue,ivalue,dvalue,tvalue,bvalue,ltype,createdAt FROM nodes WHERE tvalue = ? AND lang IS NULL AND ltype = ?
+load.literal_by_bv     = SELECT id,ntype,svalue,ivalue,dvalue,tvalue,bvalue,ltype,createdAt FROM nodes WHERE bvalue = ? AND lang IS NULL AND ltype = ?
 
 
 load.namespace_prefix  = SELECT id,prefix,uri,createdAt FROM namespaces WHERE prefix = ?;
@@ -65,15 +68,21 @@ store.tliteral       = INSERT INTO nodes (id,ntype,svalue,tvalue,ltype,createdAt
 
 store.namespace      = INSERT INTO namespaces (id,prefix,uri,createdAt) VALUES (?,?,?,?)
 
-store.triple         = INSERT INTO triples (id,subject,predicate,object,context,inferred,createdAt) VALUES (?,?,?,?,?,?,?)
+store.triple         = INSERT IGNORE INTO triples (id,subject,predicate,object,context,inferred,createdAt) VALUES (?,?,?,?,?,?,?)
+load.triple          = SELECT id FROM triples WHERE subject = ? AND predicate = ? AND object = ? AND context = ? AND deleted = false AND inferred = true
 
 
-query.size           = SELECT count(*) FROM triples WHERE deleted = false
-query.size_ctx       = SELECT count(*) FROM triples WHERE context = ? AND deleted = false
+query.size           = SELECT count(*) FROM triples WHERE deleted = false AND inferred = false
+query.size_ctx       = SELECT count(*) FROM triples WHERE context = ? AND deleted = false AND inferred = false
 query.contexts       = SELECT DISTINCT context FROM triples WHERE deleted = false
 query.namespaces     = SELECT id,prefix,uri,createdAt FROM namespaces
+query.resources      = SELECT id,ntype,svalue,createdAt FROM nodes WHERE ntype = 'uri' OR ntype = 'bnode'
+query.resources_prefix = SELECT id,ntype,svalue,createdAt FROM nodes WHERE ntype = 'uri' AND svalue LIKE ?
 
 # delete entities
 delete.triple        = UPDATE triples SET deleted = true, deletedAt = now() WHERE id = ?
 undelete.triple      = UPDATE triples SET deleted = false, deletedAt = NULL WHERE id = ?
 delete.namespace     = DELETE FROM namespaces WHERE id = ?
+
+gc.check_consistency = SELECT svalue, ntype, count(id), max(id) FROM nodes group by svalue, ntype having count(id) > 1
+gc.list_node_ids     = SELECT id FROM nodes WHERE svalue = ? AND ntype = ? AND id != ?

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/kiwi/kiwi-triplestore/src/main/resources/org/apache/marmotta/kiwi/persistence/mysql/upgrade_base_001_002.sql
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-triplestore/src/main/resources/org/apache/marmotta/kiwi/persistence/mysql/upgrade_base_001_002.sql b/libraries/kiwi/kiwi-triplestore/src/main/resources/org/apache/marmotta/kiwi/persistence/mysql/upgrade_base_001_002.sql
new file mode 100644
index 0000000..1dc5df4
--- /dev/null
+++ b/libraries/kiwi/kiwi-triplestore/src/main/resources/org/apache/marmotta/kiwi/persistence/mysql/upgrade_base_001_002.sql
@@ -0,0 +1,24 @@
+-- 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.
+
+UPDATE metadata SET mvalue = '2' WHERE mkey = 'version';
+
+-- update nodes.svalue to longtext
+ALTER TABLE nodes MODIFY svalue LONGTEXT NOT NULL;
+
+ALTER TABLE nodes ADD CONSTRAINT nodes_unique UNIQUE (ntype,svalue);
+
+-- drop not null on triples.context
+ALTER TABLE triples MODIFY context bigint     REFERENCES nodes(id);

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/kiwi/kiwi-triplestore/src/main/resources/org/apache/marmotta/kiwi/persistence/pgsql/create_base_tables.sql
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-triplestore/src/main/resources/org/apache/marmotta/kiwi/persistence/pgsql/create_base_tables.sql b/libraries/kiwi/kiwi-triplestore/src/main/resources/org/apache/marmotta/kiwi/persistence/pgsql/create_base_tables.sql
index d60fdc7..a57a297 100644
--- a/libraries/kiwi/kiwi-triplestore/src/main/resources/org/apache/marmotta/kiwi/persistence/pgsql/create_base_tables.sql
+++ b/libraries/kiwi/kiwi-triplestore/src/main/resources/org/apache/marmotta/kiwi/persistence/pgsql/create_base_tables.sql
@@ -37,7 +37,7 @@ CREATE TABLE triples (
   subject   bigint     NOT NULL REFERENCES nodes(id),
   predicate bigint     NOT NULL REFERENCES nodes(id),
   object    bigint     NOT NULL REFERENCES nodes(id),
-  context   bigint     NOT NULL REFERENCES nodes(id),
+  context   bigint     REFERENCES nodes(id),
   creator   bigint     REFERENCES nodes(id),
   inferred  boolean    DEFAULT false,
   deleted   boolean    DEFAULT false,
@@ -67,21 +67,27 @@ CREATE TABLE metadata (
 CREATE INDEX idx_node_content ON nodes USING hash(svalue);
 CREATE INDEX idx_literal_lang ON nodes(lang) WHERE ntype = 'string';
 
-CREATE INDEX idx_triples_s ON triples(subject) WHERE deleted = false;
-CREATE INDEX idx_triples_o ON triples(object) WHERE deleted = false;
-CREATE INDEX idx_triples_sp ON triples(subject,predicate) WHERE deleted = false;
-CREATE INDEX idx_triples_po ON triples(predicate,object) WHERE deleted = false;
+CREATE INDEX idx_triples_op ON triples(object,predicate) WHERE deleted = false;
 CREATE INDEX idx_triples_spo ON triples(subject,predicate,object) WHERE deleted = false;
-CREATE INDEX idx_triples_cs ON triples(context,subject) WHERE deleted = false;
-CREATE INDEX idx_triples_csp ON triples(context,subject,predicate) WHERE deleted = false;
 CREATE INDEX idx_triples_cspo ON triples(context,subject,predicate,object) WHERE deleted = false;
 
+
 CREATE INDEX idx_namespaces_uri ON namespaces(uri);
 CREATE INDEX idx_namespaces_prefix ON namespaces(prefix);
 
 
+-- a rule to ignore duplicate inserts into triple table
+CREATE OR REPLACE RULE "triples_ignore_duplicates" AS
+ON INSERT TO triples
+  WHERE EXISTS(
+      SELECT 1 FROM triples
+      WHERE id = NEW.id
+  )
+DO INSTEAD NOTHING;
+
+
 -- a function for cleaning up table rows without incoming references
 
 -- insert initial metadata
-INSERT INTO metadata(mkey,mvalue) VALUES ('version','1');
+INSERT INTO metadata(mkey,mvalue) VALUES ('version','2');
 INSERT INTO metadata(mkey,mvalue) VALUES ('created',to_char(now(),'yyyy-MM-DD HH:mm:ss TZ') );
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/kiwi/kiwi-triplestore/src/main/resources/org/apache/marmotta/kiwi/persistence/pgsql/drop_base_tables.sql
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-triplestore/src/main/resources/org/apache/marmotta/kiwi/persistence/pgsql/drop_base_tables.sql b/libraries/kiwi/kiwi-triplestore/src/main/resources/org/apache/marmotta/kiwi/persistence/pgsql/drop_base_tables.sql
index e3199b8..5a34920 100644
--- a/libraries/kiwi/kiwi-triplestore/src/main/resources/org/apache/marmotta/kiwi/persistence/pgsql/drop_base_tables.sql
+++ b/libraries/kiwi/kiwi-triplestore/src/main/resources/org/apache/marmotta/kiwi/persistence/pgsql/drop_base_tables.sql
@@ -15,13 +15,8 @@
 DROP INDEX idx_node_content;
 DROP INDEX idx_literal_lang;
 
-DROP INDEX idx_triples_s;
-DROP INDEX idx_triples_o;
-DROP INDEX idx_triples_sp;
-DROP INDEX idx_triples_po;
+DROP INDEX idx_triples_op;
 DROP INDEX idx_triples_spo;
-DROP INDEX idx_triples_cs;
-DROP INDEX idx_triples_csp;
 DROP INDEX idx_triples_cspo;
 
 DROP INDEX idx_namespaces_uri;

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/kiwi/kiwi-triplestore/src/main/resources/org/apache/marmotta/kiwi/persistence/pgsql/statements.properties
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-triplestore/src/main/resources/org/apache/marmotta/kiwi/persistence/pgsql/statements.properties b/libraries/kiwi/kiwi-triplestore/src/main/resources/org/apache/marmotta/kiwi/persistence/pgsql/statements.properties
index 2b2f0c6..2ae6fa6 100644
--- a/libraries/kiwi/kiwi-triplestore/src/main/resources/org/apache/marmotta/kiwi/persistence/pgsql/statements.properties
+++ b/libraries/kiwi/kiwi-triplestore/src/main/resources/org/apache/marmotta/kiwi/persistence/pgsql/statements.properties
@@ -22,8 +22,11 @@ meta.version           = SELECT mvalue FROM metadata WHERE mkey = 'version';
 
 # get sequence numbers
 seq.nodes              = SELECT nextval('seq_nodes')
+seq.nodes.set          = SELECT setval('seq_nodes',?)
 seq.triples            = SELECT nextval('seq_triples')
+seq.triples.set        = SELECT setval('seq_triples',?)
 seq.namespaces         = SELECT nextval('seq_namespaces')
+seq.namespaces.set     = SELECT setval('seq_namespaces',?)
 
 # load entities
 load.node_by_id        = SELECT id,ntype,svalue,ivalue,dvalue,tvalue,bvalue,lang,ltype,createdAt FROM nodes WHERE id = ?
@@ -36,10 +39,10 @@ load.literal_by_v     = SELECT id,ntype,svalue,ivalue,dvalue,tvalue,bvalue,lang,
 load.literal_by_vl    = SELECT id,ntype,svalue,ivalue,dvalue,tvalue,bvalue,lang,ltype,createdAt FROM nodes WHERE svalue = ? AND lang = ?
 load.literal_by_vt    = SELECT id,ntype,svalue,ivalue,dvalue,tvalue,bvalue,lang,ltype,createdAt FROM nodes WHERE svalue = ? AND ltype = ?
 
-load.literal_by_iv     = SELECT id,ntype,svalue,ivalue,dvalue,tvalue,bvalue,lang,ltype,createdAt FROM nodes WHERE ivalue = ? AND lang IS NULL AND ltype = ?
-load.literal_by_dv     = SELECT id,ntype,svalue,ivalue,dvalue,tvalue,bvalue,lang,ltype,createdAt FROM nodes WHERE dvalue = ? AND lang IS NULL AND ltype = ?
-load.literal_by_tv     = SELECT id,ntype,svalue,ivalue,dvalue,tvalue,bvalue,lang,ltype,createdAt FROM nodes WHERE tvalue = ? AND lang IS NULL AND ltype = ?
-load.literal_by_bv     = SELECT id,ntype,svalue,ivalue,dvalue,tvalue,bvalue,lang,ltype,createdAt FROM nodes WHERE bvalue = ? AND lang IS NULL AND ltype = ?
+load.literal_by_iv     = SELECT id,ntype,svalue,ivalue,dvalue,tvalue,bvalue,ltype,createdAt FROM nodes WHERE ivalue = ? AND lang IS NULL AND ltype = ?
+load.literal_by_dv     = SELECT id,ntype,svalue,ivalue,dvalue,tvalue,bvalue,ltype,createdAt FROM nodes WHERE dvalue = ? AND lang IS NULL AND ltype = ?
+load.literal_by_tv     = SELECT id,ntype,svalue,ivalue,dvalue,tvalue,bvalue,ltype,createdAt FROM nodes WHERE tvalue = ? AND lang IS NULL AND ltype = ?
+load.literal_by_bv     = SELECT id,ntype,svalue,ivalue,dvalue,tvalue,bvalue,ltype,createdAt FROM nodes WHERE bvalue = ? AND lang IS NULL AND ltype = ?
 
 load.namespace_prefix  = SELECT id,prefix,uri,createdAt FROM namespaces WHERE prefix = ?;
 load.namespace_uri     = SELECT id,prefix,uri,createdAt FROM namespaces WHERE uri = ?;
@@ -59,13 +62,19 @@ store.tliteral       = INSERT INTO nodes (id,ntype,svalue,tvalue,ltype,createdAt
 store.namespace      = INSERT INTO namespaces (id,prefix,uri,createdAt) VALUES (?,?,?,?)
 
 store.triple         = INSERT INTO triples (id,subject,predicate,object,context,inferred,createdAt) VALUES (?,?,?,?,?,?,?)
+load.triple          = SELECT id FROM triples WHERE subject = ? AND predicate = ? AND object = ? AND context = ? AND deleted = false
 
-query.size           = SELECT count(*) FROM triples WHERE deleted = false
-query.size_ctx       = SELECT count(*) FROM triples WHERE context = ? AND deleted = false
+query.size           = SELECT count(*) FROM triples WHERE deleted = false AND inferred = false
+query.size_ctx       = SELECT count(*) FROM triples WHERE context = ? AND deleted = false AND inferred = false
 query.contexts       = SELECT DISTINCT context FROM triples WHERE deleted = false
 query.namespaces     = SELECT id,prefix,uri,createdAt FROM namespaces
+query.resources      = SELECT id,ntype,svalue,createdAt FROM nodes WHERE ntype = 'uri' OR ntype = 'bnode'
+query.resources_prefix = SELECT id,ntype,svalue,createdAt FROM nodes WHERE ntype = 'uri' AND svalue LIKE ?
 
 # delete entities
 delete.triple        = UPDATE triples SET deleted = true, deletedAt = now() WHERE id = ?
 undelete.triple      = UPDATE triples SET deleted = false, deletedAt = NULL WHERE id = ?
 delete.namespace     = DELETE FROM namespaces WHERE id = ?
+
+gc.check_consistency = SELECT svalue, ntype, count(id), max(id) FROM nodes group by svalue, ntype having count(id) > 1
+gc.list_node_ids     = SELECT id FROM nodes WHERE svalue = ? AND ntype = CAST(? AS nodetype) AND id != ?

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/kiwi/kiwi-triplestore/src/main/resources/org/apache/marmotta/kiwi/persistence/pgsql/upgrade_base_001_002.sql
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-triplestore/src/main/resources/org/apache/marmotta/kiwi/persistence/pgsql/upgrade_base_001_002.sql b/libraries/kiwi/kiwi-triplestore/src/main/resources/org/apache/marmotta/kiwi/persistence/pgsql/upgrade_base_001_002.sql
new file mode 100644
index 0000000..eb794e8
--- /dev/null
+++ b/libraries/kiwi/kiwi-triplestore/src/main/resources/org/apache/marmotta/kiwi/persistence/pgsql/upgrade_base_001_002.sql
@@ -0,0 +1,19 @@
+-- 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.
+
+UPDATE METADATA SET mvalue = '2' WHERE mkey = 'version';
+
+-- drop not null on triples.context
+ALTER TABLE triples ALTER COLUMN context DROP NOT NULL;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/kiwi/kiwi-triplestore/src/test/java/org/apache/marmotta/kiwi/test/ConcurrencyTestBase.java
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-triplestore/src/test/java/org/apache/marmotta/kiwi/test/ConcurrencyTestBase.java b/libraries/kiwi/kiwi-triplestore/src/test/java/org/apache/marmotta/kiwi/test/ConcurrencyTestBase.java
new file mode 100644
index 0000000..517efe9
--- /dev/null
+++ b/libraries/kiwi/kiwi-triplestore/src/test/java/org/apache/marmotta/kiwi/test/ConcurrencyTestBase.java
@@ -0,0 +1,189 @@
+/*
+ * 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.kiwi.test;
+
+import com.google.code.tempusfugit.concurrency.ConcurrentRule;
+import com.google.code.tempusfugit.concurrency.RepeatingRule;
+import com.google.code.tempusfugit.concurrency.annotations.Concurrent;
+import com.google.code.tempusfugit.concurrency.annotations.Repeating;
+import org.apache.commons.lang3.RandomStringUtils;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.TestWatcher;
+import org.junit.runner.Description;
+import org.openrdf.model.Statement;
+import org.openrdf.model.URI;
+import org.openrdf.model.Value;
+import org.openrdf.repository.Repository;
+import org.openrdf.repository.RepositoryConnection;
+import org.slf4j.Logger;
+
+import java.util.*;
+
+/**
+ * Add file description here!
+ *
+ * @author Sebastian Schaffert (sschaffert@apache.org)
+ */
+public abstract class ConcurrencyTestBase {
+
+    protected static Repository repository;
+
+    protected static Random rnd;
+
+    private static long runs = 0;
+
+    protected static Logger logger;
+
+    private List<URI> resources = new ArrayList<>();
+
+    private List<Value> objects = new ArrayList<>();
+
+    private Set<Statement> allAddedTriples = new HashSet<>();
+
+    @Rule
+    public ConcurrentRule concurrently = new ConcurrentRule();
+
+    @Rule
+    public RepeatingRule repeatedly = new RepeatingRule();
+
+    @Rule
+    public TestWatcher watchman = new TestWatcher() {
+        /**
+         * Invoked when a test is about to start
+         */
+        @Override
+        protected void starting(Description description) {
+            logger.info("{} being run...", description.getMethodName());
+        }
+
+        /**
+         * Invoked when a test method finishes (whether passing or failing)
+         */
+        @Override
+        protected void finished(Description description) {
+            logger.info("{}: {} added triples, {} removed triples, {} resources reused, {} objects reused", description.getMethodName(), tripleAddCount, tripleRemoveCount, resourcesReused, objectsReused);
+        }
+    };
+
+    long tripleAddCount = 0;
+    long tripleRemoveCount = 0;
+
+    long resourcesReused = 0;
+    long objectsReused = 0;
+
+    @Test
+    @Concurrent(count = 10)
+    @Repeating(repetition = 10)
+    public void testConcurrency() throws Exception {
+        long run = runs++;
+        long removed = 0;
+
+        Set<Statement> addedTriples = new HashSet<>();
+
+        // generate random nodes and triples and add them
+        RepositoryConnection con = repository.getConnection();
+        try {
+            for(int i=0; i< rnd.nextInt(1000); i++) {
+                // there is a random chance of deleting a previously added triple, either from this session or from
+                // a previous session
+                if(allAddedTriples.size() + addedTriples.size() > 0 && rnd.nextInt(10) == 0) {
+                    List<Statement> statements = new ArrayList<>();
+                    synchronized (allAddedTriples) {
+                        statements.addAll(allAddedTriples);
+                    }
+                    statements.addAll(addedTriples);
+
+                    con.remove(statements.get(rnd.nextInt(statements.size())));
+
+                    removed ++;
+                    tripleRemoveCount++;
+                } else {
+                    URI subject = randomURI();
+                    URI predicate = randomURI();
+                    Value object = randomObject();
+                    Statement stmt = con.getValueFactory().createStatement(subject,predicate,object);
+                    con.add(stmt);
+                    addedTriples.add(stmt);
+                    tripleAddCount++;
+                }
+            }
+            con.commit();
+
+            // commit also all added triples
+            synchronized (allAddedTriples) {
+                allAddedTriples.addAll(addedTriples);
+            }
+        } finally {
+            con.close();
+        }
+
+
+        logger.info("run {}: triples added: {}; triples removed: {}", run, addedTriples.size(), removed);
+    }
+
+
+    /**
+     * Return a random URI, with a 10% chance of returning a URI that has already been used.
+     * @return
+     */
+    protected URI randomURI() {
+        if(resources.size() > 0 && rnd.nextInt(10) == 0) {
+            resourcesReused++;
+            // return a resource that was already used
+            return resources.get(rnd.nextInt(resources.size()));
+        } else {
+            URI resource = repository.getValueFactory().createURI("http://localhost/"+ RandomStringUtils.randomAlphanumeric(8));
+            resources.add(resource);
+            return resource;
+        }
+    }
+
+    /**
+     * Return a random RDF value, either a reused object (10% chance) or of any other kind.
+     * @return
+     */
+    protected Value randomObject() {
+        if(objects.size() > 0 && rnd.nextInt(10) == 0) {
+            objectsReused++;
+            return objects.get(rnd.nextInt(objects.size()));
+        } else {
+            Value object;
+            switch(rnd.nextInt(6)) {
+                case 0: object = repository.getValueFactory().createURI("http://localhost/"+ RandomStringUtils.randomAlphanumeric(8));
+                    break;
+                case 1: object = repository.getValueFactory().createBNode();
+                    break;
+                case 2: object = repository.getValueFactory().createLiteral(RandomStringUtils.randomAscii(40));
+                    break;
+                case 3: object = repository.getValueFactory().createLiteral(rnd.nextInt());
+                    break;
+                case 4: object = repository.getValueFactory().createLiteral(rnd.nextDouble());
+                    break;
+                case 5: object = repository.getValueFactory().createLiteral(rnd.nextBoolean());
+                    break;
+                default: object = repository.getValueFactory().createURI("http://localhost/"+ RandomStringUtils.randomAlphanumeric(8));
+                    break;
+
+            }
+            objects.add(object);
+            return object;
+        }
+
+    }
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/kiwi/kiwi-triplestore/src/test/java/org/apache/marmotta/kiwi/test/DialectTest.java
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-triplestore/src/test/java/org/apache/marmotta/kiwi/test/DialectTest.java b/libraries/kiwi/kiwi-triplestore/src/test/java/org/apache/marmotta/kiwi/test/DialectTest.java
index a7af15b..ed47cee 100644
--- a/libraries/kiwi/kiwi-triplestore/src/test/java/org/apache/marmotta/kiwi/test/DialectTest.java
+++ b/libraries/kiwi/kiwi-triplestore/src/test/java/org/apache/marmotta/kiwi/test/DialectTest.java
@@ -1,13 +1,12 @@
-/**
- * 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
+/*
+ * 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
+ *      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,
@@ -17,66 +16,32 @@
  */
 package org.apache.marmotta.kiwi.test;
 
+import static org.hamcrest.Matchers.hasItem;
+
+import java.util.Set;
+
+import org.apache.marmotta.kiwi.config.KiWiConfiguration;
 import org.apache.marmotta.kiwi.persistence.KiWiDialect;
-import org.apache.marmotta.kiwi.persistence.h2.H2Dialect;
-import org.apache.marmotta.kiwi.persistence.mysql.MySQLDialect;
-import org.apache.marmotta.kiwi.persistence.pgsql.PostgreSQLDialect;
+import org.apache.marmotta.kiwi.test.junit.KiWiDatabaseRunner;
 import org.junit.Assert;
-import org.junit.Rule;
 import org.junit.Test;
-import org.junit.rules.MethodRule;
-import org.junit.rules.TestWatcher;
-import org.junit.rules.TestWatchman;
-import org.junit.runner.Description;
 import org.junit.runner.RunWith;
-import org.junit.runners.Parameterized;
-import org.junit.runners.model.FrameworkMethod;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Set;
-
-import static org.hamcrest.Matchers.hasItem;
-
 /**
  * Test if the dialects returns correct values
  * <p/>
- * Author: Sebastian Schaffert
+ * @author Sebastian Schaffert
  */
-@RunWith(Parameterized.class)
+@RunWith(KiWiDatabaseRunner.class)
 public class DialectTest {
 
-    public KiWiDialect dialect;
-
-
-    /**
-     * Return database configurations if the appropriate parameters have been set.
-     *
-     * @return an array (database name)
-     */
-    @Parameterized.Parameters(name="Database Test {index}: {0}")
-    public static Iterable<Object[]> databases() {
-        String[] databases = {"H2", "PostgreSQL", "MySQL"};
-
-        List<Object[]> result = new ArrayList<Object[]>(databases.length);
-        for(String database : databases) {
-                result.add(new Object[] {
-                        database
-                });
-        }
-        return result;
-    }
+    public final KiWiDialect dialect;
 
-    public DialectTest(String database) {
-        if("H2".equals(database)) {
-            this.dialect = new H2Dialect();
-        } else if("MySQL".equals(database)) {
-            this.dialect = new MySQLDialect();
-        } else if("PostgreSQL".equals(database)) {
-            this.dialect = new PostgreSQLDialect();
-        }
+
+    public DialectTest(KiWiConfiguration configuration) {
+        this.dialect = configuration.getDialect();
     }
 
     @Test
@@ -110,22 +75,17 @@ public class DialectTest {
         String migrateScript = dialect.getMigrationScript(1,"base");
 
         Assert.assertNotNull(migrateScript);
-        Assert.assertTrue("".equals(migrateScript));
+        Assert.assertFalse("".equals(migrateScript));
+
+        String migrateScript2 = dialect.getMigrationScript(2,"base");
+
+        Assert.assertNotNull(migrateScript2);
+        Assert.assertTrue("".equals(migrateScript2));
     }
 
 
     final Logger logger =
             LoggerFactory.getLogger(DialectTest.class);
 
-    @Rule
-    public TestWatcher watchman = new TestWatcher() {
-        /**
-         * Invoked when a test is about to start
-         */
-        @Override
-        protected void starting(Description description) {
-            logger.info("{} being run...", description.getMethodName());
-        }
-    };
 
 }

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/kiwi/kiwi-triplestore/src/test/java/org/apache/marmotta/kiwi/test/H2ConcurrencyTest.java
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-triplestore/src/test/java/org/apache/marmotta/kiwi/test/H2ConcurrencyTest.java b/libraries/kiwi/kiwi-triplestore/src/test/java/org/apache/marmotta/kiwi/test/H2ConcurrencyTest.java
new file mode 100644
index 0000000..b526a0f
--- /dev/null
+++ b/libraries/kiwi/kiwi-triplestore/src/test/java/org/apache/marmotta/kiwi/test/H2ConcurrencyTest.java
@@ -0,0 +1,67 @@
+/*
+ * 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.kiwi.test;
+
+import static org.junit.Assert.assertTrue;
+
+import java.sql.SQLException;
+import java.util.Random;
+
+import org.apache.marmotta.kiwi.config.KiWiConfiguration;
+import org.apache.marmotta.kiwi.persistence.h2.H2Dialect;
+import org.apache.marmotta.kiwi.sail.KiWiStore;
+import org.apache.marmotta.kiwi.test.helper.DBConnectionChecker;
+import org.apache.marmotta.kiwi.test.junit.KiWiDatabaseRunner;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.openrdf.repository.RepositoryException;
+import org.openrdf.repository.sail.SailRepository;
+import org.openrdf.sail.SailException;
+import org.slf4j.LoggerFactory;
+
+/**
+ * This test starts many triplestore operations in parallel to check if concurrent operations will break things,
+ *
+ * @author Sebastian Schaffert (sschaffert@apache.org)
+ */
+public class H2ConcurrencyTest extends ConcurrencyTestBase {
+
+    private static KiWiStore store;
+
+    @BeforeClass
+    public static void setup() throws RepositoryException {
+        logger = LoggerFactory.getLogger(H2ConcurrencyTest.class);
+
+        KiWiConfiguration h2Config = KiWiDatabaseRunner.createKiWiConfig("H2", new H2Dialect());
+        DBConnectionChecker.checkDatabaseAvailability(h2Config);
+        
+        rnd = new Random();
+
+        store = new KiWiStore(h2Config);
+        repository = new SailRepository(store);
+        repository.initialize();
+    }
+
+    @AfterClass
+    public static void dropDatabase() throws RepositoryException, SQLException, SailException {
+        assertTrue(store.checkConsistency());
+        store.closeValueFactory(); // release all connections before dropping the database
+        store.getPersistence().dropDatabase();
+        repository.shutDown();
+    }
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/kiwi/kiwi-triplestore/src/test/java/org/apache/marmotta/kiwi/test/MySQLConcurrencyTest.java
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-triplestore/src/test/java/org/apache/marmotta/kiwi/test/MySQLConcurrencyTest.java b/libraries/kiwi/kiwi-triplestore/src/test/java/org/apache/marmotta/kiwi/test/MySQLConcurrencyTest.java
new file mode 100644
index 0000000..29bfabf
--- /dev/null
+++ b/libraries/kiwi/kiwi-triplestore/src/test/java/org/apache/marmotta/kiwi/test/MySQLConcurrencyTest.java
@@ -0,0 +1,69 @@
+/*
+ * 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.kiwi.test;
+
+import static org.junit.Assert.assertTrue;
+
+import java.sql.SQLException;
+import java.util.Random;
+
+import org.apache.marmotta.kiwi.config.KiWiConfiguration;
+import org.apache.marmotta.kiwi.persistence.mysql.MySQLDialect;
+import org.apache.marmotta.kiwi.sail.KiWiStore;
+import org.apache.marmotta.kiwi.test.helper.DBConnectionChecker;
+import org.apache.marmotta.kiwi.test.junit.KiWiDatabaseRunner;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.openrdf.repository.RepositoryException;
+import org.openrdf.repository.sail.SailRepository;
+import org.openrdf.sail.SailException;
+import org.slf4j.LoggerFactory;
+
+/**
+ * This test starts many triplestore operations in parallel to check if concurrent operations will break things,
+ *
+ * @author Sebastian Schaffert (sschaffert@apache.org)
+ */
+public class MySQLConcurrencyTest extends ConcurrencyTestBase {
+
+    private static KiWiStore store;
+
+    @BeforeClass
+    public static void setup() throws RepositoryException {
+        logger = LoggerFactory.getLogger(MySQLConcurrencyTest.class);
+
+        KiWiConfiguration mysqlConfig = KiWiDatabaseRunner.createKiWiConfig("MySQL", new MySQLDialect());
+        DBConnectionChecker.checkDatabaseAvailability(mysqlConfig);
+        
+        rnd = new Random();
+
+        store = new KiWiStore(mysqlConfig);
+        repository = new SailRepository(store);
+        repository.initialize();
+    }
+
+    @AfterClass
+    public static void dropDatabase() throws RepositoryException, SQLException, SailException {
+    	if (store != null && store.isInitialized()) {
+            assertTrue(store.checkConsistency());
+            store.closeValueFactory(); // release all connections before dropping the database 
+            store.getPersistence().dropDatabase();
+            repository.shutDown();
+    	}
+    }
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/kiwi/kiwi-triplestore/src/test/java/org/apache/marmotta/kiwi/test/PersistenceTest.java
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-triplestore/src/test/java/org/apache/marmotta/kiwi/test/PersistenceTest.java b/libraries/kiwi/kiwi-triplestore/src/test/java/org/apache/marmotta/kiwi/test/PersistenceTest.java
index 15f8a52..1f9245e 100644
--- a/libraries/kiwi/kiwi-triplestore/src/test/java/org/apache/marmotta/kiwi/test/PersistenceTest.java
+++ b/libraries/kiwi/kiwi-triplestore/src/test/java/org/apache/marmotta/kiwi/test/PersistenceTest.java
@@ -1,13 +1,12 @@
-/**
- * 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
+/*
+ * 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
+ *      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,
@@ -18,134 +17,68 @@
 package org.apache.marmotta.kiwi.test;
 
 import static org.apache.marmotta.commons.sesame.model.LiteralCommons.getRDFLangStringType;
+import static org.hamcrest.Matchers.hasItem;
+import static org.hamcrest.Matchers.hasItems;
+import info.aduna.iteration.Iterations;
+
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.util.Date;
+import java.util.List;
+import java.util.Locale;
+import java.util.Random;
 
+import org.apache.commons.lang3.RandomStringUtils;
 import org.apache.marmotta.commons.sesame.model.Namespaces;
 import org.apache.marmotta.commons.util.DateUtils;
-import info.aduna.iteration.Iterations;
-import org.apache.commons.lang.RandomStringUtils;
-import org.apache.marmotta.kiwi.model.rdf.*;
+import org.apache.marmotta.kiwi.config.KiWiConfiguration;
+import org.apache.marmotta.kiwi.model.rdf.KiWiAnonResource;
+import org.apache.marmotta.kiwi.model.rdf.KiWiBooleanLiteral;
+import org.apache.marmotta.kiwi.model.rdf.KiWiDateLiteral;
+import org.apache.marmotta.kiwi.model.rdf.KiWiDoubleLiteral;
+import org.apache.marmotta.kiwi.model.rdf.KiWiIntLiteral;
+import org.apache.marmotta.kiwi.model.rdf.KiWiLiteral;
+import org.apache.marmotta.kiwi.model.rdf.KiWiNamespace;
+import org.apache.marmotta.kiwi.model.rdf.KiWiNode;
+import org.apache.marmotta.kiwi.model.rdf.KiWiResource;
+import org.apache.marmotta.kiwi.model.rdf.KiWiStringLiteral;
+import org.apache.marmotta.kiwi.model.rdf.KiWiTriple;
+import org.apache.marmotta.kiwi.model.rdf.KiWiUriResource;
 import org.apache.marmotta.kiwi.persistence.KiWiConnection;
-import org.apache.marmotta.kiwi.persistence.KiWiDialect;
 import org.apache.marmotta.kiwi.persistence.KiWiPersistence;
-import org.apache.marmotta.kiwi.persistence.h2.H2Dialect;
-import org.apache.marmotta.kiwi.persistence.mysql.MySQLDialect;
-import org.apache.marmotta.kiwi.persistence.pgsql.PostgreSQLDialect;
-import org.apache.marmotta.kiwi.test.helper.DBConnectionChecker;
+import org.apache.marmotta.kiwi.test.junit.KiWiDatabaseRunner;
 import org.junit.After;
 import org.junit.Assert;
 import org.junit.Before;
-import org.junit.Rule;
 import org.junit.Test;
-import org.junit.rules.TestWatcher;
-import org.junit.runner.Description;
 import org.junit.runner.RunWith;
-import org.junit.runners.Parameterized;
 import org.openrdf.model.Statement;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.sql.PreparedStatement;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-import java.util.Locale;
-import java.util.Random;
-
-import static org.hamcrest.Matchers.hasItem;
-import static org.hamcrest.Matchers.hasItems;
 
 /**
- * This test verifies the persistence functionality of the KiWi triple store. It will try running over all
- * available databases. Except for in-memory databases like H2 or Derby, database URLs must be passed as
- * system property, or otherwise the test is skipped for this database. Available system properties:
- * <ul>
- *     <li>PostgreSQL:
- *     <ul>
- *         <li>postgresql.url, e.g. jdbc:postgresql://localhost:5433/kiwitest?prepareThreshold=3</li>
- *         <li>postgresql.user (default: lmf)</li>
- *         <li>postgresql.pass (default: lmf)</li>
- *     </ul>
- *     </li>
- *     <li>MySQL:
- *     <ul>
- *         <li>mysql.url, e.g. jdbc:mysql://localhost:3306/kiwitest?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull</li>
- *         <li>mysql.user (default: lmf)</li>
- *         <li>mysql.pass (default: lmf</li>
- *     </ul>
- *     </li>
- *     <li>H2:
- *     <ul>
- *         <li>h2.url, e.g. jdbc:h2:mem;MVCC=true;DB_CLOSE_ON_EXIT=FALSE;DB_CLOSE_DELAY=10</li>
- *         <li>h2.user (default: lmf)</li>
- *         <li>h2.pass (default: lmf</li>
- *     </ul>
- *     </li>
- * </ul>
+ * This test verifies the persistence functionality of the KiWi triple store. 
  *
  * @see org.apache.marmotta.kiwi.persistence.KiWiConnection
  * @see org.apache.marmotta.kiwi.persistence.KiWiPersistence
- * <p/>
- * Author: Sebastian Schaffert
+ * @author Sebastian Schaffert
  */
-@RunWith(Parameterized.class)
+@RunWith(KiWiDatabaseRunner.class)
 public class PersistenceTest {
 
-    /**
-     * Return database configurations if the appropriate parameters have been set.
-     *
-     * @return an array (database name, url, user, password)
-     */
-    @Parameterized.Parameters(name="Database Test {index}: {0} at {1}")
-    public static Iterable<Object[]> databases() {
-        String[] databases = {"H2", "PostgreSQL", "MySQL"};
-
-        List<Object[]> result = new ArrayList<Object[]>(databases.length);
-        for(String database : databases) {
-            if(System.getProperty(database.toLowerCase()+".url") != null) {
-                result.add(new Object[] {
-                        database,
-                        System.getProperty(database.toLowerCase()+".url"),
-                        System.getProperty(database.toLowerCase()+".user","lmf"),
-                        System.getProperty(database.toLowerCase()+".pass","lmf")
-                });
-            }
-        }
-        return result;
-    }
-
-
-    private KiWiDialect dialect;
-
-    private String jdbcUrl;
-
-    private String jdbcUser;
-
-    private String jdbcPass;
 
     private KiWiPersistence persistence;
 
-    public PersistenceTest(String database, String jdbcUrl, String jdbcUser, String jdbcPass) {
-        this.jdbcPass = jdbcPass;
-        this.jdbcUrl = jdbcUrl;
-        this.jdbcUser = jdbcUser;
-
-        if("H2".equals(database)) {
-            this.dialect = new H2Dialect();
-        } else if("MySQL".equals(database)) {
-            this.dialect = new MySQLDialect();
-        } else if("PostgreSQL".equals(database)) {
-            this.dialect = new PostgreSQLDialect();
-        }
-        
-        DBConnectionChecker.checkDatabaseAvailability(jdbcUrl, jdbcUser, jdbcPass, dialect);
+    private final KiWiConfiguration kiwiConfig;
+
+    public PersistenceTest(KiWiConfiguration kiwiConfig) {
+        this.kiwiConfig = kiwiConfig;
     }
 
 
     @Before
     public void initDatabase() throws SQLException {
-        persistence = new KiWiPersistence("test",jdbcUrl,jdbcUser,jdbcPass,dialect);
+        persistence = new KiWiPersistence(kiwiConfig);
+        persistence.initialise();
         persistence.initDatabase();
     }
 
@@ -156,28 +89,13 @@ public class PersistenceTest {
     }
 
 
-    final Logger logger =
-            LoggerFactory.getLogger(PersistenceTest.class);
-
-    @Rule
-    public TestWatcher watchman = new TestWatcher() {
-        /**
-         * Invoked when a test is about to start
-         */
-        @Override
-        protected void starting(Description description) {
-            logger.info("{} being run...", description.getMethodName());
-        }
-    };
-
-
     @Test
     public void testCreateDropDatabase() throws SQLException {
         // test if database exists and has a version
         KiWiConnection connection = persistence.getConnection();
         try {
             Assert.assertThat(connection.getDatabaseTables(),hasItems("nodes","triples","namespaces"));
-            Assert.assertEquals(1, connection.getDatabaseVersion());
+            Assert.assertEquals(2, connection.getDatabaseVersion());
 
             connection.commit();
         } finally {
@@ -197,7 +115,7 @@ public class PersistenceTest {
         try {
             // add a new URI to the triple store and check if it exists afterwards, before and after commit
             KiWiUriResource uri = new KiWiUriResource("http://localhost/"+ RandomStringUtils.randomAlphanumeric(8));
-            connection.storeNode(uri);
+            connection.storeNode(uri, false);
 
             // check if it then has a database ID
             Assert.assertNotNull(uri.getId());
@@ -226,6 +144,8 @@ public class PersistenceTest {
 
             connection.commit();
 
+            Assert.assertEquals(1,Iterations.asList(connection.listResources()).size());
+
 
             // clear cache and test again
             persistence.clearCache();
@@ -272,7 +192,7 @@ public class PersistenceTest {
         try {
             // add a new URI to the triple store and check if it exists afterwards, before and after commit
             KiWiAnonResource bnode = new KiWiAnonResource(RandomStringUtils.randomAlphanumeric(8));
-            connection.storeNode(bnode);
+            connection.storeNode(bnode, false);
 
             // check if it then has a database ID
             Assert.assertNotNull(bnode.getId());
@@ -301,6 +221,7 @@ public class PersistenceTest {
 
             connection.commit();
 
+            Assert.assertEquals(1,Iterations.asList(connection.listResources()).size());
 
             // clear cache and test again
             persistence.clearCache();
@@ -346,11 +267,11 @@ public class PersistenceTest {
         KiWiConnection connection = persistence.getConnection();
         try {
             KiWiUriResource   stype   = new KiWiUriResource(Namespaces.NS_XSD+"string");
-            connection.storeNode(stype);
+            connection.storeNode(stype, false);
 
             // add a new URI to the triple store and check if it exists afterwards, before and after commit
             KiWiStringLiteral literal = new KiWiStringLiteral(RandomStringUtils.randomAlphanumeric(8),null,stype);
-            connection.storeNode(literal);
+            connection.storeNode(literal, false);
 
             // check if it then has a database ID
             Assert.assertNotNull(literal.getId());
@@ -425,11 +346,11 @@ public class PersistenceTest {
         KiWiConnection connection = persistence.getConnection();
         try {
             KiWiUriResource   stype   = new KiWiUriResource(getRDFLangStringType());
-            connection.storeNode(stype);
+            connection.storeNode(stype, false);
 
             // add a new URI to the triple store and check if it exists afterwards, before and after commit
             KiWiStringLiteral literal = new KiWiStringLiteral(RandomStringUtils.randomAlphanumeric(8), Locale.ENGLISH, stype);
-            connection.storeNode(literal);
+            connection.storeNode(literal, false);
 
             // check if it then has a database ID
             Assert.assertNotNull(literal.getId());
@@ -507,7 +428,7 @@ public class PersistenceTest {
 
             // add a new URI to the triple store and check if it exists afterwards, before and after commit
             KiWiStringLiteral literal = new KiWiStringLiteral(RandomStringUtils.randomAlphanumeric(8), null, uri);
-            connection.storeNode(literal);
+            connection.storeNode(literal, false);
 
             // check if it then has a database ID
             Assert.assertNotNull(literal.getId());
@@ -582,6 +503,89 @@ public class PersistenceTest {
      * @throws SQLException
      */
     @Test
+    public void testStoreBigStringLiteral() throws SQLException {
+        KiWiConnection connection = persistence.getConnection();
+        try {
+            KiWiUriResource uri = new KiWiUriResource("http://localhost/"+ RandomStringUtils.randomAlphanumeric(8));
+
+            // add a new URI to the triple store and check if it exists afterwards, before and after commit
+            KiWiStringLiteral literal = new KiWiStringLiteral(RandomStringUtils.randomAlphanumeric(16384), null, uri);
+            connection.storeNode(literal, false);
+
+            // check if it then has a database ID
+            Assert.assertNotNull(literal.getId());
+
+            KiWiNode testLiteral1 = connection.loadNodeById(literal.getId());
+
+            // needs to be equal, and should also be the identical object!
+            Assert.assertEquals(literal,testLiteral1);
+            Assert.assertEquals(uri,((KiWiLiteral)testLiteral1).getType());
+            Assert.assertTrue(literal == testLiteral1);
+
+            connection.commit();
+
+            KiWiNode testLiteral2 = connection.loadNodeById(literal.getId());
+
+            // needs to be equal, and should also be the identical object!
+            Assert.assertEquals(literal,testLiteral2);
+            Assert.assertEquals(uri,((KiWiLiteral)testLiteral2).getType());
+            Assert.assertTrue(literal == testLiteral2);
+
+            KiWiNode testLiteral3 = connection.loadLiteral(literal.stringValue(),null,uri);
+
+            // needs to be equal, and should also be the identical object!
+            Assert.assertEquals(literal,testLiteral3);
+            Assert.assertEquals(uri,((KiWiLiteral)testLiteral3).getType());
+            Assert.assertTrue(literal == testLiteral3);
+
+            connection.commit();
+
+
+            // clear cache and test again
+            persistence.clearCache();
+            KiWiNode testLiteral4 = connection.loadNodeById(literal.getId());
+
+            // needs to be equal, but now it should not be the same object!
+            Assert.assertEquals(literal,testLiteral4);
+            Assert.assertEquals(uri,((KiWiLiteral)testLiteral4).getType());
+            Assert.assertTrue(literal != testLiteral4);
+
+            KiWiNode testLiteral5 = connection.loadLiteral(literal.stringValue(),null,uri);
+
+            // needs to be equal, but now it should not be the same object!
+            Assert.assertEquals(literal,testLiteral5);
+            Assert.assertEquals(uri,((KiWiLiteral)testLiteral5).getType());
+            Assert.assertTrue(literal != testLiteral5);
+
+            connection.commit();
+
+            // finally do a test on the nodes table, it should contain exactly one entry
+            PreparedStatement checkNodeStmt = connection.getJDBCConnection().prepareStatement("SELECT * FROM nodes WHERE ntype='string'");
+            ResultSet result = checkNodeStmt.executeQuery();
+
+            Assert.assertTrue(result.next());
+            Assert.assertEquals((long)literal.getId(),result.getLong("id"));
+            Assert.assertEquals(literal.stringValue(),result.getString("svalue"));
+            Assert.assertEquals("string",result.getString("ntype"));
+            Assert.assertNull(result.getString("lang"));
+            Assert.assertEquals((long) uri.getId(), result.getLong("ltype"));
+
+            result.close();
+            connection.commit();
+        } finally {
+            connection.close();
+        }
+
+    }
+
+
+
+    /**
+     * Test storing and loading string literals (with type and without language).
+     *
+     * @throws SQLException
+     */
+    @Test
     public void testStoreIntLiteral() throws SQLException {
         KiWiConnection connection = persistence.getConnection();
         try {
@@ -593,7 +597,7 @@ public class PersistenceTest {
 
                     // add a new URI to the triple store and check if it exists afterwards, before and after commit
             KiWiIntLiteral literal = new KiWiIntLiteral(value, uri);
-            connection.storeNode(literal);
+            connection.storeNode(literal, false);
 
             // check if it then has a database ID
             Assert.assertNotNull(literal.getId());
@@ -698,7 +702,7 @@ public class PersistenceTest {
 
             // add a new URI to the triple store and check if it exists afterwards, before and after commit
             KiWiDoubleLiteral literal = new KiWiDoubleLiteral(value, uri);
-            connection.storeNode(literal);
+            connection.storeNode(literal, false);
 
             // check if it then has a database ID
             Assert.assertNotNull(literal.getId());
@@ -802,7 +806,7 @@ public class PersistenceTest {
             boolean value = rnd.nextBoolean();
             // add a new URI to the triple store and check if it exists afterwards, before and after commit
             KiWiBooleanLiteral literal = new KiWiBooleanLiteral(value, uri);
-            connection.storeNode(literal);
+            connection.storeNode(literal, false);
 
             // check if it then has a database ID
             Assert.assertNotNull(literal.getId());
@@ -905,7 +909,7 @@ public class PersistenceTest {
             Date value = new Date();
             // add a new URI to the triple store and check if it exists afterwards, before and after commit
             KiWiDateLiteral literal = new KiWiDateLiteral(value, uri);
-            connection.storeNode(literal);
+            connection.storeNode(literal, false);
 
             // check if it then has a database ID
             Assert.assertNotNull(literal.getId());
@@ -994,6 +998,7 @@ public class PersistenceTest {
     }
 
 
+
     /**
      * Test storing, querying and deleting triples
      */
@@ -1009,13 +1014,13 @@ public class PersistenceTest {
                 KiWiStringLiteral object_2 = new KiWiStringLiteral(RandomStringUtils.randomAlphanumeric(32),null,stype);
                 KiWiUriResource context  = new KiWiUriResource("http://localhost/context/"+RandomStringUtils.randomAlphanumeric(8));
 
-                connection.storeNode(stype);
-                connection.storeNode(subject);
-                connection.storeNode(pred_1);
-                connection.storeNode(pred_2);
-                connection.storeNode(object_1);
-                connection.storeNode(object_2);
-                connection.storeNode(context);
+                connection.storeNode(stype, false);
+                connection.storeNode(subject, false);
+                connection.storeNode(pred_1, false);
+                connection.storeNode(pred_2, false);
+                connection.storeNode(object_1, false);
+                connection.storeNode(object_2, false);
+                connection.storeNode(context, false);
 
                 KiWiTriple triple1 = new KiWiTriple(subject,pred_1,object_1,context);
                 KiWiTriple triple2 = new KiWiTriple(subject,pred_2,object_2,context);
@@ -1024,7 +1029,7 @@ public class PersistenceTest {
                 connection.storeTriple(triple2);
 
                 // check querying within transaction
-                List<Statement> result1 = connection.listTriples(subject,null,null,null,false).asList();
+                List<Statement> result1 = connection.listTriples(subject,null,null,null,false, true).asList();
                 Assert.assertThat(result1,hasItems((Statement)triple1,(Statement)triple2));
 
                 Assert.assertEquals(2, connection.getSize());
@@ -1033,7 +1038,7 @@ public class PersistenceTest {
 
                 connection.commit();
 
-                List<Statement> result2 = connection.listTriples(subject,null,null,null,false).asList();
+                List<Statement> result2 = connection.listTriples(subject,null,null,null,false, true).asList();
                 Assert.assertThat(result2,hasItems((Statement)triple1,(Statement)triple2));
 
                 Assert.assertEquals(2, connection.getSize());
@@ -1045,7 +1050,7 @@ public class PersistenceTest {
                 // clear cache and test again
                 persistence.clearCache();
 
-                List<Statement> result3 = connection.listTriples(subject,null,null,null,false).asList();
+                List<Statement> result3 = connection.listTriples(subject,null,null,null,false, true).asList();
                 Assert.assertThat(result3,hasItems((Statement)triple1,(Statement)triple2));
 
 
@@ -1054,7 +1059,7 @@ public class PersistenceTest {
                 Assert.assertEquals(0, connection.getSize(subject));
 
                 // test database contents
-                PreparedStatement stmt = connection.getJDBCConnection().prepareStatement("SELECT * FROM triples WHERE deleted = false");
+                PreparedStatement stmt = connection.getJDBCConnection().prepareStatement("SELECT * FROM triples WHERE deleted = false ORDER BY subject, predicate");
                 ResultSet dbResult1 = stmt.executeQuery();
 
                 Assert.assertTrue(dbResult1.next());

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/kiwi/kiwi-triplestore/src/test/java/org/apache/marmotta/kiwi/test/PostgreSQLConcurrencyTest.java
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-triplestore/src/test/java/org/apache/marmotta/kiwi/test/PostgreSQLConcurrencyTest.java b/libraries/kiwi/kiwi-triplestore/src/test/java/org/apache/marmotta/kiwi/test/PostgreSQLConcurrencyTest.java
new file mode 100644
index 0000000..7b7b3c1
--- /dev/null
+++ b/libraries/kiwi/kiwi-triplestore/src/test/java/org/apache/marmotta/kiwi/test/PostgreSQLConcurrencyTest.java
@@ -0,0 +1,74 @@
+/*
+ * 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.kiwi.test;
+
+import static org.junit.Assert.assertTrue;
+
+import java.sql.SQLException;
+import java.util.Random;
+
+import org.apache.marmotta.kiwi.config.KiWiConfiguration;
+import org.apache.marmotta.kiwi.persistence.pgsql.PostgreSQLDialect;
+import org.apache.marmotta.kiwi.sail.KiWiStore;
+import org.apache.marmotta.kiwi.test.helper.DBConnectionChecker;
+import org.apache.marmotta.kiwi.test.junit.KiWiDatabaseRunner;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.openrdf.repository.RepositoryException;
+import org.openrdf.repository.sail.SailRepository;
+import org.openrdf.sail.SailException;
+import org.slf4j.LoggerFactory;
+
+/**
+ * This test starts many triplestore operations in parallel to check if concurrent operations will break things,
+ *
+ * @author Sebastian Schaffert (sschaffert@apache.org)
+ */
+public class PostgreSQLConcurrencyTest extends ConcurrencyTestBase {
+
+    private static KiWiStore store;
+
+    @BeforeClass
+    public static void setup() throws RepositoryException {
+        logger = LoggerFactory.getLogger(PostgreSQLConcurrencyTest.class);
+
+        logger.info("creating test setup...");
+
+        KiWiConfiguration psql = KiWiDatabaseRunner.createKiWiConfig("PostgreSQL", new PostgreSQLDialect());
+        DBConnectionChecker.checkDatabaseAvailability(psql);
+        
+        rnd = new Random();
+
+        store = new KiWiStore(psql);
+        repository = new SailRepository(store);
+        repository.initialize();
+    }
+
+    @AfterClass
+    public static void dropDatabase() throws RepositoryException, SQLException, SailException {
+        logger.info("cleaning up test setup...");
+    	if (store != null && store.isInitialized()) {
+            assertTrue(store.checkConsistency());
+            store.closeValueFactory(); // release all connections before dropping the database
+            store.getPersistence().dropDatabase();
+            repository.shutDown();
+    	}
+    }
+
+
+}


[032/100] [abbrv] [partial] Reverting the erroneous merge by Sebastian according to the instructions in INFRA-6876

Posted by wi...@apache.org.
http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/extras/webjars/sgvizler/src/main/java/META-INF/resources/webjars/sgvizler/0.5.1/lib/raphael-dracula.pack.min.js
----------------------------------------------------------------------
diff --git a/extras/webjars/sgvizler/src/main/java/META-INF/resources/webjars/sgvizler/0.5.1/lib/raphael-dracula.pack.min.js b/extras/webjars/sgvizler/src/main/java/META-INF/resources/webjars/sgvizler/0.5.1/lib/raphael-dracula.pack.min.js
new file mode 100644
index 0000000..40c3420
--- /dev/null
+++ b/extras/webjars/sgvizler/src/main/java/META-INF/resources/webjars/sgvizler/0.5.1/lib/raphael-dracula.pack.min.js
@@ -0,0 +1 @@
+function log(b){console.log&&console.log(b)}Raphael=function(){function a8(b,a,d){function c(){var f=Array[bJ].slice.call(arguments,0),e=f[bN]("►"),h=c.cache=c.cache||{},g=c.count=c.count||[];return h[bP](e)?d?d(h[e]):h[e]:(g[bL]>=1000&&delete h[g.shift()],g[cm](e),h[e]=b[bZ](a,f),d?d(h[e]):h[e])}return c}function aS(){return this.x+bT+this.y}function aI(a){return function(f,e,d,c){var b={back:a};return aF.is(d,"function")?c=d:b.rot=d,f&&f.constructor==bM&&(f=f.attrs.path),f&&(b.along=f),this.animate(b,e,c)}}var bK=/[, ]+/,bG=/^(circle|rect|path|ellipse|text|image)$/,bC=document,by=window,a9={was:"Raphael" in by,is:by.Raphael},aF=function(){if(aF.is(arguments[0],"array")){var e=arguments[0],f=cc[bZ](aF,e.splice(0,3+aF.is(e[0],bz))),d=f.set();for(var c=0,b=e[bL];c<b;c++){var a=e[c]||{};bG.test(a.type)&&d[cm](f[a.type]().attr(a))}return d}return cc[bZ](aF,arguments)},aB=function(){},b9="appendChild",bZ="apply",bW="concat",bU="",bT=" ",bS="split",bR="click dblclick mousedown mousemov
 e mouseout mouseover mouseup"[bS](bT),bP="hasOwnProperty",bN="join",bL="length",bJ="prototype",bH=String[bJ].toLowerCase,bF=Math,bD=bF.max,bB=bF.min,bz="number",bx="toString",bv=Object[bJ][bx],ct={},co=bF.pow,cm="push",ck=/^(?=[\da-f]$)/,ci=/^url\(['"]?([^\)]+)['"]?\)$/i,cg=/^\s*((#[a-f\d]{6})|(#[a-f\d]{3})|rgb\(\s*([\d\.]+\s*,\s*[\d\.]+\s*,\s*[\d\.]+)\s*\)|rgb\(\s*([\d\.]+%\s*,\s*[\d\.]+%\s*,\s*[\d\.]+%)\s*\)|hs[bl]\(\s*([\d\.]+\s*,\s*[\d\.]+\s*,\s*[\d\.]+)\s*\)|hs[bl]\(\s*([\d\.]+%\s*,\s*[\d\.]+%\s*,\s*[\d\.]+%)\s*\))\s*$/i,ce=bF.round,ca="setAttribute",b6=parseFloat,b2=parseInt,aE=String[bJ].toUpperCase,aC={"clip-rect":"0 0 1e9 1e9",cursor:"default",cx:0,cy:0,fill:"#fff","fill-opacity":1,font:'10px "Arial"',"font-family":'"Arial"',"font-size":"10","font-style":"normal","font-weight":400,gradient:0,height:0,href:"http://raphaeljs.com/",opacity:1,path:"M0,0",r:0,rotation:0,rx:0,ry:0,scale:"1 1",src:"",stroke:"#000","stroke-dasharray":"","stroke-linecap":"butt","stroke-linejoin":"bu
 tt","stroke-miterlimit":0,"stroke-opacity":1,"stroke-width":1,target:"_blank","text-anchor":"middle",title:"Raphael",translation:"0 0",width:0,x:0,y:0},aA={along:"along","clip-rect":"csv",cx:bz,cy:bz,fill:"colour","fill-opacity":bz,"font-size":bz,height:bz,opacity:bz,path:"path",r:bz,rotation:"csv",rx:bz,ry:bz,scale:"csv",stroke:"colour","stroke-opacity":bz,"stroke-width":bz,translation:"csv",width:bz,x:bz,y:bz},cb="replace";aF.version="1.3.1",aF.type=by.SVGAngle||bC.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")?"SVG":"VML";if(aF.type=="VML"){var b7=document.createElement("div");b7.innerHTML="<!--[if vml]><br><br><![endif]-->";if(b7.childNodes[bL]!=2){return null}}aF.svg=!(aF.vml=aF.type=="VML"),aB[bJ]=aF[bJ],aF._id=0,aF._oid=0,aF.fn={},aF.is=function(b,a){return a=bH.call(a),(a=="object"||a=="undefined")&&typeof b==a||b==null&&a=="null"||bH.call(bv.call(b).slice(8,-1))==a},aF.setWindow=function(a){by=a,bC=by.document};var b3=function(b){if(aF.
 vml){var a=/^\s+|\s+$/g;b3=a8(function(h){var j;h=(h+bU)[cb](a,bU);try{var g=new ActiveXObject("htmlfile");g.write("<body>"),g.close(),j=g.body}catch(f){j=createPopup().document.body}var e=j.createTextRange();try{j.style.color=h;var d=e.queryCommandValue("ForeColor");return d=(d&255)<<16|d&65280|(d&16711680)>>>16,"#"+("000000"+d[bx](16)).slice(-6)}catch(f){return"none"}})}else{var c=bC.createElement("i");c.title="Raphaël Colour Picker",c.style.display="none",bC.body[b9](c),b3=a8(function(d){return c.style.color=d,bC.defaultView.getComputedStyle(c,bU).getPropertyValue("color")})}return b3(b)};aF.hsb2rgb=a8(function(l,j,h){aF.is(l,"object")&&"h" in l&&"s" in l&&"b" in l&&(h=l.b,j=l.s,l=l.h);var g,e,d;if(h==0){return{r:0,g:0,b:0,hex:"#000"}}if(l>1||j>1||h>1){l/=255,j/=255,h/=255}var c=~~(l*6),b=l*6-c,p=h*(1-j),o=h*(1-j*b),n=h*(1-j*(1-b));g=[h,o,p,p,n,h,h][c],e=[n,h,h,o,p,p,n][c],d=[p,p,n,h,h,o,p][c],g*=255,e*=255,d*=255;var m={r:g,g:e,b:d},a=(~~g)[bx](16),k=(~~e)[bx](16),f=(~~d)[bx](1
 6);return a=a[cb](ck,"0"),k=k[cb](ck,"0"),f=f[cb](ck,"0"),m.hex="#"+a+k+f,m},aF),aF.rgb2hsb=a8(function(c,b,a){aF.is(c,"object")&&"r" in c&&"g" in c&&"b" in c&&(a=c.b,b=c.g,c=c.r);if(aF.is(c,"string")){var k=aF.getRGB(c);c=k.r,b=k.g,a=k.b}if(c>1||b>1||a>1){c/=255,b/=255,a/=255}var j=bD(c,b,a),h=bB(c,b,a),g,f,e=j;if(h==j){return{h:0,s:0,b:j}}var d=j-h;return f=d/j,c==j?g=(b-a)/d:b==j?g=2+(a-c)/d:g=4+(c-b)/d,g/=6,g<0&&g++,g>1&&g--,{h:g,s:f,b:e}},aF);var bX=/,?([achlmqrstvxz]),?/gi;aF._path2string=function(){return this.join(",")[cb](bX,"$1")},aF.getRGB=a8(function(c){if(!c||!!((c+=bU).indexOf("-")+1)){return{r:-1,g:-1,b:-1,hex:"none",error:1}}if(c=="none"){return{r:-1,g:-1,b:-1,hex:"none"}}!{hs:1,rg:1}[bP](c.substring(0,2))&&c.charAt()!="#"&&(c=b3(c));var b,a,k,j,h,g=c.match(cg);if(g){g[2]&&(j=b2(g[2].substring(5),16),k=b2(g[2].substring(3,5),16),a=b2(g[2].substring(1,3),16)),g[3]&&(j=b2((h=g[3].charAt(3))+h,16),k=b2((h=g[3].charAt(2))+h,16),a=b2((h=g[3].charAt(1))+h,16)),g[4]&&(g=g[4
 ][bS](/\s*,\s*/),a=b6(g[0]),k=b6(g[1]),j=b6(g[2])),g[5]&&(g=g[5][bS](/\s*,\s*/),a=b6(g[0])*2.55,k=b6(g[1])*2.55,j=b6(g[2])*2.55);if(g[6]){return g=g[6][bS](/\s*,\s*/),a=b6(g[0]),k=b6(g[1]),j=b6(g[2]),aF.hsb2rgb(a,k,j)}if(g[7]){return g=g[7][bS](/\s*,\s*/),a=b6(g[0])*2.55,k=b6(g[1])*2.55,j=b6(g[2])*2.55,aF.hsb2rgb(a,k,j)}g={r:a,g:k,b:j};var f=(~~a)[bx](16),e=(~~k)[bx](16),d=(~~j)[bx](16);return f=f[cb](ck,"0"),e=e[cb](ck,"0"),d=d[cb](ck,"0"),g.hex="#"+f+e+d,g}return{r:-1,g:-1,b:-1,hex:"none",error:1}},aF),aF.getColor=function(b){var a=this.getColor.start=this.getColor.start||{h:0,s:1,b:b||0.75},c=this.hsb2rgb(a.h,a.s,a.b);return a.h+=0.075,a.h>1&&(a.h=0,a.s-=0.2,a.s<=0&&(this.getColor.start={h:0,s:1,b:a.b})),c.hex},aF.getColor.reset=function(){delete this.start},aF.parsePathString=a8(function(b){if(!b){return null}var a={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},c=[];return aF.is(b,"array")&&aF.is(b[0],"array")&&(c=a4(b)),c[bL]||(b+bU)[cb](/([achlmqstvz])[\s,]*((-?\d*\.?\d*(?:e[-+]?\d
 +)?\s*,?\s*)+)/ig,function(h,g,f){var e=[],d=bH.call(g);f[cb](/(-?\d*\.?\d*(?:e[-+]?\d+)?)\s*,?\s*/ig,function(j,k){k&&e[cm](+k)});while(e[bL]>=a[d]){c[cm]([g][bW](e.splice(0,a[d])));if(!a[d]){break}}}),c[bx]=aF._path2string,c}),aF.findDotsAtSegment=function(v,u,t,s,r,q,n,l,j){var h=1-j,g=co(h,3)*v+co(h,2)*3*j*t+h*3*j*j*r+co(j,3)*n,e=co(h,3)*u+co(h,2)*3*j*s+h*3*j*j*q+co(j,3)*l,d=v+2*j*(t-v)+j*j*(r-2*t+v),c=u+2*j*(s-u)+j*j*(q-2*s+u),b=t+2*j*(r-t)+j*j*(n-2*r+t),a=s+2*j*(q-s)+j*j*(l-2*q+s),p=(1-j)*v+j*t,o=(1-j)*u+j*s,m=(1-j)*r+j*n,k=(1-j)*q+j*l,f=90-bF.atan((d-b)/(c-a))*180/bF.PI;return(d>b||c<a)&&(f+=180),{x:g,y:e,m:{x:d,y:c},n:{x:b,y:a},start:{x:p,y:o},end:{x:m,y:k},alpha:f}};var a6=a8(function(f){if(!f){return{x:0,y:0,width:0,height:0}}f=aY(f);var e=0,d=0,c=[],a=[],b;for(var l=0,k=f[bL];l<k;l++){b=f[l];if(b[0]=="M"){e=b[1],d=b[2],c[cm](e),a[cm](d)}else{var j=cd(e,d,b[1],b[2],b[3],b[4],b[5],b[6]);c=c[bW](j.min.x,j.max.x),a=a[bW](j.min.y,j.max.y),e=b[5],d=b[6]}}var h=bB[bZ](0,c),g=bB[
 bZ](0,a);return{x:h,y:g,width:bD[bZ](0,c)-h,height:bD[bZ](0,a)-g}}),a4=function(b){var a=[];if(!aF.is(b,"array")||!aF.is(b&&b[0],"array")){b=aF.parsePathString(b)}for(var f=0,e=b[bL];f<e;f++){a[f]=[];for(var d=0,c=b[f][bL];d<c;d++){a[f][d]=b[f][d]}}return a[bx]=aF._path2string,a},a2=a8(function(o){if(!aF.is(o,"array")||!aF.is(o&&o[0],"array")){o=aF.parsePathString(o)}var m=[],b=0,k=0,j=0,h=0,f=0;o[0][0]=="M"&&(b=o[0][1],k=o[0][2],j=b,h=k,f++,m[cm](["M",b,k]));for(var e=f,d=o[bL];e<d;e++){var c=m[e]=[],a=o[e];if(a[0]!=bH.call(a[0])){c[0]=bH.call(a[0]);switch(c[0]){case"a":c[1]=a[1],c[2]=a[2],c[3]=a[3],c[4]=a[4],c[5]=a[5],c[6]=+(a[6]-b).toFixed(3),c[7]=+(a[7]-k).toFixed(3);break;case"v":c[1]=+(a[1]-k).toFixed(3);break;case"m":j=a[1],h=a[2];default:for(var q=1,p=a[bL];q<p;q++){c[q]=+(a[q]-(q%2?b:k)).toFixed(3)}}}else{c=m[e]=[],a[0]=="m"&&(j=a[1]+b,h=a[2]+k);for(var n=0,l=a[bL];n<l;n++){m[e][n]=a[n]}}var g=m[e][bL];switch(m[e][0]){case"z":b=j,k=h;break;case"h":b+=+m[e][g-1];break;case"v
 ":k+=+m[e][g-1];break;default:b+=+m[e][g-2],k+=+m[e][g-1]}}return m[bx]=aF._path2string,m},0,a4),aX=a8(function(l){if(!aF.is(l,"array")||!aF.is(l&&l[0],"array")){l=aF.parsePathString(l)}var j=[],h=0,g=0,e=0,d=0,c=0;l[0][0]=="M"&&(h=+l[0][1],g=+l[0][2],e=h,d=g,c++,j[0]=["M",h,g]);for(var b=c,p=l[bL];b<p;b++){var o=j[b]=[],n=l[b];if(n[0]!=aE.call(n[0])){o[0]=aE.call(n[0]);switch(o[0]){case"A":o[1]=n[1],o[2]=n[2],o[3]=n[3],o[4]=n[4],o[5]=n[5],o[6]=+(n[6]+h),o[7]=+(n[7]+g);break;case"V":o[1]=+n[1]+g;break;case"H":o[1]=+n[1]+h;break;case"M":e=+n[1]+h,d=+n[2]+g;default:for(var m=1,a=n[bL];m<a;m++){o[m]=+n[m]+(m%2?h:g)}}}else{for(var k=0,f=n[bL];k<f;k++){j[b][k]=n[k]}}switch(o[0]){case"Z":h=e,g=d;break;case"H":h=o[1];break;case"V":g=o[1];break;default:h=j[b][j[b][bL]-2],g=j[b][j[b][bL]-1]}}return j[bx]=aF._path2string,j},null,a4),cs=function(b,a,d,c){return[b,a,d,c,d,c]},cp=function(f,e,d,c,b,a){var h=1/3,g=2/3;return[h*f+g*d,h*e+g*c,h*b+g*d,h*a+g*c,b,a]},cl=function(J,I,H,G,F,E,D,C,B,A){v
 ar z=bF.PI,y=z*120/180,x=z/180*(+F||0),w=[],u,s=a8(function(X,W,V){var Z=X*bF.cos(V)-W*bF.sin(V),Y=X*bF.sin(V)+W*bF.cos(V);return{x:Z,y:Y}});if(!A){u=s(J,I,-x),J=u.x,I=u.y,u=s(C,B,-x),C=u.x,B=u.y;var r=bF.cos(z/180*F),q=bF.sin(z/180*F),o=(J-C)/2,m=(I-B)/2;H=bD(H,bF.abs(o)),G=bD(G,bF.abs(m));var T=o*o/(H*H)+m*m/(G*G);T>1&&(H=bF.sqrt(T)*H,G=bF.sqrt(T)*G);var R=H*H,Q=G*G,P=(E==D?-1:1)*bF.sqrt(bF.abs((R*Q-R*m*m-Q*o*o)/(R*m*m+Q*o*o))),N=P*H*m/G+(J+C)/2,M=P*-G*o/H+(I+B)/2,k=bF.asin(((I-M)/G).toFixed(7)),j=bF.asin(((B-M)/G).toFixed(7));k=J<N?z-k:k,j=C<N?z-j:j,k<0&&(k=z*2+k),j<0&&(j=z*2+j),D&&k>j&&(k-=z*2),!D&&j>k&&(j-=z*2)}else{k=A[0],j=A[1],N=A[2],M=A[3]}var h=j-k;if(bF.abs(h)>y){var g=j,f=C,e=B;j=k+y*(D&&j>k?1:-1),C=N+H*bF.cos(j),B=M+G*bF.sin(j),w=cl(C,B,H,G,F,0,D,f,e,[j,g,N,M])}h=j-k;var d=bF.cos(k),c=bF.sin(k),b=bF.cos(j),a=bF.sin(j),l=bF.tan(h/4),L=4/3*H*l,v=4/3*G*l,t=[J,I],p=[J+L*c,I-v*d],n=[C+L*a,B-v*b],S=[C,B];p[0]=2*t[0]-p[0],p[1]=2*t[1]-p[1];if(A){return[p,n,S][bW](w)}w=[p,n,S][b
 W](w)[bN]()[bS](",");var O=[];for(var U=0,K=w[bL];U<K;U++){O[U]=U%2?s(w[U-1],w[U],x).y:s(w[U],w[U+1],x).x}return O},ch=function(c,b,a,k,j,h,g,f,e){var d=1-e;return{x:co(d,3)*c+co(d,2)*3*e*a+d*3*e*e*j+co(e,3)*g,y:co(d,3)*b+co(d,2)*3*e*k+d*3*e*e*h+co(e,3)*f}},cd=a8(function(q,o,m,l,k,j,h,g){var f=k-2*m+q-(h-2*k+m),e=2*(m-q)-2*(k-m),d=q-m,c=(-e+bF.sqrt(e*e-4*f*d))/2/f,b=(-e-bF.sqrt(e*e-4*f*d))/2/f,p=[o,g],n=[q,h],a;return bF.abs(c)>1000000000000&&(c=0.5),bF.abs(b)>1000000000000&&(b=0.5),c>0&&c<1&&(a=ch(q,o,m,l,k,j,h,g,c),n[cm](a.x),p[cm](a.y)),b>0&&b<1&&(a=ch(q,o,m,l,k,j,h,g,b),n[cm](a.x),p[cm](a.y)),f=j-2*l+o-(g-2*j+l),e=2*(l-o)-2*(j-l),d=o-l,c=(-e+bF.sqrt(e*e-4*f*d))/2/f,b=(-e-bF.sqrt(e*e-4*f*d))/2/f,bF.abs(c)>1000000000000&&(c=0.5),bF.abs(b)>1000000000000&&(b=0.5),c>0&&c<1&&(a=ch(q,o,m,l,k,j,h,g,c),n[cm](a.x),p[cm](a.y)),b>0&&b<1&&(a=ch(q,o,m,l,k,j,h,g,b),n[cm](a.x),p[cm](a.y)),{min:{x:bB[bZ](0,n),y:bB[bZ](0,p)},max:{x:bD[bZ](0,n),y:bD[bZ](0,p)}}}),aY=a8(function(m,b){var k=aX(m),j=
 b&&aX(b),h={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},f={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},e=function(r,q){var t,s;if(!r){return["C",q.x,q.y,q.x,q.y,q.x,q.y]}!(r[0] in {T:1,Q:1})&&(q.qx=q.qy=null);switch(r[0]){case"M":q.X=r[1],q.Y=r[2];break;case"A":r=["C"][bW](cl[bZ](0,[q.x,q.y][bW](r.slice(1))));break;case"S":t=q.x+(q.x-(q.bx||q.x)),s=q.y+(q.y-(q.by||q.y)),r=["C",t,s][bW](r.slice(1));break;case"T":q.qx=q.x+(q.x-(q.qx||q.x)),q.qy=q.y+(q.y-(q.qy||q.y)),r=["C"][bW](cp(q.x,q.y,q.qx,q.qy,r[1],r[2]));break;case"Q":q.qx=r[1],q.qy=r[2],r=["C"][bW](cp(q.x,q.y,r[1],r[2],r[3],r[4]));break;case"L":r=["C"][bW](cs(q.x,q.y,r[1],r[2]));break;case"H":r=["C"][bW](cs(q.x,q.y,r[1],q.y));break;case"V":r=["C"][bW](cs(q.x,q.y,q.x,r[1]));break;case"Z":r=["C"][bW](cs(q.x,q.y,q.X,q.Y))}return r},d=function(r,q){if(r[q][bL]>7){r[q].shift();var s=r[q];while(s[bL]){r.splice(q++,0,["C"][bW](s.splice(0,6)))}r.splice(q,1),p=bD(k[bL],j&&j[bL]||0)}},c=function(r,q,u,t,s){r&&q&&r[s][0]=="M"&&q[s][0]!="M"&
 &(q.splice(s,0,["M",t.x,t.y]),u.bx=0,u.by=0,u.x=r[s][1],u.y=r[s][2],p=bD(k[bL],j&&j[bL]||0))};for(var a=0,p=bD(k[bL],j&&j[bL]||0);a<p;a++){k[a]=e(k[a],h),d(k,a),j&&(j[a]=e(j[a],f)),j&&d(j,a),c(k,j,h,f,a),c(j,k,f,h,a);var o=k[a],n=j&&j[a],l=o[bL],g=j&&n[bL];h.x=o[l-2],h.y=o[l-1],h.bx=b6(o[l-4])||h.x,h.by=b6(o[l-3])||h.y,f.bx=j&&(b6(n[g-4])||f.x),f.by=j&&(b6(n[g-3])||f.y),f.x=j&&n[g-2],f.y=j&&n[g-1]}return j?[k,j]:k},null,a4),bQ=a8(function(c){var b=[];for(var a=0,k=c[bL];a<k;a++){var j={},h=c[a].match(/^([^:]*):?([\d\.]*)/);j.color=aF.getRGB(h[1]);if(j.color.error){return null}j.color=j.color.hex,h[2]&&(j.offset=h[2]+"%"),b[cm](j)}for(var a=1,k=b[bL]-1;a<k;a++){if(!b[a].offset){var g=b6(b[a-1].offset||0),f=0;for(var e=a+1;e<k;e++){if(b[e].offset){f=b[e].offset;break}}f||(f=100,e=k),f=b6(f);var d=(f-g)/(e-a+1);for(;a<e;a++){g+=d,b[a].offset=g+"%"}}}return b}),b1=function(){var b,a,e,d,c;if(aF.is(arguments[0],"string")||aF.is(arguments[0],"object")){aF.is(arguments[0],"string")?b=bC.ge
 tElementById(arguments[0]):b=arguments[0];if(b.tagName){return arguments[1]==null?{container:b,width:b.style.pixelWidth||b.offsetWidth,height:b.style.pixelHeight||b.offsetHeight}:{container:b,width:arguments[1],height:arguments[2]}}}else{if(aF.is(arguments[0],bz)&&arguments[bL]>3){return{container:1,x:arguments[0],y:arguments[1],width:arguments[2],height:arguments[3]}}}},bV=function(b,a){var d=this;for(var c in a){if(a[bP](c)&&!(c in b)){switch(typeof a[c]){case"function":(function(e){b[c]=b===d?e:function(){return e[bZ](d,arguments)}})(a[c]);break;case"object":b[c]=b[c]||{},bV.call(this,b[c],a[c]);break;default:b[c]=a[c]}}}},a7=function(b,a){b==a.top&&(a.top=b.prev),b==a.bottom&&(a.bottom=b.next),b.next&&(b.next.prev=b.prev),b.prev&&(b.prev.next=b.next)},a5=function(b,a){if(a.top===b){return}a7(b,a),b.next=null,b.prev=a.top,a.top.next=b,a.top=b},a3=function(b,a){if(a.bottom===b){return}a7(b,a),b.next=a.bottom,b.prev=null,a.bottom.prev=b,a.bottom=b},aZ=function(b,a,c){a7(b,c),a==c.t
 op&&(c.top=b),a.next&&(a.next.prev=b),b.next=a.next,b.prev=a,a.next=b},a1=function(b,a,c){a7(b,c),a==c.bottom&&(c.bottom=b),a.prev&&(a.prev.next=b),b.prev=a.prev,a.prev=b,b.next=a},cr=function(a){return function(){throw new Error("Raphaël: you are calling to method “"+a+"” of removed object")}},cn=/^r(?:\(([^,]+?)\s*,\s*([^\)]+?)\))?/;if(aF.svg){aB[bJ].svgns="http://www.w3.org/2000/svg",aB[bJ].xlink="http://www.w3.org/1999/xlink";var ce=function(a){return +a+(~~a===a)*0.5},cj=function(b){for(var a=0,e=b[bL];a<e;a++){if(bH.call(b[a][0])!="a"){for(var d=1,c=b[a][bL];d<c;d++){b[a][d]=ce(b[a][d])}}else{b[a][6]=ce(b[a][6]),b[a][7]=ce(b[a][7])}}return b},cf=function(b,a){if(!a){return bC.createElementNS(aB[bJ].svgns,b)}for(var c in a){a[bP](c)&&b[ca](c,a[c])}};aF[bx]=function(){return"Your browser supports SVG.\nYou are running Raphaël "+this.version};var b8=function(b,a){var d=cf("path");a.canvas&&a.canvas[b9](d);var c=new bM(d,a);return c.type="path",bY(c,{fill:"none",stroke:"#000
 ",path:b}),c},b4=function(j,h,c){var b="linear",p=0.5,o=0.5,n=j.style;h=(h+bU)[cb](cn,function(r,q,t){b="radial";if(q&&t){p=b6(q),o=b6(t);var s=(o>0.5)*2-1;co(p-0.5,2)+co(o-0.5,2)>0.25&&(o=bF.sqrt(0.25-co(p-0.5,2))*s+0.5)&&o!=0.5&&(o=o.toFixed(5)-0.00001*s)}return bU}),h=h[bS](/\s*\-\s*/);if(b=="linear"){var m=h.shift();m=-b6(m);if(isNaN(m)){return null}var k=[0,0,bF.cos(m*bF.PI/180),bF.sin(m*bF.PI/180)],g=1/(bD(bF.abs(k[2]),bF.abs(k[3]))||1);k[2]*=g,k[3]*=g,k[2]<0&&(k[0]=-k[2],k[2]=0),k[3]<0&&(k[1]=-k[3],k[3]=0)}var f=bQ(h);if(!f){return null}var e=cf(b+"Gradient");e.id="r"+(aF._id++)[bx](36),cf(e,b=="radial"?{fx:p,fy:o}:{x1:k[0],y1:k[1],x2:k[2],y2:k[3]}),c.defs[b9](e);for(var d=0,a=f[bL];d<a;d++){var l=cf("stop");cf(l,{offset:f[d].offset?f[d].offset:d?"100%":"0%","stop-color":f[d].color||"#fff"}),e[b9](l)}return cf(j,{fill:"url(#"+e.id+")",opacity:1,"fill-opacity":1}),n.fill=bU,n.opacity=1,n.fillOpacity=1,1},b0=function(b){var a=b.getBBox();cf(b.pattern,{patternTransform:aF.format
 ("translate({0},{1})",a.x,a.y)})},bY=function(x,w){var v={"":[0],none:[0],"-":[3,1],".":[1,1],"-.":[3,1,1,1],"-..":[3,1,1,1,1,1],". ":[1,3],"- ":[4,3],"--":[8,3],"- .":[4,3,1,3],"--.":[8,3,1,3],"--..":[8,3,1,3,1,3]},u=x.node,t=x.attrs,s=x.rotate(),r=function(A,z){z=v[bH.call(z)];if(z){var B=A.attrs["stroke-width"]||"1",y={round:B,square:B,butt:0}[A.attrs["stroke-linecap"]||w["stroke-linecap"]]||0,D=[],C=z[bL];while(C--){D[C]=z[C]*B+(C%2?1:-1)*y}cf(u,{"stroke-dasharray":D[bN](",")})}};w[bP]("rotation")&&(s=w.rotation);var n=(s+bU)[bS](bK);n.length-1?(n[1]=+n[1],n[2]=+n[2]):n=null,b6(s)&&x.rotate(0,!0);for(var q in w){if(w[bP](q)){if(!aC[bP](q)){continue}var k=w[q];t[q]=k;switch(q){case"rotation":x.rotate(k,!0);break;case"href":case"title":case"target":var j=u.parentNode;if(bH.call(j.tagName)!="a"){var h=cf("a");j.insertBefore(h,u),h[b9](u),j=h}j.setAttributeNS(x.paper.xlink,q,k);break;case"cursor":u.style.cursor=k;break;case"clip-rect":var g=(k+bU)[bS](bK);if(g[bL]==4){x.clip&&x.clip
 .parentNode.parentNode.removeChild(x.clip.parentNode);var f=cf("clipPath"),p=cf("rect");f.id="r"+(aF._id++)[bx](36),cf(p,{x:g[0],y:g[1],width:g[2],height:g[3]}),f[b9](p),x.paper.defs[b9](f),cf(u,{"clip-path":"url(#"+f.id+")"}),x.clip=p}if(!k){var o=bC.getElementById(u.getAttribute("clip-path")[cb](/(^url\(#|\)$)/g,bU));o&&o.parentNode.removeChild(o),cf(u,{"clip-path":bU}),delete x.clip}break;case"path":k&&x.type=="path"&&(t.path=cj(aX(k)),cf(u,{d:t.path}));break;case"width":u[ca](q,k);if(t.fx){q="x",k=t.x}else{break}case"x":t.fx&&(k=-t.x-(t.width||0));case"rx":if(q=="rx"&&x.type=="rect"){break}case"cx":n&&(q=="x"||q=="cx")&&(n[1]+=k-t[q]),u[ca](q,ce(k)),x.pattern&&b0(x);break;case"height":u[ca](q,k);if(t.fy){q="y",k=t.y}else{break}case"y":t.fy&&(k=-t.y-(t.height||0));case"ry":if(q=="ry"&&x.type=="rect"){break}case"cy":n&&(q=="y"||q=="cy")&&(n[2]+=k-t[q]),u[ca](q,ce(k)),x.pattern&&b0(x);break;case"r":x.type=="rect"?cf(u,{rx:k,ry:k}):u[ca](q,k);break;case"src":x.type=="image"&&u.setAt
 tributeNS(x.paper.xlink,"href",k);break;case"stroke-width":u.style.strokeWidth=k,u[ca](q,k),t["stroke-dasharray"]&&r(x,t["stroke-dasharray"]);break;case"stroke-dasharray":r(x,k);break;case"translation":var l=(k+bU)[bS](bK);l[0]=+l[0]||0,l[1]=+l[1]||0,n&&(n[1]+=l[0],n[2]+=l[1]),aJ.call(x,l[0],l[1]);break;case"scale":var l=(k+bU)[bS](bK);x.scale(+l[0]||1,+l[1]||+l[0]||1,+l[2]||null,+l[3]||null);break;case"fill":var m=(k+bU).match(ci);if(m){var f=cf("pattern"),e=cf("image");f.id="r"+(aF._id++)[bx](36),cf(f,{x:0,y:0,patternUnits:"userSpaceOnUse",height:1,width:1}),cf(e,{x:0,y:0}),e.setAttributeNS(x.paper.xlink,"href",m[1]),f[b9](e);var d=bC.createElement("img");d.style.cssText="position:absolute;left:-9999em;top-9999em",d.onload=function(){cf(f,{width:this.offsetWidth,height:this.offsetHeight}),cf(e,{width:this.offsetWidth,height:this.offsetHeight}),bC.body.removeChild(this),x.paper.safari()},bC.body[b9](d),d.src=m[1],x.paper.defs[b9](f),u.style.fill="url(#"+f.id+")",cf(u,{fill:"url(#"+
 f.id+")"}),x.pattern=f,x.pattern&&b0(x);break}if(!aF.getRGB(k).error){delete w.gradient,delete t.gradient,!aF.is(t.opacity,"undefined")&&aF.is(w.opacity,"undefined")&&cf(u,{opacity:t.opacity}),!aF.is(t["fill-opacity"],"undefined")&&aF.is(w["fill-opacity"],"undefined")&&cf(u,{"fill-opacity":t["fill-opacity"]})}else{if(({circle:1,ellipse:1}[bP](x.type)||(k+bU).charAt()!="r")&&b4(u,k,x.paper)){t.gradient=k,t.fill="none";break}}case"stroke":u[ca](q,aF.getRGB(k).hex);break;case"gradient":((({circle:1,ellipse:1}))[bP](x.type)||(k+bU).charAt()!="r")&&b4(u,k,x.paper);break;case"opacity":case"fill-opacity":if(t.gradient){var c=bC.getElementById(u.getAttribute("fill")[cb](/^url\(#|\)$/g,bU));if(c){var b=c.getElementsByTagName("stop");b[b[bL]-1][ca]("stop-opacity",k)}break}default:q=="font-size"&&(k=b2(k,10)+"px");var a=q[cb](/(\-.)/g,function(y){return aE.call(y.substring(1))});u.style[a]=k,u[ca](q,k)}}}bO(x,w),n?x.rotate(n.join(bT)):b6(s)&&x.rotate(s,!0)},aa=1.2,bO=function(e,d){if(e.type!="
 text"||!(d[bP]("text")||d[bP]("font")||d[bP]("font-size")||d[bP]("x")||d[bP]("y"))){return}var c=e.attrs,a=e.node,b=a.firstChild?b2(bC.defaultView.getComputedStyle(a.firstChild,bU).getPropertyValue("font-size"),10):10;if(d[bP]("text")){c.text=d.text;while(a.firstChild){a.removeChild(a.firstChild)}var l=(d.text+bU)[bS]("\n");for(var k=0,j=l[bL];k<j;k++){if(l[k]){var h=cf("tspan");k&&cf(h,{dy:b*aa,x:c.x}),h[b9](bC.createTextNode(l[k])),a[b9](h)}}}else{var l=a.getElementsByTagName("tspan");for(var k=0,j=l[bL];k<j;k++){k&&cf(l[k],{dy:b*aa,x:c.x})}}cf(a,{y:c.y});var g=e.getBBox(),f=c.y-(g.y+g.height/2);f&&isFinite(f)&&cf(a,{y:c.y+f})},bM=function(b,a){var d=0,c=0;this[0]=b,this.id=aF._oid++,this.node=b,b.raphael=this,this.paper=a,this.attrs=this.attrs||{},this.transformations=[],this._={tx:0,ty:0,rt:{deg:0,cx:0,cy:0},sx:1,sy:1},!a.bottom&&(a.bottom=this),this.prev=a.top,a.top&&(a.top.next=this),a.top=this,this.next=null};bM[bJ].rotate=function(d,c,b){if(this.removed){return this}if(d==nu
 ll){return this._.rt.cx?[this._.rt.deg,this._.rt.cx,this._.rt.cy][bN](bT):this._.rt.deg}var a=this.getBBox();return d=(d+bU)[bS](bK),d[bL]-1&&(c=b6(d[1]),b=b6(d[2])),d=b6(d[0]),c!=null?this._.rt.deg=d:this._.rt.deg+=d,b==null&&(c=null),this._.rt.cx=c,this._.rt.cy=b,c=c==null?a.x+a.width/2:c,b=b==null?a.y+a.height/2:b,this._.rt.deg?(this.transformations[0]=aF.format("rotate({0} {1} {2})",this._.rt.deg,c,b),this.clip&&cf(this.clip,{transform:aF.format("rotate({0} {1} {2})",-this._.rt.deg,c,b)})):(this.transformations[0]=bU,this.clip&&cf(this.clip,{transform:bU})),cf(this.node,{transform:this.transformations[bN](bT)}),this},bM[bJ].hide=function(){return !this.removed&&(this.node.style.display="none"),this},bM[bJ].show=function(){return !this.removed&&(this.node.style.display=""),this},bM[bJ].remove=function(){if(this.removed){return}a7(this,this.paper),this.node.parentNode.removeChild(this.node);for(var a in this){delete this[a]}this.removed=!0},bM[bJ].getBBox=function(){if(this.remove
 d){return this}if(this.type=="path"){return a6(this.attrs.path)}if(this.node.style.display=="none"){this.show();var b=!0}var a={};try{a=this.node.getBBox()}catch(f){}finally{a=a||{}}if(this.type=="text"){a={x:a.x,y:Infinity,width:0,height:0};for(var e=0,d=this.node.getNumberOfChars();e<d;e++){var c=this.node.getExtentOfChar(e);c.y<a.y&&(a.y=c.y),c.y+c.height-a.y>a.height&&(a.height=c.y+c.height-a.y),c.x+c.width-a.x>a.width&&(a.width=c.x+c.width-a.x)}}return b&&this.hide(),a},bM[bJ].attr=function(){if(this.removed){return this}if(arguments[bL]==0){var b={};for(var a in this.attrs){this.attrs[bP](a)&&(b[a]=this.attrs[a])}return this._.rt.deg&&(b.rotation=this.rotate()),(this._.sx!=1||this._.sy!=1)&&(b.scale=this.scale()),b.gradient&&b.fill=="none"&&(b.fill=b.gradient)&&delete b.gradient,b}if(arguments[bL]==1&&aF.is(arguments[0],"string")){return arguments[0]=="translation"?aJ.call(this):arguments[0]=="rotation"?this.rotate():arguments[0]=="scale"?this.scale():arguments[0]=="fill"&&thi
 s.attrs.fill=="none"&&this.attrs.gradient?this.attrs.gradient:this.attrs[arguments[0]]}if(arguments[bL]==1&&aF.is(arguments[0],"array")){var e={};for(var d in arguments[0]){arguments[0][bP](d)&&(e[arguments[0][d]]=this.attrs[arguments[0][d]])}return e}if(arguments[bL]==2){var c={};c[arguments[0]]=arguments[1],bY(this,c)}else{arguments[bL]==1&&aF.is(arguments[0],"object")&&bY(this,arguments[0])}return this},bM[bJ].toFront=function(){if(this.removed){return this}this.node.parentNode[b9](this.node);var a=this.paper;return a.top!=this&&a5(this,a),this},bM[bJ].toBack=function(){if(this.removed){return this}if(this.node.parentNode.firstChild!=this.node){this.node.parentNode.insertBefore(this.node,this.node.parentNode.firstChild),a3(this,this.paper);var a=this.paper}return this},bM[bJ].insertAfter=function(b){if(this.removed){return this}var a=b.node;return a.nextSibling?a.parentNode.insertBefore(this.node,a.nextSibling):a.parentNode[b9](this.node),aZ(this,b,this.paper),this},bM[bJ].insert
 Before=function(b){if(this.removed){return this}var a=b.node;return a.parentNode.insertBefore(this.node,a),a1(this,b,this.paper),this};var bI=function(b,a,f,e){a=ce(a),f=ce(f);var d=cf("circle");b.canvas&&b.canvas[b9](d);var c=new bM(d,b);return c.attrs={cx:a,cy:f,r:e,fill:"none",stroke:"#000"},c.type="circle",cf(d,c.attrs),c},bE=function(e,d,c,b,a,h){d=ce(d),c=ce(c);var g=cf("rect");e.canvas&&e.canvas[b9](g);var f=new bM(g,e);return f.attrs={x:d,y:c,width:b,height:a,r:h||0,rx:h||0,ry:h||0,fill:"none",stroke:"#000"},f.type="rect",cf(g,f.attrs),f},bA=function(d,c,b,a,g){c=ce(c),b=ce(b);var f=cf("ellipse");d.canvas&&d.canvas[b9](f);var e=new bM(f,d);return e.attrs={cx:c,cy:b,rx:a,ry:g,fill:"none",stroke:"#000"},e.type="ellipse",cf(f,e.attrs),e},bw=function(e,d,c,b,a,h){var g=cf("image");cf(g,{x:c,y:b,width:a,height:h,preserveAspectRatio:"none"}),g.setAttributeNS(e.xlink,"href",d),e.canvas&&e.canvas[b9](g);var f=new bM(g,e);return f.attrs={x:c,y:b,width:a,height:h,src:d},f.type="image"
 ,f},aG=function(b,a,f,e){var d=cf("text");cf(d,{x:a,y:f,"text-anchor":"middle"}),b.canvas&&b.canvas[b9](d);var c=new bM(d,b);return c.attrs={x:a,y:f,"text-anchor":"middle",text:e,font:aC.font,stroke:"none",fill:"#000"},c.type="text",bY(c,c.attrs),c},aD=function(b,a){return this.width=b||this.width,this.height=a||this.height,this.canvas[ca]("width",this.width),this.canvas[ca]("height",this.height),this},cc=function(){var e=b1[bZ](null,arguments),a=e&&e.container,c=e.x,b=e.y,g=e.width,f=e.height;if(!a){throw new Error("SVG container not found.")}var d=cf("svg");return g=g||512,f=f||342,cf(d,{xmlns:"http://www.w3.org/2000/svg",version:1.1,width:g,height:f}),a==1?(d.style.cssText="position:absolute;left:"+c+"px;top:"+b+"px",bC.body[b9](d)):a.firstChild?a.insertBefore(d,a.firstChild):a[b9](d),a=new aB,a.width=g,a.height=f,a.canvas=d,bV.call(a,a,aF.fn),a.clear(),a};aB[bJ].clear=function(){var a=this.canvas;while(a.firstChild){a.removeChild(a.firstChild)}this.bottom=this.top=null,(this.des
 c=cf("desc"))[b9](bC.createTextNode("Created with Raphaël")),a[b9](this.desc),a[b9](this.defs=cf("defs"))},aB[bJ].remove=function(){this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas);for(var a in this){this[a]=cr(a)}}}if(aF.vml){var b5=function(k){var j=/[ahqstv]/ig,f=aX;(k+bU).match(j)&&(f=aY),j=/[clmz]/g;if(f==aX&&!(k+bU).match(j)){var e={M:"m",L:"l",C:"c",Z:"x",m:"t",l:"r",c:"v",z:"x"},d=/([clmz]),?([^clmz]*)/gi,c=/-?[^,\s-]+/g,b=(k+bU)[cb](d,function(q,p,s){var r=[];return s[cb](c,function(t){r[cm](ce(t))}),e[p]+r});return b}var o=f(k),n,b=[],m;for(var a=0,l=o[bL];a<l;a++){n=o[a],m=bH.call(o[a][0]),m=="z"&&(m="x");for(var h=1,g=n[bL];h<g;h++){m+=ce(n[h])+(h!=g-1?",":bU)}b[cm](m)}return b[bN](bT)};aF[bx]=function(){return"Your browser doesn’t support SVG. Falling down to VML.\nYou are running Raphaël "+this.version};var b8=function(b,a){var f=aW("group");f.style.cssText="position:absolute;left:0;top:0;width:"+a.width+"px;height:"+a.height+"px",f.coordsize
 =a.coordsize,f.coordorigin=a.coordorigin;var e=aW("shape"),d=e.style;d.width=a.width+"px",d.height=a.height+"px",e.coordsize=this.coordsize,e.coordorigin=this.coordorigin,f[b9](e);var c=new bM(e,f,a);return c.isAbsolute=!0,c.type="path",c.path=[],c.Path=bU,b&&bY(c,{fill:"none",stroke:"#000",path:b}),a.canvas[b9](f),c},bY=function(u,t){u.attrs=u.attrs||{};var s=u.node,r=u.attrs,q=s.style,p,o=u;for(var n in t){t[bP](n)&&(r[n]=t[n])}t.href&&(s.href=t.href),t.title&&(s.title=t.title),t.target&&(s.target=t.target),t.cursor&&(q.cursor=t.cursor),t.path&&u.type=="path"&&(r.path=t.path,s.path=b5(r.path)),t.rotation!=null&&u.rotate(t.rotation,!0),t.translation&&(p=(t.translation+bU)[bS](bK),aJ.call(u,p[0],p[1]),u._.rt.cx!=null&&(u._.rt.cx+=+p[0],u._.rt.cy+=+p[1],u.setBox(u.attrs,p[0],p[1]))),t.scale&&(p=(t.scale+bU)[bS](bK),u.scale(+p[0]||1,+p[1]||+p[0]||1,+p[2]||null,+p[3]||null));if("clip-rect" in t){var m=(t["clip-rect"]+bU)[bS](bK);if(m[bL]==4){m[2]=+m[2]+ +m[0],m[3]=+m[3]+ +m[1];var j=s.
 clipRect||bC.createElement("div"),h=j.style,g=s.parentNode;h.clip=aF.format("rect({1}px {2}px {3}px {0}px)",m),s.clipRect||(h.position="absolute",h.top=0,h.left=0,h.width=u.paper.width+"px",h.height=u.paper.height+"px",g.parentNode.insertBefore(j,g),j[b9](g),s.clipRect=j)}t["clip-rect"]||s.clipRect&&(s.clipRect.style.clip=bU)}u.type=="image"&&t.src&&(s.src=t.src),u.type=="image"&&t.opacity&&(s.filterOpacity=" progid:DXImageTransform.Microsoft.Alpha(opacity="+t.opacity*100+")",q.filter=(s.filterMatrix||bU)+(s.filterOpacity||bU)),t.font&&(q.font=t.font),t["font-family"]&&(q.fontFamily='"'+t["font-family"][bS](",")[0][cb](/^['"]+|['"]+$/g,bU)+'"'),t["font-size"]&&(q.fontSize=t["font-size"]),t["font-weight"]&&(q.fontWeight=t["font-weight"]),t["font-style"]&&(q.fontStyle=t["font-style"]);if(t.opacity!=null||t["stroke-width"]!=null||t.fill!=null||t.stroke!=null||t["stroke-width"]!=null||t["stroke-opacity"]!=null||t["fill-opacity"]!=null||t["stroke-dasharray"]!=null||t["stroke-miterlimit"]
 !=null||t["stroke-linejoin"]!=null||t["stroke-linecap"]!=null){s=u.shape||s;var f=s.getElementsByTagName("fill")&&s.getElementsByTagName("fill")[0],e=!1;!f&&(e=f=aW("fill"));if("fill-opacity" in t||"opacity" in t){var d=((+r["fill-opacity"]+1||2)-1)*((+r.opacity+1||2)-1);d<0&&(d=0),d>1&&(d=1),f.opacity=d}t.fill&&(f.on=!0);if(f.on==null||t.fill=="none"){f.on=!1}if(f.on&&t.fill){var c=t.fill.match(ci);c?(f.src=c[1],f.type="tile"):(f.color=aF.getRGB(t.fill).hex,f.src=bU,f.type="solid",aF.getRGB(t.fill).error&&(o.type in {circle:1,ellipse:1}||(t.fill+bU).charAt()!="r")&&b4(o,t.fill)&&(r.fill="none",r.gradient=t.fill))}e&&s[b9](f);var b=s.getElementsByTagName("stroke")&&s.getElementsByTagName("stroke")[0],a=!1;!b&&(a=b=aW("stroke"));if(t.stroke&&t.stroke!="none"||t["stroke-width"]||t["stroke-opacity"]!=null||t["stroke-dasharray"]||t["stroke-miterlimit"]||t["stroke-linejoin"]||t["stroke-linecap"]){b.on=!0}(t.stroke=="none"||b.on==null||t.stroke==0||t["stroke-width"]==0)&&(b.on=!1),b.on&&t
 .stroke&&(b.color=aF.getRGB(t.stroke).hex);var d=((+r["stroke-opacity"]+1||2)-1)*((+r.opacity+1||2)-1),l=(b6(t["stroke-width"])||1)*0.75;d<0&&(d=0),d>1&&(d=1),t["stroke-width"]==null&&(l=r["stroke-width"]),t["stroke-width"]&&(b.weight=l),l&&l<1&&(d*=l)&&(b.weight=1),b.opacity=d,t["stroke-linejoin"]&&(b.joinstyle=t["stroke-linejoin"]||"miter"),b.miterlimit=t["stroke-miterlimit"]||8,t["stroke-linecap"]&&(b.endcap=t["stroke-linecap"]=="butt"?"flat":t["stroke-linecap"]=="square"?"square":"round");if(t["stroke-dasharray"]){var k={"-":"shortdash",".":"shortdot","-.":"shortdashdot","-..":"shortdashdotdot",". ":"dot","- ":"dash","--":"longdash","- .":"dashdot","--.":"longdashdot","--..":"longdashdotdot"};b.dashstyle=k[bP](t["stroke-dasharray"])?k[t["stroke-dasharray"]]:bU}a&&s[b9](b)}if(o.type=="text"){var q=o.paper.span.style;r.font&&(q.font=r.font),r["font-family"]&&(q.fontFamily=r["font-family"]),r["font-size"]&&(q.fontSize=r["font-size"]),r["font-weight"]&&(q.fontWeight=r["font-weight"]
 ),r["font-style"]&&(q.fontStyle=r["font-style"]),o.node.string&&(o.paper.span.innerHTML=(o.node.string+bU)[cb](/</g,"&#60;")[cb](/&/g,"&#38;")[cb](/\n/g,"<br>")),o.W=r.w=o.paper.span.offsetWidth,o.H=r.h=o.paper.span.offsetHeight,o.X=r.x,o.Y=r.y+ce(o.H/2);switch(r["text-anchor"]){case"start":o.node.style["v-text-align"]="left",o.bbx=ce(o.W/2);break;case"end":o.node.style["v-text-align"]="right",o.bbx=-ce(o.W/2);break;default:o.node.style["v-text-align"]="center"}}},b4=function(e,d){e.attrs=e.attrs||{};var c=e.attrs,a=e.node.getElementsByTagName("fill"),b="linear",l=".5 .5";e.attrs.gradient=d,d=(d+bU)[cb](cn,function(n,m,o){return b="radial",m&&o&&(m=b6(m),o=b6(o),co(m-0.5,2)+co(o-0.5,2)>0.25&&(o=bF.sqrt(0.25-co(m-0.5,2))*((o>0.5)*2-1)+0.5),l=m+bT+o),bU}),d=d[bS](/\s*\-\s*/);if(b=="linear"){var k=d.shift();k=-b6(k);if(isNaN(k)){return null}}var j=bQ(d);if(!j){return null}e=e.shape||e.node,a=a[0]||aW("fill");if(j[bL]){a.on=!0,a.method="none",a.type=b=="radial"?"gradientradial":"gradien
 t",a.color=j[0].color,a.color2=j[j[bL]-1].color;var h=[];for(var g=0,f=j[bL];g<f;g++){j[g].offset&&h[cm](j[g].offset+bT+j[g].color)}a.colors&&(a.colors.value=h[bL]?h[bN](","):"0% "+a.color),b=="radial"?(a.focus="100%",a.focussize=l,a.focusposition=l):a.angle=(270-k)%360}return 1},bM=function(d,c,b){var a=0,g=0,f=0,e=1;this[0]=d,this.id=aF._oid++,this.node=d,d.raphael=this,this.X=0,this.Y=0,this.attrs={},this.Group=c,this.paper=b,this._={tx:0,ty:0,rt:{deg:0},sx:1,sy:1},!b.bottom&&(b.bottom=this),this.prev=b.top,b.top&&(b.top.next=this),b.top=this,this.next=null};bM[bJ].rotate=function(c,b,a){return this.removed?this:c==null?this._.rt.cx?[this._.rt.deg,this._.rt.cx,this._.rt.cy][bN](bT):this._.rt.deg:(c=(c+bU)[bS](bK),c[bL]-1&&(b=b6(c[1]),a=b6(c[2])),c=b6(c[0]),b!=null?this._.rt.deg=c:this._.rt.deg+=c,a==null&&(b=null),this._.rt.cx=b,this._.rt.cy=a,this.setBox(this.attrs,b,a),this.Group.style.rotation=this._.rt.deg,this)},bM[bJ].setBox=function(r,p,o){if(this.removed){return this}var 
 n=this.Group.style,l=this.shape&&this.shape.style||this.node.style;r=r||{};for(var k in r){r[bP](k)&&(this.attrs[k]=r[k])}p=p||this._.rt.cx,o=o||this._.rt.cy;var j=this.attrs,h,g,e,s;switch(this.type){case"circle":h=j.cx-j.r,g=j.cy-j.r,e=s=j.r*2;break;case"ellipse":h=j.cx-j.rx,g=j.cy-j.ry,e=j.rx*2,s=j.ry*2;break;case"rect":case"image":h=+j.x,g=+j.y,e=j.width||0,s=j.height||0;break;case"text":this.textpath.v=["m",ce(j.x),", ",ce(j.y-2),"l",ce(j.x)+1,", ",ce(j.y-2)][bN](bU),h=j.x-ce(this.W/2),g=j.y-this.H/2,e=this.W,s=this.H;break;case"path":if(!this.attrs.path){h=0,g=0,e=this.paper.width,s=this.paper.height}else{var q=a6(this.attrs.path);h=q.x,g=q.y,e=q.width,s=q.height}break;default:h=0,g=0,e=this.paper.width,s=this.paper.height}p=p==null?h+e/2:p,o=o==null?g+s/2:o;var m=p-this.paper.width/2,f=o-this.paper.height/2;if(this.type=="path"||this.type=="text"){n.left!=m+"px"&&(n.left=m+"px"),n.top!=f+"px"&&(n.top=f+"px"),this.X=this.type=="text"?h:-m,this.Y=this.type=="text"?g:-f,this.W=e
 ,this.H=s,l.left!=-m+"px"&&(l.left=-m+"px"),l.top!=-f+"px"&&(l.top=-f+"px")}else{n.left!=m+"px"&&(n.left=m+"px"),n.top!=f+"px"&&(n.top=f+"px"),this.X=h,this.Y=g,this.W=e,this.H=s,n.width!=this.paper.width+"px"&&(n.width=this.paper.width+"px"),n.height!=this.paper.height+"px"&&(n.height=this.paper.height+"px"),l.left!=h-m+"px"&&(l.left=h-m+"px"),l.top!=g-f+"px"&&(l.top=g-f+"px"),l.width!=e+"px"&&(l.width=e+"px"),l.height!=s+"px"&&(l.height=s+"px");var d=(+r.r||0)/bB(e,s);if(this.type=="rect"&&this.arcsize.toFixed(4)!=d.toFixed(4)&&(d||this.arcsize)){var c=aW("roundrect"),b={},k=0,a=this.events&&this.events[bL];c.arcsize=d,c.raphael=this,this.Group[b9](c),this.Group.removeChild(this.node),this[0]=this.node=c,this.arcsize=d;for(var k in j){b[k]=j[k]}delete b.scale,this.attr(b);if(this.events){for(;k<a;k++){this.events[k].unbind=aU(this.node,this.events[k].name,this.events[k].f,this)}}}}},bM[bJ].hide=function(){return !this.removed&&(this.Group.style.display="none"),this},bM[bJ].show=fu
 nction(){return !this.removed&&(this.Group.style.display="block"),this},bM[bJ].getBBox=function(){return this.removed?this:this.type=="path"?a6(this.attrs.path):{x:this.X+(this.bbx||0),y:this.Y,width:this.W,height:this.H}},bM[bJ].remove=function(){if(this.removed){return}a7(this,this.paper),this.node.parentNode.removeChild(this.node),this.Group.parentNode.removeChild(this.Group),this.shape&&this.shape.parentNode.removeChild(this.shape);for(var a in this){delete this[a]}this.removed=!0},bM[bJ].attr=function(){if(this.removed){return this}if(arguments[bL]==0){var b={};for(var a in this.attrs){this.attrs[bP](a)&&(b[a]=this.attrs[a])}return this._.rt.deg&&(b.rotation=this.rotate()),(this._.sx!=1||this._.sy!=1)&&(b.scale=this.scale()),b.gradient&&b.fill=="none"&&(b.fill=b.gradient)&&delete b.gradient,b}if(arguments[bL]==1&&aF.is(arguments[0],"string")){return arguments[0]=="translation"?aJ.call(this):arguments[0]=="rotation"?this.rotate():arguments[0]=="scale"?this.scale():arguments[0]==
 "fill"&&this.attrs.fill=="none"&&this.attrs.gradient?this.attrs.gradient:this.attrs[arguments[0]]}if(this.attrs&&arguments[bL]==1&&aF.is(arguments[0],"array")){var e={};for(var a=0,d=arguments[0][bL];a<d;a++){e[arguments[0][a]]=this.attrs[arguments[0][a]]}return e}var c;return arguments[bL]==2&&(c={},c[arguments[0]]=arguments[1]),arguments[bL]==1&&aF.is(arguments[0],"object")&&(c=arguments[0]),c&&(c.text&&this.type=="text"&&(this.node.string=c.text),bY(this,c),c.gradient&&({circle:1,ellipse:1}[bP](this.type)||(c.gradient+bU).charAt()!="r")&&b4(this,c.gradient),(this.type!="path"||this._.rt.deg)&&this.setBox(this.attrs)),this},bM[bJ].toFront=function(){return !this.removed&&this.Group.parentNode[b9](this.Group),this.paper.top!=this&&a5(this,this.paper),this},bM[bJ].toBack=function(){return this.removed?this:(this.Group.parentNode.firstChild!=this.Group&&(this.Group.parentNode.insertBefore(this.Group,this.Group.parentNode.firstChild),a3(this,this.paper)),this)},bM[bJ].insertAfter=func
 tion(a){return this.removed?this:(a.Group.nextSibling?a.Group.parentNode.insertBefore(this.Group,a.Group.nextSibling):a.Group.parentNode[b9](this.Group),aZ(this,a,this.paper),this)},bM[bJ].insertBefore=function(a){return this.removed?this:(a.Group.parentNode.insertBefore(this.Group,a.Group),a1(this,a,this.paper),this)};var bI=function(e,d,c,b){var a=aW("group"),h=aW("oval"),g=h.style;a.style.cssText="position:absolute;left:0;top:0;width:"+e.width+"px;height:"+e.height+"px",a.coordsize=e.coordsize,a.coordorigin=e.coordorigin,a[b9](h);var f=new bM(h,a,e);return f.type="circle",bY(f,{stroke:"#000",fill:"none"}),f.attrs.cx=d,f.attrs.cy=c,f.attrs.r=b,f.setBox({x:d-b,y:c-b,width:b*2,height:b*2}),e.canvas[b9](a),f},bE=function(c,b,a,k,j,h){var g=aW("group"),f=aW("roundrect"),e=(+h||0)/bB(k,j);g.style.cssText="position:absolute;left:0;top:0;width:"+c.width+"px;height:"+c.height+"px",g.coordsize=c.coordsize,g.coordorigin=c.coordorigin,g[b9](f),f.arcsize=e;var d=new bM(f,g,c);return d.type="r
 ect",bY(d,{stroke:"#000"}),d.arcsize=e,d.setBox({x:b,y:a,width:k,height:j,r:h}),c.canvas[b9](g),d},bA=function(a,j,h,g,f){var e=aW("group"),d=aW("oval"),c=d.style;e.style.cssText="position:absolute;left:0;top:0;width:"+a.width+"px;height:"+a.height+"px",e.coordsize=a.coordsize,e.coordorigin=a.coordorigin,e[b9](d);var b=new bM(d,e,a);return b.type="ellipse",bY(b,{stroke:"#000"}),b.attrs.cx=j,b.attrs.cy=h,b.attrs.rx=g,b.attrs.ry=f,b.setBox({x:j-g,y:h-f,width:g*2,height:f*2}),a.canvas[b9](e),b},bw=function(c,b,a,k,j,h){var g=aW("group"),f=aW("image"),e=f.style;g.style.cssText="position:absolute;left:0;top:0;width:"+c.width+"px;height:"+c.height+"px",g.coordsize=c.coordsize,g.coordorigin=c.coordorigin,f.src=b,g[b9](f);var d=new bM(f,g,c);return d.type="image",d.attrs.src=b,d.attrs.x=a,d.attrs.y=k,d.attrs.w=j,d.attrs.h=h,d.setBox({x:a,y:k,width:j,height:h}),c.canvas[b9](g),d},aG=function(e,d,c,a){var b=aW("group"),l=aW("shape"),k=l.style,j=aW("path"),h=j.style,g=aW("textpath");b.style.cs
 sText="position:absolute;left:0;top:0;width:"+e.width+"px;height:"+e.height+"px",b.coordsize=e.coordsize,b.coordorigin=e.coordorigin,j.v=aF.format("m{0},{1}l{2},{1}",ce(d),ce(c),ce(d)+1),j.textpathok=!0,k.width=e.width,k.height=e.height,g.string=a+bU,g.on=!0,l[b9](g),l[b9](j),b[b9](l);var f=new bM(g,b,e);return f.shape=l,f.textpath=j,f.type="text",f.attrs.text=a,f.attrs.x=d,f.attrs.y=c,f.attrs.w=1,f.attrs.h=1,bY(f,{font:aC.font,stroke:"none",fill:"#000"}),f.setBox(),e.canvas[b9](b),f},aD=function(b,a){var c=this.canvas.style;return b==+b&&(b+="px"),a==+a&&(a+="px"),c.width=b,c.height=a,c.clip="rect(0 "+b+" "+a+" 0)",this},aW;bC.createStyleSheet().addRule(".rvml","behavior:url(#default#VML)");try{!bC.namespaces.rvml&&bC.namespaces.add("rvml","urn:schemas-microsoft-com:vml"),aW=function(a){return bC.createElement("<rvml:"+a+' class="rvml">')}}catch(aV){aW=function(a){return bC.createElement("<"+a+' xmlns="urn:schemas-microsoft.com:vml" class="rvml">')}}var cc=function(){var d=b1[bZ](n
 ull,arguments),c=d.container,b=d.height,a,k=d.width,j=d.x,h=d.y;if(!c){throw new Error("VML container not found.")}var g=new aB,f=g.canvas=bC.createElement("div"),e=f.style;return k=k||512,b=b||342,k==+k&&(k+="px"),b==+b&&(b+="px"),g.width=1000,g.height=1000,g.coordsize="1000 1000",g.coordorigin="0 0",g.span=bC.createElement("span"),g.span.style.cssText="position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;display:inline;",f[b9](g.span),e.cssText=aF.format("width:{0};height:{1};position:absolute;clip:rect(0 {0} {1} 0);overflow:hidden",k,b),c==1?(bC.body[b9](f),e.left=j+"px",e.top=h+"px"):(c.style.width=k,c.style.height=b,c.firstChild?c.insertBefore(f,c.firstChild):c[b9](f)),bV.call(g,g,aF.fn),g};aB[bJ].clear=function(){this.canvas.innerHTML=bU,this.span=bC.createElement("span"),this.span.style.cssText="position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;display:inline;",this.canvas[b9](this.span),this.bottom=this.top=null},aB[bJ].remove
 =function(){this.canvas.parentNode.removeChild(this.canvas);for(var a in this){this[a]=cr(a)}}}/^Apple|^Google/.test(navigator.vendor)&&!(navigator.userAgent.indexOf("Version/4.0")+1)?aB[bJ].safari=function(){var a=this.rect(-99,-99,this.width+99,this.height+99);setTimeout(function(){a.remove()})}:aB[bJ].safari=function(){};var aU=function(){if(bC.addEventListener){return function(b,a,e,d){var c=function(f){return e.call(d,f)};return b.addEventListener(a,c,!1),function(){return b.removeEventListener(a,c,!1),!0}}}if(bC.attachEvent){return function(b,a,f,e){var d=function(g){return f.call(e,g||by.event)};b.attachEvent("on"+a,d);var c=function(){return b.detachEvent("on"+a,d),!0};return c}}}();for(var aT=bR[bL];aT--;){(function(a){bM[bJ][a]=function(b){return aF.is(b,"function")&&(this.events=this.events||[],this.events.push({name:a,f:b,unbind:aU(this.shape||this.node,a,b,this)})),this},bM[bJ]["un"+a]=function(d){var c=this.events,b=c[bL];while(b--){if(c[b].name==a&&c[b].f==d){return c
 [b].unbind(),c.splice(b,1),!c.length&&delete this.events,this}}return this}})(bR[aT])}bM[bJ].hover=function(b,a){return this.mouseover(b).mouseout(a)},bM[bJ].unhover=function(b,a){return this.unmouseover(b).unmouseout(a)},aB[bJ].circle=function(b,a,c){return bI(this,b||0,a||0,c||0)},aB[bJ].rect=function(b,a,e,d,c){return bE(this,b||0,a||0,e||0,d||0,c||0)},aB[bJ].ellipse=function(b,a,d,c){return bA(this,b||0,a||0,d||0,c||0)},aB[bJ].path=function(a){return a&&!aF.is(a,"string")&&!aF.is(a[0],"array")&&(a+=bU),b8(aF.format[bZ](aF,arguments),this)},aB[bJ].image=function(b,a,e,d,c){return bw(this,b||"about:blank",a||0,e||0,d||0,c||0)},aB[bJ].text=function(b,a,c){return aG(this,b||0,a||0,c||bU)},aB[bJ].set=function(a){return arguments[bL]>1&&(a=Array[bJ].splice.call(arguments,0,arguments[bL])),new aH(a)},aB[bJ].setSize=aD,aB[bJ].top=aB[bJ].bottom=null,aB[bJ].raphael=aF,bM[bJ].scale=function(w,t,r,q){if(w==null&&t==null){return{x:this._.sx,y:this._.sy,toString:aS}}t=t||w,!+t&&(t=w);var n,m,
 C,A,z=this.attrs;if(w!=0){var y=this.getBBox(),x=y.x+y.width/2,v=y.y+y.height/2,p=w/this._.sx,l=t/this._.sy;r=+r||r==0?r:x,q=+q||q==0?q:v;var h=~~(w/bF.abs(w)),e=~~(t/bF.abs(t)),d=this.node.style,b=r+(x-r)*p,a=q+(v-q)*l;switch(this.type){case"rect":case"image":var u=z.width*h*p,s=z.height*e*l;this.attr({height:s,r:z.r*bB(h*p,e*l),width:u,x:b-u/2,y:a-s/2});break;case"circle":case"ellipse":this.attr({rx:z.rx*h*p,ry:z.ry*e*l,r:z.r*bB(h*p,e*l),cx:b,cy:a});break;case"path":var o=a2(z.path),k=!0;for(var j=0,g=o[bL];j<g;j++){var f=o[j],c,D=aE.call(f[0]);if(D=="M"&&k){continue}k=!1;if(D=="A"){f[o[j][bL]-2]*=p,f[o[j][bL]-1]*=l,f[1]*=h*p,f[2]*=e*l,f[5]=+(h+e?!!+f[5]:!+f[5])}else{if(D=="H"){for(c=1,jj=f[bL];c<jj;c++){f[c]*=p}}else{if(D=="V"){for(c=1,jj=f[bL];c<jj;c++){f[c]*=l}}else{for(c=1,jj=f[bL];c<jj;c++){f[c]*=c%2?p:l}}}}}var B=a6(o),n=b-B.x-B.width/2,m=a-B.y-B.height/2;o[0][1]+=n,o[0][2]+=m,this.attr({path:o})}this.type in {text:1,image:1}&&(h!=1||e!=1)?this.transformations?(this.transfor
 mations[2]="scale("[bW](h,",",e,")"),this.node[ca]("transform",this.transformations[bN](bT)),n=h==-1?-z.x-(u||0):z.x,m=e==-1?-z.y-(s||0):z.y,this.attr({x:n,y:m}),z.fx=h-1,z.fy=e-1):(this.node.filterMatrix=" progid:DXImageTransform.Microsoft.Matrix(M11="[bW](h,", M12=0, M21=0, M22=",e,", Dx=0, Dy=0, sizingmethod='auto expand', filtertype='bilinear')"),d.filter=(this.node.filterMatrix||bU)+(this.node.filterOpacity||bU)):this.transformations?(this.transformations[2]=bU,this.node[ca]("transform",this.transformations[bN](bT)),z.fx=0,z.fy=0):(this.node.filterMatrix=bU,d.filter=(this.node.filterMatrix||bU)+(this.node.filterOpacity||bU)),z.scale=[w,t,r,q][bN](bT),this._.sx=w,this._.sy=t}return this},bM[bJ].clone=function(){var a=this.attr();return delete a.scale,delete a.translation,this.paper[this.type]().attr(a)};var aR=function(b,a){return function(h,f,d){h=aY(h);var c,p,o,n,m="",l={},k,j=0;for(var g=0,e=h.length;g<e;g++){o=h[g];if(o[0]=="M"){c=+o[1],p=+o[2]}else{n=aQ(c,p,o[1],o[2],o[3],
 o[4],o[5],o[6]);if(j+n>f){if(a&&!l.start){k=aF.findDotsAtSegment(c,p,o[1],o[2],o[3],o[4],o[5],o[6],(f-j)/n),m+=["C",k.start.x,k.start.y,k.m.x,k.m.y,k.x,k.y];if(d){return m}l.start=m,m=["M",k.x,k.y+"C",k.n.x,k.n.y,k.end.x,k.end.y,o[5],o[6]][bN](),j+=n,c=+o[5],p=+o[6];continue}if(!b&&!a){return k=aF.findDotsAtSegment(c,p,o[1],o[2],o[3],o[4],o[5],o[6],(f-j)/n),{x:k.x,y:k.y,alpha:k.alpha}}}j+=n,c=+o[5],p=+o[6]}m+=o}return l.end=m,k=b?j:a?l:aF.findDotsAtSegment(c,p,o[1],o[2],o[3],o[4],o[5],o[6],1),k.alpha&&(k={x:k.x,y:k.y,alpha:k.alpha}),k}},aQ=a8(function(f,e,d,c,a,m,b,l){var k={x:0,y:0},j=0;for(var h=0;h<1.01;h+=0.01){var g=ch(f,e,d,c,a,m,b,l,h);h&&(j+=bF.sqrt(co(k.x-g.x,2)+co(k.y-g.y,2))),k=g}return j}),aP=aR(1),aO=aR(),aN=aR(0,1);bM[bJ].getTotalLength=function(){if(this.type!="path"){return}return aP(this.attrs.path)},bM[bJ].getPointAtLength=function(a){if(this.type!="path"){return}return aO(this.attrs.path,a)},bM[bJ].getSubpath=function(b,a){if(this.type!="path"){return}if(bF.abs(th
 is.getTotalLength()-a)<0.000001){return aN(this.attrs.path,b).end}var c=aN(this.attrs.path,a,1);return b?aN(c,b).end:c},aF.easing_formulas={linear:function(a){return a},"<":function(a){return co(a,3)},">":function(a){return co(a-1,3)+1},"<>":function(a){return a*=2,a<1?co(a,3)/2:(a-=2,(co(a,3)+2)/2)},backIn:function(b){var a=1.70158;return b*b*((a+1)*b-a)},backOut:function(b){b-=1;var a=1.70158;return b*b*((a+1)*b+a)+1},elastic:function(b){if(b==0||b==1){return b}var a=0.3,c=a/4;return co(2,-10*b)*bF.sin((b-c)*2*bF.PI/a)+1},bounce:function(b){var a=7.5625,d=2.75,c;return b<1/d?c=a*b*b:b<2/d?(b-=1.5/d,c=a*b*b+0.75):b<2.5/d?(b-=2.25/d,c=a*b*b+0.9375):(b-=2.625/d,c=a*b*b+0.984375),c}};var aM={length:0},aL=function(){var y=+(new Date);for(var x in aM){if(x!="length"&&aM[bP](x)){var w=aM[x];if(w.stop){delete aM[x],aM[bL]--;continue}var v=y-w.start,u=w.ms,t=w.easing,s=w.from,r=w.diff,q=w.to,p=w.t,o=w.prev||0,l=w.el,j=w.callback,g={},f;if(v<u){var e=aF.easing_formulas[t]?aF.easing_formulas
 [t](v/u):v/u;for(var d in s){if(s[bP](d)){switch(aA[d]){case"along":f=e*u*r[d],q.back&&(f=q.len-f);var c=aO(q[d],f);l.translate(r.sx-r.x||0,r.sy-r.y||0),r.x=c.x,r.y=c.y,l.translate(c.x-r.sx,c.y-r.sy),q.rot&&l.rotate(r.r+c.alpha,c.x,c.y);break;case"number":f=+s[d]+e*u*r[d];break;case"colour":f="rgb("+[aK(ce(s[d].r+e*u*r[d].r)),aK(ce(s[d].g+e*u*r[d].g)),aK(ce(s[d].b+e*u*r[d].b))][bN](",")+")";break;case"path":f=[];for(var b=0,a=s[d][bL];b<a;b++){f[b]=[s[d][b][0]];for(var n=1,m=s[d][b][bL];n<m;n++){f[b][n]=+s[d][b][n]+e*u*r[d][b][n]}f[b]=f[b][bN](bT)}f=f[bN](bT);break;case"csv":switch(d){case"translation":var k=r[d][0]*(v-o),h=r[d][1]*(v-o);p.x+=k,p.y+=h,f=k+bT+h;break;case"rotation":f=+s[d][0]+e*u*r[d][0],s[d][1]&&(f+=","+s[d][1]+","+s[d][2]);break;case"scale":f=[+s[d][0]+e*u*r[d][0],+s[d][1]+e*u*r[d][1],2 in q[d]?q[d][2]:bU,3 in q[d]?q[d][3]:bU][bN](bT);break;case"clip-rect":f=[];var b=4;while(b--){f[b]=+s[d][b]+e*u*r[d][b]}}}g[d]=f}}l.attr(g),l._run&&l._run.call(l)}else{if(q.along){
 var c=aO(q.along,q.len*!q.back);l.translate(r.sx-(r.x||0)+c.x-r.sx,r.sy-(r.y||0)+c.y-r.sy),q.rot&&l.rotate(r.r+c.alpha,c.x,c.y)}(p.x||p.y)&&l.translate(-p.x,-p.y),q.scale&&(q.scale=q.scale+bU),l.attr(q),delete aM[x],aM[bL]--,l.in_animation=null,aF.is(j,"function")&&j.call(l)}w.prev=v}}aF.svg&&l&&l.paper.safari(),aM[bL]&&setTimeout(aL)},aK=function(a){return a>255?255:a<0?0:a},aJ=function(b,a){if(b==null){return{x:this._.tx,y:this._.ty,toString:aS}}this._.tx+=+b,this._.ty+=+a;switch(this.type){case"circle":case"ellipse":this.attr({cx:+b+this.attrs.cx,cy:+a+this.attrs.cy});break;case"rect":case"image":case"text":this.attr({x:+b+this.attrs.x,y:+a+this.attrs.y});break;case"path":var c=a2(this.attrs.path);c[0][1]+=+b,c[0][2]+=+a,this.attr({path:c})}return this};bM[bJ].animateWith=function(b,a,e,d,c){return aM[b.id]&&(a.start=aM[b.id].start),this.animate(a,e,d,c)},bM[bJ].animateAlong=aI(),bM[bJ].animateAlongBack=aI(1),bM[bJ].onAnimation=function(a){return this._run=a||0,this},bM[bJ].anima
 te=function(u,t,s,r){if(aF.is(s,"function")||!s){r=s||null}var q={},p={},o={};for(var n in u){if(u[bP](n)&&aA[bP](n)){q[n]=this.attr(n),q[n]==null&&(q[n]=aC[n]),p[n]=u[n];switch(aA[n]){case"along":var m=aP(u[n]),l=aO(u[n],m*!!u.back),k=this.getBBox();o[n]=m/t,o.tx=k.x,o.ty=k.y,o.sx=l.x,o.sy=l.y,p.rot=u.rot,p.back=u.back,p.len=m,u.rot&&(o.r=b6(this.rotate())||0);break;case"number":o[n]=(p[n]-q[n])/t;break;case"colour":q[n]=aF.getRGB(q[n]);var j=aF.getRGB(p[n]);o[n]={r:(j.r-q[n].r)/t,g:(j.g-q[n].g)/t,b:(j.b-q[n].b)/t};break;case"path":var h=aY(q[n],p[n]);q[n]=h[0];var f=h[1];o[n]=[];for(var g=0,e=q[n][bL];g<e;g++){o[n][g]=[0];for(var d=1,c=q[n][g][bL];d<c;d++){o[n][g][d]=(f[g][d]-q[n][g][d])/t}}break;case"csv":var b=(u[n]+bU)[bS](bK),a=(q[n]+bU)[bS](bK);switch(n){case"translation":q[n]=[0,0],o[n]=[b[0]/t,b[1]/t];break;case"rotation":q[n]=a[1]==b[1]&&a[2]==b[2]?a:[0,b[1],b[2]],o[n]=[(b[0]-q[n][0])/t,0,0];break;case"scale":u[n]=b,q[n]=(q[n]+bU)[bS](bK),o[n]=[(b[0]-q[n][0])/t,(b[1]-q[n][
 1])/t,0,0];break;case"clip-rect":q[n]=(q[n]+bU)[bS](bK),o[n]=[];var g=4;while(g--){o[n][g]=(b[g]-q[n][g])/t}}p[n]=b}}}return this.stop(),this.in_animation=1,aM[this.id]={start:u.start||+(new Date),ms:t,easing:s,from:q,diff:o,to:p,el:this,callback:r,t:{x:0,y:0}},++aM[bL]==1&&aL(),this},bM[bJ].stop=function(){return aM[this.id]&&aM[bL]--,delete aM[this.id],this},bM[bJ].translate=function(b,a){return this.attr({translation:b+" "+a})},bM[bJ][bx]=function(){return"Raphaël’s object"},aF.ae=aM;var aH=function(b){this.items=[],this[bL]=0;if(b){for(var a=0,c=b[bL];a<c;a++){b[a]&&(b[a].constructor==bM||b[a].constructor==aH)&&(this[this.items[bL]]=this.items[this.items[bL]]=b[a],this[bL]++)}}};aH[bJ][cm]=function(){var b,a;for(var d=0,c=arguments[bL];d<c;d++){b=arguments[d],b&&(b.constructor==bM||b.constructor==aH)&&(a=this.items[bL],this[a]=this.items[a]=b,this[bL]++)}return this},aH[bJ].pop=function(){return delete this[this[bL]--],this.items.pop()};for(var cq in bM[bJ]){bM[bJ][bP](cq)&&(
 aH[bJ][cq]=function(a){return function(){for(var c=0,b=this.items[bL];c<b;c++){this.items[c][a][bZ](this.items[c],arguments)}return this}}(cq))}return aH[bJ].attr=function(b,a){if(b&&aF.is(b,"array")&&aF.is(b[0],"object")){for(var f=0,e=b[bL];f<e;f++){this.items[f].attr(b[f])}}else{for(var d=0,c=this.items[bL];d<c;d++){this.items[d].attr[bZ](this.items[d],arguments)}}return this},aH[bJ].animate=function(e,d,c,b){(aF.is(c,"function")||!c)&&(b=c||null);var a=this.items[bL],h=a,g=this,f;b&&(f=function(){!--a&&b.call(g)}),this.items[--h].animate(e,d,c||f,f);while(h--){this.items[h].animateWith(this.items[a-1],e,d,c||f,f)}return this},aH[bJ].insertAfter=function(b){var a=this.items[bL];while(a--){this.items[a].insertAfter(b)}return this},aH[bJ].getBBox=function(){var b=[],a=[],f=[],e=[];for(var d=this.items[bL];d--;){var c=this.items[d].getBBox();b[cm](c.x),a[cm](c.y),f[cm](c.x+c.width),e[cm](c.y+c.height)}return b=bB[bZ](0,b),a=bB[bZ](0,a),{x:b,y:a,width:bD[bZ](0,f)-b,height:bD[bZ](0,e)
 -a}},aF.registerFont=function(d){if(!d.face){return d}this.fonts=this.fonts||{};var c={w:d.w,face:{},glyphs:{}},b=d.face["font-family"];for(var a in d.face){d.face[bP](a)&&(c.face[a]=d.face[a])}this.fonts[b]?this.fonts[b][cm](c):this.fonts[b]=[c];if(!d.svg){c.face["units-per-em"]=b2(d.face["units-per-em"],10);for(var g in d.glyphs){if(d.glyphs[bP](g)){var f=d.glyphs[g];c.glyphs[g]={w:f.w,k:{},d:f.d&&"M"+f.d[cb](/[mlcxtrv]/g,function(h){return{l:"L",c:"C",x:"z",t:"m",r:"l",v:"c"}[h]||"M"})+"z"};if(f.k){for(var e in f.k){f[bP](e)&&(c.glyphs[g].k[e]=f.k[e])}}}}}return d},aB[bJ].getFont=function(c,b,a,k){k=k||"normal",a=a||"normal",b=+b||{normal:400,bold:700,lighter:300,bolder:800}[b]||400;var j=aF.fonts[c];if(!j){var h=new RegExp("(^|\\s)"+c[cb](/[^\w\d\s+!~.:_-]/g,bU)+"(\\s|$)","i");for(var g in aF.fonts){if(aF.fonts[bP](g)&&h.test(g)){j=aF.fonts[g];break}}}var f;if(j){for(var e=0,d=j[bL];e<d;e++){f=j[e];if(f.face["font-weight"]==b&&(f.face["font-style"]==a||!f.face["font-style"])&&f.
 face["font-stretch"]==k){break}}}return f},aB[bJ].print=function(r,p,n,m,l,k){k=k||"middle";var j=this.set(),h=(n+bU)[bS](bU),g=0,e=bU,s;aF.is(m,"string")&&(m=this.getFont(m));if(m){s=(l||16)/m.face["units-per-em"];var q=m.face.bbox.split(bK),o=+q[0],f=+q[1]+(k=="baseline"?q[3]-q[1]+ +m.face.descent:(q[3]-q[1])/2);for(var d=0,c=h[bL];d<c;d++){var b=d&&m.glyphs[h[d-1]]||{},a=m.glyphs[h[d]];g+=d?(b.w||m.w)+(b.k&&b.k[h[d]]||0):0,a&&a.d&&j[cm](this.path(a.d).attr({fill:"#000",stroke:"none",translation:[g,0]}))}j.scale(s,s,o,f).translate(r-o,p-f)}return j},aF.format=function(b){var a=aF.is(arguments[1],"array")?[0][bW](arguments[1]):arguments,c=/\{(\d+)\}/g;return b&&aF.is(b,"string")&&a[bL]-1&&(b=b[cb](c,function(e,d){return a[++d]==null?bU:a[d]})),b||bU},aF.ninja=function(){var a=Raphael;return a9.was?Raphael=a9.is:delete Raphael,a},aF.el=bM[bJ],aF}();var Graph=function(){this.nodes=[],this.nodelist=[],this.edges=[],this.snapshots=[]};Graph.prototype={addNode:function(d,c){return this.
 nodes[d]==undefined&&(this.nodes[d]=new Graph.Node(d,c||{id:d}),this.nodelist.push(this.nodes[d])),this.nodes[d]},addEdge:function(n,m,l){var k=this.addNode(n),j=this.addNode(m),h={source:k,target:j,style:l,weight:l&&l.weight||1};k.edges.push(h),this.edges.push(h);if(!l||!l.directed){var o={source:j,target:k,style:l,weight:l&&l.weight||1,backedge:h};this.edges.push(o),j.edges.push(o)}},snapShot:function(d,f){var e=new Graph;jQuery.extend(!0,e.nodes,this.nodes),jQuery.extend(!0,e.nodelist,this.nodelist),jQuery.extend(!0,e.edges,this.edges),e.snapShot=null,this.snapshots.push({comment:d,graph:e})}},Graph.Node=function(d,c){return c.id=d,c.edges=[],c},Graph.Node.prototype={},Graph.Renderer={},Graph.Renderer.Raphael=function(k,j,h,g,m){this.width=h||400,this.height=g||400;var l=this;this.r=Raphael(k,this.width,this.height),this.radius=m&&m.noderadius?m.noderadius:40,this.graph=j,this.mouse_in=!1,this.graph.render||(this.graph.render=function(){return}),this.isDrag=!1,this.dragger=functi
 on(a){this.dx=a.clientX,this.dy=a.clientY,l.isDrag=this,this.set&&this.set.animate({"fill-opacity":0.1},200)&&this.set.toFront(),a.preventDefault&&a.preventDefault()},document.onmousemove=function(e){e=e||window.event;if(l.isDrag){var c=l.isDrag.set.getBBox(),n=e.clientX-l.isDrag.dx+(c.x+c.width/2),f=e.clientY-l.isDrag.dy+(c.y+c.height/2),d=e.clientX-(n<20?n-20:n>l.width-20?n-l.width+20:0),b=e.clientY-(f<20?f-20:f>l.height-20?f-l.height+20:0);l.isDrag.set.translate(d-l.isDrag.dx,b-l.isDrag.dy);for(var a in l.graph.edges){l.graph.edges[a].connection&&l.graph.edges[a].connection.draw()}l.isDrag.dx=d,l.isDrag.dy=b}},document.onmouseup=function(){l.isDrag&&l.isDrag.set.animate({"fill-opacity":0.6},500),l.isDrag=!1}},Graph.Renderer.Raphael.prototype={translate:function(b){return[Math.round((b[0]-this.graph.layoutMinX)*this.factorX+this.radius),Math.round((b[1]-this.graph.layoutMinY)*this.factorY+this.radius)]},rotate:function(j,h,g){var f=h*Math.cos(g),k=h*Math.sin(g);return[j[0]+f,j[1]+
 k]},draw:function(){this.factorX=(this.width-10*this.radius)/(this.graph.layoutMaxX-this.graph.layoutMinX),this.factorY=(this.height-15*this.radius)/(this.graph.layoutMaxY-this.graph.layoutMinY);for(b in this.graph.nodes){this.drawNode(this.graph.nodes[b])}for(var b=0;b<this.graph.edges.length;b++){this.drawEdge(this.graph.edges[b])}},drawNode:function(k){var j=this.translate([k.layoutPosX,k.layoutPosY]);k.point=j;if(k.shape){var h=k.shape.getBBox(),g=[h.x+Math.round(h.width/2),h.y+Math.round(h.height/2)];k.shape.translate(j[0]-g[0],j[1]-g[1]),this.r.safari();return}var m;if(k.render){m=k.render(this.r,k)}else{if(!k.shape){var l=Raphael.getColor();m=this.r.set().push(this.r.ellipse(j[0],j[1],30,20).attr({fill:l,stroke:l,"stroke-width":2})).push(this.r.text(j[0],j[1]+30,k.label||k.id))}}m.attr({"fill-opacity":0.6}),m.items.forEach(function(a){a.set=m,a.node.style.cursor="pointer"}),m.mousedown(this.dragger),k.shape=m},drawEdge:function(b){if(b.backedge){return}b.connection&&b.connect
 ion.draw(),b.connection||(b.style&&b.style.callback&&b.style.callback(b),b.connection=this.r.connection(b.source.shape,b.target.shape,b.style))}},Graph.Layout={},Graph.Layout.Spring=function(b){this.graph=b,this.iterations=500,this.maxRepulsiveForceDistance=6,this.k=2,this.c=0.01,this.maxVertexMovement=0.5},Graph.Layout.Spring.prototype={layout:function(){this.layoutPrepare();for(var b=0;b<this.iterations;b++){this.layoutIteration()}this.layoutCalcBounds()},layoutPrepare:function(){for(i in this.graph.nodes){var b=this.graph.nodes[i];b.layoutPosX=0,b.layoutPosY=0,b.layoutForceX=0,b.layoutForceY=0}},layoutCalcBounds:function(){var k=Infinity,j=-Infinity,h=Infinity,g=-Infinity;for(i in this.graph.nodes){var m=this.graph.nodes[i].layoutPosX,l=this.graph.nodes[i].layoutPosY;m>j&&(j=m),m<k&&(k=m),l>g&&(g=l),l<h&&(h=l)}this.graph.layoutMinX=k,this.graph.layoutMaxX=j,this.graph.layoutMinY=h,this.graph.layoutMaxY=g},layoutIteration:function(){for(var q=0;q<this.graph.nodelist.length;q++){va
 r p=this.graph.nodelist[q];for(var o=q+1;o<this.graph.nodelist.length;o++){var n=this.graph.nodelist[o];this.layoutRepulsive(p,n)}}for(var q=0;q<this.graph.edges.length;q++){var m=this.graph.edges[q];this.layoutAttractive(m)}for(q in this.graph.nodes){var l=this.graph.nodes[q],k=this.c*l.layoutForceX,j=this.c*l.layoutForceY,r=this.maxVertexMovement;k>r&&(k=r),k<-r&&(k=-r),j>r&&(j=r),j<-r&&(j=-r),l.layoutPosX+=k,l.layoutPosY+=j,l.layoutForceX=0,l.layoutForceY=0}},layoutRepulsive:function(n,m){var l=m.layoutPosX-n.layoutPosX,k=m.layoutPosY-n.layoutPosY,j=l*l+k*k;if(j<0.01){l=0.1*Math.random()+0.1,k=0.1*Math.random()+0.1;var j=l*l+k*k}var h=Math.sqrt(j);if(h<this.maxRepulsiveForceDistance){var o=this.k*this.k/h;m.layoutForceX+=o*l/h,m.layoutForceY+=o*k/h,n.layoutForceX-=o*l/h,n.layoutForceY-=o*k/h}},layoutAttractive:function(q){var p=q.source,o=q.target,n=o.layoutPosX-p.layoutPosX,m=o.layoutPosY-p.layoutPosY,l=n*n+m*m;if(l<0.01){n=0.1*Math.random()+0.1,m=0.1*Math.random()+0.1;var l=n*n
 +m*m}var k=Math.sqrt(l);k>this.maxRepulsiveForceDistance&&(k=this.maxRepulsiveForceDistance,l=k*k);var j=(l-this.k*this.k)/this.k;q.attraction==undefined&&(q.attraction=1),j*=Math.log(q.attraction)*0.5+1,o.layoutForceX-=j*n/k,o.layoutForceY-=j*m/k,p.layoutForceX+=j*n/k,p.layoutForceY+=j*m/k}},Raphael.el.tooltip=function(b){return this.tp=b,this.tp.o={x:0,y:0},this.tp.hide(),this.hover(function(a){this.mousemove(function(d){this.tp.translate(d.clientX-this.tp.o.x,d.clientY-this.tp.o.y),this.tp.o={x:d.clientX,y:d.clientY}}),this.tp.show().toFront()},function(a){this.tp.hide(),this.unmousemove()}),this},Raphael.fn.connection=function(j,h,g){var f=this,k={draw:function(){var V=j.getBBox(),U=h.getBBox(),T=0,S=0,R=[{x:V.x+V.width/2,y:V.y-T},{x:V.x+V.width/2,y:V.y+V.height+T},{x:V.x-T,y:V.y+V.height/2},{x:V.x+V.width+T,y:V.y+V.height/2},{x:U.x+U.width/2,y:U.y-S},{x:U.x+U.width/2,y:U.y+U.height+S},{x:U.x-S,y:U.y+U.height/2},{x:U.x+U.width+S,y:U.y+U.height/2}],Q={},P=[];for(var O=0;O<4;O++){
 for(var N=4;N<8;N++){var M=Math.abs(R[O].x-R[N].x),K=Math.abs(R[O].y-R[N].y);if(O==N-4||(O!=3&&N!=6||R[O].x<R[N].x)&&(O!=2&&N!=7||R[O].x>R[N].x)&&(O!=0&&N!=5||R[O].y>R[N].y)&&(O!=1&&N!=4||R[O].y<R[N].y)){P.push(M+K),Q[P[P.length-1].toFixed(3)]=[O,N]}}}var G=P.length==0?[0,4]:Q[Math.min.apply(Math,P).toFixed(3)],E=R[G[0]].x,e=R[G[0]].y,d=R[G[1]].x,c=R[G[1]].y,M=Math.max(Math.abs(E-d)/2,10),K=Math.max(Math.abs(e-c)/2,10),b=[E,E,E-M,E+M][G[0]].toFixed(3),L=[e-K,e+K,e,e][G[0]].toFixed(3),J=[0,0,0,0,d,d,d-M,d+M][G[1]].toFixed(3),I=[0,0,0,0,e+K,e-K,c,c][G[1]].toFixed(3),a=["M",E.toFixed(3),e.toFixed(3),"C",b,L,J,I,d.toFixed(3),c.toFixed(3)].join(",");if(g&&g.directed){var H=Math.sqrt((c-I)*(c-I)+(d-J)*(d-J)),F=function(m,l){return -m*(l||5)/H},D=[{x:(F(d-J)+F(c-I)+d).toFixed(3),y:(F(c-I)+F(d-J)+c).toFixed(3)},{x:(F(d-J)-F(c-I)+d).toFixed(3),y:(F(c-I)-F(d-J)+c).toFixed(3)}];a=a+",M"+D[0].x+","+D[0].y+",L"+d+","+c+",L"+D[1].x+","+D[1].y}k.fg&&k.fg.attr({path:a})||(k.fg=f.path(a).attr({strok
 e:g&&g.stroke||"#000",fill:"none"}).toBack()),k.bg&&k.bg.attr({path:a})||g&&g.fill&&(k.bg=g.fill.split&&f.path(a).attr({stroke:g.fill,fill:"none","stroke-width":g.width||3}).toBack()),g&&g.label&&(k.label&&k.label.attr({x:(E+d)/2,y:(e+c)/2})||(k.label=f.text((E+d)/2,(e+c)/2,g.label).attr({fill:"#000","font-size":g.fontsize||"12px"})))}};return k.draw(),k};
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/extras/webjars/sgvizler/src/main/java/META-INF/resources/webjars/sgvizler/0.5.1/sgvizler.chart.css
----------------------------------------------------------------------
diff --git a/extras/webjars/sgvizler/src/main/java/META-INF/resources/webjars/sgvizler/0.5.1/sgvizler.chart.css b/extras/webjars/sgvizler/src/main/java/META-INF/resources/webjars/sgvizler/0.5.1/sgvizler.chart.css
new file mode 100644
index 0000000..93f0ec4
--- /dev/null
+++ b/extras/webjars/sgvizler/src/main/java/META-INF/resources/webjars/sgvizler/0.5.1/sgvizler.chart.css
@@ -0,0 +1 @@
+div.sgvizler-sMap{padding:0;margin:0;font-family:sans-serif}div.sgvizler-sMap h1,div.sgvizler-sMap p{font-size:11pt;margin:2px 0 1px 0}div.sgvizler-sMap p.text{font-family:serif}div.sgvizler-sMap div.img{float:right;padding:10px}circle.node{stroke:#999;stroke-width:.5px}line.link{stroke:#999;stroke-opacity:.6}.nodetext{pointer-events:none;font:10px sans-serif;color:black}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/extras/webjars/sgvizler/src/main/java/META-INF/resources/webjars/sgvizler/0.5.1/sgvizler.js
----------------------------------------------------------------------
diff --git a/extras/webjars/sgvizler/src/main/java/META-INF/resources/webjars/sgvizler/0.5.1/sgvizler.js b/extras/webjars/sgvizler/src/main/java/META-INF/resources/webjars/sgvizler/0.5.1/sgvizler.js
new file mode 100644
index 0000000..db552c9
--- /dev/null
+++ b/extras/webjars/sgvizler/src/main/java/META-INF/resources/webjars/sgvizler/0.5.1/sgvizler.js
@@ -0,0 +1 @@
+(function(a){var b={go:function(c){google.load("visualization","1.0",{packages:["annotatedtimeline","corechart","gauge","geomap","geochart","imagesparkline","map","orgchart","table","motionchart","treemap"]});google.setOnLoadCallback(function(){b.charts.loadCharts();b.drawFormQuery();b.drawContainerQueries();c()})},drawFormQuery:function(){var c=new b.query(b.ui.id.chartCon),d=b.ui.getUrlParams();$.extend(c,b.option.query,{query:d.query,chart:d.chart});if(b.ui.isElement(c.container)&&c.query){$.extend(c.chartOptions,{width:d.width,height:d.height});c.draw()}b.ui.displayUI(c)},drawContainerQueries:function(){$("["+this.ui.attr.prefix+"query]").each(function(){var c=new b.query();$.extend(c,b.option.query,b.ui.getQueryOptionAttr(this));$.extend(c.chartOptions,b.ui.getChartOptionAttr(this));c.draw()})},option:{},chart:{},charts:{},parser:{},ui:{}};jQuery.ajaxSetup({accepts:{xml:"application/sparql-results+xml",json:"application/sparql-results+json"}});b.option={home:(window.location.hr
 ef).replace(window.location.search,""),homefolder:"",libfolder:"/lib/",stylepath:"",namespace:{rdf:"http://www.w3.org/1999/02/22-rdf-syntax-ns#",rdfs:"http://www.w3.org/2000/01/rdf-schema#",owl:"http://www.w3.org/2002/07/owl#",xsd:"http://www.w3.org/2001/XMLSchema#"},query:{},chart:{}};b.ui={id:{script:"sgvzlr_script",chartCon:"sgvzlr_gchart",queryForm:"sgvzlr_formQuery",queryTxt:"sgvzlr_cQuery",formQuery:"sgvzlr_strQuery",formWidth:"sgvzlr_strWidth",formHeight:"sgvzlr_strHeight",formChart:"sgvzlr_optChart",prefixCon:"sgvzlr_cPrefix",messageCon:"sgvzlr_cMessage"},attr:{prefix:"data-sgvizler-",prefixChart:"data-sgvizler-chart-options",valueAssign:"=",valueSplit:"|"},params:["query","chart","width","height"],displayUI:function(c){this.displayPrefixes();this.displayChartTypesMenu();this.displayUserInput(c)},displayPrefixes:function(){this.setElementText(this.id.prefixCon,b.query.prototype.getPrefixes())},displayUserInput:function(c){this.setElementValue(this.id.queryTxt,c.query);this.s
 etElementValue(this.id.formChart,c.chart);this.setElementValue(this.id.formWidth,c.chartOptions.width);this.setElementValue(this.id.formHeight,c.chartOptions.height)},displayChartTypesMenu:function(){var d,c;if(this.isElement(this.id.formChart)){d=b.charts.all;for(c=0;c<d.length;c+=1){$("#"+this.id.formChart).append($("<option/>").val(d[c].id).html(d[c].id))}}},displayFeedback:function(c,f){var d,e=c.container;if(c.container===this.id.chartCon&&this.isElement(this.id.messageCon)){e=this.id.messageCon}if(c.loglevel===0){d=""}else{if(c.loglevel===1){if(f==="LOADING"){d="Loading..."}else{if(f==="ERROR_ENDPOINT"||f==="ERROR_UNKNOWN"){d="Error."}}}else{if(f==="LOADING"){d="Sending query..."}else{if(f==="ERROR_ENDPOINT"){d="Error querying endpoint. Possible errors:"+this.html.ul(this.html.a(c.endpoint,"SPARQL endpoint")+" down? "+this.html.a(c.endpoint+c.endpoint_query_url+c.encodedQuery,"Check if query runs at the endpoint")+".","Malformed SPARQL query? "+this.html.a(c.validator_query_ur
 l+c.encodedQuery,"Check if it validates")+".","CORS supported and enabled? Read more about "+this.html.a("http://code.google.com/p/sgvizler/wiki/Compatibility","CORS and compatibility")+".","Is your "+this.html.a("http://code.google.com/p/sgvizler/wiki/Compatibility","browser support")+"ed?","Hmm.. it might be a bug! Please file a report to "+this.html.a("http://code.google.com/p/sgvizler/issues/","the issues")+".")}else{if(f==="ERROR_UNKNOWN"){d="Unknown error."}else{if(f==="NO_RESULTS"){d="Query returned no results."}else{if(f==="DRAWING"){d="Received "+c.noRows+" rows. Drawing chart...<br/>"+this.html.a(c.endpoint+c.endpoint_query_url+c.encodedQuery,"View query results","target='_blank'")+" (in new window)."}}}}}}}this.setElementHTML(e,this.html.tag("p",d))},setElementValue:function(c,d){if(this.isElement(c)){$("#"+c).val(d)}},setElementText:function(c,d){if(this.isElement(c)){$("#"+c).text(d)}},setElementHTML:function(c,d){if(this.isElement(c)){$("#"+c).html(d)}},isElement:funct
 ion(c){return $("#"+c).length>0},getQueryOptionAttr:function(d){var c,f={container:$(d).attr("id")},e=d.attributes;for(c=0;c<e.length;c+=1){if(e[c].name.lastIndexOf(this.attr.prefix,0)===0){f[e[c].name.substring(this.attr.prefix.length)]=e[c].value}}return f},getChartOptionAttr:function(g){var h,m,c,l,d,f,e={},k=$(g).attr(b.ui.attr.prefixChart);if(typeof k!=="undefined"){m=k.split(this.attr.valueSplit);for(h=0;h<m.length;h+=1){c=m[h].split(this.attr.valueAssign);l=c[0].split(".");d=e;for(f=0;f<l.length-1;f+=1){if(typeof d[l[f]]==="undefined"){d[l[f]]={}}d=d[l[f]]}d[l[f]]=c[1]}}e.width=/(\d+)/.exec($(g).css("width"))[1];e.height=/(\d+)/.exec($(g).css("height"))[1];return e},getUrlParams:function(){var f={},c,g=/([^&=]+)=?([^&]*)/g,d=function(e){return decodeURIComponent(e.replace(/\+/g," "))},h=window.location.search.substring(1);while((c=g.exec(h))){if(c[2].length>0&&this.params.indexOf(c[1])!==-1){f[d(c[1])]=d(c[2])}}return f},resetPage:function(){document.location=b.home},submitQu
 ery:function(){$("#"+this.id.formQuery).val($("#"+this.id.queryTxt).val());$("#"+this.id.queryForm).submit()},html:{a:function(c,d,e){if(typeof e==="undefined"){e=""}if(typeof c!=="undefined"&&typeof d!=="undefined"){return"<a "+e+" href='"+c+"'>"+d+"</a>"}},ul:function(){var d,c;if(arguments.length){c="<ul>";for(d=0;d<arguments.length;d+=1){c+="<li>"+arguments[d]+"</li>"}return c+"</ul>"}},tag:function(c,d){return"<"+c+">"+d+"</"+c+">"}}};b.parser={defaultGDatatype:"string",countRowsSparqlXML:function(c){return $(c).find("sparql").find("results").find("result").length},countRowsSparqlJSON:function(c){if(typeof c.results.bindings!=="undefined"){return c.results.bindings.length}},SparqlXML2GoogleJSON:function(f){var d,c,g=[],e=[],h=[],i=$(f).find("sparql").find("results").find("result");d=0;$(f).find("sparql").find("head").find("variable").each(function(){var l=null,n=null,m=$(this).attr("name"),j=null,k=$(i).find('binding[name="'+m+'"]');if(k.length){j=$(k).first().children().first(
 )[0];l=j.nodeName;n=$(j).attr("datatype")}h[d]=b.parser.getGoogleJsonDatatype(l,n);g[d]={id:m,label:m,type:h[d]};d+=1});c=0;$(i).each(function(){var p,k,m,n,o,l=[];for(d=0;d<g.length;d+=1){p=null;k=$(this).find('binding[name="'+g[d].id+'"]');if(k.length&&typeof $(k).first().children().first()!=="undefined"&&$(k).first().children().first().firstChild!==null){m=$(k).first().children().first()[0];n=m.nodeName;o=$(m).first().text();p=b.parser.getGoogleJsonValue(o,h[d],n)}l[d]={v:p}}e[c]={c:l};c+=1});return{cols:g,rows:e}},SparqlJSON2GoogleJSON:function(k){var n,f,j,h,m,o,l,d=[],e=[],i=[],c=k.head.vars,g=k.results.bindings;for(n=0;n<c.length;n+=1){f=0;o=null;l=null;while(typeof g[f][c[n]]==="undefined"&&f+1<g.length){f+=1}if(typeof g[f][c[n]]!=="undefined"){o=g[f][c[n]].type;l=g[f][c[n]].datatype}i[n]=this.getGoogleJsonDatatype(o,l);d[n]={id:c[n],label:c[n],type:i[n]}}for(f=0;f<g.length;f+=1){j=g[f];h=[];for(n=0;n<c.length;n+=1){m=null;if(typeof j[c[n]]!=="undefined"&&typeof j[c[n]].valu
 e!=="undefined"){m=this.getGoogleJsonValue(j[c[n]].value,i[n],j[c[n]].type)}h[n]={v:m}}e[f]={c:h}}return{cols:d,rows:e}},getGoogleJsonValue:function(d,c,f){var e;if(c==="number"){e=Number(d)}else{if(c==="date"){e=new Date(d.substr(0,4),d.substr(5,2),d.substr(8,2))}else{if(c==="datetime"){e=new Date(d.substr(0,4),d.substr(5,2),d.substr(8,2),d.substr(11,2),d.substr(14,2),d.substr(17,2))}else{if(c==="timeofday"){e=[d.substr(0,2),d.substr(3,2),d.substr(6,2)]}else{if(f==="uri"){e=this.prefixify(d)}e=d}}}}return e},getGoogleJsonDatatype:function(c,d){var f=this.defaultGDatatype,e=b.option.namespace.xsd;if(typeof c!=="undefined"&&(c==="typed-literal"||c==="literal")){if(d===e+"float"||d===e+"double"||d===e+"decimal"||d===e+"int"||d===e+"long"||d===e+"integer"){f="number"}else{if(d===e+"boolean"){f="boolean"}else{if(d===e+"date"){f="date"}else{if(d===e+"dateTime"){f="datetime"}else{if(d===e+"time"){f="timeofday"}}}}}}return f},prefixify:function(c){var d;for(d in b.option.namespace){if(b.op
 tion.namespace.hasOwnProperty(d)&&c.lastIndexOf(b.option.namespace[d],0)===0){return c.replace(b.option.namespace[d],d+":")}}return c},unprefixify:function(d){var c;for(c in b.option.namespace){if(b.option.namespace.hasOwnProperty(c)&&d.lastIndexOf(c+":",0)===0){return d.replace(c+":",b.option.namespace[c])}}return d}};b.query=function(c){this.container=c;this.query="SELECT ?class (count(?instance) AS ?noOfInstances)\nWHERE{ ?instance a ?class }\nGROUP BY ?class\nORDER BY ?class";this.endpoint="http://sws.ifi.uio.no/sparql/world";this.endpoint_output="json";this.endpoint_query_url="?output=text&amp;query=";this.validator_query_url="http://www.sparql.org/query-validator?languageSyntax=SPARQL&amp;outputFormat=sparql&amp;linenumbers=true&amp;query=";this.chart="gLineChart";this.loglevel=2;this.chartOptions={width:"800",height:"400",chartArea:{left:"5%",top:"5%",width:"75%",height:"80%"},gGeoMap:{dataMode:"markers"},gMap:{dataMode:"markers"},sMap:{dataMode:"markers",showTip:true,useMapT
 ypeControl:true},gSparkline:{showAxisLines:false}}};b.query.prototype.draw=function(f,e,d){var c=this,g=b.charts.getChart(this.container,this.chart);this.setChartSpecificOptions();this.insertFrom();$.extend(this.chartOptions,e);this.runQuery(function(j){var i=new google.visualization.DataTable(c.processQueryResults(j));for(var h in f){google.visualization.events.addListener(g,h,function(){f[h](g,i)})}g.draw(i,c.chartOptions);if(d){d(i)}})};b.query.prototype.runQuery=function(d){var e,f,c=this.endpoint_output;b.ui.displayFeedback(this,"LOADING");this.encodedQuery=encodeURIComponent(this.getPrefixes()+this.query);if(this.endpoint_output!=="jsonp"&&$.browser.msie&&window.XDomainRequest){e=new XDomainRequest();f=this.endpoint+"?query="+this.encodedQuery+"&output="+this.endpoint_output;e.open("GET",f);e.onload=function(){var g;if(c==="xml"){g=$.parseXML(e.responseText)}else{g=$.parseJSON(e.responseText)}d(g)};e.send()}else{$.get(this.endpoint,{query:this.getPrefixes()+this.query,output:(
 this.endpoint_output==="jsonp")?"json":this.endpoint_output},function(g){d(g)},this.endpoint_output).error(function(){b.ui.displayFeedback(this,"ERROR_ENDPOINT")})}};b.query.prototype.processQueryResults=function(c){this.setResultRowCount(c);if(this.noRows===null){b.ui.displayFeedback(this,"ERROR_UNKNOWN")}else{if(this.noRows===0){b.ui.displayFeedback(this,"NO_RESULTS")}else{b.ui.displayFeedback(this,"DRAWING");return this.getGoogleJSON(c)}}};b.query.prototype.setResultRowCount=function(c){if(this.endpoint_output==="xml"){this.noRows=b.parser.countRowsSparqlXML(c)}else{this.noRows=b.parser.countRowsSparqlJSON(c)}};b.query.prototype.getGoogleJSON=function(c){if(this.endpoint_output==="xml"){c=b.parser.SparqlXML2GoogleJSON(c)}else{c=b.parser.SparqlJSON2GoogleJSON(c)}return c};b.query.prototype.insertFrom=function(){if(typeof this.rdf!=="undefined"){var e,c=this.rdf.split(b.ui.attr.valueSplit),d="";for(e=0;e<c.length;e+=1){d+="FROM <"+c[e]+">\n"}this.query=this.query.replace(/(WHERE)?(
 \s)*\{/,"\n"+d+"WHERE {")}};b.query.prototype.getPrefixes=function(){var d,c="";for(d in b.option.namespace){if(b.option.namespace.hasOwnProperty(d)){c+="PREFIX "+d+": <"+b.option.namespace[d]+">\n"}}return c};b.query.prototype.setChartSpecificOptions=function(){var d,c;for(d in this.chartOptions){if(this.chartOptions.hasOwnProperty(d)&&d===this.chart){for(c in this.chartOptions[d]){if(this.chartOptions[d].hasOwnProperty(c)){this.chartOptions[c]=this.chartOptions[d][c]}}}}};b.charts={all:[],loadCharts:function(){var d=[{id:"gLineChart",func:google.visualization.LineChart},{id:"gAreaChart",func:google.visualization.AreaChart},{id:"gSteppedAreaChart",func:google.visualization.SteppedAreaChart},{id:"gPieChart",func:google.visualization.PieChart},{id:"gBubbleChart",func:google.visualization.BubbleChart},{id:"gColumnChart",func:google.visualization.ColumnChart},{id:"gBarChart",func:google.visualization.BarChart},{id:"gSparkline",func:google.visualization.ImageSparkLine},{id:"gScatterChar
 t",func:google.visualization.ScatterChart},{id:"gCandlestickChart",func:google.visualization.CandlestickChart},{id:"gGauge",func:google.visualization.Gauge},{id:"gOrgChart",func:google.visualization.OrgChart},{id:"gTreeMap",func:google.visualization.TreeMap},{id:"gTimeline",func:google.visualization.AnnotatedTimeLine},{id:"gMotionChart",func:google.visualization.MotionChart},{id:"gGeoChart",func:google.visualization.GeoChart},{id:"gGeoMap",func:google.visualization.GeoMap},{id:"gMap",func:google.visualization.Map},{id:"gTable",func:google.visualization.Table}],c;$.merge(this.all,d);for(c in b.chart){if(b.chart.hasOwnProperty(c)){this.register(b.chart[c].prototype.id,b.chart[c])}}},register:function(d,c){this.all.push({id:d,func:c})},getChart:function(f,d){var c,e=document.getElementById(f);for(c=0;c<this.all.length;c+=1){if(d===this.all[c].id){return new this.all[c].func(e)}}}};b.chart.dForceGraph=function(c){this.container=c};b.chart.dForceGraph.prototype={id:"dForceGraph",draw:fun
 ction(A,n){var B=A.getNumberOfColumns(),x=A.getNumberOfRows(),c=$.extend({maxnodesize:15,minnodesize:2},n),j=d3.scale.category20(),k=n.width,q=n.height,m=function(h){return !isNaN(parseFloat(h))&&isFinite(h)},y=[],e=[],s={},l={},f=0,p,z,v,E,F,D,t,o,d,g,C,u;for(p=0;p<x;p+=1){z=A.getValue(p,0);v=A.getValue(p,1);if(z!==null&&$.inArray(z,y)===-1){y.push(z);l[z]=(B>2)?Math.sqrt(A.getValue(p,2)):0;s[z]=(B>3)?A.getValue(p,3):0;if(l[z]>f){f=l[z]}}if(v!==null&&$.inArray(v,y)===-1){y.push(v)}if(z!==null&&v!==null){e.push({source:$.inArray(z,y),target:$.inArray(v,y)})}}if(f===0){f=1}E=c.maxnodesize/f;for(F=0;F<y.length;F+=1){D=typeof s[y[F]]!=="undefined"?s[y[F]]:1;t=m(l[y[F]])?c.minnodesize+l[y[F]]*E:c.minnodesize;y[F]={name:y[F],color:D,size:t}}$(this.container).empty();o=d3.select(this.container).append("svg:svg").attr("width",k).attr("height",q).attr("pointer-events","all").append("svg:g").call(d3.behavior.zoom().on("zoom",function(){o.attr("transform","translate("+d3.event.translate+") sc
 ale("+d3.event.scale+")")})).append("svg:g");o.append("svg:rect").attr("width",k).attr("height",q).attr("fill","white");d=d3.layout.force().gravity(0.05).distance(100).charge(-100).nodes(y).links(e).size([k,q]).start();g=o.selectAll("line.link").data(e).enter().append("svg:line").attr("class","link").attr("x1",function(h){return h.source.x}).attr("y1",function(h){return h.source.y}).attr("x2",function(h){return h.target.x}).attr("y2",function(h){return h.target.y});C=o.selectAll("g.node").data(y).enter().append("svg:g").attr("class","node").call(d.drag);C.append("svg:circle").style("fill",function(h){return j(h.color)}).attr("class","node").attr("r",function(h){return h.size});C.append("svg:title").text(function(h){return h.name});C.append("svg:text").attr("class","nodetext").attr("dx",12).attr("dy",".35em").text(function(h){return h.name});u=0;d.on("tick",function(){u+=1;if(u>250){d.stop();d.charge(0).linkStrength(0).linkDistance(0).gravity(0).start()}g.attr("x1",function(h){return
  h.source.x}).attr("y1",function(h){return h.source.y}).attr("x2",function(h){return h.target.x}).attr("y2",function(h){return h.target.y});C.attr("transform",function(h){return"translate("+h.x+","+h.y+")"})})}};b.chart.rdGraph=function(c){this.container=c};b.chart.rdGraph.prototype={id:"rdGraph",draw:function(u,r){var p=u.getNumberOfColumns(),k=u.getNumberOfRows(),d=$.extend({noderadius:0.5,nodefontsize:"10px",nodeheight:20,nodestrokewidth:"1px",nodecornerradius:"1px",nodepadding:7,nodecolor:"green",edgestroke:"blue",edgefill:"blue",edgestrokewidth:1,edgefontsize:"10px",edgeseparator:", "},r),f=new Graph(),e,j,n,l,m,g,t,o,s=function(v,i){return function(w,x){return w.set().push(w.rect(x.point[0],x.point[1],x.label.length*d.nodepadding,d.nodeheight).attr({fill:v,"stroke-width":d.nodestrokewidth,r:d.nodecornerradius})).push(w.text(x.point[0]+x.label.length*d.nodepadding/2,x.point[1]+d.nodeheight/2,x.label).attr({"font-size":d.nodefontsize}).click(function(){if(i){window.open(b.parser
 .unprefixify(i))}}))}},c=function(i,w,v){f.addNode(i,{label:w,render:s(v,i)})},h={},q=[];for(n=0;n<k;n+=1){g=u.getValue(n,0);t=u.getValue(n,2);if(g){c(g,u.getValue(n,1)||g,p>5?u.getValue(n,5):d.nodecolor)}if(t){c(t,u.getValue(n,3)||t,p>6?u.getValue(n,6):d.nodecolor)}if(g&&t){o="";if(typeof h[g+t]!=="undefined"){o=h[g+t].label}else{q.push(g+t)}if(p>4&&u.getValue(n,4).length>0){if(o.length>0){o+=d.edgeseparator}o+=u.getValue(n,4)}h[g+t]={source:g,target:t,label:o}}}for(l=0;l<q.length;l+=1){m=h[q[l]];f.addEdge(m.source,m.target,{stroke:d.edgestroke,fill:d.edgefill,label:m.label,width:d.edgestrokewidth,fontsize:d.edgefontsize})}e=new Graph.Layout.Spring(f);e.layout();$(this.container).empty();j=new Graph.Renderer.Raphael(this.container,f,d.width,d.height,{noderadius:d.nodeheight*d.noderadius});j.draw()}};b.chart.DefList=function(c){this.container=c};b.chart.DefList.prototype={id:"sDefList",draw:function(e,d){var j,i,c,l,g=e.getNumberOfColumns(),f=e.getNumberOfRows(),k=$.extend({cellSep:
 " ",termPrefix:"",termPostfix:":",definitionPrefix:"",definitionPostfix:""},d),h=$(document.createElement("dl"));for(j=0;j<f;j+=1){c=k.termPrefix+e.getValue(j,0)+k.termPostfix;h.append($(document.createElement("dt")).html(c));l=k.definitionPrefix;for(i=1;i<g;i+=1){l+=e.getValue(j,i);if(i+1!==g){l+=k.cellSep}}l+=k.definitionPostfix;h.append($(document.createElement("dd")).html(l))}$(this.container).empty();$(this.container).append(h)}};b.chart.List=function(c){this.container=c};b.chart.List.prototype={id:"sList",draw:function(f,d){var h=f.getNumberOfColumns(),g=f.getNumberOfRows(),c=$.extend({list:"ul",cellSep:", ",rowPrefix:"",rowPostfix:""},d),i=$(document.createElement(c.list)),k,j,e;for(k=0;k<g;k+=1){e=c.rowPrefix;for(j=0;j<h;j+=1){e+=f.getValue(k,j);if(j+1!==h){e+=c.cellSep}}e+=c.rowPostfix;i.append($(document.createElement("li")).html(e))}$(this.container).empty();$(this.container).append(i)}};b.chart.sMap=function(c){this.container=c};b.chart.sMap.prototype={id:"sMap",draw:fun
 ction(f,g){var j,i,d,h=f.getNumberOfColumns(),c,e;if(h>3){i=f.clone();for(e=h-1;e>2;e-=1){i.removeColumn(e)}for(c=0;c<f.getNumberOfRows();c+=1){d="<div class='sgvizler sgvizler-sMap'>";d+="<h1>"+f.getValue(c,2)+"</h1>";if(5<h&&f.getValue(c,5)!==null){d+="<div class='img'><img src='"+f.getValue(c,5)+"'/></div>"}if(3<h&&f.getValue(c,3)!==null){d+="<p class='text'>"+f.getValue(c,3)+"</p>"}if(4<h&&f.getValue(c,4)!==null){d+="<p class='link'><a href='"+b.parser.unprefixify(f.getValue(c,4))+"'>"+f.getValue(c,4)+"</a></p>"}d+="</div>";i.setCell(c,2,d)}}else{i=f}j=new google.visualization.Map(this.container);j.draw(i,g)}};b.chart.Table=function(c){this.container=c};b.chart.Table.prototype={id:"sTable",draw:function(e,d){var g=e.getNumberOfColumns(),f=e.getNumberOfRows(),c=$.extend({headings:true},d),i=$(document.createElement("table")),h,k,j;if(c.headings){j=$(document.createElement("tr"));for(h=0;h<g;h+=1){j.append($(document.createElement("th")).html(e.getColumnLabel(h)))}i.append(j)}for(
 k=0;k<f;k+=1){j=$(document.createElement("tr"));for(h=0;h<g;h+=1){j.append($(document.createElement("td")).html(e.getValue(k,h)))}i.append(j)}$(this.container).empty();$(this.container).append(i)}};b.chart.Text=function(c){this.container=c};b.chart.Text.prototype={id:"sText",draw:function(e,d){var g=e.getNumberOfColumns(),f=e.getNumberOfRows(),c=$.extend({cellSep:", ",cellPrefix:"",cellPostfix:"",rowPrefix:"<p>",rowPostfix:"</p>",resultsPrefix:"<div>",resultsPostfix:"</div>"},d),i=c.resultsPrefix,k,h,j;for(k=0;k<f;k+=1){j=c.rowPrefix;for(h=0;h<g;h+=1){j+=c.cellPrefix+e.getValue(k,h)+c.cellPostfix;if(h+1!==g){j+=c.cellSep}}i+=j+c.rowPostfix}i+=c.resultsPostfix;$(this.container).empty();$(this.container).html(i)}};a.sgvizler=b}(window));
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/extras/webjars/sgvizler/src/main/resources/LICENSE
----------------------------------------------------------------------
diff --git a/extras/webjars/sgvizler/src/main/resources/LICENSE b/extras/webjars/sgvizler/src/main/resources/LICENSE
new file mode 100644
index 0000000..0e50dba
--- /dev/null
+++ b/extras/webjars/sgvizler/src/main/resources/LICENSE
@@ -0,0 +1,16 @@
+Copyright (c) 2011 Martin G. Skjæveland
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/extras/webjars/sgvizler/src/main/resources/REVISION
----------------------------------------------------------------------
diff --git a/extras/webjars/sgvizler/src/main/resources/REVISION b/extras/webjars/sgvizler/src/main/resources/REVISION
new file mode 100644
index 0000000..4dc1283
--- /dev/null
+++ b/extras/webjars/sgvizler/src/main/resources/REVISION
@@ -0,0 +1 @@
+172:173


[057/100] [abbrv] git commit: MARMOTTA-481: removed experimental tag from marmotta-ldp, added by default to marmotta-webapp and marmotta-installer.

Posted by wi...@apache.org.
MARMOTTA-481: removed experimental tag from marmotta-ldp, added by default to marmotta-webapp and marmotta-installer.


Project: http://git-wip-us.apache.org/repos/asf/marmotta/repo
Commit: http://git-wip-us.apache.org/repos/asf/marmotta/commit/2983aeaf
Tree: http://git-wip-us.apache.org/repos/asf/marmotta/tree/2983aeaf
Diff: http://git-wip-us.apache.org/repos/asf/marmotta/diff/2983aeaf

Branch: refs/heads/ldp
Commit: 2983aeaff0b1b50469498b30aa556f400f525409
Parents: 27ccb55
Author: Jakob Frank <ja...@apache.org>
Authored: Tue Apr 8 11:03:37 2014 +0200
Committer: Jakob Frank <ja...@apache.org>
Committed: Tue Apr 8 11:05:47 2014 +0200

----------------------------------------------------------------------
 .../src/main/resources/installer/standalone.xml     |  1 +
 launchers/marmotta-webapp/pom.xml                   | 16 +++++-----------
 platform/marmotta-ldp/pom.xml                       |  2 +-
 platform/pom.xml                                    | 13 +++----------
 4 files changed, 10 insertions(+), 22 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/marmotta/blob/2983aeaf/launchers/marmotta-installer/src/main/resources/installer/standalone.xml
----------------------------------------------------------------------
diff --git a/launchers/marmotta-installer/src/main/resources/installer/standalone.xml b/launchers/marmotta-installer/src/main/resources/installer/standalone.xml
index 7d392aa..f14d4f3 100644
--- a/launchers/marmotta-installer/src/main/resources/installer/standalone.xml
+++ b/launchers/marmotta-installer/src/main/resources/installer/standalone.xml
@@ -114,6 +114,7 @@
         <refpack file="refpacks/marmotta-webapp.xml" />
         <refpack file="refpacks/marmotta-core.xml" />
         <refpack file="refpacks/marmotta-backend-kiwi.xml" />
+        <refpack file="refpacks/marmotta-ldp.xml" />
         <refpack file="refpacks/marmotta-ldcache-common.xml" />
         <refpack file="refpacks/marmotta-ldcache-kiwi.xml" />
         <refpack file="refpacks/marmotta-ldpath.xml" />

http://git-wip-us.apache.org/repos/asf/marmotta/blob/2983aeaf/launchers/marmotta-webapp/pom.xml
----------------------------------------------------------------------
diff --git a/launchers/marmotta-webapp/pom.xml b/launchers/marmotta-webapp/pom.xml
index fc925d0..4f90733 100644
--- a/launchers/marmotta-webapp/pom.xml
+++ b/launchers/marmotta-webapp/pom.xml
@@ -199,17 +199,6 @@
 
     <profiles>
 
-        <profile>
-            <id>experimental</id>
-            <dependencies>
-                <dependency>
-                    <groupId>org.apache.marmotta</groupId>
-                    <artifactId>marmotta-ldp</artifactId>
-                    <version>${project.version}</version>
-                </dependency>
-            </dependencies>
-        </profile>
-
         <!-- backend profiles -->
         
         <profile>
@@ -467,6 +456,11 @@
         </dependency>
         <dependency>
             <groupId>org.apache.marmotta</groupId>
+            <artifactId>marmotta-ldp</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.marmotta</groupId>
             <artifactId>marmotta-sparql</artifactId>
             <version>${project.version}</version>
         </dependency>

http://git-wip-us.apache.org/repos/asf/marmotta/blob/2983aeaf/platform/marmotta-ldp/pom.xml
----------------------------------------------------------------------
diff --git a/platform/marmotta-ldp/pom.xml b/platform/marmotta-ldp/pom.xml
index 247e693..a5bcdfe 100644
--- a/platform/marmotta-ldp/pom.xml
+++ b/platform/marmotta-ldp/pom.xml
@@ -30,7 +30,7 @@
 
     <name>Apache Marmotta Platform: LDP</name>
     <description>
-        Provides experimental support for the current working draft of the
+        Provides support for the current working draft of the
         Linked Data Platform 1.0 specification.
     </description>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/2983aeaf/platform/pom.xml
----------------------------------------------------------------------
diff --git a/platform/pom.xml b/platform/pom.xml
index 7581785..3614050 100644
--- a/platform/pom.xml
+++ b/platform/pom.xml
@@ -70,6 +70,9 @@
         <module>backends</module>
         <module>ldcache</module>
 
+        <!-- LDP -->
+        <module>marmotta-ldp</module>
+
         <!-- generic modules -->
         <module>marmotta-ldpath</module>
         <module>marmotta-security</module>
@@ -87,14 +90,4 @@
 
     </modules>
 
-    <profiles>
-        <!-- experimental modules -->
-        <profile>
-            <id>experimental</id>
-            <modules>
-                <module>marmotta-ldp</module>
-            </modules>
-        </profile>
-    </profiles>
-
 </project>


[052/100] [abbrv] git commit: fixed wrong version numbers - update to 3.1.0-incubating (partially cherry picked from commit cdb3223db7439a9f8fd7fb5159ffd52f6da0ecb7)

Posted by wi...@apache.org.
fixed wrong version numbers - update to 3.1.0-incubating
(partially cherry picked from commit cdb3223db7439a9f8fd7fb5159ffd52f6da0ecb7)


Project: http://git-wip-us.apache.org/repos/asf/marmotta/repo
Commit: http://git-wip-us.apache.org/repos/asf/marmotta/commit/a20097e4
Tree: http://git-wip-us.apache.org/repos/asf/marmotta/tree/a20097e4
Diff: http://git-wip-us.apache.org/repos/asf/marmotta/diff/a20097e4

Branch: refs/heads/ldp
Commit: a20097e472cdaffa06edb5db991407394ac53a16
Parents: 582abb5
Author: Jakob Frank <ja...@apache.org>
Authored: Tue Nov 5 11:50:11 2013 +0100
Committer: Jakob Frank <ja...@apache.org>
Committed: Tue Nov 5 11:50:11 2013 +0100

----------------------------------------------------------------------
 client/marmotta-client-js-sample-webapp/pom.xml | 2 +-
 client/marmotta-client-php/pom.xml              | 2 +-
 libraries/ldcache/ldcache-backend-mapdb/pom.xml | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/marmotta/blob/a20097e4/client/marmotta-client-js-sample-webapp/pom.xml
----------------------------------------------------------------------
diff --git a/client/marmotta-client-js-sample-webapp/pom.xml b/client/marmotta-client-js-sample-webapp/pom.xml
index afe52bf..e0f7f5d 100644
--- a/client/marmotta-client-js-sample-webapp/pom.xml
+++ b/client/marmotta-client-js-sample-webapp/pom.xml
@@ -23,7 +23,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/marmotta/blob/a20097e4/client/marmotta-client-php/pom.xml
----------------------------------------------------------------------
diff --git a/client/marmotta-client-php/pom.xml b/client/marmotta-client-php/pom.xml
index 33a83fc..42a368e 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.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/marmotta/blob/a20097e4/libraries/ldcache/ldcache-backend-mapdb/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldcache/ldcache-backend-mapdb/pom.xml b/libraries/ldcache/ldcache-backend-mapdb/pom.xml
index 2b66c90..33a66c7 100644
--- a/libraries/ldcache/ldcache-backend-mapdb/pom.xml
+++ b/libraries/ldcache/ldcache-backend-mapdb/pom.xml
@@ -23,7 +23,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>
 


[081/100] [abbrv] git commit: preventing potential portability issues on ldclient tests

Posted by wi...@apache.org.
preventing potential portability issues on ldclient tests


Project: http://git-wip-us.apache.org/repos/asf/marmotta/repo
Commit: http://git-wip-us.apache.org/repos/asf/marmotta/commit/e6807666
Tree: http://git-wip-us.apache.org/repos/asf/marmotta/tree/e6807666
Diff: http://git-wip-us.apache.org/repos/asf/marmotta/diff/e6807666

Branch: refs/heads/ldp
Commit: e680766665f68cb092a48384386f12989f1ddd59
Parents: def9d41
Author: Sergio Fernández <wi...@apache.org>
Authored: Tue Apr 15 14:50:59 2014 +0200
Committer: Sergio Fernández <wi...@apache.org>
Committed: Tue Apr 15 14:50:59 2014 +0200

----------------------------------------------------------------------
 .../apache/marmotta/ldclient/test/provider/ProviderTestBase.java   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/marmotta/blob/e6807666/libraries/ldclient/ldclient-core/src/test/java/org/apache/marmotta/ldclient/test/provider/ProviderTestBase.java
----------------------------------------------------------------------
diff --git a/libraries/ldclient/ldclient-core/src/test/java/org/apache/marmotta/ldclient/test/provider/ProviderTestBase.java b/libraries/ldclient/ldclient-core/src/test/java/org/apache/marmotta/ldclient/test/provider/ProviderTestBase.java
index df0936c..1ff772f 100644
--- a/libraries/ldclient/ldclient-core/src/test/java/org/apache/marmotta/ldclient/test/provider/ProviderTestBase.java
+++ b/libraries/ldclient/ldclient-core/src/test/java/org/apache/marmotta/ldclient/test/provider/ProviderTestBase.java
@@ -98,7 +98,7 @@ public class ProviderTestBase {
 
         // run a SPARQL test to see if the returned data is correct
         InputStream sparql = this.getClass().getResourceAsStream(sparqlFile);
-        BooleanQuery testLabel = connection.prepareBooleanQuery(QueryLanguage.SPARQL, IOUtils.toString(sparql));
+        BooleanQuery testLabel = connection.prepareBooleanQuery(QueryLanguage.SPARQL, IOUtils.toString(sparql, "UTF-8"));
         Assert.assertTrue("SPARQL test query failed", testLabel.evaluate());
 
         if(log.isDebugEnabled()) {


[028/100] [abbrv] [partial] Reverting the erroneous merge by Sebastian according to the instructions in INFRA-6876

Posted by wi...@apache.org.
http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/extras/webjars/snorql/src/main/resources/prototype.js
----------------------------------------------------------------------
diff --git a/extras/webjars/snorql/src/main/resources/prototype.js b/extras/webjars/snorql/src/main/resources/prototype.js
new file mode 100755
index 0000000..3548fc0
--- /dev/null
+++ b/extras/webjars/snorql/src/main/resources/prototype.js
@@ -0,0 +1,4238 @@
+/*
+ * 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.
+ */
+/*  Prototype JavaScript framework, version 1.6.0.2
+ *  (c) 2005-2008 Sam Stephenson
+ *
+ *  Prototype is freely distributable under the terms of an MIT-style license.
+ *  For details, see the Prototype web site: http://www.prototypejs.org/
+ *
+ *--------------------------------------------------------------------------*/
+
+var Prototype = {
+  Version: '1.6.0.2',
+
+  Browser: {
+    IE:     !!(window.attachEvent && !window.opera),
+    Opera:  !!window.opera,
+    WebKit: navigator.userAgent.indexOf('AppleWebKit/') > -1,
+    Gecko:  navigator.userAgent.indexOf('Gecko') > -1 && navigator.userAgent.indexOf('KHTML') == -1,
+    MobileSafari: !!navigator.userAgent.match(/Apple.*Mobile.*Safari/)
+  },
+
+  BrowserFeatures: {
+    XPath: !!document.evaluate,
+    ElementExtensions: !!window.HTMLElement,
+    SpecificElementExtensions:
+      document.createElement('div').__proto__ &&
+      document.createElement('div').__proto__ !==
+        document.createElement('form').__proto__
+  },
+
+  ScriptFragment: '<script[^>]*>([\\S\\s]*?)<\/script>',
+  JSONFilter: /^\/\*-secure-([\s\S]*)\*\/\s*$/,
+
+  emptyFunction: function() { },
+  K: function(x) { return x }
+};
+
+if (Prototype.Browser.MobileSafari)
+  Prototype.BrowserFeatures.SpecificElementExtensions = false;
+
+
+/* Based on Alex Arnell's inheritance implementation. */
+var Class = {
+  create: function() {
+    var parent = null, properties = $A(arguments);
+    if (Object.isFunction(properties[0]))
+      parent = properties.shift();
+
+    function klass() {
+      this.initialize.apply(this, arguments);
+    }
+
+    Object.extend(klass, Class.Methods);
+    klass.superclass = parent;
+    klass.subclasses = [];
+
+    if (parent) {
+      var subclass = function() { };
+      subclass.prototype = parent.prototype;
+      klass.prototype = new subclass;
+      parent.subclasses.push(klass);
+    }
+
+    for (var i = 0; i < properties.length; i++)
+      klass.addMethods(properties[i]);
+
+    if (!klass.prototype.initialize)
+      klass.prototype.initialize = Prototype.emptyFunction;
+
+    klass.prototype.constructor = klass;
+
+    return klass;
+  }
+};
+
+Class.Methods = {
+  addMethods: function(source) {
+    var ancestor   = this.superclass && this.superclass.prototype;
+    var properties = Object.keys(source);
+
+    if (!Object.keys({ toString: true }).length)
+      properties.push("toString", "valueOf");
+
+    for (var i = 0, length = properties.length; i < length; i++) {
+      var property = properties[i], value = source[property];
+      if (ancestor && Object.isFunction(value) &&
+          value.argumentNames().first() == "$super") {
+        var method = value, value = Object.extend((function(m) {
+          return function() { return ancestor[m].apply(this, arguments) };
+        })(property).wrap(method), {
+          valueOf:  function() { return method },
+          toString: function() { return method.toString() }
+        });
+      }
+      this.prototype[property] = value;
+    }
+
+    return this;
+  }
+};
+
+var Abstract = { };
+
+Object.extend = function(destination, source) {
+  for (var property in source)
+    destination[property] = source[property];
+  return destination;
+};
+
+Object.extend(Object, {
+  inspect: function(object) {
+    try {
+      if (Object.isUndefined(object)) return 'undefined';
+      if (object === null) return 'null';
+      return object.inspect ? object.inspect() : String(object);
+    } catch (e) {
+      if (e instanceof RangeError) return '...';
+      throw e;
+    }
+  },
+
+  toJSON: function(object) {
+    var type = typeof object;
+    switch (type) {
+      case 'undefined':
+      case 'function':
+      case 'unknown': return;
+      case 'boolean': return object.toString();
+    }
+
+    if (object === null) return 'null';
+    if (object.toJSON) return object.toJSON();
+    if (Object.isElement(object)) return;
+
+    var results = [];
+    for (var property in object) {
+      var value = Object.toJSON(object[property]);
+      if (!Object.isUndefined(value))
+        results.push(property.toJSON() + ': ' + value);
+    }
+
+    return '{' + results.join(', ') + '}';
+  },
+
+  toQueryString: function(object) {
+    return $H(object).toQueryString();
+  },
+
+  toHTML: function(object) {
+    return object && object.toHTML ? object.toHTML() : String.interpret(object);
+  },
+
+  keys: function(object) {
+    var keys = [];
+    for (var property in object)
+      keys.push(property);
+    return keys;
+  },
+
+  values: function(object) {
+    var values = [];
+    for (var property in object)
+      values.push(object[property]);
+    return values;
+  },
+
+  clone: function(object) {
+    return Object.extend({ }, object);
+  },
+
+  isElement: function(object) {
+    return object && object.nodeType == 1;
+  },
+
+  isArray: function(object) {
+    return object != null && typeof object == "object" &&
+      'splice' in object && 'join' in object;
+  },
+
+  isHash: function(object) {
+    return object instanceof Hash;
+  },
+
+  isFunction: function(object) {
+    return typeof object == "function";
+  },
+
+  isString: function(object) {
+    return typeof object == "string";
+  },
+
+  isNumber: function(object) {
+    return typeof object == "number";
+  },
+
+  isUndefined: function(object) {
+    return typeof object == "undefined";
+  }
+});
+
+Object.extend(Function.prototype, {
+  argumentNames: function() {
+    var names = this.toString().match(/^[\s\(]*function[^(]*\((.*?)\)/)[1].split(",").invoke("strip");
+    return names.length == 1 && !names[0] ? [] : names;
+  },
+
+  bind: function() {
+    if (arguments.length < 2 && Object.isUndefined(arguments[0])) return this;
+    var __method = this, args = $A(arguments), object = args.shift();
+    return function() {
+      return __method.apply(object, args.concat($A(arguments)));
+    }
+  },
+
+  bindAsEventListener: function() {
+    var __method = this, args = $A(arguments), object = args.shift();
+    return function(event) {
+      return __method.apply(object, [event || window.event].concat(args));
+    }
+  },
+
+  curry: function() {
+    if (!arguments.length) return this;
+    var __method = this, args = $A(arguments);
+    return function() {
+      return __method.apply(this, args.concat($A(arguments)));
+    }
+  },
+
+  delay: function() {
+    var __method = this, args = $A(arguments), timeout = args.shift() * 1000;
+    return window.setTimeout(function() {
+      return __method.apply(__method, args);
+    }, timeout);
+  },
+
+  wrap: function(wrapper) {
+    var __method = this;
+    return function() {
+      return wrapper.apply(this, [__method.bind(this)].concat($A(arguments)));
+    }
+  },
+
+  methodize: function() {
+    if (this._methodized) return this._methodized;
+    var __method = this;
+    return this._methodized = function() {
+      return __method.apply(null, [this].concat($A(arguments)));
+    };
+  }
+});
+
+Function.prototype.defer = Function.prototype.delay.curry(0.01);
+
+Date.prototype.toJSON = function() {
+  return '"' + this.getUTCFullYear() + '-' +
+    (this.getUTCMonth() + 1).toPaddedString(2) + '-' +
+    this.getUTCDate().toPaddedString(2) + 'T' +
+    this.getUTCHours().toPaddedString(2) + ':' +
+    this.getUTCMinutes().toPaddedString(2) + ':' +
+    this.getUTCSeconds().toPaddedString(2) + 'Z"';
+};
+
+var Try = {
+  these: function() {
+    var returnValue;
+
+    for (var i = 0, length = arguments.length; i < length; i++) {
+      var lambda = arguments[i];
+      try {
+        returnValue = lambda();
+        break;
+      } catch (e) { }
+    }
+
+    return returnValue;
+  }
+};
+
+RegExp.prototype.match = RegExp.prototype.test;
+
+RegExp.escape = function(str) {
+  return String(str).replace(/([.*+?^=!:${}()|[\]\/\\])/g, '\\$1');
+};
+
+/*--------------------------------------------------------------------------*/
+
+var PeriodicalExecuter = Class.create({
+  initialize: function(callback, frequency) {
+    this.callback = callback;
+    this.frequency = frequency;
+    this.currentlyExecuting = false;
+
+    this.registerCallback();
+  },
+
+  registerCallback: function() {
+    this.timer = setInterval(this.onTimerEvent.bind(this), this.frequency * 1000);
+  },
+
+  execute: function() {
+    this.callback(this);
+  },
+
+  stop: function() {
+    if (!this.timer) return;
+    clearInterval(this.timer);
+    this.timer = null;
+  },
+
+  onTimerEvent: function() {
+    if (!this.currentlyExecuting) {
+      try {
+        this.currentlyExecuting = true;
+        this.execute();
+      } finally {
+        this.currentlyExecuting = false;
+      }
+    }
+  }
+});
+Object.extend(String, {
+  interpret: function(value) {
+    return value == null ? '' : String(value);
+  },
+  specialChar: {
+    '\b': '\\b',
+    '\t': '\\t',
+    '\n': '\\n',
+    '\f': '\\f',
+    '\r': '\\r',
+    '\\': '\\\\'
+  }
+});
+
+Object.extend(String.prototype, {
+  gsub: function(pattern, replacement) {
+    var result = '', source = this, match;
+    replacement = arguments.callee.prepareReplacement(replacement);
+
+    while (source.length > 0) {
+      if (match = source.match(pattern)) {
+        result += source.slice(0, match.index);
+        result += String.interpret(replacement(match));
+        source  = source.slice(match.index + match[0].length);
+      } else {
+        result += source, source = '';
+      }
+    }
+    return result;
+  },
+
+  sub: function(pattern, replacement, count) {
+    replacement = this.gsub.prepareReplacement(replacement);
+    count = Object.isUndefined(count) ? 1 : count;
+
+    return this.gsub(pattern, function(match) {
+      if (--count < 0) return match[0];
+      return replacement(match);
+    });
+  },
+
+  scan: function(pattern, iterator) {
+    this.gsub(pattern, iterator);
+    return String(this);
+  },
+
+  truncate: function(length, truncation) {
+    length = length || 30;
+    truncation = Object.isUndefined(truncation) ? '...' : truncation;
+    return this.length > length ?
+      this.slice(0, length - truncation.length) + truncation : String(this);
+  },
+
+  strip: function() {
+    return this.replace(/^\s+/, '').replace(/\s+$/, '');
+  },
+
+  stripTags: function() {
+    return this.replace(/<\/?[^>]+>/gi, '');
+  },
+
+  stripScripts: function() {
+    return this.replace(new RegExp(Prototype.ScriptFragment, 'img'), '');
+  },
+
+  extractScripts: function() {
+    var matchAll = new RegExp(Prototype.ScriptFragment, 'img');
+    var matchOne = new RegExp(Prototype.ScriptFragment, 'im');
+    return (this.match(matchAll) || []).map(function(scriptTag) {
+      return (scriptTag.match(matchOne) || ['', ''])[1];
+    });
+  },
+
+  evalScripts: function() {
+    return this.extractScripts().map(function(script) { return eval(script) });
+  },
+
+  escapeHTML: function() {
+    var self = arguments.callee;
+    self.text.data = this;
+    return self.div.innerHTML;
+  },
+
+  unescapeHTML: function() {
+    var div = new Element('div');
+    div.innerHTML = this.stripTags();
+    return div.childNodes[0] ? (div.childNodes.length > 1 ?
+      $A(div.childNodes).inject('', function(memo, node) { return memo+node.nodeValue }) :
+      div.childNodes[0].nodeValue) : '';
+  },
+
+  toQueryParams: function(separator) {
+    var match = this.strip().match(/([^?#]*)(#.*)?$/);
+    if (!match) return { };
+
+    return match[1].split(separator || '&').inject({ }, function(hash, pair) {
+      if ((pair = pair.split('='))[0]) {
+        var key = decodeURIComponent(pair.shift());
+        var value = pair.length > 1 ? pair.join('=') : pair[0];
+        if (value != undefined) value = decodeURIComponent(value);
+
+        if (key in hash) {
+          if (!Object.isArray(hash[key])) hash[key] = [hash[key]];
+          hash[key].push(value);
+        }
+        else hash[key] = value;
+      }
+      return hash;
+    });
+  },
+
+  toArray: function() {
+    return this.split('');
+  },
+
+  succ: function() {
+    return this.slice(0, this.length - 1) +
+      String.fromCharCode(this.charCodeAt(this.length - 1) + 1);
+  },
+
+  times: function(count) {
+    return count < 1 ? '' : new Array(count + 1).join(this);
+  },
+
+  camelize: function() {
+    var parts = this.split('-'), len = parts.length;
+    if (len == 1) return parts[0];
+
+    var camelized = this.charAt(0) == '-'
+      ? parts[0].charAt(0).toUpperCase() + parts[0].substring(1)
+      : parts[0];
+
+    for (var i = 1; i < len; i++)
+      camelized += parts[i].charAt(0).toUpperCase() + parts[i].substring(1);
+
+    return camelized;
+  },
+
+  capitalize: function() {
+    return this.charAt(0).toUpperCase() + this.substring(1).toLowerCase();
+  },
+
+  underscore: function() {
+    return this.gsub(/::/, '/').gsub(/([A-Z]+)([A-Z][a-z])/,'#{1}_#{2}').gsub(/([a-z\d])([A-Z])/,'#{1}_#{2}').gsub(/-/,'_').toLowerCase();
+  },
+
+  dasherize: function() {
+    return this.gsub(/_/,'-');
+  },
+
+  inspect: function(useDoubleQuotes) {
+    var escapedString = this.gsub(/[\x00-\x1f\\]/, function(match) {
+      var character = String.specialChar[match[0]];
+      return character ? character : '\\u00' + match[0].charCodeAt().toPaddedString(2, 16);
+    });
+    if (useDoubleQuotes) return '"' + escapedString.replace(/"/g, '\\"') + '"';
+    return "'" + escapedString.replace(/'/g, '\\\'') + "'";
+  },
+
+  toJSON: function() {
+    return this.inspect(true);
+  },
+
+  unfilterJSON: function(filter) {
+    return this.sub(filter || Prototype.JSONFilter, '#{1}');
+  },
+
+  isJSON: function() {
+    var str = this;
+    if (str.blank()) return false;
+    str = this.replace(/\\./g, '@').replace(/"[^"\\\n\r]*"/g, '');
+    return (/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/).test(str);
+  },
+
+  evalJSON: function(sanitize) {
+    var json = this.unfilterJSON();
+    try {
+      if (!sanitize || json.isJSON()) return eval('(' + json + ')');
+    } catch (e) { }
+    throw new SyntaxError('Badly formed JSON string: ' + this.inspect());
+  },
+
+  include: function(pattern) {
+    return this.indexOf(pattern) > -1;
+  },
+
+  startsWith: function(pattern) {
+    return this.indexOf(pattern) === 0;
+  },
+
+  endsWith: function(pattern) {
+    var d = this.length - pattern.length;
+    return d >= 0 && this.lastIndexOf(pattern) === d;
+  },
+
+  empty: function() {
+    return this == '';
+  },
+
+  blank: function() {
+    return /^\s*$/.test(this);
+  },
+
+  interpolate: function(object, pattern) {
+    return new Template(this, pattern).evaluate(object);
+  }
+});
+
+if (Prototype.Browser.WebKit || Prototype.Browser.IE) Object.extend(String.prototype, {
+  escapeHTML: function() {
+    return this.replace(/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;');
+  },
+  unescapeHTML: function() {
+    return this.replace(/&amp;/g,'&').replace(/&lt;/g,'<').replace(/&gt;/g,'>');
+  }
+});
+
+String.prototype.gsub.prepareReplacement = function(replacement) {
+  if (Object.isFunction(replacement)) return replacement;
+  var template = new Template(replacement);
+  return function(match) { return template.evaluate(match) };
+};
+
+String.prototype.parseQuery = String.prototype.toQueryParams;
+
+Object.extend(String.prototype.escapeHTML, {
+  div:  document.createElement('div'),
+  text: document.createTextNode('')
+});
+
+with (String.prototype.escapeHTML) div.appendChild(text);
+
+var Template = Class.create({
+  initialize: function(template, pattern) {
+    this.template = template.toString();
+    this.pattern = pattern || Template.Pattern;
+  },
+
+  evaluate: function(object) {
+    if (Object.isFunction(object.toTemplateReplacements))
+      object = object.toTemplateReplacements();
+
+    return this.template.gsub(this.pattern, function(match) {
+      if (object == null) return '';
+
+      var before = match[1] || '';
+      if (before == '\\') return match[2];
+
+      var ctx = object, expr = match[3];
+      var pattern = /^([^.[]+|\[((?:.*?[^\\])?)\])(\.|\[|$)/;
+      match = pattern.exec(expr);
+      if (match == null) return before;
+
+      while (match != null) {
+        var comp = match[1].startsWith('[') ? match[2].gsub('\\\\]', ']') : match[1];
+        ctx = ctx[comp];
+        if (null == ctx || '' == match[3]) break;
+        expr = expr.substring('[' == match[3] ? match[1].length : match[0].length);
+        match = pattern.exec(expr);
+      }
+
+      return before + String.interpret(ctx);
+    });
+  }
+});
+Template.Pattern = /(^|.|\r|\n)(#\{(.*?)\})/;
+
+var $break = { };
+
+var Enumerable = {
+  each: function(iterator, context) {
+    var index = 0;
+    iterator = iterator.bind(context);
+    try {
+      this._each(function(value) {
+        iterator(value, index++);
+      });
+    } catch (e) {
+      if (e != $break) throw e;
+    }
+    return this;
+  },
+
+  eachSlice: function(number, iterator, context) {
+    iterator = iterator ? iterator.bind(context) : Prototype.K;
+    var index = -number, slices = [], array = this.toArray();
+    while ((index += number) < array.length)
+      slices.push(array.slice(index, index+number));
+    return slices.collect(iterator, context);
+  },
+
+  all: function(iterator, context) {
+    iterator = iterator ? iterator.bind(context) : Prototype.K;
+    var result = true;
+    this.each(function(value, index) {
+      result = result && !!iterator(value, index);
+      if (!result) throw $break;
+    });
+    return result;
+  },
+
+  any: function(iterator, context) {
+    iterator = iterator ? iterator.bind(context) : Prototype.K;
+    var result = false;
+    this.each(function(value, index) {
+      if (result = !!iterator(value, index))
+        throw $break;
+    });
+    return result;
+  },
+
+  collect: function(iterator, context) {
+    iterator = iterator ? iterator.bind(context) : Prototype.K;
+    var results = [];
+    this.each(function(value, index) {
+      results.push(iterator(value, index));
+    });
+    return results;
+  },
+
+  detect: function(iterator, context) {
+    iterator = iterator.bind(context);
+    var result;
+    this.each(function(value, index) {
+      if (iterator(value, index)) {
+        result = value;
+        throw $break;
+      }
+    });
+    return result;
+  },
+
+  findAll: function(iterator, context) {
+    iterator = iterator.bind(context);
+    var results = [];
+    this.each(function(value, index) {
+      if (iterator(value, index))
+        results.push(value);
+    });
+    return results;
+  },
+
+  grep: function(filter, iterator, context) {
+    iterator = iterator ? iterator.bind(context) : Prototype.K;
+    var results = [];
+
+    if (Object.isString(filter))
+      filter = new RegExp(filter);
+
+    this.each(function(value, index) {
+      if (filter.match(value))
+        results.push(iterator(value, index));
+    });
+    return results;
+  },
+
+  include: function(object) {
+    if (Object.isFunction(this.indexOf))
+      if (this.indexOf(object) != -1) return true;
+
+    var found = false;
+    this.each(function(value) {
+      if (value == object) {
+        found = true;
+        throw $break;
+      }
+    });
+    return found;
+  },
+
+  inGroupsOf: function(number, fillWith) {
+    fillWith = Object.isUndefined(fillWith) ? null : fillWith;
+    return this.eachSlice(number, function(slice) {
+      while(slice.length < number) slice.push(fillWith);
+      return slice;
+    });
+  },
+
+  inject: function(memo, iterator, context) {
+    iterator = iterator.bind(context);
+    this.each(function(value, index) {
+      memo = iterator(memo, value, index);
+    });
+    return memo;
+  },
+
+  invoke: function(method) {
+    var args = $A(arguments).slice(1);
+    return this.map(function(value) {
+      return value[method].apply(value, args);
+    });
+  },
+
+  max: function(iterator, context) {
+    iterator = iterator ? iterator.bind(context) : Prototype.K;
+    var result;
+    this.each(function(value, index) {
+      value = iterator(value, index);
+      if (result == null || value >= result)
+        result = value;
+    });
+    return result;
+  },
+
+  min: function(iterator, context) {
+    iterator = iterator ? iterator.bind(context) : Prototype.K;
+    var result;
+    this.each(function(value, index) {
+      value = iterator(value, index);
+      if (result == null || value < result)
+        result = value;
+    });
+    return result;
+  },
+
+  partition: function(iterator, context) {
+    iterator = iterator ? iterator.bind(context) : Prototype.K;
+    var trues = [], falses = [];
+    this.each(function(value, index) {
+      (iterator(value, index) ?
+        trues : falses).push(value);
+    });
+    return [trues, falses];
+  },
+
+  pluck: function(property) {
+    var results = [];
+    this.each(function(value) {
+      results.push(value[property]);
+    });
+    return results;
+  },
+
+  reject: function(iterator, context) {
+    iterator = iterator.bind(context);
+    var results = [];
+    this.each(function(value, index) {
+      if (!iterator(value, index))
+        results.push(value);
+    });
+    return results;
+  },
+
+  sortBy: function(iterator, context) {
+    iterator = iterator.bind(context);
+    return this.map(function(value, index) {
+      return {value: value, criteria: iterator(value, index)};
+    }).sort(function(left, right) {
+      var a = left.criteria, b = right.criteria;
+      return a < b ? -1 : a > b ? 1 : 0;
+    }).pluck('value');
+  },
+
+  toArray: function() {
+    return this.map();
+  },
+
+  zip: function() {
+    var iterator = Prototype.K, args = $A(arguments);
+    if (Object.isFunction(args.last()))
+      iterator = args.pop();
+
+    var collections = [this].concat(args).map($A);
+    return this.map(function(value, index) {
+      return iterator(collections.pluck(index));
+    });
+  },
+
+  size: function() {
+    return this.toArray().length;
+  },
+
+  inspect: function() {
+    return '#<Enumerable:' + this.toArray().inspect() + '>';
+  }
+};
+
+Object.extend(Enumerable, {
+  map:     Enumerable.collect,
+  find:    Enumerable.detect,
+  select:  Enumerable.findAll,
+  filter:  Enumerable.findAll,
+  member:  Enumerable.include,
+  entries: Enumerable.toArray,
+  every:   Enumerable.all,
+  some:    Enumerable.any
+});
+function $A(iterable) {
+  if (!iterable) return [];
+  if (iterable.toArray) return iterable.toArray();
+  var length = iterable.length || 0, results = new Array(length);
+  while (length--) results[length] = iterable[length];
+  return results;
+}
+
+if (Prototype.Browser.WebKit) {
+  $A = function(iterable) {
+    if (!iterable) return [];
+    if (!(Object.isFunction(iterable) && iterable == '[object NodeList]') &&
+        iterable.toArray) return iterable.toArray();
+    var length = iterable.length || 0, results = new Array(length);
+    while (length--) results[length] = iterable[length];
+    return results;
+  };
+}
+
+Array.from = $A;
+
+Object.extend(Array.prototype, Enumerable);
+
+if (!Array.prototype._reverse) Array.prototype._reverse = Array.prototype.reverse;
+
+Object.extend(Array.prototype, {
+  _each: function(iterator) {
+    for (var i = 0, length = this.length; i < length; i++)
+      iterator(this[i]);
+  },
+
+  clear: function() {
+    this.length = 0;
+    return this;
+  },
+
+  first: function() {
+    return this[0];
+  },
+
+  last: function() {
+    return this[this.length - 1];
+  },
+
+  compact: function() {
+    return this.select(function(value) {
+      return value != null;
+    });
+  },
+
+  flatten: function() {
+    return this.inject([], function(array, value) {
+      return array.concat(Object.isArray(value) ?
+        value.flatten() : [value]);
+    });
+  },
+
+  without: function() {
+    var values = $A(arguments);
+    return this.select(function(value) {
+      return !values.include(value);
+    });
+  },
+
+  reverse: function(inline) {
+    return (inline !== false ? this : this.toArray())._reverse();
+  },
+
+  reduce: function() {
+    return this.length > 1 ? this : this[0];
+  },
+
+  uniq: function(sorted) {
+    return this.inject([], function(array, value, index) {
+      if (0 == index || (sorted ? array.last() != value : !array.include(value)))
+        array.push(value);
+      return array;
+    });
+  },
+
+  intersect: function(array) {
+    return this.uniq().findAll(function(item) {
+      return array.detect(function(value) { return item === value });
+    });
+  },
+
+  clone: function() {
+    return [].concat(this);
+  },
+
+  size: function() {
+    return this.length;
+  },
+
+  inspect: function() {
+    return '[' + this.map(Object.inspect).join(', ') + ']';
+  },
+
+  toJSON: function() {
+    var results = [];
+    this.each(function(object) {
+      var value = Object.toJSON(object);
+      if (!Object.isUndefined(value)) results.push(value);
+    });
+    return '[' + results.join(', ') + ']';
+  }
+});
+
+// use native browser JS 1.6 implementation if available
+if (Object.isFunction(Array.prototype.forEach))
+  Array.prototype._each = Array.prototype.forEach;
+
+if (!Array.prototype.indexOf) Array.prototype.indexOf = function(item, i) {
+  i || (i = 0);
+  var length = this.length;
+  if (i < 0) i = length + i;
+  for (; i < length; i++)
+    if (this[i] === item) return i;
+  return -1;
+};
+
+if (!Array.prototype.lastIndexOf) Array.prototype.lastIndexOf = function(item, i) {
+  i = isNaN(i) ? this.length : (i < 0 ? this.length + i : i) + 1;
+  var n = this.slice(0, i).reverse().indexOf(item);
+  return (n < 0) ? n : i - n - 1;
+};
+
+Array.prototype.toArray = Array.prototype.clone;
+
+function $w(string) {
+  if (!Object.isString(string)) return [];
+  string = string.strip();
+  return string ? string.split(/\s+/) : [];
+}
+
+if (Prototype.Browser.Opera){
+  Array.prototype.concat = function() {
+    var array = [];
+    for (var i = 0, length = this.length; i < length; i++) array.push(this[i]);
+    for (var i = 0, length = arguments.length; i < length; i++) {
+      if (Object.isArray(arguments[i])) {
+        for (var j = 0, arrayLength = arguments[i].length; j < arrayLength; j++)
+          array.push(arguments[i][j]);
+      } else {
+        array.push(arguments[i]);
+      }
+    }
+    return array;
+  };
+}
+Object.extend(Number.prototype, {
+  toColorPart: function() {
+    return this.toPaddedString(2, 16);
+  },
+
+  succ: function() {
+    return this + 1;
+  },
+
+  times: function(iterator) {
+    $R(0, this, true).each(iterator);
+    return this;
+  },
+
+  toPaddedString: function(length, radix) {
+    var string = this.toString(radix || 10);
+    return '0'.times(length - string.length) + string;
+  },
+
+  toJSON: function() {
+    return isFinite(this) ? this.toString() : 'null';
+  }
+});
+
+$w('abs round ceil floor').each(function(method){
+  Number.prototype[method] = Math[method].methodize();
+});
+function $H(object) {
+  return new Hash(object);
+};
+
+var Hash = Class.create(Enumerable, (function() {
+
+  function toQueryPair(key, value) {
+    if (Object.isUndefined(value)) return key;
+    return key + '=' + encodeURIComponent(String.interpret(value));
+  }
+
+  return {
+    initialize: function(object) {
+      this._object = Object.isHash(object) ? object.toObject() : Object.clone(object);
+    },
+
+    _each: function(iterator) {
+      for (var key in this._object) {
+        var value = this._object[key], pair = [key, value];
+        pair.key = key;
+        pair.value = value;
+        iterator(pair);
+      }
+    },
+
+    set: function(key, value) {
+      return this._object[key] = value;
+    },
+
+    get: function(key) {
+      return this._object[key];
+    },
+
+    unset: function(key) {
+      var value = this._object[key];
+      delete this._object[key];
+      return value;
+    },
+
+    toObject: function() {
+      return Object.clone(this._object);
+    },
+
+    keys: function() {
+      return this.pluck('key');
+    },
+
+    values: function() {
+      return this.pluck('value');
+    },
+
+    index: function(value) {
+      var match = this.detect(function(pair) {
+        return pair.value === value;
+      });
+      return match && match.key;
+    },
+
+    merge: function(object) {
+      return this.clone().update(object);
+    },
+
+    update: function(object) {
+      return new Hash(object).inject(this, function(result, pair) {
+        result.set(pair.key, pair.value);
+        return result;
+      });
+    },
+
+    toQueryString: function() {
+      return this.map(function(pair) {
+        var key = encodeURIComponent(pair.key), values = pair.value;
+
+        if (values && typeof values == 'object') {
+          if (Object.isArray(values))
+            return values.map(toQueryPair.curry(key)).join('&');
+        }
+        return toQueryPair(key, values);
+      }).join('&');
+    },
+
+    inspect: function() {
+      return '#<Hash:{' + this.map(function(pair) {
+        return pair.map(Object.inspect).join(': ');
+      }).join(', ') + '}>';
+    },
+
+    toJSON: function() {
+      return Object.toJSON(this.toObject());
+    },
+
+    clone: function() {
+      return new Hash(this);
+    }
+  }
+})());
+
+Hash.prototype.toTemplateReplacements = Hash.prototype.toObject;
+Hash.from = $H;
+var ObjectRange = Class.create(Enumerable, {
+  initialize: function(start, end, exclusive) {
+    this.start = start;
+    this.end = end;
+    this.exclusive = exclusive;
+  },
+
+  _each: function(iterator) {
+    var value = this.start;
+    while (this.include(value)) {
+      iterator(value);
+      value = value.succ();
+    }
+  },
+
+  include: function(value) {
+    if (value < this.start)
+      return false;
+    if (this.exclusive)
+      return value < this.end;
+    return value <= this.end;
+  }
+});
+
+var $R = function(start, end, exclusive) {
+  return new ObjectRange(start, end, exclusive);
+};
+
+var Ajax = {
+  getTransport: function() {
+    return Try.these(
+      function() {return new XMLHttpRequest()},
+      function() {return new ActiveXObject('Msxml2.XMLHTTP')},
+      function() {return new ActiveXObject('Microsoft.XMLHTTP')}
+    ) || false;
+  },
+
+  activeRequestCount: 0
+};
+
+Ajax.Responders = {
+  responders: [],
+
+  _each: function(iterator) {
+    this.responders._each(iterator);
+  },
+
+  register: function(responder) {
+    if (!this.include(responder))
+      this.responders.push(responder);
+  },
+
+  unregister: function(responder) {
+    this.responders = this.responders.without(responder);
+  },
+
+  dispatch: function(callback, request, transport, json) {
+    this.each(function(responder) {
+      if (Object.isFunction(responder[callback])) {
+        try {
+          responder[callback].apply(responder, [request, transport, json]);
+        } catch (e) { }
+      }
+    });
+  }
+};
+
+Object.extend(Ajax.Responders, Enumerable);
+
+Ajax.Responders.register({
+  onCreate:   function() { Ajax.activeRequestCount++ },
+  onComplete: function() { Ajax.activeRequestCount-- }
+});
+
+Ajax.Base = Class.create({
+  initialize: function(options) {
+    this.options = {
+      method:       'post',
+      asynchronous: true,
+      contentType:  'application/x-www-form-urlencoded',
+      encoding:     'UTF-8',
+      parameters:   '',
+      evalJSON:     true,
+      evalJS:       true
+    };
+    Object.extend(this.options, options || { });
+
+    this.options.method = this.options.method.toLowerCase();
+
+    if (Object.isString(this.options.parameters))
+      this.options.parameters = this.options.parameters.toQueryParams();
+    else if (Object.isHash(this.options.parameters))
+      this.options.parameters = this.options.parameters.toObject();
+  }
+});
+
+Ajax.Request = Class.create(Ajax.Base, {
+  _complete: false,
+
+  initialize: function($super, url, options) {
+    $super(options);
+    this.transport = Ajax.getTransport();
+    this.request(url);
+  },
+
+  request: function(url) {
+    this.url = url;
+    this.method = this.options.method;
+    var params = Object.clone(this.options.parameters);
+
+    if (!['get', 'post'].include(this.method)) {
+      // simulate other verbs over post
+      params['_method'] = this.method;
+      this.method = 'post';
+    }
+
+    this.parameters = params;
+
+    if (params = Object.toQueryString(params)) {
+      // when GET, append parameters to URL
+      if (this.method == 'get')
+        this.url += (this.url.include('?') ? '&' : '?') + params;
+      else if (/Konqueror|Safari|KHTML/.test(navigator.userAgent))
+        params += '&_=';
+    }
+
+    try {
+      var response = new Ajax.Response(this);
+      if (this.options.onCreate) this.options.onCreate(response);
+      Ajax.Responders.dispatch('onCreate', this, response);
+
+      this.transport.open(this.method.toUpperCase(), this.url,
+        this.options.asynchronous);
+
+      if (this.options.asynchronous) this.respondToReadyState.bind(this).defer(1);
+
+      this.transport.onreadystatechange = this.onStateChange.bind(this);
+      this.setRequestHeaders();
+
+      this.body = this.method == 'post' ? (this.options.postBody || params) : null;
+      this.transport.send(this.body);
+
+      /* Force Firefox to handle ready state 4 for synchronous requests */
+      if (!this.options.asynchronous && this.transport.overrideMimeType)
+        this.onStateChange();
+
+    }
+    catch (e) {
+      this.dispatchException(e);
+    }
+  },
+
+  onStateChange: function() {
+    var readyState = this.transport.readyState;
+    if (readyState > 1 && !((readyState == 4) && this._complete))
+      this.respondToReadyState(this.transport.readyState);
+  },
+
+  setRequestHeaders: function() {
+    var headers = {
+      'X-Requested-With': 'XMLHttpRequest',
+      'X-Prototype-Version': Prototype.Version,
+      'Accept': 'text/javascript, text/html, application/xml, text/xml, */*'
+    };
+
+    if (this.method == 'post') {
+      headers['Content-type'] = this.options.contentType +
+        (this.options.encoding ? '; charset=' + this.options.encoding : '');
+
+      /* Force "Connection: close" for older Mozilla browsers to work
+       * around a bug where XMLHttpRequest sends an incorrect
+       * Content-length header. See Mozilla Bugzilla #246651.
+       */
+      if (this.transport.overrideMimeType &&
+          (navigator.userAgent.match(/Gecko\/(\d{4})/) || [0,2005])[1] < 2005)
+            headers['Connection'] = 'close';
+    }
+
+    // user-defined headers
+    if (typeof this.options.requestHeaders == 'object') {
+      var extras = this.options.requestHeaders;
+
+      if (Object.isFunction(extras.push))
+        for (var i = 0, length = extras.length; i < length; i += 2)
+          headers[extras[i]] = extras[i+1];
+      else
+        $H(extras).each(function(pair) { headers[pair.key] = pair.value });
+    }
+
+    for (var name in headers)
+      this.transport.setRequestHeader(name, headers[name]);
+  },
+
+  success: function() {
+    var status = this.getStatus();
+    return !status || (status >= 200 && status < 300);
+  },
+
+  getStatus: function() {
+    try {
+      return this.transport.status || 0;
+    } catch (e) { return 0 }
+  },
+
+  respondToReadyState: function(readyState) {
+    var state = Ajax.Request.Events[readyState], response = new Ajax.Response(this);
+
+    if (state == 'Complete') {
+      try {
+        this._complete = true;
+        (this.options['on' + response.status]
+         || this.options['on' + (this.success() ? 'Success' : 'Failure')]
+         || Prototype.emptyFunction)(response, response.headerJSON);
+      } catch (e) {
+        this.dispatchException(e);
+      }
+
+      var contentType = response.getHeader('Content-type');
+      if (this.options.evalJS == 'force'
+          || (this.options.evalJS && this.isSameOrigin() && contentType
+          && contentType.match(/^\s*(text|application)\/(x-)?(java|ecma)script(;.*)?\s*$/i)))
+        this.evalResponse();
+    }
+
+    try {
+      (this.options['on' + state] || Prototype.emptyFunction)(response, response.headerJSON);
+      Ajax.Responders.dispatch('on' + state, this, response, response.headerJSON);
+    } catch (e) {
+      this.dispatchException(e);
+    }
+
+    if (state == 'Complete') {
+      // avoid memory leak in MSIE: clean up
+      this.transport.onreadystatechange = Prototype.emptyFunction;
+    }
+  },
+
+  isSameOrigin: function() {
+    var m = this.url.match(/^\s*https?:\/\/[^\/]*/);
+    return !m || (m[0] == '#{protocol}//#{domain}#{port}'.interpolate({
+      protocol: location.protocol,
+      domain: document.domain,
+      port: location.port ? ':' + location.port : ''
+    }));
+  },
+
+  getHeader: function(name) {
+    try {
+      return this.transport.getResponseHeader(name) || null;
+    } catch (e) { return null }
+  },
+
+  evalResponse: function() {
+    try {
+      return eval((this.transport.responseText || '').unfilterJSON());
+    } catch (e) {
+      this.dispatchException(e);
+    }
+  },
+
+  dispatchException: function(exception) {
+    (this.options.onException || Prototype.emptyFunction)(this, exception);
+    Ajax.Responders.dispatch('onException', this, exception);
+  }
+});
+
+Ajax.Request.Events =
+  ['Uninitialized', 'Loading', 'Loaded', 'Interactive', 'Complete'];
+
+Ajax.Response = Class.create({
+  initialize: function(request){
+    this.request = request;
+    var transport  = this.transport  = request.transport,
+        readyState = this.readyState = transport.readyState;
+
+    if((readyState > 2 && !Prototype.Browser.IE) || readyState == 4) {
+      this.status       = this.getStatus();
+      this.statusText   = this.getStatusText();
+      this.responseText = String.interpret(transport.responseText);
+      this.headerJSON   = this._getHeaderJSON();
+    }
+
+    if(readyState == 4) {
+      var xml = transport.responseXML;
+      this.responseXML  = Object.isUndefined(xml) ? null : xml;
+      this.responseJSON = this._getResponseJSON();
+    }
+  },
+
+  status:      0,
+  statusText: '',
+
+  getStatus: Ajax.Request.prototype.getStatus,
+
+  getStatusText: function() {
+    try {
+      return this.transport.statusText || '';
+    } catch (e) { return '' }
+  },
+
+  getHeader: Ajax.Request.prototype.getHeader,
+
+  getAllHeaders: function() {
+    try {
+      return this.getAllResponseHeaders();
+    } catch (e) { return null }
+  },
+
+  getResponseHeader: function(name) {
+    return this.transport.getResponseHeader(name);
+  },
+
+  getAllResponseHeaders: function() {
+    return this.transport.getAllResponseHeaders();
+  },
+
+  _getHeaderJSON: function() {
+    var json = this.getHeader('X-JSON');
+    if (!json) return null;
+    json = decodeURIComponent(escape(json));
+    try {
+      return json.evalJSON(this.request.options.sanitizeJSON ||
+        !this.request.isSameOrigin());
+    } catch (e) {
+      this.request.dispatchException(e);
+    }
+  },
+
+  _getResponseJSON: function() {
+    var options = this.request.options;
+    if (!options.evalJSON || (options.evalJSON != 'force' &&
+      !(this.getHeader('Content-type') || '').include('application/json')) ||
+        this.responseText.blank())
+          return null;
+    try {
+      return this.responseText.evalJSON(options.sanitizeJSON ||
+        !this.request.isSameOrigin());
+    } catch (e) {
+      this.request.dispatchException(e);
+    }
+  }
+});
+
+Ajax.Updater = Class.create(Ajax.Request, {
+  initialize: function($super, container, url, options) {
+    this.container = {
+      success: (container.success || container),
+      failure: (container.failure || (container.success ? null : container))
+    };
+
+    options = Object.clone(options);
+    var onComplete = options.onComplete;
+    options.onComplete = (function(response, json) {
+      this.updateContent(response.responseText);
+      if (Object.isFunction(onComplete)) onComplete(response, json);
+    }).bind(this);
+
+    $super(url, options);
+  },
+
+  updateContent: function(responseText) {
+    var receiver = this.container[this.success() ? 'success' : 'failure'],
+        options = this.options;
+
+    if (!options.evalScripts) responseText = responseText.stripScripts();
+
+    if (receiver = $(receiver)) {
+      if (options.insertion) {
+        if (Object.isString(options.insertion)) {
+          var insertion = { }; insertion[options.insertion] = responseText;
+          receiver.insert(insertion);
+        }
+        else options.insertion(receiver, responseText);
+      }
+      else receiver.update(responseText);
+    }
+  }
+});
+
+Ajax.PeriodicalUpdater = Class.create(Ajax.Base, {
+  initialize: function($super, container, url, options) {
+    $super(options);
+    this.onComplete = this.options.onComplete;
+
+    this.frequency = (this.options.frequency || 2);
+    this.decay = (this.options.decay || 1);
+
+    this.updater = { };
+    this.container = container;
+    this.url = url;
+
+    this.start();
+  },
+
+  start: function() {
+    this.options.onComplete = this.updateComplete.bind(this);
+    this.onTimerEvent();
+  },
+
+  stop: function() {
+    this.updater.options.onComplete = undefined;
+    clearTimeout(this.timer);
+    (this.onComplete || Prototype.emptyFunction).apply(this, arguments);
+  },
+
+  updateComplete: function(response) {
+    if (this.options.decay) {
+      this.decay = (response.responseText == this.lastText ?
+        this.decay * this.options.decay : 1);
+
+      this.lastText = response.responseText;
+    }
+    this.timer = this.onTimerEvent.bind(this).delay(this.decay * this.frequency);
+  },
+
+  onTimerEvent: function() {
+    this.updater = new Ajax.Updater(this.container, this.url, this.options);
+  }
+});
+function $(element) {
+  if (arguments.length > 1) {
+    for (var i = 0, elements = [], length = arguments.length; i < length; i++)
+      elements.push($(arguments[i]));
+    return elements;
+  }
+  if (Object.isString(element))
+    element = document.getElementById(element);
+  return Element.extend(element);
+}
+
+if (Prototype.BrowserFeatures.XPath) {
+  document._getElementsByXPath = function(expression, parentElement) {
+    var results = [];
+    var query = document.evaluate(expression, $(parentElement) || document,
+      null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
+    for (var i = 0, length = query.snapshotLength; i < length; i++)
+      results.push(Element.extend(query.snapshotItem(i)));
+    return results;
+  };
+}
+
+/*--------------------------------------------------------------------------*/
+
+if (!window.Node) var Node = { };
+
+if (!Node.ELEMENT_NODE) {
+  // DOM level 2 ECMAScript Language Binding
+  Object.extend(Node, {
+    ELEMENT_NODE: 1,
+    ATTRIBUTE_NODE: 2,
+    TEXT_NODE: 3,
+    CDATA_SECTION_NODE: 4,
+    ENTITY_REFERENCE_NODE: 5,
+    ENTITY_NODE: 6,
+    PROCESSING_INSTRUCTION_NODE: 7,
+    COMMENT_NODE: 8,
+    DOCUMENT_NODE: 9,
+    DOCUMENT_TYPE_NODE: 10,
+    DOCUMENT_FRAGMENT_NODE: 11,
+    NOTATION_NODE: 12
+  });
+}
+
+(function() {
+  var element = this.Element;
+  this.Element = function(tagName, attributes) {
+    attributes = attributes || { };
+    tagName = tagName.toLowerCase();
+    var cache = Element.cache;
+    if (Prototype.Browser.IE && attributes.name) {
+      tagName = '<' + tagName + ' name="' + attributes.name + '">';
+      delete attributes.name;
+      return Element.writeAttribute(document.createElement(tagName), attributes);
+    }
+    if (!cache[tagName]) cache[tagName] = Element.extend(document.createElement(tagName));
+    return Element.writeAttribute(cache[tagName].cloneNode(false), attributes);
+  };
+  Object.extend(this.Element, element || { });
+}).call(window);
+
+Element.cache = { };
+
+Element.Methods = {
+  visible: function(element) {
+    return $(element).style.display != 'none';
+  },
+
+  toggle: function(element) {
+    element = $(element);
+    Element[Element.visible(element) ? 'hide' : 'show'](element);
+    return element;
+  },
+
+  hide: function(element) {
+    $(element).style.display = 'none';
+    return element;
+  },
+
+  show: function(element) {
+    $(element).style.display = '';
+    return element;
+  },
+
+  remove: function(element) {
+    element = $(element);
+    element.parentNode.removeChild(element);
+    return element;
+  },
+
+  update: function(element, content) {
+    element = $(element);
+    if (content && content.toElement) content = content.toElement();
+    if (Object.isElement(content)) return element.update().insert(content);
+    content = Object.toHTML(content);
+    element.innerHTML = content.stripScripts();
+    content.evalScripts.bind(content).defer();
+    return element;
+  },
+
+  replace: function(element, content) {
+    element = $(element);
+    if (content && content.toElement) content = content.toElement();
+    else if (!Object.isElement(content)) {
+      content = Object.toHTML(content);
+      var range = element.ownerDocument.createRange();
+      range.selectNode(element);
+      content.evalScripts.bind(content).defer();
+      content = range.createContextualFragment(content.stripScripts());
+    }
+    element.parentNode.replaceChild(content, element);
+    return element;
+  },
+
+  insert: function(element, insertions) {
+    element = $(element);
+
+    if (Object.isString(insertions) || Object.isNumber(insertions) ||
+        Object.isElement(insertions) || (insertions && (insertions.toElement || insertions.toHTML)))
+          insertions = {bottom:insertions};
+
+    var content, insert, tagName, childNodes;
+
+    for (var position in insertions) {
+      content  = insertions[position];
+      position = position.toLowerCase();
+      insert = Element._insertionTranslations[position];
+
+      if (content && content.toElement) content = content.toElement();
+      if (Object.isElement(content)) {
+        insert(element, content);
+        continue;
+      }
+
+      content = Object.toHTML(content);
+
+      tagName = ((position == 'before' || position == 'after')
+        ? element.parentNode : element).tagName.toUpperCase();
+
+      childNodes = Element._getContentFromAnonymousElement(tagName, content.stripScripts());
+
+      if (position == 'top' || position == 'after') childNodes.reverse();
+      childNodes.each(insert.curry(element));
+
+      content.evalScripts.bind(content).defer();
+    }
+
+    return element;
+  },
+
+  wrap: function(element, wrapper, attributes) {
+    element = $(element);
+    if (Object.isElement(wrapper))
+      $(wrapper).writeAttribute(attributes || { });
+    else if (Object.isString(wrapper)) wrapper = new Element(wrapper, attributes);
+    else wrapper = new Element('div', wrapper);
+    if (element.parentNode)
+      element.parentNode.replaceChild(wrapper, element);
+    wrapper.appendChild(element);
+    return wrapper;
+  },
+
+  inspect: function(element) {
+    element = $(element);
+    var result = '<' + element.tagName.toLowerCase();
+    $H({'id': 'id', 'className': 'class'}).each(function(pair) {
+      var property = pair.first(), attribute = pair.last();
+      var value = (element[property] || '').toString();
+      if (value) result += ' ' + attribute + '=' + value.inspect(true);
+    });
+    return result + '>';
+  },
+
+  recursivelyCollect: function(element, property) {
+    element = $(element);
+    var elements = [];
+    while (element = element[property])
+      if (element.nodeType == 1)
+        elements.push(Element.extend(element));
+    return elements;
+  },
+
+  ancestors: function(element) {
+    return $(element).recursivelyCollect('parentNode');
+  },
+
+  descendants: function(element) {
+    return $(element).select("*");
+  },
+
+  firstDescendant: function(element) {
+    element = $(element).firstChild;
+    while (element && element.nodeType != 1) element = element.nextSibling;
+    return $(element);
+  },
+
+  immediateDescendants: function(element) {
+    if (!(element = $(element).firstChild)) return [];
+    while (element && element.nodeType != 1) element = element.nextSibling;
+    if (element) return [element].concat($(element).nextSiblings());
+    return [];
+  },
+
+  previousSiblings: function(element) {
+    return $(element).recursivelyCollect('previousSibling');
+  },
+
+  nextSiblings: function(element) {
+    return $(element).recursivelyCollect('nextSibling');
+  },
+
+  siblings: function(element) {
+    element = $(element);
+    return element.previousSiblings().reverse().concat(element.nextSiblings());
+  },
+
+  match: function(element, selector) {
+    if (Object.isString(selector))
+      selector = new Selector(selector);
+    return selector.match($(element));
+  },
+
+  up: function(element, expression, index) {
+    element = $(element);
+    if (arguments.length == 1) return $(element.parentNode);
+    var ancestors = element.ancestors();
+    return Object.isNumber(expression) ? ancestors[expression] :
+      Selector.findElement(ancestors, expression, index);
+  },
+
+  down: function(element, expression, index) {
+    element = $(element);
+    if (arguments.length == 1) return element.firstDescendant();
+    return Object.isNumber(expression) ? element.descendants()[expression] :
+      element.select(expression)[index || 0];
+  },
+
+  previous: function(element, expression, index) {
+    element = $(element);
+    if (arguments.length == 1) return $(Selector.handlers.previousElementSibling(element));
+    var previousSiblings = element.previousSiblings();
+    return Object.isNumber(expression) ? previousSiblings[expression] :
+      Selector.findElement(previousSiblings, expression, index);
+  },
+
+  next: function(element, expression, index) {
+    element = $(element);
+    if (arguments.length == 1) return $(Selector.handlers.nextElementSibling(element));
+    var nextSiblings = element.nextSiblings();
+    return Object.isNumber(expression) ? nextSiblings[expression] :
+      Selector.findElement(nextSiblings, expression, index);
+  },
+
+  select: function() {
+    var args = $A(arguments), element = $(args.shift());
+    return Selector.findChildElements(element, args);
+  },
+
+  adjacent: function() {
+    var args = $A(arguments), element = $(args.shift());
+    return Selector.findChildElements(element.parentNode, args).without(element);
+  },
+
+  identify: function(element) {
+    element = $(element);
+    var id = element.readAttribute('id'), self = arguments.callee;
+    if (id) return id;
+    do { id = 'anonymous_element_' + self.counter++ } while ($(id));
+    element.writeAttribute('id', id);
+    return id;
+  },
+
+  readAttribute: function(element, name) {
+    element = $(element);
+    if (Prototype.Browser.IE) {
+      var t = Element._attributeTranslations.read;
+      if (t.values[name]) return t.values[name](element, name);
+      if (t.names[name]) name = t.names[name];
+      if (name.include(':')) {
+        return (!element.attributes || !element.attributes[name]) ? null :
+         element.attributes[name].value;
+      }
+    }
+    return element.getAttribute(name);
+  },
+
+  writeAttribute: function(element, name, value) {
+    element = $(element);
+    var attributes = { }, t = Element._attributeTranslations.write;
+
+    if (typeof name == 'object') attributes = name;
+    else attributes[name] = Object.isUndefined(value) ? true : value;
+
+    for (var attr in attributes) {
+      name = t.names[attr] || attr;
+      value = attributes[attr];
+      if (t.values[attr]) name = t.values[attr](element, value);
+      if (value === false || value === null)
+        element.removeAttribute(name);
+      else if (value === true)
+        element.setAttribute(name, name);
+      else element.setAttribute(name, value);
+    }
+    return element;
+  },
+
+  getHeight: function(element) {
+    return $(element).getDimensions().height;
+  },
+
+  getWidth: function(element) {
+    return $(element).getDimensions().width;
+  },
+
+  classNames: function(element) {
+    return new Element.ClassNames(element);
+  },
+
+  hasClassName: function(element, className) {
+    if (!(element = $(element))) return;
+    var elementClassName = element.className;
+    return (elementClassName.length > 0 && (elementClassName == className ||
+      new RegExp("(^|\\s)" + className + "(\\s|$)").test(elementClassName)));
+  },
+
+  addClassName: function(element, className) {
+    if (!(element = $(element))) return;
+    if (!element.hasClassName(className))
+      element.className += (element.className ? ' ' : '') + className;
+    return element;
+  },
+
+  removeClassName: function(element, className) {
+    if (!(element = $(element))) return;
+    element.className = element.className.replace(
+      new RegExp("(^|\\s+)" + className + "(\\s+|$)"), ' ').strip();
+    return element;
+  },
+
+  toggleClassName: function(element, className) {
+    if (!(element = $(element))) return;
+    return element[element.hasClassName(className) ?
+      'removeClassName' : 'addClassName'](className);
+  },
+
+  // removes whitespace-only text node children
+  cleanWhitespace: function(element) {
+    element = $(element);
+    var node = element.firstChild;
+    while (node) {
+      var nextNode = node.nextSibling;
+      if (node.nodeType == 3 && !/\S/.test(node.nodeValue))
+        element.removeChild(node);
+      node = nextNode;
+    }
+    return element;
+  },
+
+  empty: function(element) {
+    return $(element).innerHTML.blank();
+  },
+
+  descendantOf: function(element, ancestor) {
+    element = $(element), ancestor = $(ancestor);
+    var originalAncestor = ancestor;
+
+    if (element.compareDocumentPosition)
+      return (element.compareDocumentPosition(ancestor) & 8) === 8;
+
+    if (element.sourceIndex && !Prototype.Browser.Opera) {
+      var e = element.sourceIndex, a = ancestor.sourceIndex,
+       nextAncestor = ancestor.nextSibling;
+      if (!nextAncestor) {
+        do { ancestor = ancestor.parentNode; }
+        while (!(nextAncestor = ancestor.nextSibling) && ancestor.parentNode);
+      }
+      if (nextAncestor && nextAncestor.sourceIndex)
+       return (e > a && e < nextAncestor.sourceIndex);
+    }
+
+    while (element = element.parentNode)
+      if (element == originalAncestor) return true;
+    return false;
+  },
+
+  scrollTo: function(element) {
+    element = $(element);
+    var pos = element.cumulativeOffset();
+    window.scrollTo(pos[0], pos[1]);
+    return element;
+  },
+
+  getStyle: function(element, style) {
+    element = $(element);
+    style = style == 'float' ? 'cssFloat' : style.camelize();
+    var value = element.style[style];
+    if (!value) {
+      var css = document.defaultView.getComputedStyle(element, null);
+      value = css ? css[style] : null;
+    }
+    if (style == 'opacity') return value ? parseFloat(value) : 1.0;
+    return value == 'auto' ? null : value;
+  },
+
+  getOpacity: function(element) {
+    return $(element).getStyle('opacity');
+  },
+
+  setStyle: function(element, styles) {
+    element = $(element);
+    var elementStyle = element.style, match;
+    if (Object.isString(styles)) {
+      element.style.cssText += ';' + styles;
+      return styles.include('opacity') ?
+        element.setOpacity(styles.match(/opacity:\s*(\d?\.?\d*)/)[1]) : element;
+    }
+    for (var property in styles)
+      if (property == 'opacity') element.setOpacity(styles[property]);
+      else
+        elementStyle[(property == 'float' || property == 'cssFloat') ?
+          (Object.isUndefined(elementStyle.styleFloat) ? 'cssFloat' : 'styleFloat') :
+            property] = styles[property];
+
+    return element;
+  },
+
+  setOpacity: function(element, value) {
+    element = $(element);
+    element.style.opacity = (value == 1 || value === '') ? '' :
+      (value < 0.00001) ? 0 : value;
+    return element;
+  },
+
+  getDimensions: function(element) {
+    element = $(element);
+    var display = $(element).getStyle('display');
+    if (display != 'none' && display != null) // Safari bug
+      return {width: element.offsetWidth, height: element.offsetHeight};
+
+    // All *Width and *Height properties give 0 on elements with display none,
+    // so enable the element temporarily
+    var els = element.style;
+    var originalVisibility = els.visibility;
+    var originalPosition = els.position;
+    var originalDisplay = els.display;
+    els.visibility = 'hidden';
+    els.position = 'absolute';
+    els.display = 'block';
+    var originalWidth = element.clientWidth;
+    var originalHeight = element.clientHeight;
+    els.display = originalDisplay;
+    els.position = originalPosition;
+    els.visibility = originalVisibility;
+    return {width: originalWidth, height: originalHeight};
+  },
+
+  makePositioned: function(element) {
+    element = $(element);
+    var pos = Element.getStyle(element, 'position');
+    if (pos == 'static' || !pos) {
+      element._madePositioned = true;
+      element.style.position = 'relative';
+      // Opera returns the offset relative to the positioning context, when an
+      // element is position relative but top and left have not been defined
+      if (window.opera) {
+        element.style.top = 0;
+        element.style.left = 0;
+      }
+    }
+    return element;
+  },
+
+  undoPositioned: function(element) {
+    element = $(element);
+    if (element._madePositioned) {
+      element._madePositioned = undefined;
+      element.style.position =
+        element.style.top =
+        element.style.left =
+        element.style.bottom =
+        element.style.right = '';
+    }
+    return element;
+  },
+
+  makeClipping: function(element) {
+    element = $(element);
+    if (element._overflow) return element;
+    element._overflow = Element.getStyle(element, 'overflow') || 'auto';
+    if (element._overflow !== 'hidden')
+      element.style.overflow = 'hidden';
+    return element;
+  },
+
+  undoClipping: function(element) {
+    element = $(element);
+    if (!element._overflow) return element;
+    element.style.overflow = element._overflow == 'auto' ? '' : element._overflow;
+    element._overflow = null;
+    return element;
+  },
+
+  cumulativeOffset: function(element) {
+    var valueT = 0, valueL = 0;
+    do {
+      valueT += element.offsetTop  || 0;
+      valueL += element.offsetLeft || 0;
+      element = element.offsetParent;
+    } while (element);
+    return Element._returnOffset(valueL, valueT);
+  },
+
+  positionedOffset: function(element) {
+    var valueT = 0, valueL = 0;
+    do {
+      valueT += element.offsetTop  || 0;
+      valueL += element.offsetLeft || 0;
+      element = element.offsetParent;
+      if (element) {
+        if (element.tagName == 'BODY') break;
+        var p = Element.getStyle(element, 'position');
+        if (p !== 'static') break;
+      }
+    } while (element);
+    return Element._returnOffset(valueL, valueT);
+  },
+
+  absolutize: function(element) {
+    element = $(element);
+    if (element.getStyle('position') == 'absolute') return;
+    // Position.prepare(); // To be done manually by Scripty when it needs it.
+
+    var offsets = element.positionedOffset();
+    var top     = offsets[1];
+    var left    = offsets[0];
+    var width   = element.clientWidth;
+    var height  = element.clientHeight;
+
+    element._originalLeft   = left - parseFloat(element.style.left  || 0);
+    element._originalTop    = top  - parseFloat(element.style.top || 0);
+    element._originalWidth  = element.style.width;
+    element._originalHeight = element.style.height;
+
+    element.style.position = 'absolute';
+    element.style.top    = top + 'px';
+    element.style.left   = left + 'px';
+    element.style.width  = width + 'px';
+    element.style.height = height + 'px';
+    return element;
+  },
+
+  relativize: function(element) {
+    element = $(element);
+    if (element.getStyle('position') == 'relative') return;
+    // Position.prepare(); // To be done manually by Scripty when it needs it.
+
+    element.style.position = 'relative';
+    var top  = parseFloat(element.style.top  || 0) - (element._originalTop || 0);
+    var left = parseFloat(element.style.left || 0) - (element._originalLeft || 0);
+
+    element.style.top    = top + 'px';
+    element.style.left   = left + 'px';
+    element.style.height = element._originalHeight;
+    element.style.width  = element._originalWidth;
+    return element;
+  },
+
+  cumulativeScrollOffset: function(element) {
+    var valueT = 0, valueL = 0;
+    do {
+      valueT += element.scrollTop  || 0;
+      valueL += element.scrollLeft || 0;
+      element = element.parentNode;
+    } while (element);
+    return Element._returnOffset(valueL, valueT);
+  },
+
+  getOffsetParent: function(element) {
+    if (element.offsetParent) return $(element.offsetParent);
+    if (element == document.body) return $(element);
+
+    while ((element = element.parentNode) && element != document.body)
+      if (Element.getStyle(element, 'position') != 'static')
+        return $(element);
+
+    return $(document.body);
+  },
+
+  viewportOffset: function(forElement) {
+    var valueT = 0, valueL = 0;
+
+    var element = forElement;
+    do {
+      valueT += element.offsetTop  || 0;
+      valueL += element.offsetLeft || 0;
+
+      // Safari fix
+      if (element.offsetParent == document.body &&
+        Element.getStyle(element, 'position') == 'absolute') break;
+
+    } while (element = element.offsetParent);
+
+    element = forElement;
+    do {
+      if (!Prototype.Browser.Opera || element.tagName == 'BODY') {
+        valueT -= element.scrollTop  || 0;
+        valueL -= element.scrollLeft || 0;
+      }
+    } while (element = element.parentNode);
+
+    return Element._returnOffset(valueL, valueT);
+  },
+
+  clonePosition: function(element, source) {
+    var options = Object.extend({
+      setLeft:    true,
+      setTop:     true,
+      setWidth:   true,
+      setHeight:  true,
+      offsetTop:  0,
+      offsetLeft: 0
+    }, arguments[2] || { });
+
+    // find page position of source
+    source = $(source);
+    var p = source.viewportOffset();
+
+    // find coordinate system to use
+    element = $(element);
+    var delta = [0, 0];
+    var parent = null;
+    // delta [0,0] will do fine with position: fixed elements,
+    // position:absolute needs offsetParent deltas
+    if (Element.getStyle(element, 'position') == 'absolute') {
+      parent = element.getOffsetParent();
+      delta = parent.viewportOffset();
+    }
+
+    // correct by body offsets (fixes Safari)
+    if (parent == document.body) {
+      delta[0] -= document.body.offsetLeft;
+      delta[1] -= document.body.offsetTop;
+    }
+
+    // set position
+    if (options.setLeft)   element.style.left  = (p[0] - delta[0] + options.offsetLeft) + 'px';
+    if (options.setTop)    element.style.top   = (p[1] - delta[1] + options.offsetTop) + 'px';
+    if (options.setWidth)  element.style.width = source.offsetWidth + 'px';
+    if (options.setHeight) element.style.height = source.offsetHeight + 'px';
+    return element;
+  }
+};
+
+Element.Methods.identify.counter = 1;
+
+Object.extend(Element.Methods, {
+  getElementsBySelector: Element.Methods.select,
+  childElements: Element.Methods.immediateDescendants
+});
+
+Element._attributeTranslations = {
+  write: {
+    names: {
+      className: 'class',
+      htmlFor:   'for'
+    },
+    values: { }
+  }
+};
+
+if (Prototype.Browser.Opera) {
+  Element.Methods.getStyle = Element.Methods.getStyle.wrap(
+    function(proceed, element, style) {
+      switch (style) {
+        case 'left': case 'top': case 'right': case 'bottom':
+          if (proceed(element, 'position') === 'static') return null;
+        case 'height': case 'width':
+          // returns '0px' for hidden elements; we want it to return null
+          if (!Element.visible(element)) return null;
+
+          // returns the border-box dimensions rather than the content-box
+          // dimensions, so we subtract padding and borders from the value
+          var dim = parseInt(proceed(element, style), 10);
+
+          if (dim !== element['offset' + style.capitalize()])
+            return dim + 'px';
+
+          var properties;
+          if (style === 'height') {
+            properties = ['border-top-width', 'padding-top',
+             'padding-bottom', 'border-bottom-width'];
+          }
+          else {
+            properties = ['border-left-width', 'padding-left',
+             'padding-right', 'border-right-width'];
+          }
+          return properties.inject(dim, function(memo, property) {
+            var val = proceed(element, property);
+            return val === null ? memo : memo - parseInt(val, 10);
+          }) + 'px';
+        default: return proceed(element, style);
+      }
+    }
+  );
+
+  Element.Methods.readAttribute = Element.Methods.readAttribute.wrap(
+    function(proceed, element, attribute) {
+      if (attribute === 'title') return element.title;
+      return proceed(element, attribute);
+    }
+  );
+}
+
+else if (Prototype.Browser.IE) {
+  // IE doesn't report offsets correctly for static elements, so we change them
+  // to "relative" to get the values, then change them back.
+  Element.Methods.getOffsetParent = Element.Methods.getOffsetParent.wrap(
+    function(proceed, element) {
+      element = $(element);
+      var position = element.getStyle('position');
+      if (position !== 'static') return proceed(element);
+      element.setStyle({ position: 'relative' });
+      var value = proceed(element);
+      element.setStyle({ position: position });
+      return value;
+    }
+  );
+
+  $w('positionedOffset viewportOffset').each(function(method) {
+    Element.Methods[method] = Element.Methods[method].wrap(
+      function(proceed, element) {
+        element = $(element);
+        var position = element.getStyle('position');
+        if (position !== 'static') return proceed(element);
+        // Trigger hasLayout on the offset parent so that IE6 reports
+        // accurate offsetTop and offsetLeft values for position: fixed.
+        var offsetParent = element.getOffsetParent();
+        if (offsetParent && offsetParent.getStyle('position') === 'fixed')
+          offsetParent.setStyle({ zoom: 1 });
+        element.setStyle({ position: 'relative' });
+        var value = proceed(element);
+        element.setStyle({ position: position });
+        return value;
+      }
+    );
+  });
+
+  Element.Methods.getStyle = function(element, style) {
+    element = $(element);
+    style = (style == 'float' || style == 'cssFloat') ? 'styleFloat' : style.camelize();
+    var value = element.style[style];
+    if (!value && element.currentStyle) value = element.currentStyle[style];
+
+    if (style == 'opacity') {
+      if (value = (element.getStyle('filter') || '').match(/alpha\(opacity=(.*)\)/))
+        if (value[1]) return parseFloat(value[1]) / 100;
+      return 1.0;
+    }
+
+    if (value == 'auto') {
+      if ((style == 'width' || style == 'height') && (element.getStyle('display') != 'none'))
+        return element['offset' + style.capitalize()] + 'px';
+      return null;
+    }
+    return value;
+  };
+
+  Element.Methods.setOpacity = function(element, value) {
+    function stripAlpha(filter){
+      return filter.replace(/alpha\([^\)]*\)/gi,'');
+    }
+    element = $(element);
+    var currentStyle = element.currentStyle;
+    if ((currentStyle && !currentStyle.hasLayout) ||
+      (!currentStyle && element.style.zoom == 'normal'))
+        element.style.zoom = 1;
+
+    var filter = element.getStyle('filter'), style = element.style;
+    if (value == 1 || value === '') {
+      (filter = stripAlpha(filter)) ?
+        style.filter = filter : style.removeAttribute('filter');
+      return element;
+    } else if (value < 0.00001) value = 0;
+    style.filter = stripAlpha(filter) +
+      'alpha(opacity=' + (value * 100) + ')';
+    return element;
+  };
+
+  Element._attributeTranslations = {
+    read: {
+      names: {
+        'class': 'className',
+        'for':   'htmlFor'
+      },
+      values: {
+        _getAttr: function(element, attribute) {
+          return element.getAttribute(attribute, 2);
+        },
+        _getAttrNode: function(element, attribute) {
+          var node = element.getAttributeNode(attribute);
+          return node ? node.value : "";
+        },
+        _getEv: function(element, attribute) {
+          attribute = element.getAttribute(attribute);
+          return attribute ? attribute.toString().slice(23, -2) : null;
+        },
+        _flag: function(element, attribute) {
+          return $(element).hasAttribute(attribute) ? attribute : null;
+        },
+        style: function(element) {
+          return element.style.cssText.toLowerCase();
+        },
+        title: function(element) {
+          return element.title;
+        }
+      }
+    }
+  };
+
+  Element._attributeTranslations.write = {
+    names: Object.extend({
+      cellpadding: 'cellPadding',
+      cellspacing: 'cellSpacing'
+    }, Element._attributeTranslations.read.names),
+    values: {
+      checked: function(element, value) {
+        element.checked = !!value;
+      },
+
+      style: function(element, value) {
+        element.style.cssText = value ? value : '';
+      }
+    }
+  };
+
+  Element._attributeTranslations.has = {};
+
+  $w('colSpan rowSpan vAlign dateTime accessKey tabIndex ' +
+      'encType maxLength readOnly longDesc').each(function(attr) {
+    Element._attributeTranslations.write.names[attr.toLowerCase()] = attr;
+    Element._attributeTranslations.has[attr.toLowerCase()] = attr;
+  });
+
+  (function(v) {
+    Object.extend(v, {
+      href:        v._getAttr,
+      src:         v._getAttr,
+      type:        v._getAttr,
+      action:      v._getAttrNode,
+      disabled:    v._flag,
+      checked:     v._flag,
+      readonly:    v._flag,
+      multiple:    v._flag,
+      onload:      v._getEv,
+      onunload:    v._getEv,
+      onclick:     v._getEv,
+      ondblclick:  v._getEv,
+      onmousedown: v._getEv,
+      onmouseup:   v._getEv,
+      onmouseover: v._getEv,
+      onmousemove: v._getEv,
+      onmouseout:  v._getEv,
+      onfocus:     v._getEv,
+      onblur:      v._getEv,
+      onkeypress:  v._getEv,
+      onkeydown:   v._getEv,
+      onkeyup:     v._getEv,
+      onsubmit:    v._getEv,
+      onreset:     v._getEv,
+      onselect:    v._getEv,
+      onchange:    v._getEv
+    });
+  })(Element._attributeTranslations.read.values);
+}
+
+else if (Prototype.Browser.Gecko && /rv:1\.8\.0/.test(navigator.userAgent)) {
+  Element.Methods.setOpacity = function(element, value) {
+    element = $(element);
+    element.style.opacity = (value == 1) ? 0.999999 :
+      (value === '') ? '' : (value < 0.00001) ? 0 : value;
+    return element;
+  };
+}
+
+else if (Prototype.Browser.WebKit) {
+  Element.Methods.setOpacity = function(element, value) {
+    element = $(element);
+    element.style.opacity = (value == 1 || value === '') ? '' :
+      (value < 0.00001) ? 0 : value;
+
+    if (value == 1)
+      if(element.tagName == 'IMG' && element.width) {
+        element.width++; element.width--;
+      } else try {
+        var n = document.createTextNode(' ');
+        element.appendChild(n);
+        element.removeChild(n);
+      } catch (e) { }
+
+    return element;
+  };
+
+  // Safari returns margins on body which is incorrect if the child is absolutely
+  // positioned.  For performance reasons, redefine Element#cumulativeOffset for
+  // KHTML/WebKit only.
+  Element.Methods.cumulativeOffset = function(element) {
+    var valueT = 0, valueL = 0;
+    do {
+      valueT += element.offsetTop  || 0;
+      valueL += element.offsetLeft || 0;
+      if (element.offsetParent == document.body)
+        if (Element.getStyle(element, 'position') == 'absolute') break;
+
+      element = element.offsetParent;
+    } while (element);
+
+    return Element._returnOffset(valueL, valueT);
+  };
+}
+
+if (Prototype.Browser.IE || Prototype.Browser.Opera) {
+  // IE and Opera are missing .innerHTML support for TABLE-related and SELECT elements
+  Element.Methods.update = function(element, content) {
+    element = $(element);
+
+    if (content && content.toElement) content = content.toElement();
+    if (Object.isElement(content)) return element.update().insert(content);
+
+    content = Object.toHTML(content);
+    var tagName = element.tagName.toUpperCase();
+
+    if (tagName in Element._insertionTranslations.tags) {
+      $A(element.childNodes).each(function(node) { element.removeChild(node) });
+      Element._getContentFromAnonymousElement(tagName, content.stripScripts())
+        .each(function(node) { element.appendChild(node) });
+    }
+    else element.innerHTML = content.stripScripts();
+
+    content.evalScripts.bind(content).defer();
+    return element;
+  };
+}
+
+if ('outerHTML' in document.createElement('div')) {
+  Element.Methods.replace = function(element, content) {
+    element = $(element);
+
+    if (content && content.toElement) content = content.toElement();
+    if (Object.isElement(content)) {
+      element.parentNode.replaceChild(content, element);
+      return element;
+    }
+
+    content = Object.toHTML(content);
+    var parent = element.parentNode, tagName = parent.tagName.toUpperCase();
+
+    if (Element._insertionTranslations.tags[tagName]) {
+      var nextSibling = element.next();
+      var fragments = Element._getContentFromAnonymousElement(tagName, content.stripScripts());
+      parent.removeChild(element);
+      if (nextSibling)
+        fragments.each(function(node) { parent.insertBefore(node, nextSibling) });
+      else
+        fragments.each(function(node) { parent.appendChild(node) });
+    }
+    else element.outerHTML = content.stripScripts();
+
+    content.evalScripts.bind(content).defer();
+    return element;
+  };
+}
+
+Element._returnOffset = function(l, t) {
+  var result = [l, t];
+  result.left = l;
+  result.top = t;
+  return result;
+};
+
+Element._getContentFromAnonymousElement = function(tagName, html) {
+  var div = new Element('div'), t = Element._insertionTranslations.tags[tagName];
+  if (t) {
+    div.innerHTML = t[0] + html + t[1];
+    t[2].times(function() { div = div.firstChild });
+  } else div.innerHTML = html;
+  return $A(div.childNodes);
+};
+
+Element._insertionTranslations = {
+  before: function(element, node) {
+    element.parentNode.insertBefore(node, element);
+  },
+  top: function(element, node) {
+    element.insertBefore(node, element.firstChild);
+  },
+  bottom: function(element, node) {
+    element.appendChild(node);
+  },
+  after: function(element, node) {
+    element.parentNode.insertBefore(node, element.nextSibling);
+  },
+  tags: {
+    TABLE:  ['<table>',                '</table>',                   1],
+    TBODY:  ['<table><tbody>',         '</tbody></table>',           2],
+    TR:     ['<table><tbody><tr>',     '</tr></tbody></table>',      3],
+    TD:     ['<table><tbody><tr><td>', '</td></tr></tbody></table>', 4],
+    SELECT: ['<select>',               '</select>',                  1]
+  }
+};
+
+(function() {
+  Object.extend(this.tags, {
+    THEAD: this.tags.TBODY,
+    TFOOT: this.tags.TBODY,
+    TH:    this.tags.TD
+  });
+}).call(Element._insertionTranslations);
+
+Element.Methods.Simulated = {
+  hasAttribute: function(element, attribute) {
+    attribute = Element._attributeTranslations.has[attribute] || attribute;
+    var node = $(element).getAttributeNode(attribute);
+    return node && node.specified;
+  }
+};
+
+Element.Methods.ByTag = { };
+
+Object.extend(Element, Element.Methods);
+
+if (!Prototype.BrowserFeatures.ElementExtensions &&
+    document.createElement('div').__proto__) {
+  window.HTMLElement = { };
+  window.HTMLElement.prototype = document.createElement('div').__proto__;
+  Prototype.BrowserFeatures.ElementExtensions = true;
+}
+
+Element.extend = (function() {
+  if (Prototype.BrowserFeatures.SpecificElementExtensions)
+    return Prototype.K;
+
+  var Methods = { }, ByTag = Element.Methods.ByTag;
+
+  var extend = Object.extend(function(element) {
+    if (!element || element._extendedByPrototype ||
+        element.nodeType != 1 || element == window) return element;
+
+    var methods = Object.clone(Methods),
+      tagName = element.tagName, property, value;
+
+    // extend methods for specific tags
+    if (ByTag[tagName]) Object.extend(methods, ByTag[tagName]);
+
+    for (property in methods) {
+      value = methods[property];
+      if (Object.isFunction(value) && !(property in element))
+        element[property] = value.methodize();
+    }
+
+    element._extendedByPrototype = Prototype.emptyFunction;
+    return element;
+
+  }, {
+    refresh: function() {
+      // extend methods for all tags (Safari doesn't need this)
+      if (!Prototype.BrowserFeatures.ElementExtensions) {
+        Object.extend(Methods, Element.Methods);
+        Object.extend(Methods, Element.Methods.Simulated);
+      }
+    }
+  });
+
+  extend.refresh();
+  return extend;
+})();
+
+Element.hasAttribute = function(element, attribute) {
+  if (element.hasAttribute) return element.hasAttribute(attribute);
+  return Element.Methods.Simulated.hasAttribute(element, attribute);
+};
+
+Element.addMethods = function(methods) {
+  var F = Prototype.BrowserFeatures, T = Element.Methods.ByTag;
+
+  if (!methods) {
+    Object.extend(Form, Form.Methods);
+    Object.extend(Form.Element, Form.Element.Methods);
+    Object.extend(Element.Methods.ByTag, {
+      "FORM":     Object.clone(Form.Methods),
+      "INPUT":    Object.clone(Form.Element.Methods),
+      "SELECT":   Object.clone(Form.Element.Methods),
+      "TEXTAREA": Object.clone(Form.Element.Methods)
+    });
+  }
+
+  if (arguments.length == 2) {
+    var tagName = methods;
+    methods = arguments[1];
+  }
+
+  if (!tagName) Object.extend(Element.Methods, methods || { });
+  else {
+    if (Object.isArray(tagName)) tagName.each(extend);
+    else extend(tagName);
+  }
+
+  function extend(tagName) {
+    tagName = tagName.toUpperCase();
+    if (!Element.Methods.ByTag[tagName])
+      Element.Methods.ByTag[tagName] = { };
+    Object.extend(Element.Methods.ByTag[tagName], methods);
+  }
+
+  function copy(methods, destination, onlyIfAbsent) {
+    onlyIfAbsent = onlyIfAbsent || false;
+    for (var property in methods) {
+      var value = methods[property];
+      if (!Object.isFunction(value)) continue;
+      if (!onlyIfAbsent || !(property in destination))
+        destination[property] = value.methodize();
+    }
+  }
+
+  function findDOMClass(tagName) {
+    var klass;
+    var trans = {
+      "OPTGROUP": "OptGroup", "TEXTAREA": "TextArea", "P": "Paragraph",
+      "FIELDSET": "FieldSet", "UL": "UList", "OL": "OList", "DL": "DList",
+      "DIR": "Directory", "H1": "Heading", "H2": "Heading", "H3": "Heading",
+      "H4": "Heading", "H5": "Heading", "H6": "Heading", "Q": "Quote",
+      "INS": "Mod", "DEL": "Mod", "A": "Anchor", "IMG": "Image", "CAPTION":
+      "TableCaption", "COL": "TableCol", "COLGROUP": "TableCol", "THEAD":
+      "TableSection", "TFOOT": "TableSection", "TBODY": "TableSection", "TR":
+      "TableRow", "TH": "TableCell", "TD": "TableCell", "FRAMESET":
+      "FrameSet", "IFRAME": "IFrame"
+    };
+    if (trans[tagName]) klass = 'HTML' + trans[tagName] + 'Element';
+    if (window[klass]) return window[klass];
+    klass = 'HTML' + tagName + 'Element';
+    if (window[klass]) return window[klass];
+    klass = 'HTML' + tagName.capitalize() + 'Element';
+    if (window[klass]) return window[klass];
+
+    window[klass] = { };
+    window[klass].prototype = document.createElement(tagName).__proto__;
+    return window[klass];
+  }
+
+  if (F.ElementExtensions) {
+    copy(Element.Methods, HTMLElement.prototype);
+    copy(Element.Methods.Simulated, HTMLElement.prototype, true);
+  }
+
+  if (F.SpecificElementExtensions) {
+    for (var tag in Element.Methods.ByTag) {
+      var klass = findDOMClass(tag);
+      if (Object.isUndefined(klass)) continue;
+      copy(T[tag], klass.prototype);
+    }
+  }
+
+  Object.extend(Element, Element.Methods);
+  delete Element.ByTag;
+
+  if (Element.extend.refresh) Element.extend.refresh();
+  Element.cache = { };
+};
+
+document.viewport = {
+  getDimensions: function() {
+    var dimensions = { };
+    var B = Prototype.Browser;
+    $w('width height').each(function(d) {
+      var D = d.capitalize();
+      dimensions[d] = (B.WebKit && !document.evaluate) ? self['inner' + D] :
+        (B.Opera) ? document.body['client' + D] : document.documentElement['client' + D];
+    });
+    return dimensions;
+  },
+
+  getWidth: function() {
+    return this.getDimensions().width;
+  },
+
+  getHeight: function() {
+    return this.getDimensions().height;
+  },
+
+  getScrollOffsets: function() {
+    return Element._returnOffset(
+      window.pageXOffset || document.documentElement.scrollLeft || document.body.scrollLeft,
+      window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop);
+  }
+};
+/* Portions of the Selector class are derived from Jack Slocum’s DomQuery,
+ * part of YUI-Ext version 0.40, distributed under the terms of an MIT-style
+ * license.  Please see http://www.yui-ext.com/ for more information. */
+
+var Selector = Class.create({
+  initialize: function(expression) {
+    this.expression = expression.strip();
+    this.compileMatcher();
+  },
+
+  shouldUseXPath: function() {
+    if (!Prototype.BrowserFeatures.XPath) return false;
+
+    var e = this.expression;
+
+    // Safari 3 chokes on :*-of-type and :empty
+    if (Prototype.Browser.WebKit &&
+     (e.include("-of-type") || e.include(":empty")))
+      return false;
+
+    // XPath can't do namespaced attributes, nor can it read
+    // the "checked" property from DOM nodes
+    if ((/(\[[\w-]*?:|:checked)/).test(this.expression))
+      return false;
+
+    return true;
+  },
+
+  compileMatcher: function() {
+    if (this.shouldUseXPath())
+      return this.compileXPathMatcher();
+
+    var e = this.expression, ps = Selector.patterns, h = Selector.handlers,
+        c = Selector.criteria, le, p, m;
+
+    if (Selector._cache[e]) {
+      this.matcher = Selector._cache[e];
+      return;
+    }
+
+    this.matcher = ["this.matcher = function(root) {",
+                    "var r = root, h = Selector.handlers, c = false, n;"];
+
+    while (e && le != e && (/\S/).test(e)) {
+      le = e;
+      for (var i in ps) {
+        p = ps[i];
+        if (m = e.match(p)) {
+          this.matcher.push(Object.isFunction(c[i]) ? c[i](m) :
+    	      new Template(c[i]).evaluate(m));
+          e = e.replace(m[0], '');
+          break;
+        }
+      }
+    }
+
+    this.matcher.push("return h.unique(n);\n}");
+    eval(this.matcher.join('\n'));
+    Selector._cache[this.expression] = this.matcher;
+  },
+
+  compileXPathMatcher: function() {
+    var e = this.expression, ps = Selector.patterns,
+        x = Selector.xpath, le, m;
+
+    if (Selector._cache[e]) {
+      this.xpath = Selector._cache[e]; return;
+    }
+
+    this.matcher = ['.//*'];
+    while (e && le != e && (/\S/).test(e)) {
+      le = e;
+      for (var i in ps) {
+        if (m = e.match(ps[i])) {
+          this.matcher.push(Object.isFunction(x[i]) ? x[i](m) :
+            new Template(x[i]).evaluate(m));
+          e = e.replace(m[0], '');
+          break;
+        }
+      }
+    }
+
+    this.xpath = this.matcher.join('');
+    Selector._cache[this.expression] = this.xpath;
+  },
+
+  findElements: function(root) {
+    root = root || document;
+    if (this.xpath) return document._getElementsByXPath(this.xpath, root);
+    return this.matcher(root);
+  },
+
+  match: function(element) {
+    this.tokens = [];
+
+    var e = this.expression, ps = Selector.patterns, as = Selector.assertions;
+    var le, p, m;
+
+    while (e && le !== e && (/\S/).test(e)) {
+      le = e;
+      for (var i in ps) {
+        p = ps[i];
+        if (m = e.match(p)) {
+          // use the Selector.assertions methods unless the selector
+          // is too complex.
+          if (as[i]) {
+            this.tokens.push([i, Object.clone(m)]);
+            e = e.replace(m[0], '');
+          } else {
+            // reluctantly do a document-wide search
+            // and look for a match in the array
+            return this.findElements(document).include(element);
+          }
+        }
+      }
+    }
+
+    var match = true, name, matches;
+    for (var i = 0, token; token = this.tokens[i]; i++) {
+      name = token[0], matches = token[1];
+      if (!Selector.assertions[name](element, matches)) {
+        match = false; break;
+      }
+    }
+
+    return match;
+  },
+
+  toString: function() {
+    return this.expression;
+  },
+
+  inspect: function() {
+    return "#<Selector:" + this.expression.inspect() + ">";
+  }
+});
+
+Object.extend(Selector, {
+  _cache: { },
+
+  xpath: {
+    descendant:   "//*",
+    child:        "/*",
+    adjacent:     "/following-sibling::*[1]",
+    laterSibling: '/following-sibling::*',
+    tagName:      function(m) {
+      if (m[1] == '*') return '';
+      return "[local-name()='" + m[1].toLowerCase() +
+             "' or local-name()='" + m[1].toUpperCase() + "']";
+    },
+    className:    "[contains(concat(' ', @class, ' '), ' #{1} ')]",
+    id:           "[@id='#{1}']",
+    attrPresence: function(m) {
+      m[1] = m[1].toLowerCase();
+      return new Template("[@#{1}]").evaluate(m);
+    },
+    attr: function(m) {
+      m[1] = m[1].toLowerCase();
+      m[3] = m[5] || m[6];
+      return new Template(Selector.xpath.operators[m[2]]).evaluate(m);
+    },
+    pseudo: function(m) {
+      var h = Selector.xpath.pseudos[m[1]];
+      if (!h) return '';
+      if (Object.isFunction(h)) return h(m);
+      return new Template(Selector.xpath.pseudos[m[1]]).evaluate(m);
+    },
+    operators: {
+      '=':  "[@#{1}='#{3}']",
+      '!=': "[@#{1}!='#{3}']",
+      '^=': "[starts-with(@#{1}, '#{3}')]",
+      '$=': "[substring(@#{1}, (string-length(@#{1}) - string-length('#{3}') + 1))='#{3}']",
+      '*=': "[contains(@#{1}, '#{3}')]",
+      '~=': "[contains(concat(' ', @#{1}, ' '), ' #{3} ')]",
+      '|=': "[contains(concat('-', @#{1}, '-'), '-#{3}-')]"
+    },
+    pseudos: {
+      'first-child': '[not(preceding-sibling::*)]',
+      'last-child':  '[not(following-sibling::*)]',
+      'only-child':  '[not(preceding-sibling::* or following-sibling::*)]',
+      'empty':       "[count(*) = 0 and (count(text()) = 0 or translate(text(), ' \t\r\n', '') = '')]",
+      'checked':     "[@checked]",
+      'disabled':    "[@disabled]",
+      'enabled':     "[not(@disabled)]",
+      'not': function(m) {
+        var e = m[6], p = Selector.patterns,
+            x = Selector.xpath, le, v;
+
+        var exclusion = [];
+        while (e && le != e && (/\S/).test(e)) {
+          le = e;
+          for (var i in p) {
+            if (m = e.match(p[i])) {
+              v = Object.isFunction(x[i]) ? x[i](m) : new Template(x[i]).evaluate(m);
+              exclusion.push("(" + v.substring(1, v.length - 1) + ")");
+              e = e.replace(m[0], '');
+              break;
+            }
+          }
+        }
+        return "[not(" + exclusion.join(" and ") + ")]";
+      },
+      'nth-child':      function(m) {
+        return Selector.xpath.pseudos.nth("(count(./preceding-sibling::*) + 1) ", m);
+      },
+      'nth-last-child': function(m) {
+        return Selector.xpath.pseudos.nth("(count(./following-sibling::*) + 1) ", m);
+      },
+      'nth-of-type':    function(m) {
+        return Selector.xpath.pseudos.nth("position() ", m);
+      },
+      'nth-last-of-type': function(m) {
+        return Selector.xpath.pseudos.nth("(last() + 1 - position()) ", m);
+      },
+      'first-of-type':  function(m) {
+        m[6] = "1"

<TRUNCATED>
http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/extras/webjars/snorql/src/main/resources/rdf_flyer.24.gif
----------------------------------------------------------------------
diff --git a/extras/webjars/snorql/src/main/resources/rdf_flyer.24.gif b/extras/webjars/snorql/src/main/resources/rdf_flyer.24.gif
new file mode 100755
index 0000000..0291161
Binary files /dev/null and b/extras/webjars/snorql/src/main/resources/rdf_flyer.24.gif differ


[030/100] [abbrv] [partial] Reverting the erroneous merge by Sebastian according to the instructions in INFRA-6876

Posted by wi...@apache.org.
http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/extras/webjars/sgvizler/src/main/resources/lib/raphael-dracula.pack.min.js
----------------------------------------------------------------------
diff --git a/extras/webjars/sgvizler/src/main/resources/lib/raphael-dracula.pack.min.js b/extras/webjars/sgvizler/src/main/resources/lib/raphael-dracula.pack.min.js
new file mode 100644
index 0000000..1bf619e
--- /dev/null
+++ b/extras/webjars/sgvizler/src/main/resources/lib/raphael-dracula.pack.min.js
@@ -0,0 +1,7 @@
+/*
+ * Raphael 1.3.1 - JavaScript Vector Library
+ *
+ * Copyright (c) 2008 - 2009 Dmitry Baranovskiy (http://raphaeljs.com)
+ * Licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) license.
+ */function log(a){console.log&&console.log(a)}Raphael=function(){function Q(a,b,c){function d(){var e=Array[r].slice.call(arguments,0),f=e[p]("►"),g=d.cache=d.cache||{},h=d.count=d.count||[];return g[o](f)?c?c(g[f]):g[f]:(h[q]>=1e3&&delete g[h.shift()],h[B](f),g[f]=a[i](b,e),c?c(g[f]):g[f])}return d}function bE(){return this.x+l+this.y}function bO(a){return function(b,c,d,e){var g={back:a};return f.is(d,"function")?e=d:g.rot=d,b&&b.constructor==br&&(b=b.attrs.path),b&&(g.along=b),this.animate(g,c,e)}}var a=/[, ]+/,b=/^(circle|rect|path|ellipse|text|image)$/,c=document,d=window,e={was:"Raphael"in d,is:d.Raphael},f=function(){if(f.is(arguments[0],"array")){var a=arguments[0],c=by[i](f,a.splice(0,3+f.is(a[0],w))),d=c.set();for(var e=0,g=a[q];e<g;e++){var h=a[e]||{};b.test(h.type)&&d[B](c[h.type]().attr(h))}return d}return by[i](f,arguments)},g=function(){},h="appendChild",i="apply",j="concat",k="",l=" ",m="split",n="click dblclick mousedown mousemove mouseout mouseover mouseup"[m](l
 ),o="hasOwnProperty",p="join",q="length",r="prototype",s=String[r].toLowerCase,t=Math,u=t.max,v=t.min,w="number",x="toString",y=Object[r][x],z={},A=t.pow,B="push",C=/^(?=[\da-f]$)/,D=/^url\(['"]?([^\)]+)['"]?\)$/i,E=/^\s*((#[a-f\d]{6})|(#[a-f\d]{3})|rgb\(\s*([\d\.]+\s*,\s*[\d\.]+\s*,\s*[\d\.]+)\s*\)|rgb\(\s*([\d\.]+%\s*,\s*[\d\.]+%\s*,\s*[\d\.]+%)\s*\)|hs[bl]\(\s*([\d\.]+\s*,\s*[\d\.]+\s*,\s*[\d\.]+)\s*\)|hs[bl]\(\s*([\d\.]+%\s*,\s*[\d\.]+%\s*,\s*[\d\.]+%)\s*\))\s*$/i,F=t.round,G="setAttribute",H=parseFloat,I=parseInt,J=String[r].toUpperCase,K={"clip-rect":"0 0 1e9 1e9",cursor:"default",cx:0,cy:0,fill:"#fff","fill-opacity":1,font:'10px "Arial"',"font-family":'"Arial"',"font-size":"10","font-style":"normal","font-weight":400,gradient:0,height:0,href:"http://raphaeljs.com/",opacity:1,path:"M0,0",r:0,rotation:0,rx:0,ry:0,scale:"1 1",src:"",stroke:"#000","stroke-dasharray":"","stroke-linecap":"butt","stroke-linejoin":"butt","stroke-miterlimit":0,"stroke-opacity":1,"stroke-width":1,targe
 t:"_blank","text-anchor":"middle",title:"Raphael",translation:"0 0",width:0,x:0,y:0},L={along:"along","clip-rect":"csv",cx:w,cy:w,fill:"colour","fill-opacity":w,"font-size":w,height:w,opacity:w,path:"path",r:w,rotation:"csv",rx:w,ry:w,scale:"csv",stroke:"colour","stroke-opacity":w,"stroke-width":w,translation:"csv",width:w,x:w,y:w},M="replace";f.version="1.3.1",f.type=d.SVGAngle||c.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")?"SVG":"VML";if(f.type=="VML"){var N=document.createElement("div");N.innerHTML="<!--[if vml]><br><br><![endif]-->";if(N.childNodes[q]!=2)return null}f.svg=!(f.vml=f.type=="VML"),g[r]=f[r],f._id=0,f._oid=0,f.fn={},f.is=function(a,b){return b=s.call(b),(b=="object"||b=="undefined")&&typeof a==b||a==null&&b=="null"||s.call(y.call(a).slice(8,-1))==b},f.setWindow=function(a){d=a,c=d.document};var O=function(a){if(f.vml){var b=/^\s+|\s+$/g;O=Q(function(a){var c;a=(a+k)[M](b,k);try{var d=new ActiveXObject("htmlfile");d.write("<bo
 dy>"),d.close(),c=d.body}catch(e){c=createPopup().document.body}var f=c.createTextRange();try{c.style.color=a;var g=f.queryCommandValue("ForeColor");return g=(g&255)<<16|g&65280|(g&16711680)>>>16,"#"+("000000"+g[x](16)).slice(-6)}catch(e){return"none"}})}else{var d=c.createElement("i");d.title="Raphaël Colour Picker",d.style.display="none",c.body[h](d),O=Q(function(a){return d.style.color=a,c.defaultView.getComputedStyle(d,k).getPropertyValue("color")})}return O(a)};f.hsb2rgb=Q(function(a,b,c){f.is(a,"object")&&"h"in a&&"s"in a&&"b"in a&&(c=a.b,b=a.s,a=a.h);var d,e,g;if(c==0)return{r:0,g:0,b:0,hex:"#000"};if(a>1||b>1||c>1)a/=255,b/=255,c/=255;var h=~~(a*6),i=a*6-h,j=c*(1-b),k=c*(1-b*i),l=c*(1-b*(1-i));d=[c,k,j,j,l,c,c][h],e=[l,c,c,k,j,j,l][h],g=[j,j,l,c,c,k,j][h],d*=255,e*=255,g*=255;var m={r:d,g:e,b:g},n=(~~d)[x](16),o=(~~e)[x](16),p=(~~g)[x](16);return n=n[M](C,"0"),o=o[M](C,"0"),p=p[M](C,"0"),m.hex="#"+n+o+p,m},f),f.rgb2hsb=Q(function(a,b,c){f.is(a,"object")&&"r"in a&&"g"in a&&"
 b"in a&&(c=a.b,b=a.g,a=a.r);if(f.is(a,"string")){var d=f.getRGB(a);a=d.r,b=d.g,c=d.b}if(a>1||b>1||c>1)a/=255,b/=255,c/=255;var e=u(a,b,c),g=v(a,b,c),h,i,j=e;if(g==e)return{h:0,s:0,b:e};var k=e-g;return i=k/e,a==e?h=(b-c)/k:b==e?h=2+(c-a)/k:h=4+(a-b)/k,h/=6,h<0&&h++,h>1&&h--,{h:h,s:i,b:j}},f);var P=/,?([achlmqrstvxz]),?/gi;f._path2string=function(){return this.join(",")[M](P,"$1")},f.getRGB=Q(function(a){if(!a||!!((a+=k).indexOf("-")+1))return{r:-1,g:-1,b:-1,hex:"none",error:1};if(a=="none")return{r:-1,g:-1,b:-1,hex:"none"};!{hs:1,rg:1}[o](a.substring(0,2))&&a.charAt()!="#"&&(a=O(a));var b,c,d,e,g,h=a.match(E);if(h){h[2]&&(e=I(h[2].substring(5),16),d=I(h[2].substring(3,5),16),c=I(h[2].substring(1,3),16)),h[3]&&(e=I((g=h[3].charAt(3))+g,16),d=I((g=h[3].charAt(2))+g,16),c=I((g=h[3].charAt(1))+g,16)),h[4]&&(h=h[4][m](/\s*,\s*/),c=H(h[0]),d=H(h[1]),e=H(h[2])),h[5]&&(h=h[5][m](/\s*,\s*/),c=H(h[0])*2.55,d=H(h[1])*2.55,e=H(h[2])*2.55);if(h[6])return h=h[6][m](/\s*,\s*/),c=H(h[0]),d=H(h[1]),
 e=H(h[2]),f.hsb2rgb(c,d,e);if(h[7])return h=h[7][m](/\s*,\s*/),c=H(h[0])*2.55,d=H(h[1])*2.55,e=H(h[2])*2.55,f.hsb2rgb(c,d,e);h={r:c,g:d,b:e};var i=(~~c)[x](16),j=(~~d)[x](16),l=(~~e)[x](16);return i=i[M](C,"0"),j=j[M](C,"0"),l=l[M](C,"0"),h.hex="#"+i+j+l,h}return{r:-1,g:-1,b:-1,hex:"none",error:1}},f),f.getColor=function(a){var b=this.getColor.start=this.getColor.start||{h:0,s:1,b:a||.75},c=this.hsb2rgb(b.h,b.s,b.b);return b.h+=.075,b.h>1&&(b.h=0,b.s-=.2,b.s<=0&&(this.getColor.start={h:0,s:1,b:b.b})),c.hex},f.getColor.reset=function(){delete this.start},f.parsePathString=Q(function(a){if(!a)return null;var b={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},c=[];return f.is(a,"array")&&f.is(a[0],"array")&&(c=S(a)),c[q]||(a+k)[M](/([achlmqstvz])[\s,]*((-?\d*\.?\d*(?:e[-+]?\d+)?\s*,?\s*)+)/ig,function(a,d,e){var f=[],g=s.call(d);e[M](/(-?\d*\.?\d*(?:e[-+]?\d+)?)\s*,?\s*/ig,function(a,b){b&&f[B](+b)});while(f[q]>=b[g]){c[B]([d][j](f.splice(0,b[g])));if(!b[g])break}}),c[x]=f._path2string,c}),f.
 findDotsAtSegment=function(a,b,c,d,e,f,g,h,i){var j=1-i,k=A(j,3)*a+A(j,2)*3*i*c+j*3*i*i*e+A(i,3)*g,l=A(j,3)*b+A(j,2)*3*i*d+j*3*i*i*f+A(i,3)*h,m=a+2*i*(c-a)+i*i*(e-2*c+a),n=b+2*i*(d-b)+i*i*(f-2*d+b),o=c+2*i*(e-c)+i*i*(g-2*e+c),p=d+2*i*(f-d)+i*i*(h-2*f+d),q=(1-i)*a+i*c,r=(1-i)*b+i*d,s=(1-i)*e+i*g,u=(1-i)*f+i*h,v=90-t.atan((m-o)/(n-p))*180/t.PI;return(m>o||n<p)&&(v+=180),{x:k,y:l,m:{x:m,y:n},n:{x:o,y:p},start:{x:q,y:r},end:{x:s,y:u},alpha:v}};var R=Q(function(a){if(!a)return{x:0,y:0,width:0,height:0};a=$(a);var b=0,c=0,d=[],e=[],f;for(var g=0,h=a[q];g<h;g++){f=a[g];if(f[0]=="M")b=f[1],c=f[2],d[B](b),e[B](c);else{var k=Z(b,c,f[1],f[2],f[3],f[4],f[5],f[6]);d=d[j](k.min.x,k.max.x),e=e[j](k.min.y,k.max.y),b=f[5],c=f[6]}}var l=v[i](0,d),m=v[i](0,e);return{x:l,y:m,width:u[i](0,d)-l,height:u[i](0,e)-m}}),S=function(a){var b=[];if(!f.is(a,"array")||!f.is(a&&a[0],"array"))a=f.parsePathString(a);for(var c=0,d=a[q];c<d;c++){b[c]=[];for(var e=0,g=a[c][q];e<g;e++)b[c][e]=a[c][e]}return b[x]=f._path
 2string,b},T=Q(function(a){if(!f.is(a,"array")||!f.is(a&&a[0],"array"))a=f.parsePathString(a);var b=[],c=0,d=0,e=0,g=0,h=0;a[0][0]=="M"&&(c=a[0][1],d=a[0][2],e=c,g=d,h++,b[B](["M",c,d]));for(var i=h,j=a[q];i<j;i++){var k=b[i]=[],l=a[i];if(l[0]!=s.call(l[0])){k[0]=s.call(l[0]);switch(k[0]){case"a":k[1]=l[1],k[2]=l[2],k[3]=l[3],k[4]=l[4],k[5]=l[5],k[6]=+(l[6]-c).toFixed(3),k[7]=+(l[7]-d).toFixed(3);break;case"v":k[1]=+(l[1]-d).toFixed(3);break;case"m":e=l[1],g=l[2];default:for(var m=1,n=l[q];m<n;m++)k[m]=+(l[m]-(m%2?c:d)).toFixed(3)}}else{k=b[i]=[],l[0]=="m"&&(e=l[1]+c,g=l[2]+d);for(var o=0,p=l[q];o<p;o++)b[i][o]=l[o]}var r=b[i][q];switch(b[i][0]){case"z":c=e,d=g;break;case"h":c+=+b[i][r-1];break;case"v":d+=+b[i][r-1];break;default:c+=+b[i][r-2],d+=+b[i][r-1]}}return b[x]=f._path2string,b},0,S),U=Q(function(a){if(!f.is(a,"array")||!f.is(a&&a[0],"array"))a=f.parsePathString(a);var b=[],c=0,d=0,e=0,g=0,h=0;a[0][0]=="M"&&(c=+a[0][1],d=+a[0][2],e=c,g=d,h++,b[0]=["M",c,d]);for(var i=h,j=a[
 q];i<j;i++){var k=b[i]=[],l=a[i];if(l[0]!=J.call(l[0])){k[0]=J.call(l[0]);switch(k[0]){case"A":k[1]=l[1],k[2]=l[2],k[3]=l[3],k[4]=l[4],k[5]=l[5],k[6]=+(l[6]+c),k[7]=+(l[7]+d);break;case"V":k[1]=+l[1]+d;break;case"H":k[1]=+l[1]+c;break;case"M":e=+l[1]+c,g=+l[2]+d;default:for(var m=1,n=l[q];m<n;m++)k[m]=+l[m]+(m%2?c:d)}}else for(var o=0,p=l[q];o<p;o++)b[i][o]=l[o];switch(k[0]){case"Z":c=e,d=g;break;case"H":c=k[1];break;case"V":d=k[1];break;default:c=b[i][b[i][q]-2],d=b[i][b[i][q]-1]}}return b[x]=f._path2string,b},null,S),V=function(a,b,c,d){return[a,b,c,d,c,d]},W=function(a,b,c,d,e,f){var g=1/3,h=2/3;return[g*a+h*c,g*b+h*d,g*e+h*c,g*f+h*d,e,f]},X=function(a,b,c,d,e,f,g,h,i,k){var l=t.PI,n=l*120/180,o=l/180*(+e||0),r=[],s,v=Q(function(a,b,c){var d=a*t.cos(c)-b*t.sin(c),e=a*t.sin(c)+b*t.cos(c);return{x:d,y:e}});if(!k){s=v(a,b,-o),a=s.x,b=s.y,s=v(h,i,-o),h=s.x,i=s.y;var w=t.cos(l/180*e),x=t.sin(l/180*e),y=(a-h)/2,z=(b-i)/2;c=u(c,t.abs(y)),d=u(d,t.abs(z));var A=y*y/(c*c)+z*z/(d*d);A>1&&(c
 =t.sqrt(A)*c,d=t.sqrt(A)*d);var B=c*c,C=d*d,D=(f==g?-1:1)*t.sqrt(t.abs((B*C-B*z*z-C*y*y)/(B*z*z+C*y*y))),E=D*c*z/d+(a+h)/2,F=D*-d*y/c+(b+i)/2,G=t.asin(((b-F)/d).toFixed(7)),H=t.asin(((i-F)/d).toFixed(7));G=a<E?l-G:G,H=h<E?l-H:H,G<0&&(G=l*2+G),H<0&&(H=l*2+H),g&&G>H&&(G-=l*2),!g&&H>G&&(H-=l*2)}else G=k[0],H=k[1],E=k[2],F=k[3];var I=H-G;if(t.abs(I)>n){var J=H,K=h,L=i;H=G+n*(g&&H>G?1:-1),h=E+c*t.cos(H),i=F+d*t.sin(H),r=X(h,i,c,d,e,0,g,K,L,[H,J,E,F])}I=H-G;var M=t.cos(G),N=t.sin(G),O=t.cos(H),P=t.sin(H),R=t.tan(I/4),S=4/3*c*R,T=4/3*d*R,U=[a,b],V=[a+S*N,b-T*M],W=[h+S*P,i-T*O],Y=[h,i];V[0]=2*U[0]-V[0],V[1]=2*U[1]-V[1];if(k)return[V,W,Y][j](r);r=[V,W,Y][j](r)[p]()[m](",");var Z=[];for(var $=0,_=r[q];$<_;$++)Z[$]=$%2?v(r[$-1],r[$],o).y:v(r[$],r[$+1],o).x;return Z},Y=function(a,b,c,d,e,f,g,h,i){var j=1-i;return{x:A(j,3)*a+A(j,2)*3*i*c+j*3*i*i*e+A(i,3)*g,y:A(j,3)*b+A(j,2)*3*i*d+j*3*i*i*f+A(i,3)*h}},Z=Q(function(a,b,c,d,e,f,g,h){var j=e-2*c+a-(g-2*e+c),k=2*(c-a)-2*(e-c),l=a-c,m=(-k+t.sqrt(k*k-4
 *j*l))/2/j,n=(-k-t.sqrt(k*k-4*j*l))/2/j,o=[b,h],p=[a,g],q;return t.abs(m)>1e12&&(m=.5),t.abs(n)>1e12&&(n=.5),m>0&&m<1&&(q=Y(a,b,c,d,e,f,g,h,m),p[B](q.x),o[B](q.y)),n>0&&n<1&&(q=Y(a,b,c,d,e,f,g,h,n),p[B](q.x),o[B](q.y)),j=f-2*d+b-(h-2*f+d),k=2*(d-b)-2*(f-d),l=b-d,m=(-k+t.sqrt(k*k-4*j*l))/2/j,n=(-k-t.sqrt(k*k-4*j*l))/2/j,t.abs(m)>1e12&&(m=.5),t.abs(n)>1e12&&(n=.5),m>0&&m<1&&(q=Y(a,b,c,d,e,f,g,h,m),p[B](q.x),o[B](q.y)),n>0&&n<1&&(q=Y(a,b,c,d,e,f,g,h,n),p[B](q.x),o[B](q.y)),{min:{x:v[i](0,p),y:v[i](0,o)},max:{x:u[i](0,p),y:u[i](0,o)}}}),$=Q(function(a,b){var c=U(a),d=b&&U(b),e={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},f={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},g=function(a,b){var c,d;if(!a)return["C",b.x,b.y,b.x,b.y,b.x,b.y];!(a[0]in{T:1,Q:1})&&(b.qx=b.qy=null);switch(a[0]){case"M":b.X=a[1],b.Y=a[2];break;case"A":a=["C"][j](X[i](0,[b.x,b.y][j](a.slice(1))));break;case"S":c=b.x+(b.x-(b.bx||b.x)),d=b.y+(b.y-(b.by||b.y)),a=["C",c,d][j](a.slice(1));break;case"T":b.qx=b.x+(b.x-(b.qx||b.
 x)),b.qy=b.y+(b.y-(b.qy||b.y)),a=["C"][j](W(b.x,b.y,b.qx,b.qy,a[1],a[2]));break;case"Q":b.qx=a[1],b.qy=a[2],a=["C"][j](W(b.x,b.y,a[1],a[2],a[3],a[4]));break;case"L":a=["C"][j](V(b.x,b.y,a[1],a[2]));break;case"H":a=["C"][j](V(b.x,b.y,a[1],b.y));break;case"V":a=["C"][j](V(b.x,b.y,b.x,a[1]));break;case"Z":a=["C"][j](V(b.x,b.y,b.X,b.Y))}return a},h=function(a,b){if(a[b][q]>7){a[b].shift();var e=a[b];while(e[q])a.splice(b++,0,["C"][j](e.splice(0,6)));a.splice(b,1),m=u(c[q],d&&d[q]||0)}},k=function(a,b,e,f,g){a&&b&&a[g][0]=="M"&&b[g][0]!="M"&&(b.splice(g,0,["M",f.x,f.y]),e.bx=0,e.by=0,e.x=a[g][1],e.y=a[g][2],m=u(c[q],d&&d[q]||0))};for(var l=0,m=u(c[q],d&&d[q]||0);l<m;l++){c[l]=g(c[l],e),h(c,l),d&&(d[l]=g(d[l],f)),d&&h(d,l),k(c,d,e,f,l),k(d,c,f,e,l);var n=c[l],o=d&&d[l],p=n[q],r=d&&o[q];e.x=n[p-2],e.y=n[p-1],e.bx=H(n[p-4])||e.x,e.by=H(n[p-3])||e.y,f.bx=d&&(H(o[r-4])||f.x),f.by=d&&(H(o[r-3])||f.y),f.x=d&&o[r-2],f.y=d&&o[r-1]}return d?[c,d]:c},null,S),_=Q(function(a){var b=[];for(var c=0,d=a
 [q];c<d;c++){var e={},g=a[c].match(/^([^:]*):?([\d\.]*)/);e.color=f.getRGB(g[1]);if(e.color.error)return null;e.color=e.color.hex,g[2]&&(e.offset=g[2]+"%"),b[B](e)}for(var c=1,d=b[q]-1;c<d;c++)if(!b[c].offset){var h=H(b[c-1].offset||0),i=0;for(var j=c+1;j<d;j++)if(b[j].offset){i=b[j].offset;break}i||(i=100,j=d),i=H(i);var k=(i-h)/(j-c+1);for(;c<j;c++)h+=k,b[c].offset=h+"%"}return b}),ba=function(){var a,b,d,e,g;if(f.is(arguments[0],"string")||f.is(arguments[0],"object")){f.is(arguments[0],"string")?a=c.getElementById(arguments[0]):a=arguments[0];if(a.tagName)return arguments[1]==null?{container:a,width:a.style.pixelWidth||a.offsetWidth,height:a.style.pixelHeight||a.offsetHeight}:{container:a,width:arguments[1],height:arguments[2]}}else if(f.is(arguments[0],w)&&arguments[q]>3)return{container:1,x:arguments[0],y:arguments[1],width:arguments[2],height:arguments[3]}},bb=function(a,b){var c=this;for(var d in b)if(b[o](d)&&!(d in a))switch(typeof b[d]){case"function":(function(b){a[d]=a==
 =c?b:function(){return b[i](c,arguments)}})(b[d]);break;case"object":a[d]=a[d]||{},bb.call(this,a[d],b[d]);break;default:a[d]=b[d]}},bc=function(a,b){a==b.top&&(b.top=a.prev),a==b.bottom&&(b.bottom=a.next),a.next&&(a.next.prev=a.prev),a.prev&&(a.prev.next=a.next)},bd=function(a,b){if(b.top===a)return;bc(a,b),a.next=null,a.prev=b.top,b.top.next=a,b.top=a},be=function(a,b){if(b.bottom===a)return;bc(a,b),a.next=b.bottom,a.prev=null,b.bottom.prev=a,b.bottom=a},bf=function(a,b,c){bc(a,c),b==c.top&&(c.top=a),b.next&&(b.next.prev=a),a.next=b.next,a.prev=b,b.next=a},bg=function(a,b,c){bc(a,c),b==c.bottom&&(c.bottom=a),b.prev&&(b.prev.next=a),a.prev=b.prev,b.prev=a,a.next=b},bh=function(a){return function(){throw new Error("Raphaël: you are calling to method “"+a+"” of removed object")}},bi=/^r(?:\(([^,]+?)\s*,\s*([^\)]+?)\))?/;if(f.svg){g[r].svgns="http://www.w3.org/2000/svg",g[r].xlink="http://www.w3.org/1999/xlink";var F=function(a){return+a+(~~a===a)*.5},bj=function(a){for(var b=0,c
 =a[q];b<c;b++)if(s.call(a[b][0])!="a")for(var d=1,e=a[b][q];d<e;d++)a[b][d]=F(a[b][d]);else a[b][6]=F(a[b][6]),a[b][7]=F(a[b][7]);return a},bk=function(a,b){if(!b)return c.createElementNS(g[r].svgns,a);for(var d in b)b[o](d)&&a[G](d,b[d])};f[x]=function(){return"Your browser supports SVG.\nYou are running Raphaël "+this.version};var bl=function(a,b){var c=bk("path");b.canvas&&b.canvas[h](c);var d=new br(c,b);return d.type="path",bo(d,{fill:"none",stroke:"#000",path:a}),d},bm=function(a,b,c){var d="linear",e=.5,g=.5,i=a.style;b=(b+k)[M](bi,function(a,b,c){d="radial";if(b&&c){e=H(b),g=H(c);var f=(g>.5)*2-1;A(e-.5,2)+A(g-.5,2)>.25&&(g=t.sqrt(.25-A(e-.5,2))*f+.5)&&g!=.5&&(g=g.toFixed(5)-1e-5*f)}return k}),b=b[m](/\s*\-\s*/);if(d=="linear"){var j=b.shift();j=-H(j);if(isNaN(j))return null;var l=[0,0,t.cos(j*t.PI/180),t.sin(j*t.PI/180)],n=1/(u(t.abs(l[2]),t.abs(l[3]))||1);l[2]*=n,l[3]*=n,l[2]<0&&(l[0]=-l[2],l[2]=0),l[3]<0&&(l[1]=-l[3],l[3]=0)}var o=_(b);if(!o)return null;var p=bk(d+"Gradi
 ent");p.id="r"+(f._id++)[x](36),bk(p,d=="radial"?{fx:e,fy:g}:{x1:l[0],y1:l[1],x2:l[2],y2:l[3]}),c.defs[h](p);for(var r=0,s=o[q];r<s;r++){var v=bk("stop");bk(v,{offset:o[r].offset?o[r].offset:r?"100%":"0%","stop-color":o[r].color||"#fff"}),p[h](v)}return bk(a,{fill:"url(#"+p.id+")",opacity:1,"fill-opacity":1}),i.fill=k,i.opacity=1,i.fillOpacity=1,1},bn=function(a){var b=a.getBBox();bk(a.pattern,{patternTransform:f.format("translate({0},{1})",b.x,b.y)})},bo=function(b,d){var e={"":[0],none:[0],"-":[3,1],".":[1,1],"-.":[3,1,1,1],"-..":[3,1,1,1,1,1],". ":[1,3],"- ":[4,3],"--":[8,3],"- .":[4,3,1,3],"--.":[8,3,1,3],"--..":[8,3,1,3,1,3]},g=b.node,i=b.attrs,j=b.rotate(),n=function(a,b){b=e[s.call(b)];if(b){var c=a.attrs["stroke-width"]||"1",f={round:c,square:c,butt:0}[a.attrs["stroke-linecap"]||d["stroke-linecap"]]||0,h=[],i=b[q];while(i--)h[i]=b[i]*c+(i%2?1:-1)*f;bk(g,{"stroke-dasharray":h[p](",")})}};d[o]("rotation")&&(j=d.rotation);var r=(j+k)[m](a);r.length-1?(r[1]=+r[1],r[2]=+r[2]):r=n
 ull,H(j)&&b.rotate(0,!0);for(var t in d)if(d[o](t)){if(!K[o](t))continue;var u=d[t];i[t]=u;switch(t){case"rotation":b.rotate(u,!0);break;case"href":case"title":case"target":var v=g.parentNode;if(s.call(v.tagName)!="a"){var w=bk("a");v.insertBefore(w,g),w[h](g),v=w}v.setAttributeNS(b.paper.xlink,t,u);break;case"cursor":g.style.cursor=u;break;case"clip-rect":var y=(u+k)[m](a);if(y[q]==4){b.clip&&b.clip.parentNode.parentNode.removeChild(b.clip.parentNode);var z=bk("clipPath"),A=bk("rect");z.id="r"+(f._id++)[x](36),bk(A,{x:y[0],y:y[1],width:y[2],height:y[3]}),z[h](A),b.paper.defs[h](z),bk(g,{"clip-path":"url(#"+z.id+")"}),b.clip=A}if(!u){var B=c.getElementById(g.getAttribute("clip-path")[M](/(^url\(#|\)$)/g,k));B&&B.parentNode.removeChild(B),bk(g,{"clip-path":k}),delete b.clip}break;case"path":u&&b.type=="path"&&(i.path=bj(U(u)),bk(g,{d:i.path}));break;case"width":g[G](t,u);if(i.fx)t="x",u=i.x;else break;case"x":i.fx&&(u=-i.x-(i.width||0));case"rx":if(t=="rx"&&b.type=="rect")break;case"
 cx":r&&(t=="x"||t=="cx")&&(r[1]+=u-i[t]),g[G](t,F(u)),b.pattern&&bn(b);break;case"height":g[G](t,u);if(i.fy)t="y",u=i.y;else break;case"y":i.fy&&(u=-i.y-(i.height||0));case"ry":if(t=="ry"&&b.type=="rect")break;case"cy":r&&(t=="y"||t=="cy")&&(r[2]+=u-i[t]),g[G](t,F(u)),b.pattern&&bn(b);break;case"r":b.type=="rect"?bk(g,{rx:u,ry:u}):g[G](t,u);break;case"src":b.type=="image"&&g.setAttributeNS(b.paper.xlink,"href",u);break;case"stroke-width":g.style.strokeWidth=u,g[G](t,u),i["stroke-dasharray"]&&n(b,i["stroke-dasharray"]);break;case"stroke-dasharray":n(b,u);break;case"translation":var C=(u+k)[m](a);C[0]=+C[0]||0,C[1]=+C[1]||0,r&&(r[1]+=C[0],r[2]+=C[1]),bN.call(b,C[0],C[1]);break;case"scale":var C=(u+k)[m](a);b.scale(+C[0]||1,+C[1]||+C[0]||1,+C[2]||null,+C[3]||null);break;case"fill":var E=(u+k).match(D);if(E){var z=bk("pattern"),L=bk("image");z.id="r"+(f._id++)[x](36),bk(z,{x:0,y:0,patternUnits:"userSpaceOnUse",height:1,width:1}),bk(L,{x:0,y:0}),L.setAttributeNS(b.paper.xlink,"href",E[1]
 ),z[h](L);var N=c.createElement("img");N.style.cssText="position:absolute;left:-9999em;top-9999em",N.onload=function(){bk(z,{width:this.offsetWidth,height:this.offsetHeight}),bk(L,{width:this.offsetWidth,height:this.offsetHeight}),c.body.removeChild(this),b.paper.safari()},c.body[h](N),N.src=E[1],b.paper.defs[h](z),g.style.fill="url(#"+z.id+")",bk(g,{fill:"url(#"+z.id+")"}),b.pattern=z,b.pattern&&bn(b);break}if(!f.getRGB(u).error)delete d.gradient,delete i.gradient,!f.is(i.opacity,"undefined")&&f.is(d.opacity,"undefined")&&bk(g,{opacity:i.opacity}),!f.is(i["fill-opacity"],"undefined")&&f.is(d["fill-opacity"],"undefined")&&bk(g,{"fill-opacity":i["fill-opacity"]});else if(({circle:1,ellipse:1}[o](b.type)||(u+k).charAt()!="r")&&bm(g,u,b.paper)){i.gradient=u,i.fill="none";break};case"stroke":g[G](t,f.getRGB(u).hex);break;case"gradient":((({circle:1,ellipse:1}))[o](b.type)||(u+k).charAt()!="r")&&bm(g,u,b.paper);break;case"opacity":case"fill-opacity":if(i.gradient){var O=c.getElementById(
 g.getAttribute("fill")[M](/^url\(#|\)$/g,k));if(O){var P=O.getElementsByTagName("stop");P[P[q]-1][G]("stop-opacity",u)}break};default:t=="font-size"&&(u=I(u,10)+"px");var Q=t[M](/(\-.)/g,function(a){return J.call(a.substring(1))});g.style[Q]=u,g[G](t,u)}}bq(b,d),r?b.rotate(r.join(l)):H(j)&&b.rotate(j,!0)},bp=1.2,bq=function(a,b){if(a.type!="text"||!(b[o]("text")||b[o]("font")||b[o]("font-size")||b[o]("x")||b[o]("y")))return;var d=a.attrs,e=a.node,f=e.firstChild?I(c.defaultView.getComputedStyle(e.firstChild,k).getPropertyValue("font-size"),10):10;if(b[o]("text")){d.text=b.text;while(e.firstChild)e.removeChild(e.firstChild);var g=(b.text+k)[m]("\n");for(var i=0,j=g[q];i<j;i++)if(g[i]){var l=bk("tspan");i&&bk(l,{dy:f*bp,x:d.x}),l[h](c.createTextNode(g[i])),e[h](l)}}else{var g=e.getElementsByTagName("tspan");for(var i=0,j=g[q];i<j;i++)i&&bk(g[i],{dy:f*bp,x:d.x})}bk(e,{y:d.y});var n=a.getBBox(),p=d.y-(n.y+n.height/2);p&&isFinite(p)&&bk(e,{y:d.y+p})},br=function(a,b){var c=0,d=0;this[0]=a
 ,this.id=f._oid++,this.node=a,a.raphael=this,this.paper=b,this.attrs=this.attrs||{},this.transformations=[],this._={tx:0,ty:0,rt:{deg:0,cx:0,cy:0},sx:1,sy:1},!b.bottom&&(b.bottom=this),this.prev=b.top,b.top&&(b.top.next=this),b.top=this,this.next=null};br[r].rotate=function(b,c,d){if(this.removed)return this;if(b==null)return this._.rt.cx?[this._.rt.deg,this._.rt.cx,this._.rt.cy][p](l):this._.rt.deg;var e=this.getBBox();return b=(b+k)[m](a),b[q]-1&&(c=H(b[1]),d=H(b[2])),b=H(b[0]),c!=null?this._.rt.deg=b:this._.rt.deg+=b,d==null&&(c=null),this._.rt.cx=c,this._.rt.cy=d,c=c==null?e.x+e.width/2:c,d=d==null?e.y+e.height/2:d,this._.rt.deg?(this.transformations[0]=f.format("rotate({0} {1} {2})",this._.rt.deg,c,d),this.clip&&bk(this.clip,{transform:f.format("rotate({0} {1} {2})",-this._.rt.deg,c,d)})):(this.transformations[0]=k,this.clip&&bk(this.clip,{transform:k})),bk(this.node,{transform:this.transformations[p](l)}),this},br[r].hide=function(){return!this.removed&&(this.node.style.displa
 y="none"),this},br[r].show=function(){return!this.removed&&(this.node.style.display=""),this},br[r].remove=function(){if(this.removed)return;bc(this,this.paper),this.node.parentNode.removeChild(this.node);for(var a in this)delete this[a];this.removed=!0},br[r].getBBox=function(){if(this.removed)return this;if(this.type=="path")return R(this.attrs.path);if(this.node.style.display=="none"){this.show();var a=!0}var b={};try{b=this.node.getBBox()}catch(c){}finally{b=b||{}}if(this.type=="text"){b={x:b.x,y:Infinity,width:0,height:0};for(var d=0,e=this.node.getNumberOfChars();d<e;d++){var f=this.node.getExtentOfChar(d);f.y<b.y&&(b.y=f.y),f.y+f.height-b.y>b.height&&(b.height=f.y+f.height-b.y),f.x+f.width-b.x>b.width&&(b.width=f.x+f.width-b.x)}}return a&&this.hide(),b},br[r].attr=function(){if(this.removed)return this;if(arguments[q]==0){var a={};for(var b in this.attrs)this.attrs[o](b)&&(a[b]=this.attrs[b]);return this._.rt.deg&&(a.rotation=this.rotate()),(this._.sx!=1||this._.sy!=1)&&(a.sc
 ale=this.scale()),a.gradient&&a.fill=="none"&&(a.fill=a.gradient)&&delete a.gradient,a}if(arguments[q]==1&&f.is(arguments[0],"string"))return arguments[0]=="translation"?bN.call(this):arguments[0]=="rotation"?this.rotate():arguments[0]=="scale"?this.scale():arguments[0]=="fill"&&this.attrs.fill=="none"&&this.attrs.gradient?this.attrs.gradient:this.attrs[arguments[0]];if(arguments[q]==1&&f.is(arguments[0],"array")){var c={};for(var d in arguments[0])arguments[0][o](d)&&(c[arguments[0][d]]=this.attrs[arguments[0][d]]);return c}if(arguments[q]==2){var e={};e[arguments[0]]=arguments[1],bo(this,e)}else arguments[q]==1&&f.is(arguments[0],"object")&&bo(this,arguments[0]);return this},br[r].toFront=function(){if(this.removed)return this;this.node.parentNode[h](this.node);var a=this.paper;return a.top!=this&&bd(this,a),this},br[r].toBack=function(){if(this.removed)return this;if(this.node.parentNode.firstChild!=this.node){this.node.parentNode.insertBefore(this.node,this.node.parentNode.first
 Child),be(this,this.paper);var a=this.paper}return this},br[r].insertAfter=function(a){if(this.removed)return this;var b=a.node;return b.nextSibling?b.parentNode.insertBefore(this.node,b.nextSibling):b.parentNode[h](this.node),bf(this,a,this.paper),this},br[r].insertBefore=function(a){if(this.removed)return this;var b=a.node;return b.parentNode.insertBefore(this.node,b),bg(this,a,this.paper),this};var bs=function(a,b,c,d){b=F(b),c=F(c);var e=bk("circle");a.canvas&&a.canvas[h](e);var f=new br(e,a);return f.attrs={cx:b,cy:c,r:d,fill:"none",stroke:"#000"},f.type="circle",bk(e,f.attrs),f},bt=function(a,b,c,d,e,f){b=F(b),c=F(c);var g=bk("rect");a.canvas&&a.canvas[h](g);var i=new br(g,a);return i.attrs={x:b,y:c,width:d,height:e,r:f||0,rx:f||0,ry:f||0,fill:"none",stroke:"#000"},i.type="rect",bk(g,i.attrs),i},bu=function(a,b,c,d,e){b=F(b),c=F(c);var f=bk("ellipse");a.canvas&&a.canvas[h](f);var g=new br(f,a);return g.attrs={cx:b,cy:c,rx:d,ry:e,fill:"none",stroke:"#000"},g.type="ellipse",bk(f
 ,g.attrs),g},bv=function(a,b,c,d,e,f){var g=bk("image");bk(g,{x:c,y:d,width:e,height:f,preserveAspectRatio:"none"}),g.setAttributeNS(a.xlink,"href",b),a.canvas&&a.canvas[h](g);var i=new br(g,a);return i.attrs={x:c,y:d,width:e,height:f,src:b},i.type="image",i},bw=function(a,b,c,d){var e=bk("text");bk(e,{x:b,y:c,"text-anchor":"middle"}),a.canvas&&a.canvas[h](e);var f=new br(e,a);return f.attrs={x:b,y:c,"text-anchor":"middle",text:d,font:K.font,stroke:"none",fill:"#000"},f.type="text",bo(f,f.attrs),f},bx=function(a,b){return this.width=a||this.width,this.height=b||this.height,this.canvas[G]("width",this.width),this.canvas[G]("height",this.height),this},by=function(){var a=ba[i](null,arguments),b=a&&a.container,d=a.x,e=a.y,j=a.width,k=a.height;if(!b)throw new Error("SVG container not found.");var l=bk("svg");return j=j||512,k=k||342,bk(l,{xmlns:"http://www.w3.org/2000/svg",version:1.1,width:j,height:k}),b==1?(l.style.cssText="position:absolute;left:"+d+"px;top:"+e+"px",c.body[h](l)):b.f
 irstChild?b.insertBefore(l,b.firstChild):b[h](l),b=new g,b.width=j,b.height=k,b.canvas=l,bb.call(b,b,f.fn),b.clear(),b};g[r].clear=function(){var a=this.canvas;while(a.firstChild)a.removeChild(a.firstChild);this.bottom=this.top=null,(this.desc=bk("desc"))[h](c.createTextNode("Created with Raphaël")),a[h](this.desc),a[h](this.defs=bk("defs"))},g[r].remove=function(){this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas);for(var a in this)this[a]=bh(a)}}if(f.vml){var bz=function(a){var b=/[ahqstv]/ig,c=U;(a+k).match(b)&&(c=$),b=/[clmz]/g;if(c==U&&!(a+k).match(b)){var d={M:"m",L:"l",C:"c",Z:"x",m:"t",l:"r",c:"v",z:"x"},e=/([clmz]),?([^clmz]*)/gi,f=/-?[^,\s-]+/g,g=(a+k)[M](e,function(a,b,c){var e=[];return c[M](f,function(a){e[B](F(a))}),d[b]+e});return g}var h=c(a),i,g=[],j;for(var m=0,n=h[q];m<n;m++){i=h[m],j=s.call(h[m][0]),j=="z"&&(j="x");for(var o=1,r=i[q];o<r;o++)j+=F(i[o])+(o!=r-1?",":k);g[B](j)}return g[p](l)};f[x]=function(){return"Your browser doesn’t suppo
 rt SVG. Falling down to VML.\nYou are running Raphaël "+this.version};var bl=function(a,b){var c=bA("group");c.style.cssText="position:absolute;left:0;top:0;width:"+b.width+"px;height:"+b.height+"px",c.coordsize=b.coordsize,c.coordorigin=b.coordorigin;var d=bA("shape"),e=d.style;e.width=b.width+"px",e.height=b.height+"px",d.coordsize=this.coordsize,d.coordorigin=this.coordorigin,c[h](d);var f=new br(d,c,b);return f.isAbsolute=!0,f.type="path",f.path=[],f.Path=k,a&&bo(f,{fill:"none",stroke:"#000",path:a}),b.canvas[h](c),f},bo=function(b,d){b.attrs=b.attrs||{};var e=b.node,g=b.attrs,i=e.style,j,l=b;for(var n in d)d[o](n)&&(g[n]=d[n]);d.href&&(e.href=d.href),d.title&&(e.title=d.title),d.target&&(e.target=d.target),d.cursor&&(i.cursor=d.cursor),d.path&&b.type=="path"&&(g.path=d.path,e.path=bz(g.path)),d.rotation!=null&&b.rotate(d.rotation,!0),d.translation&&(j=(d.translation+k)[m](a),bN.call(b,j[0],j[1]),b._.rt.cx!=null&&(b._.rt.cx+=+j[0],b._.rt.cy+=+j[1],b.setBox(b.attrs,j[0],j[1]))),
 d.scale&&(j=(d.scale+k)[m](a),b.scale(+j[0]||1,+j[1]||+j[0]||1,+j[2]||null,+j[3]||null));if("clip-rect"in d){var p=(d["clip-rect"]+k)[m](a);if(p[q]==4){p[2]=+p[2]+ +p[0],p[3]=+p[3]+ +p[1];var r=e.clipRect||c.createElement("div"),s=r.style,t=e.parentNode;s.clip=f.format("rect({1}px {2}px {3}px {0}px)",p),e.clipRect||(s.position="absolute",s.top=0,s.left=0,s.width=b.paper.width+"px",s.height=b.paper.height+"px",t.parentNode.insertBefore(r,t),r[h](t),e.clipRect=r)}d["clip-rect"]||e.clipRect&&(e.clipRect.style.clip=k)}b.type=="image"&&d.src&&(e.src=d.src),b.type=="image"&&d.opacity&&(e.filterOpacity=" progid:DXImageTransform.Microsoft.Alpha(opacity="+d.opacity*100+")",i.filter=(e.filterMatrix||k)+(e.filterOpacity||k)),d.font&&(i.font=d.font),d["font-family"]&&(i.fontFamily='"'+d["font-family"][m](",")[0][M](/^['"]+|['"]+$/g,k)+'"'),d["font-size"]&&(i.fontSize=d["font-size"]),d["font-weight"]&&(i.fontWeight=d["font-weight"]),d["font-style"]&&(i.fontStyle=d["font-style"]);if(d.opacity!=nu
 ll||d["stroke-width"]!=null||d.fill!=null||d.stroke!=null||d["stroke-width"]!=null||d["stroke-opacity"]!=null||d["fill-opacity"]!=null||d["stroke-dasharray"]!=null||d["stroke-miterlimit"]!=null||d["stroke-linejoin"]!=null||d["stroke-linecap"]!=null){e=b.shape||e;var u=e.getElementsByTagName("fill")&&e.getElementsByTagName("fill")[0],v=!1;!u&&(v=u=bA("fill"));if("fill-opacity"in d||"opacity"in d){var w=((+g["fill-opacity"]+1||2)-1)*((+g.opacity+1||2)-1);w<0&&(w=0),w>1&&(w=1),u.opacity=w}d.fill&&(u.on=!0);if(u.on==null||d.fill=="none")u.on=!1;if(u.on&&d.fill){var x=d.fill.match(D);x?(u.src=x[1],u.type="tile"):(u.color=f.getRGB(d.fill).hex,u.src=k,u.type="solid",f.getRGB(d.fill).error&&(l.type in{circle:1,ellipse:1}||(d.fill+k).charAt()!="r")&&bm(l,d.fill)&&(g.fill="none",g.gradient=d.fill))}v&&e[h](u);var y=e.getElementsByTagName("stroke")&&e.getElementsByTagName("stroke")[0],z=!1;!y&&(z=y=bA("stroke"));if(d.stroke&&d.stroke!="none"||d["stroke-width"]||d["stroke-opacity"]!=null||d["st
 roke-dasharray"]||d["stroke-miterlimit"]||d["stroke-linejoin"]||d["stroke-linecap"])y.on=!0;(d.stroke=="none"||y.on==null||d.stroke==0||d["stroke-width"]==0)&&(y.on=!1),y.on&&d.stroke&&(y.color=f.getRGB(d.stroke).hex);var w=((+g["stroke-opacity"]+1||2)-1)*((+g.opacity+1||2)-1),A=(H(d["stroke-width"])||1)*.75;w<0&&(w=0),w>1&&(w=1),d["stroke-width"]==null&&(A=g["stroke-width"]),d["stroke-width"]&&(y.weight=A),A&&A<1&&(w*=A)&&(y.weight=1),y.opacity=w,d["stroke-linejoin"]&&(y.joinstyle=d["stroke-linejoin"]||"miter"),y.miterlimit=d["stroke-miterlimit"]||8,d["stroke-linecap"]&&(y.endcap=d["stroke-linecap"]=="butt"?"flat":d["stroke-linecap"]=="square"?"square":"round");if(d["stroke-dasharray"]){var B={"-":"shortdash",".":"shortdot","-.":"shortdashdot","-..":"shortdashdotdot",". ":"dot","- ":"dash","--":"longdash","- .":"dashdot","--.":"longdashdot","--..":"longdashdotdot"};y.dashstyle=B[o](d["stroke-dasharray"])?B[d["stroke-dasharray"]]:k}z&&e[h](y)}if(l.type=="text"){var i=l.paper.span.st
 yle;g.font&&(i.font=g.font),g["font-family"]&&(i.fontFamily=g["font-family"]),g["font-size"]&&(i.fontSize=g["font-size"]),g["font-weight"]&&(i.fontWeight=g["font-weight"]),g["font-style"]&&(i.fontStyle=g["font-style"]),l.node.string&&(l.paper.span.innerHTML=(l.node.string+k)[M](/</g,"&#60;")[M](/&/g,"&#38;")[M](/\n/g,"<br>")),l.W=g.w=l.paper.span.offsetWidth,l.H=g.h=l.paper.span.offsetHeight,l.X=g.x,l.Y=g.y+F(l.H/2);switch(g["text-anchor"]){case"start":l.node.style["v-text-align"]="left",l.bbx=F(l.W/2);break;case"end":l.node.style["v-text-align"]="right",l.bbx=-F(l.W/2);break;default:l.node.style["v-text-align"]="center"}}},bm=function(a,b){a.attrs=a.attrs||{};var c=a.attrs,d=a.node.getElementsByTagName("fill"),e="linear",f=".5 .5";a.attrs.gradient=b,b=(b+k)[M](bi,function(a,b,c){return e="radial",b&&c&&(b=H(b),c=H(c),A(b-.5,2)+A(c-.5,2)>.25&&(c=t.sqrt(.25-A(b-.5,2))*((c>.5)*2-1)+.5),f=b+l+c),k}),b=b[m](/\s*\-\s*/);if(e=="linear"){var g=b.shift();g=-H(g);if(isNaN(g))return null}var 
 h=_(b);if(!h)return null;a=a.shape||a.node,d=d[0]||bA("fill");if(h[q]){d.on=!0,d.method="none",d.type=e=="radial"?"gradientradial":"gradient",d.color=h[0].color,d.color2=h[h[q]-1].color;var i=[];for(var j=0,n=h[q];j<n;j++)h[j].offset&&i[B](h[j].offset+l+h[j].color);d.colors&&(d.colors.value=i[q]?i[p](","):"0% "+d.color),e=="radial"?(d.focus="100%",d.focussize=f,d.focusposition=f):d.angle=(270-g)%360}return 1},br=function(a,b,c){var d=0,e=0,g=0,h=1;this[0]=a,this.id=f._oid++,this.node=a,a.raphael=this,this.X=0,this.Y=0,this.attrs={},this.Group=b,this.paper=c,this._={tx:0,ty:0,rt:{deg:0},sx:1,sy:1},!c.bottom&&(c.bottom=this),this.prev=c.top,c.top&&(c.top.next=this),c.top=this,this.next=null};br[r].rotate=function(b,c,d){return this.removed?this:b==null?this._.rt.cx?[this._.rt.deg,this._.rt.cx,this._.rt.cy][p](l):this._.rt.deg:(b=(b+k)[m](a),b[q]-1&&(c=H(b[1]),d=H(b[2])),b=H(b[0]),c!=null?this._.rt.deg=b:this._.rt.deg+=b,d==null&&(c=null),this._.rt.cx=c,this._.rt.cy=d,this.setBox(this.
 attrs,c,d),this.Group.style.rotation=this._.rt.deg,this)},br[r].setBox=function(a,b,c){if(this.removed)return this;var d=this.Group.style,e=this.shape&&this.shape.style||this.node.style;a=a||{};for(var f in a)a[o](f)&&(this.attrs[f]=a[f]);b=b||this._.rt.cx,c=c||this._.rt.cy;var g=this.attrs,i,j,l,m;switch(this.type){case"circle":i=g.cx-g.r,j=g.cy-g.r,l=m=g.r*2;break;case"ellipse":i=g.cx-g.rx,j=g.cy-g.ry,l=g.rx*2,m=g.ry*2;break;case"rect":case"image":i=+g.x,j=+g.y,l=g.width||0,m=g.height||0;break;case"text":this.textpath.v=["m",F(g.x),", ",F(g.y-2),"l",F(g.x)+1,", ",F(g.y-2)][p](k),i=g.x-F(this.W/2),j=g.y-this.H/2,l=this.W,m=this.H;break;case"path":if(!this.attrs
+.path)i=0,j=0,l=this.paper.width,m=this.paper.height;else{var n=R(this.attrs.path);i=n.x,j=n.y,l=n.width,m=n.height}break;default:i=0,j=0,l=this.paper.width,m=this.paper.height}b=b==null?i+l/2:b,c=c==null?j+m/2:c;var r=b-this.paper.width/2,s=c-this.paper.height/2;if(this.type=="path"||this.type=="text")d.left!=r+"px"&&(d.left=r+"px"),d.top!=s+"px"&&(d.top=s+"px"),this.X=this.type=="text"?i:-r,this.Y=this.type=="text"?j:-s,this.W=l,this.H=m,e.left!=-r+"px"&&(e.left=-r+"px"),e.top!=-s+"px"&&(e.top=-s+"px");else{d.left!=r+"px"&&(d.left=r+"px"),d.top!=s+"px"&&(d.top=s+"px"),this.X=i,this.Y=j,this.W=l,this.H=m,d.width!=this.paper.width+"px"&&(d.width=this.paper.width+"px"),d.height!=this.paper.height+"px"&&(d.height=this.paper.height+"px"),e.left!=i-r+"px"&&(e.left=i-r+"px"),e.top!=j-s+"px"&&(e.top=j-s+"px"),e.width!=l+"px"&&(e.width=l+"px"),e.height!=m+"px"&&(e.height=m+"px");var t=(+a.r||0)/v(l,m);if(this.type=="rect"&&this.arcsize.toFixed(4)!=t.toFixed(4)&&(t||this.arcsize)){var u=bA(
 "roundrect"),w={},f=0,x=this.events&&this.events[q];u.arcsize=t,u.raphael=this,this.Group[h](u),this.Group.removeChild(this.node),this[0]=this.node=u,this.arcsize=t;for(var f in g)w[f]=g[f];delete w.scale,this.attr(w);if(this.events)for(;f<x;f++)this.events[f].unbind=bC(this.node,this.events[f].name,this.events[f].f,this)}}},br[r].hide=function(){return!this.removed&&(this.Group.style.display="none"),this},br[r].show=function(){return!this.removed&&(this.Group.style.display="block"),this},br[r].getBBox=function(){return this.removed?this:this.type=="path"?R(this.attrs.path):{x:this.X+(this.bbx||0),y:this.Y,width:this.W,height:this.H}},br[r].remove=function(){if(this.removed)return;bc(this,this.paper),this.node.parentNode.removeChild(this.node),this.Group.parentNode.removeChild(this.Group),this.shape&&this.shape.parentNode.removeChild(this.shape);for(var a in this)delete this[a];this.removed=!0},br[r].attr=function(){if(this.removed)return this;if(arguments[q]==0){var a={};for(var b 
 in this.attrs)this.attrs[o](b)&&(a[b]=this.attrs[b]);return this._.rt.deg&&(a.rotation=this.rotate()),(this._.sx!=1||this._.sy!=1)&&(a.scale=this.scale()),a.gradient&&a.fill=="none"&&(a.fill=a.gradient)&&delete a.gradient,a}if(arguments[q]==1&&f.is(arguments[0],"string"))return arguments[0]=="translation"?bN.call(this):arguments[0]=="rotation"?this.rotate():arguments[0]=="scale"?this.scale():arguments[0]=="fill"&&this.attrs.fill=="none"&&this.attrs.gradient?this.attrs.gradient:this.attrs[arguments[0]];if(this.attrs&&arguments[q]==1&&f.is(arguments[0],"array")){var c={};for(var b=0,d=arguments[0][q];b<d;b++)c[arguments[0][b]]=this.attrs[arguments[0][b]];return c}var e;return arguments[q]==2&&(e={},e[arguments[0]]=arguments[1]),arguments[q]==1&&f.is(arguments[0],"object")&&(e=arguments[0]),e&&(e.text&&this.type=="text"&&(this.node.string=e.text),bo(this,e),e.gradient&&({circle:1,ellipse:1}[o](this.type)||(e.gradient+k).charAt()!="r")&&bm(this,e.gradient),(this.type!="path"||this._.rt.
 deg)&&this.setBox(this.attrs)),this},br[r].toFront=function(){return!this.removed&&this.Group.parentNode[h](this.Group),this.paper.top!=this&&bd(this,this.paper),this},br[r].toBack=function(){return this.removed?this:(this.Group.parentNode.firstChild!=this.Group&&(this.Group.parentNode.insertBefore(this.Group,this.Group.parentNode.firstChild),be(this,this.paper)),this)},br[r].insertAfter=function(a){return this.removed?this:(a.Group.nextSibling?a.Group.parentNode.insertBefore(this.Group,a.Group.nextSibling):a.Group.parentNode[h](this.Group),bf(this,a,this.paper),this)},br[r].insertBefore=function(a){return this.removed?this:(a.Group.parentNode.insertBefore(this.Group,a.Group),bg(this,a,this.paper),this)};var bs=function(a,b,c,d){var e=bA("group"),f=bA("oval"),g=f.style;e.style.cssText="position:absolute;left:0;top:0;width:"+a.width+"px;height:"+a.height+"px",e.coordsize=a.coordsize,e.coordorigin=a.coordorigin,e[h](f);var i=new br(f,e,a);return i.type="circle",bo(i,{stroke:"#000",fil
 l:"none"}),i.attrs.cx=b,i.attrs.cy=c,i.attrs.r=d,i.setBox({x:b-d,y:c-d,width:d*2,height:d*2}),a.canvas[h](e),i},bt=function(a,b,c,d,e,f){var g=bA("group"),i=bA("roundrect"),j=(+f||0)/v(d,e);g.style.cssText="position:absolute;left:0;top:0;width:"+a.width+"px;height:"+a.height+"px",g.coordsize=a.coordsize,g.coordorigin=a.coordorigin,g[h](i),i.arcsize=j;var k=new br(i,g,a);return k.type="rect",bo(k,{stroke:"#000"}),k.arcsize=j,k.setBox({x:b,y:c,width:d,height:e,r:f}),a.canvas[h](g),k},bu=function(a,b,c,d,e){var f=bA("group"),g=bA("oval"),i=g.style;f.style.cssText="position:absolute;left:0;top:0;width:"+a.width+"px;height:"+a.height+"px",f.coordsize=a.coordsize,f.coordorigin=a.coordorigin,f[h](g);var j=new br(g,f,a);return j.type="ellipse",bo(j,{stroke:"#000"}),j.attrs.cx=b,j.attrs.cy=c,j.attrs.rx=d,j.attrs.ry=e,j.setBox({x:b-d,y:c-e,width:d*2,height:e*2}),a.canvas[h](f),j},bv=function(a,b,c,d,e,f){var g=bA("group"),i=bA("image"),j=i.style;g.style.cssText="position:absolute;left:0;top:0
 ;width:"+a.width+"px;height:"+a.height+"px",g.coordsize=a.coordsize,g.coordorigin=a.coordorigin,i.src=b,g[h](i);var k=new br(i,g,a);return k.type="image",k.attrs.src=b,k.attrs.x=c,k.attrs.y=d,k.attrs.w=e,k.attrs.h=f,k.setBox({x:c,y:d,width:e,height:f}),a.canvas[h](g),k},bw=function(a,b,c,d){var e=bA("group"),g=bA("shape"),i=g.style,j=bA("path"),l=j.style,m=bA("textpath");e.style.cssText="position:absolute;left:0;top:0;width:"+a.width+"px;height:"+a.height+"px",e.coordsize=a.coordsize,e.coordorigin=a.coordorigin,j.v=f.format("m{0},{1}l{2},{1}",F(b),F(c),F(b)+1),j.textpathok=!0,i.width=a.width,i.height=a.height,m.string=d+k,m.on=!0,g[h](m),g[h](j),e[h](g);var n=new br(m,e,a);return n.shape=g,n.textpath=j,n.type="text",n.attrs.text=d,n.attrs.x=b,n.attrs.y=c,n.attrs.w=1,n.attrs.h=1,bo(n,{font:K.font,stroke:"none",fill:"#000"}),n.setBox(),a.canvas[h](e),n},bx=function(a,b){var c=this.canvas.style;return a==+a&&(a+="px"),b==+b&&(b+="px"),c.width=a,c.height=b,c.clip="rect(0 "+a+" "+b+" 0)"
 ,this},bA;c.createStyleSheet().addRule(".rvml","behavior:url(#default#VML)");try{!c.namespaces.rvml&&c.namespaces.add("rvml","urn:schemas-microsoft-com:vml"),bA=function(a){return c.createElement("<rvml:"+a+' class="rvml">')}}catch(bB){bA=function(a){return c.createElement("<"+a+' xmlns="urn:schemas-microsoft.com:vml" class="rvml">')}}var by=function(){var a=ba[i](null,arguments),b=a.container,d=a.height,e,j=a.width,k=a.x,l=a.y;if(!b)throw new Error("VML container not found.");var m=new g,n=m.canvas=c.createElement("div"),o=n.style;return j=j||512,d=d||342,j==+j&&(j+="px"),d==+d&&(d+="px"),m.width=1e3,m.height=1e3,m.coordsize="1000 1000",m.coordorigin="0 0",m.span=c.createElement("span"),m.span.style.cssText="position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;display:inline;",n[h](m.span),o.cssText=f.format("width:{0};height:{1};position:absolute;clip:rect(0 {0} {1} 0);overflow:hidden",j,d),b==1?(c.body[h](n),o.left=k+"px",o.top=l+"px"):(b.style.width=j,b.st
 yle.height=d,b.firstChild?b.insertBefore(n,b.firstChild):b[h](n)),bb.call(m,m,f.fn),m};g[r].clear=function(){this.canvas.innerHTML=k,this.span=c.createElement("span"),this.span.style.cssText="position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;display:inline;",this.canvas[h](this.span),this.bottom=this.top=null},g[r].remove=function(){this.canvas.parentNode.removeChild(this.canvas);for(var a in this)this[a]=bh(a)}}/^Apple|^Google/.test(navigator.vendor)&&!(navigator.userAgent.indexOf("Version/4.0")+1)?g[r].safari=function(){var a=this.rect(-99,-99,this.width+99,this.height+99);setTimeout(function(){a.remove()})}:g[r].safari=function(){};var bC=function(){if(c.addEventListener)return function(a,b,c,d){var e=function(a){return c.call(d,a)};return a.addEventListener(b,e,!1),function(){return a.removeEventListener(b,e,!1),!0}};if(c.attachEvent)return function(a,b,c,e){var f=function(a){return c.call(e,a||d.event)};a.attachEvent("on"+b,f);var g=function(){return a
 .detachEvent("on"+b,f),!0};return g}}();for(var bD=n[q];bD--;)(function(a){br[r][a]=function(b){return f.is(b,"function")&&(this.events=this.events||[],this.events.push({name:a,f:b,unbind:bC(this.shape||this.node,a,b,this)})),this},br[r]["un"+a]=function(b){var c=this.events,d=c[q];while(d--)if(c[d].name==a&&c[d].f==b)return c[d].unbind(),c.splice(d,1),!c.length&&delete this.events,this;return this}})(n[bD]);br[r].hover=function(a,b){return this.mouseover(a).mouseout(b)},br[r].unhover=function(a,b){return this.unmouseover(a).unmouseout(b)},g[r].circle=function(a,b,c){return bs(this,a||0,b||0,c||0)},g[r].rect=function(a,b,c,d,e){return bt(this,a||0,b||0,c||0,d||0,e||0)},g[r].ellipse=function(a,b,c,d){return bu(this,a||0,b||0,c||0,d||0)},g[r].path=function(a){return a&&!f.is(a,"string")&&!f.is(a[0],"array")&&(a+=k),bl(f.format[i](f,arguments),this)},g[r].image=function(a,b,c,d,e){return bv(this,a||"about:blank",b||0,c||0,d||0,e||0)},g[r].text=function(a,b,c){return bw(this,a||0,b||0,c
 ||k)},g[r].set=function(a){return arguments[q]>1&&(a=Array[r].splice.call(arguments,0,arguments[q])),new bP(a)},g[r].setSize=bx,g[r].top=g[r].bottom=null,g[r].raphael=f,br[r].scale=function(a,b,c,d){if(a==null&&b==null)return{x:this._.sx,y:this._.sy,toString:bE};b=b||a,!+b&&(b=a);var e,f,g,h,i=this.attrs;if(a!=0){var m=this.getBBox(),n=m.x+m.width/2,o=m.y+m.height/2,r=a/this._.sx,s=b/this._.sy;c=+c||c==0?c:n,d=+d||d==0?d:o;var u=~~(a/t.abs(a)),w=~~(b/t.abs(b)),x=this.node.style,y=c+(n-c)*r,z=d+(o-d)*s;switch(this.type){case"rect":case"image":var A=i.width*u*r,B=i.height*w*s;this.attr({height:B,r:i.r*v(u*r,w*s),width:A,x:y-A/2,y:z-B/2});break;case"circle":case"ellipse":this.attr({rx:i.rx*u*r,ry:i.ry*w*s,r:i.r*v(u*r,w*s),cx:y,cy:z});break;case"path":var C=T(i.path),D=!0;for(var E=0,F=C[q];E<F;E++){var H=C[E],I,K=J.call(H[0]);if(K=="M"&&D)continue;D=!1;if(K=="A")H[C[E][q]-2]*=r,H[C[E][q]-1]*=s,H[1]*=u*r,H[2]*=w*s,H[5]=+(u+w?!!+H[5]:!+H[5]);else if(K=="H")for(I=1,jj=H[q];I<jj;I++)H[I]*=
 r;else if(K=="V")for(I=1,jj=H[q];I<jj;I++)H[I]*=s;else for(I=1,jj=H[q];I<jj;I++)H[I]*=I%2?r:s}var L=R(C),e=y-L.x-L.width/2,f=z-L.y-L.height/2;C[0][1]+=e,C[0][2]+=f,this.attr({path:C})}this.type in{text:1,image:1}&&(u!=1||w!=1)?this.transformations?(this.transformations[2]="scale("[j](u,",",w,")"),this.node[G]("transform",this.transformations[p](l)),e=u==-1?-i.x-(A||0):i.x,f=w==-1?-i.y-(B||0):i.y,this.attr({x:e,y:f}),i.fx=u-1,i.fy=w-1):(this.node.filterMatrix=" progid:DXImageTransform.Microsoft.Matrix(M11="[j](u,", M12=0, M21=0, M22=",w,", Dx=0, Dy=0, sizingmethod='auto expand', filtertype='bilinear')"),x.filter=(this.node.filterMatrix||k)+(this.node.filterOpacity||k)):this.transformations?(this.transformations[2]=k,this.node[G]("transform",this.transformations[p](l)),i.fx=0,i.fy=0):(this.node.filterMatrix=k,x.filter=(this.node.filterMatrix||k)+(this.node.filterOpacity||k)),i.scale=[a,b,c,d][p](l),this._.sx=a,this._.sy=b}return this},br[r].clone=function(){var a=this.attr();return de
 lete a.scale,delete a.translation,this.paper[this.type]().attr(a)};var bF=function(a,b){return function(c,d,e){c=$(c);var g,h,i,j,k="",l={},m,n=0;for(var o=0,q=c.length;o<q;o++){i=c[o];if(i[0]=="M")g=+i[1],h=+i[2];else{j=bG(g,h,i[1],i[2],i[3],i[4],i[5],i[6]);if(n+j>d){if(b&&!l.start){m=f.findDotsAtSegment(g,h,i[1],i[2],i[3],i[4],i[5],i[6],(d-n)/j),k+=["C",m.start.x,m.start.y,m.m.x,m.m.y,m.x,m.y];if(e)return k;l.start=k,k=["M",m.x,m.y+"C",m.n.x,m.n.y,m.end.x,m.end.y,i[5],i[6]][p](),n+=j,g=+i[5],h=+i[6];continue}if(!a&&!b)return m=f.findDotsAtSegment(g,h,i[1],i[2],i[3],i[4],i[5],i[6],(d-n)/j),{x:m.x,y:m.y,alpha:m.alpha}}n+=j,g=+i[5],h=+i[6]}k+=i}return l.end=k,m=a?n:b?l:f.findDotsAtSegment(g,h,i[1],i[2],i[3],i[4],i[5],i[6],1),m.alpha&&(m={x:m.x,y:m.y,alpha:m.alpha}),m}},bG=Q(function(a,b,c,d,e,f,g,h){var i={x:0,y:0},j=0;for(var k=0;k<1.01;k+=.01){var l=Y(a,b,c,d,e,f,g,h,k);k&&(j+=t.sqrt(A(i.x-l.x,2)+A(i.y-l.y,2))),i=l}return j}),bH=bF(1),bI=bF(),bJ=bF(0,1);br[r].getTotalLength=functio
 n(){if(this.type!="path")return;return bH(this.attrs.path)},br[r].getPointAtLength=function(a){if(this.type!="path")return;return bI(this.attrs.path,a)},br[r].getSubpath=function(a,b){if(this.type!="path")return;if(t.abs(this.getTotalLength()-b)<1e-6)return bJ(this.attrs.path,a).end;var c=bJ(this.attrs.path,b,1);return a?bJ(c,a).end:c},f.easing_formulas={linear:function(a){return a},"<":function(a){return A(a,3)},">":function(a){return A(a-1,3)+1},"<>":function(a){return a*=2,a<1?A(a,3)/2:(a-=2,(A(a,3)+2)/2)},backIn:function(a){var b=1.70158;return a*a*((b+1)*a-b)},backOut:function(a){a-=1;var b=1.70158;return a*a*((b+1)*a+b)+1},elastic:function(a){if(a==0||a==1)return a;var b=.3,c=b/4;return A(2,-10*a)*t.sin((a-c)*2*t.PI/b)+1},bounce:function(a){var b=7.5625,c=2.75,d;return a<1/c?d=b*a*a:a<2/c?(a-=1.5/c,d=b*a*a+.75):a<2.5/c?(a-=2.25/c,d=b*a*a+.9375):(a-=2.625/c,d=b*a*a+.984375),d}};var bK={length:0},bL=function(){var a=+(new Date);for(var b in bK)if(b!="length"&&bK[o](b)){var c=bK[
 b];if(c.stop){delete bK[b],bK[q]--;continue}var d=a-c.start,e=c.ms,g=c.easing,h=c.from,i=c.diff,j=c.to,m=c.t,n=c.prev||0,r=c.el,s=c.callback,t={},u;if(d<e){var v=f.easing_formulas[g]?f.easing_formulas[g](d/e):d/e;for(var w in h)if(h[o](w)){switch(L[w]){case"along":u=v*e*i[w],j.back&&(u=j.len-u);var x=bI(j[w],u);r.translate(i.sx-i.x||0,i.sy-i.y||0),i.x=x.x,i.y=x.y,r.translate(x.x-i.sx,x.y-i.sy),j.rot&&r.rotate(i.r+x.alpha,x.x,x.y);break;case"number":u=+h[w]+v*e*i[w];break;case"colour":u="rgb("+[bM(F(h[w].r+v*e*i[w].r)),bM(F(h[w].g+v*e*i[w].g)),bM(F(h[w].b+v*e*i[w].b))][p](",")+")";break;case"path":u=[];for(var y=0,z=h[w][q];y<z;y++){u[y]=[h[w][y][0]];for(var A=1,B=h[w][y][q];A<B;A++)u[y][A]=+h[w][y][A]+v*e*i[w][y][A];u[y]=u[y][p](l)}u=u[p](l);break;case"csv":switch(w){case"translation":var C=i[w][0]*(d-n),D=i[w][1]*(d-n);m.x+=C,m.y+=D,u=C+l+D;break;case"rotation":u=+h[w][0]+v*e*i[w][0],h[w][1]&&(u+=","+h[w][1]+","+h[w][2]);break;case"scale":u=[+h[w][0]+v*e*i[w][0],+h[w][1]+v*e*i[w][1
 ],2 in j[w]?j[w][2]:k,3 in j[w]?j[w][3]:k][p](l);break;case"clip-rect":u=[];var y=4;while(y--)u[y]=+h[w][y]+v*e*i[w][y]}}t[w]=u}r.attr(t),r._run&&r._run.call(r)}else{if(j.along){var x=bI(j.along,j.len*!j.back);r.translate(i.sx-(i.x||0)+x.x-i.sx,i.sy-(i.y||0)+x.y-i.sy),j.rot&&r.rotate(i.r+x.alpha,x.x,x.y)}(m.x||m.y)&&r.translate(-m.x,-m.y),j.scale&&(j.scale=j.scale+k),r.attr(j),delete bK[b],bK[q]--,r.in_animation=null,f.is(s,"function")&&s.call(r)}c.prev=d}f.svg&&r&&r.paper.safari(),bK[q]&&setTimeout(bL)},bM=function(a){return a>255?255:a<0?0:a},bN=function(a,b){if(a==null)return{x:this._.tx,y:this._.ty,toString:bE};this._.tx+=+a,this._.ty+=+b;switch(this.type){case"circle":case"ellipse":this.attr({cx:+a+this.attrs.cx,cy:+b+this.attrs.cy});break;case"rect":case"image":case"text":this.attr({x:+a+this.attrs.x,y:+b+this.attrs.y});break;case"path":var c=T(this.attrs.path);c[0][1]+=+a,c[0][2]+=+b,this.attr({path:c})}return this};br[r].animateWith=function(a,b,c,d,e){return bK[a.id]&&(b.st
 art=bK[a.id].start),this.animate(b,c,d,e)},br[r].animateAlong=bO(),br[r].animateAlongBack=bO(1),br[r].onAnimation=function(a){return this._run=a||0,this},br[r].animate=function(b,c,d,e){if(f.is(d,"function")||!d)e=d||null;var g={},h={},i={};for(var j in b)if(b[o](j)&&L[o](j)){g[j]=this.attr(j),g[j]==null&&(g[j]=K[j]),h[j]=b[j];switch(L[j]){case"along":var l=bH(b[j]),n=bI(b[j],l*!!b.back),p=this.getBBox();i[j]=l/c,i.tx=p.x,i.ty=p.y,i.sx=n.x,i.sy=n.y,h.rot=b.rot,h.back=b.back,h.len=l,b.rot&&(i.r=H(this.rotate())||0);break;case"number":i[j]=(h[j]-g[j])/c;break;case"colour":g[j]=f.getRGB(g[j]);var r=f.getRGB(h[j]);i[j]={r:(r.r-g[j].r)/c,g:(r.g-g[j].g)/c,b:(r.b-g[j].b)/c};break;case"path":var s=$(g[j],h[j]);g[j]=s[0];var t=s[1];i[j]=[];for(var u=0,v=g[j][q];u<v;u++){i[j][u]=[0];for(var w=1,x=g[j][u][q];w<x;w++)i[j][u][w]=(t[u][w]-g[j][u][w])/c}break;case"csv":var y=(b[j]+k)[m](a),z=(g[j]+k)[m](a);switch(j){case"translation":g[j]=[0,0],i[j]=[y[0]/c,y[1]/c];break;case"rotation":g[j]=z[1]==
 y[1]&&z[2]==y[2]?z:[0,y[1],y[2]],i[j]=[(y[0]-g[j][0])/c,0,0];break;case"scale":b[j]=y,g[j]=(g[j]+k)[m](a),i[j]=[(y[0]-g[j][0])/c,(y[1]-g[j][1])/c,0,0];break;case"clip-rect":g[j]=(g[j]+k)[m](a),i[j]=[];var u=4;while(u--)i[j][u]=(y[u]-g[j][u])/c}h[j]=y}}return this.stop(),this.in_animation=1,bK[this.id]={start:b.start||+(new Date),ms:c,easing:d,from:g,diff:i,to:h,el:this,callback:e,t:{x:0,y:0}},++bK[q]==1&&bL(),this},br[r].stop=function(){return bK[this.id]&&bK[q]--,delete bK[this.id],this},br[r].translate=function(a,b){return this.attr({translation:a+" "+b})},br[r][x]=function(){return"Raphaël’s object"},f.ae=bK;var bP=function(a){this.items=[],this[q]=0;if(a)for(var b=0,c=a[q];b<c;b++)a[b]&&(a[b].constructor==br||a[b].constructor==bP)&&(this[this.items[q]]=this.items[this.items[q]]=a[b],this[q]++)};bP[r][B]=function(){var a,b;for(var c=0,d=arguments[q];c<d;c++)a=arguments[c],a&&(a.constructor==br||a.constructor==bP)&&(b=this.items[q],this[b]=this.items[b]=a,this[q]++);return this
 },bP[r].pop=function(){return delete this[this[q]--],this.items.pop()};for(var bQ in br[r])br[r][o](bQ)&&(bP[r][bQ]=function(a){return function(){for(var b=0,c=this.items[q];b<c;b++)this.items[b][a][i](this.items[b],arguments);return this}}(bQ));return bP[r].attr=function(a,b){if(a&&f.is(a,"array")&&f.is(a[0],"object"))for(var c=0,d=a[q];c<d;c++)this.items[c].attr(a[c]);else for(var e=0,g=this.items[q];e<g;e++)this.items[e].attr[i](this.items[e],arguments);return this},bP[r].animate=function(a,b,c,d){(f.is(c,"function")||!c)&&(d=c||null);var e=this.items[q],g=e,h=this,i;d&&(i=function(){!--e&&d.call(h)}),this.items[--g].animate(a,b,c||i,i);while(g--)this.items[g].animateWith(this.items[e-1],a,b,c||i,i);return this},bP[r].insertAfter=function(a){var b=this.items[q];while(b--)this.items[b].insertAfter(a);return this},bP[r].getBBox=function(){var a=[],b=[],c=[],d=[];for(var e=this.items[q];e--;){var f=this.items[e].getBBox();a[B](f.x),b[B](f.y),c[B](f.x+f.width),d[B](f.y+f.height)}retu
 rn a=v[i](0,a),b=v[i](0,b),{x:a,y:b,width:u[i](0,c)-a,height:u[i](0,d)-b}},f.registerFont=function(a){if(!a.face)return a;this.fonts=this.fonts||{};var b={w:a.w,face:{},glyphs:{}},c=a.face["font-family"];for(var d in a.face)a.face[o](d)&&(b.face[d]=a.face[d]);this.fonts[c]?this.fonts[c][B](b):this.fonts[c]=[b];if(!a.svg){b.face["units-per-em"]=I(a.face["units-per-em"],10);for(var e in a.glyphs)if(a.glyphs[o](e)){var f=a.glyphs[e];b.glyphs[e]={w:f.w,k:{},d:f.d&&"M"+f.d[M](/[mlcxtrv]/g,function(a){return{l:"L",c:"C",x:"z",t:"m",r:"l",v:"c"}[a]||"M"})+"z"};if(f.k)for(var g in f.k)f[o](g)&&(b.glyphs[e].k[g]=f.k[g])}}return a},g[r].getFont=function(a,b,c,d){d=d||"normal",c=c||"normal",b=+b||{normal:400,bold:700,lighter:300,bolder:800}[b]||400;var e=f.fonts[a];if(!e){var g=new RegExp("(^|\\s)"+a[M](/[^\w\d\s+!~.:_-]/g,k)+"(\\s|$)","i");for(var h in f.fonts)if(f.fonts[o](h)&&g.test(h)){e=f.fonts[h];break}}var i;if(e)for(var j=0,l=e[q];j<l;j++){i=e[j];if(i.face["font-weight"]==b&&(i.face["f
 ont-style"]==c||!i.face["font-style"])&&i.face["font-stretch"]==d)break}return i},g[r].print=function(b,c,d,e,g,h){h=h||"middle";var i=this.set(),j=(d+k)[m](k),l=0,n=k,o;f.is(e,"string")&&(e=this.getFont(e));if(e){o=(g||16)/e.face["units-per-em"];var p=e.face.bbox.split(a),r=+p[0],s=+p[1]+(h=="baseline"?p[3]-p[1]+ +e.face.descent:(p[3]-p[1])/2);for(var t=0,u=j[q];t<u;t++){var v=t&&e.glyphs[j[t-1]]||{},w=e.glyphs[j[t]];l+=t?(v.w||e.w)+(v.k&&v.k[j[t]]||0):0,w&&w.d&&i[B](this.path(w.d).attr({fill:"#000",stroke:"none",translation:[l,0]}))}i.scale(o,o,r,s).translate(b-r,c-s)}return i},f.format=function(a){var b=f.is(arguments[1],"array")?[0][j](arguments[1]):arguments,c=/\{(\d+)\}/g;return a&&f.is(a,"string")&&b[q]-1&&(a=a[M](c,function(a,c){return b[++c]==null?k:b[c]})),a||k},f.ninja=function(){var a=Raphael;return e.was?Raphael=e.is:delete Raphael,a},f.el=br[r],f}();var Graph=function(){this.nodes=[],this.nodelist=[],this.edges=[],this.snapshots=[]};Graph.prototype={addNode:function(a,
 b){return this.nodes[a]==undefined&&(this.nodes[a]=new Graph.Node(a,b||{id:a}),this.nodelist.push(this.nodes[a])),this.nodes[a]},addEdge:function(a,b,c){var d=this.addNode(a),e=this.addNode(b),f={source:d,target:e,style:c,weight:c&&c.weight||1};d.edges.push(f),this.edges.push(f);if(!c||!c.directed){var g={source:e,target:d,style:c,weight:c&&c.weight||1,backedge:f};this.edges.push(g),e.edges.push(g)}},snapShot:function(a,b){var c=new Graph;jQuery.extend(!0,c.nodes,this.nodes),jQuery.extend(!0,c.nodelist,this.nodelist),jQuery.extend(!0,c.edges,this.edges),c.snapShot=null,this.snapshots.push({comment:a,graph:c})}},Graph.Node=function(a,b){return b.id=a,b.edges=[],b},Graph.Node.prototype={},Graph.Renderer={},Graph.Renderer.Raphael=function(a,b,c,d,e){this.width=c||400,this.height=d||400;var f=this;this.r=Raphael(a,this.width,this.height),this.radius=e&&e.noderadius?e.noderadius:40,this.graph=b,this.mouse_in=!1,this.graph.render||(this.graph.render=function(){return}),this.isDrag=!1,this
 .dragger=function(a){this.dx=a.clientX,this.dy=a.clientY,f.isDrag=this,this.set&&this.set.animate({"fill-opacity":.1},200)&&this.set.toFront(),a.preventDefault&&a.preventDefault()},document.onmousemove=function(a){a=a||window.event;if(f.isDrag){var b=f.isDrag.set.getBBox(),c=a.clientX-f.isDrag.dx+(b.x+b.width/2),d=a.clientY-f.isDrag.dy+(b.y+b.height/2),e=a.clientX-(c<20?c-20:c>f.width-20?c-f.width+20:0),g=a.clientY-(d<20?d-20:d>f.height-20?d-f.height+20:0);f.isDrag.set.translate(e-f.isDrag.dx,g-f.isDrag.dy);for(var h in f.graph.edges)f.graph.edges[h].connection&&f.graph.edges[h].connection.draw();f.isDrag.dx=e,f.isDrag.dy=g}},document.onmouseup=function(){f.isDrag&&f.isDrag.set.animate({"fill-opacity":.6},500),f.isDrag=!1}},Graph.Renderer.Raphael.prototype={translate:function(a){return[Math.round((a[0]-this.graph.layoutMinX)*this.factorX+this.radius),Math.round((a[1]-this.graph.layoutMinY)*this.factorY+this.radius)]},rotate:function(a,b,c){var d=b*Math.cos(c),e=b*Math.sin(c);return[
 a[0]+d,a[1]+e]},draw:function(){this.factorX=(this.width-10*this.radius)/(this.graph.layoutMaxX-this.graph.layoutMinX),this.factorY=(this.height-15*this.radius)/(this.graph.layoutMaxY-this.graph.layoutMinY);for(a in this.graph.nodes)this.drawNode(this.graph.nodes[a]);for(var a=0;a<this.graph.edges.length;a++)this.drawEdge(this.graph.edges[a])},drawNode:function(a){var b=this.translate([a.layoutPosX,a.layoutPosY]);a.point=b;if(a.shape){var c=a.shape.getBBox(),d=[c.x+Math.round(c.width/2),c.y+Math.round(c.height/2)];a.shape.translate(b[0]-d[0],b[1]-d[1]),this.r.safari();return}var e;if(a.render)e=a.render(this.r,a);else if(!a.shape){var f=Raphael.getColor();e=this.r.set().push(this.r.ellipse(b[0],b[1],30,20).attr({fill:f,stroke:f,"stroke-width":2})).push(this.r.text(b[0],b[1]+30,a.label||a.id))}e.attr({"fill-opacity":.6}),e.items.forEach(function(a){a.set=e,a.node.style.cursor="pointer"}),e.mousedown(this.dragger),a.shape=e},drawEdge:function(a){if(a.backedge)return;a.connection&&a.co
 nnection.draw(),a.connection||(a.style&&a.style.callback&&a.style.callback(a),a.connection=this.r.connection(a.source.shape,a.target.shape,a.style))}},Graph.Layout={},Graph.Layout.Spring=function(a){this.graph=a,this.iterations=500,this.maxRepulsiveForceDistance=6,this.k=2,this.c=.01,this.maxVertexMovement=.5},Graph.Layout.Spring.prototype={layout:function(){this.layoutPrepare();for(var a=0;a<this.iterations;a++)this.layoutIteration();this.layoutCalcBounds()},layoutPrepare:function(){for(i in this.graph.nodes){var a=this.graph.nodes[i];a.layoutPosX=0,a.layoutPosY=0,a.layoutForceX=0,a.layoutForceY=0}},layoutCalcBounds:function(){var a=Infinity,b=-Infinity,c=Infinity,d=-Infinity;for(i in this.graph.nodes){var e=this.graph.nodes[i].layoutPosX,f=this.graph.nodes[i].layoutPosY;e>b&&(b=e),e<a&&(a=e),f>d&&(d=f),f<c&&(c=f)}this.graph.layoutMinX=a,this.graph.layoutMaxX=b,this.graph.layoutMinY=c,this.graph.layoutMaxY=d},layoutIteration:function(){for(var a=0;a<this.graph.nodelist.length;a++){
 var b=this.graph.nodelist[a];for(var c=a+1;c<this.graph.nodelist.length;c++){var d=this.graph.nodelist[c];this.layoutRepulsive(b,d)}}for(var a=0;a<this.graph.edges.length;a++){var e=this.graph.edges[a];this.layoutAttractive(e)}for(a in this.graph.nodes){var f=this.graph.nodes[a],g=this.c*f.layoutForceX,h=this.c*f.layoutForceY,i=this.maxVertexMovement;g>i&&(g=i),g<-i&&(g=-i),h>i&&(h=i),h<-i&&(h=-i),f.layoutPosX+=g,f.layoutPosY+=h,f.layoutForceX=0,f.layoutForceY=0}},layoutRepulsive:function(a,b){var c=b.layoutPosX-a.layoutPosX,d=b.layoutPosY-a.layoutPosY,e=c*c+d*d;if(e<.01){c=.1*Math.random()+.1,d=.1*Math.random()+.1;var e=c*c+d*d}var f=Math.sqrt(e);if(f<this.maxRepulsiveForceDistance){var g=this.k*this.k/f;b.layoutForceX+=g*c/f,b.layoutForceY+=g*d/f,a.layoutForceX-=g*c/f,a.layoutForceY-=g*d/f}},layoutAttractive:function(a){var b=a.source,c=a.target,d=c.layoutPosX-b.layoutPosX,e=c.layoutPosY-b.layoutPosY,f=d*d+e*e;if(f<.01){d=.1*Math.random()+.1,e=.1*Math.random()+.1;var f=d*d+e*e}var
  g=Math.sqrt(f);g>this.maxRepulsiveForceDistance&&(g=this.maxRepulsiveForceDistance,f=g*g);var h=(f-this.k*this.k)/this.k;a.attraction==undefined&&(a.attraction=1),h*=Math.log(a.attraction)*.5+1,c.layoutForceX-=h*d/g,c.layoutForceY-=h*e/g,b.layoutForceX+=h*d/g,b.layoutForceY+=h*e/g}},Raphael.el.tooltip=function(a){return this.tp=a,this.tp.o={x:0,y:0},this.tp.hide(),this.hover(function(a){this.mousemove(function(a){this.tp.translate(a.clientX-this.tp.o.x,a.clientY-this.tp.o.y),this.tp.o={x:a.clientX,y:a.clientY}}),this.tp.show().toFront()},function(a){this.tp.hide(),this.unmousemove()}),this},Raphael.fn.connection=function(a,b,c){var d=this,e={draw:function(){var f=a.getBBox(),g=b.getBBox(),h=0,i=0,j=[{x:f.x+f.width/2,y:f.y-h},{x:f.x+f.width/2,y:f.y+f.height+h},{x:f.x-h,y:f.y+f.height/2},{x:f.x+f.width+h,y:f.y+f.height/2},{x:g.x+g.width/2,y:g.y-i},{x:g.x+g.width/2,y:g.y+g.height+i},{x:g.x-i,y:g.y+g.height/2},{x:g.x+g.width+i,y:g.y+g.height/2}],k={},l=[];for(var m=0;m<4;m++)for(var n=
 4;n<8;n++){var o=Math.abs(j[m].x-j[n].x),p=Math.abs(j[m].y-j[n].y);if(m==n-4||(m!=3&&n!=6||j[m].x<j[n].x)&&(m!=2&&n!=7||j[m].x>j[n].x)&&(m!=0&&n!=5||j[m].y>j[n].y)&&(m!=1&&n!=4||j[m].y<j[n].y))l.push(o+p),k[l[l.length-1].toFixed(3)]=[m,n]}var q=l.length==0?[0,4]:k[Math.min.apply(Math,l).toFixed(3)],r=j[q[0]].x,s=j[q[0]].y,t=j[q[1]].x,u=j[q[1]].y,o=Math.max(Math.abs(r-t)/2,10),p=Math.max(Math.abs(s-u)/2,10),v=[r,r,r-o,r+o][q[0]].toFixed(3),w=[s-p,s+p,s,s][q[0]].toFixed(3),x=[0,0,0,0,t,t,t-o,t+o][q[1]].toFixed(3),y=[0,0,0,0,s+p,s-p,u,u][q[1]].toFixed(3),z=["M",r.toFixed(3),s.toFixed(3),"C",v,w,x,y,t.toFixed(3),u.toFixed(3)].join(",");if(c&&c.directed){var A=Math.sqrt((u-y)*(u-y)+(t-x)*(t-x)),B=function(a,b){return-a*(b||5)/A},C=[{x:(B(t-x)+B(u-y)+t).toFixed(3),y:(B(u-y)+B(t-x)+u).toFixed(3)},{x:(B(t-x)-B(u-y)+t).toFixed(3),y:(B(u-y)-B(t-x)+u).toFixed(3)}];z=z+",M"+C[0].x+","+C[0].y+",L"+t+","+u+",L"+C[1].x+","+C[1].y}e.fg&&e.fg.attr({path:z})||(e.fg=d.path(z).attr({stroke:c&&c.stroke|
 |"#000",fill:"none"}).toBack()),e.bg&&e.bg.attr({path:z})||c&&c.fill&&(e.bg=c.fill.split&&d.path(z).attr({stroke:c.fill,fill:"none","stroke-width":c.width||3}).toBack()),c&&c.label&&(e.label&&e.label.attr({x:(r+t)/2,y:(s+u)/2})||(e.label=d.text((r+t)/2,(s+u)/2,c.label).attr({fill:"#000","font-size":c.fontsize||"12px"})))}};return e.draw(),e};
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/extras/webjars/sgvizler/src/main/resources/sgvizler.chart.css
----------------------------------------------------------------------
diff --git a/extras/webjars/sgvizler/src/main/resources/sgvizler.chart.css b/extras/webjars/sgvizler/src/main/resources/sgvizler.chart.css
new file mode 100644
index 0000000..3f0026e
--- /dev/null
+++ b/extras/webjars/sgvizler/src/main/resources/sgvizler.chart.css
@@ -0,0 +1,37 @@
+
+/*** sMap ***/
+
+div.sgvizler-sMap{
+    padding: 0;
+    margin: 0;
+    font-family: sans-serif;
+}
+div.sgvizler-sMap h1, div.sgvizler-sMap p{
+    font-size: 11pt;
+    margin: 2px 0 1px 0;
+}
+div.sgvizler-sMap p.text{
+    font-family: serif;
+}
+div.sgvizler-sMap div.img{
+    float: right;
+    padding: 10px;
+}
+
+/*** pForce ***/
+
+circle.node {
+  stroke: #999;
+  stroke-width: 0.5px;
+}
+
+line.link {
+  stroke: #999;
+  stroke-opacity: .6;
+}
+
+.nodetext { 
+    pointer-events: none; 
+    font: 10px sans-serif; 
+    color: black;
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/extras/webjars/sgvizler/src/main/resources/sgvizler.html
----------------------------------------------------------------------
diff --git a/extras/webjars/sgvizler/src/main/resources/sgvizler.html b/extras/webjars/sgvizler/src/main/resources/sgvizler.html
new file mode 100644
index 0000000..a5e52a8
--- /dev/null
+++ b/extras/webjars/sgvizler/src/main/resources/sgvizler.html
@@ -0,0 +1,114 @@
+<!DOCTYPE HTML>
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <title>Sgvizler</title>
+    <meta charset="UTF-8"/>
+    <link rel="shortcut icon" href="http://sgvizler.googlecode.com/svn/www/favicon.ico" />
+    <link rel="stylesheet" type="text/css" href="http://sgvizler.googlecode.com/svn/www/sgvizler.css" />
+    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
+    <script type="text/javascript" src="https://www.google.com/jsapi"></script>
+    <script type="text/javascript" id="sgvzlr_script" src="http://sgvizler.googlecode.com/svn/release/0.5/sgvizler.js"></script>
+    <script type="text/javascript">
+      // CONFIGURATION Sgvizler 0.5: Set variables to fit your setup.
+      // NB! Do not let the last item in a list end with a comma.
+
+       //// Query settings. The defaults settings are listed.
+       sgvizler.option.query = {
+           // Default query. 
+           //'query':                "SELECT ?class (count(?instance) AS ?noOfInstances)\nWHERE{ ?instance a ?class }\nGROUP BY ?class\nORDER BY ?class",
+    
+           // Endpoint URL. 
+           //'endpoint':             "http://sws.ifi.uio.no/sparql/world",
+    
+           // Endpoint output format. 
+           //'endpoint_output':      'json',  // 'xml', 'json' or 'jsonp'
+    
+           // This string is appended the 'endpoint' variable and the query to it again to give a link to the "raw" query results.
+           //'endpoint_query_url':   "?output=text&amp;query=",
+    
+           // URL to SPARQL validation service. The query is appended to it. 
+           //'validator_query_url':  "http://www.sparql.org/query-validator?languageSyntax=SPARQL&amp;outputFormat=sparql&amp;linenumbers=true&amp;query=",
+    
+           // Default chart type. 
+           //'chart':                'gLineChart',
+    
+           // Default log level. Must be either 0, 1, or 2. 
+           //'loglevel':             2
+       };
+
+       //// Prefixes
+       // Add convenient prefixes for your dataset. rdf, rdfs, xsd, owl
+       // are already set.  Examples: 
+       sgvizler.option.namespace['wd'] = 'http://sws.ifi.uio.no/d2rq/resource/';
+       sgvizler.option.namespace['w']  = 'http://sws.ifi.uio.no/ont/world.owl#';
+
+       //// Your chart drawing preferences. The defaults are listed.
+       // See the Google visualization API for available options for
+       // Google charts, and the Sgvizler homepage for other
+       // options. Options applicable to all charts are put in the
+       // "root" of sgvizler.chartOptions. Chart specific options are
+       // put in a "child" with the chart's id as name,
+       // e.g. 'gGeoMap'. 
+       sgvizler.option.chart = { 
+           //'width':           '800',
+           //'height':          '400',
+           //'chartArea':       { left: '5%', top: '5%', width: '75%', height: '80%' },
+           //     'gGeoMap': {
+           //	 'dataMode':           'markers'
+           //     },
+           //     'gMap': {
+           //	 'dataMode':           'markers',
+           //     },
+           //     'sMap': {
+           //	 'dataMode':           'markers',
+           //	 'showTip':            true,
+           //	 'useMapTypeControl':  true
+           //     } 
+       };
+
+       //// Leave this as is. Ready, steady, GO!
+       $(document).ready(sgvizler.go());
+    </script>
+  </head>
+  <body>
+    <div id="logo">
+      <a href="http://code.google.com/p/sgvizler/">
+	<img src="http://sgvizler.googlecode.com/svn/www/mr.sgvizler.png" alt="mr.sgvizler.png"/>
+      </a><br/>Mr. Sgvizler
+    </div>
+    <h1>Sgvizler</h1>    
+
+    <h2>User Input</h2>
+
+    This section contains a input form where users can write and
+    execute their own SPARQL queries. The query is sent to Sgvizler
+    via the URL in GET parameters.
+
+    <div id="queryarea">
+      <pre id="sgvzlr_cPrefix"></pre>
+      <textarea id="sgvzlr_cQuery" rows="10" cols="80"></textarea>
+      <form method="get" id="sgvzlr_formQuery">
+	<p>
+	  <input type="hidden" value="" name="query" id="sgvzlr_strQuery"/>
+	  Width:  <input name="width" id="sgvzlr_strWidth" type="text" size="3"/>
+	  Height: <input name="height" id="sgvzlr_strHeight" type="text" size="3"/>
+	  Chart Type: <select name="chart" id="sgvzlr_optChart"></select>
+	  <input type="button" value="Reset" onclick="sgvizler.ui.resetPage()"/>
+	  <input type="button" value="GO!" onclick="sgvizler.ui.submitQuery()"/>
+	</p>
+      </form>
+      <div id="sgvzlr_cMessage"></div>
+    </div>
+    <div id="sgvzlr_gchart" style="width:800px; height:400px;"></div>
+    <div id="footer">
+      <!-- Please leave a link to the Sgvizler homepage --> 
+      <p>
+	Sgvizler visualizes the result of SPARQL SELECT queries using
+	javascript and the Google Visualization API. For more
+	information, see
+	the <a href="http://code.google.com/p/sgvizler/">Sgvizler</a>
+	homepage. (c) 2011 Martin G. Skj&#230;veland.
+      </p>
+    </div>
+  </body>
+</html>


[059/100] [abbrv] git commit: MARMOTTA-478: Fixed encoding for the archetype dummy tests.

Posted by wi...@apache.org.
MARMOTTA-478: Fixed encoding for the archetype dummy tests.


Project: http://git-wip-us.apache.org/repos/asf/marmotta/repo
Commit: http://git-wip-us.apache.org/repos/asf/marmotta/commit/2c1b1f5e
Tree: http://git-wip-us.apache.org/repos/asf/marmotta/tree/2c1b1f5e
Diff: http://git-wip-us.apache.org/repos/asf/marmotta/diff/2c1b1f5e

Branch: refs/heads/ldp
Commit: 2c1b1f5e5538edaff47cdfb31767c03be65ac3fc
Parents: 40ebe23
Author: Jakob Frank <ja...@apache.org>
Authored: Tue Apr 8 10:45:12 2014 +0200
Committer: Jakob Frank <ja...@apache.org>
Committed: Tue Apr 8 11:05:47 2014 +0200

----------------------------------------------------------------------
 .../src/main/java/webservices/MyWebService.java   |  4 ++--
 .../test/java/webservices/MyWebServiceTest.java   | 18 ++++++++++--------
 build/pom.xml                                     |  1 -
 3 files changed, 12 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/marmotta/blob/2c1b1f5e/build/archetypes/marmotta-archetype-module/src/main/resources/archetype-resources/src/main/java/webservices/MyWebService.java
----------------------------------------------------------------------
diff --git a/build/archetypes/marmotta-archetype-module/src/main/resources/archetype-resources/src/main/java/webservices/MyWebService.java b/build/archetypes/marmotta-archetype-module/src/main/resources/archetype-resources/src/main/java/webservices/MyWebService.java
index 8c7a0e2..bde5bd2 100644
--- a/build/archetypes/marmotta-archetype-module/src/main/resources/archetype-resources/src/main/java/webservices/MyWebService.java
+++ b/build/archetypes/marmotta-archetype-module/src/main/resources/archetype-resources/src/main/java/webservices/MyWebService.java
@@ -41,7 +41,7 @@ public class MyWebService {
     private MyService myService;
 
     @GET
-    @Produces("text/html")
+    @Produces("text/plain; charset=utf8")
     public Response hello(@QueryParam("name") String name) {
         if (StringUtils.isEmpty(name)) {
             log.warn("No name given");
@@ -61,7 +61,7 @@ public class MyWebService {
         if (turns < 0) throw new DoThisException("Can't undo 'This'");
 
         myService.doThis(turns);
-        return Response.ok().build();
+        return Response.noContent().build();
     }
 
 }

http://git-wip-us.apache.org/repos/asf/marmotta/blob/2c1b1f5e/build/archetypes/marmotta-archetype-module/src/main/resources/archetype-resources/src/test/java/webservices/MyWebServiceTest.java
----------------------------------------------------------------------
diff --git a/build/archetypes/marmotta-archetype-module/src/main/resources/archetype-resources/src/test/java/webservices/MyWebServiceTest.java b/build/archetypes/marmotta-archetype-module/src/main/resources/archetype-resources/src/test/java/webservices/MyWebServiceTest.java
index c7126ce..ecbe00f 100644
--- a/build/archetypes/marmotta-archetype-module/src/main/resources/archetype-resources/src/test/java/webservices/MyWebServiceTest.java
+++ b/build/archetypes/marmotta-archetype-module/src/main/resources/archetype-resources/src/test/java/webservices/MyWebServiceTest.java
@@ -73,19 +73,21 @@ public class MyWebServiceTest {
     }
 
     @Test
-    @Ignore
     public void testNonAsciiHello() {
+        /*
+         * GET ?name=<xxx>
+         */
         RestAssured.given()
-                .contentType(ContentType.HTML)
                 .param("name", "Jürgen")
-                .expect()
+            .expect()
+                .contentType(ContentType.TEXT)
                 .content(containsString("Hello Jürgen"))
-                .when()
+            .when()
                 .get("/${moduleKey}");
 
         RestAssured.expect()
                 .statusCode(400)
-                .when()
+            .when()
                 .get("/${moduleKey}");
     }
 
@@ -97,19 +99,19 @@ public class MyWebServiceTest {
         RestAssured.given()
                 .param("turns", 1)
             .expect()
-                .statusCode(200)
+                .statusCode(204)
             .when()
                 .post("/${moduleKey}");
 
         RestAssured.given()
                 .param("turns", 10)
             .expect()
-                .statusCode(200)
+                .statusCode(204)
             .when()
                 .post("/${moduleKey}");
 
         RestAssured.expect()
-                .statusCode(200)
+                .statusCode(204)
             .when()
                 .post("/${moduleKey}");
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/2c1b1f5e/build/pom.xml
----------------------------------------------------------------------
diff --git a/build/pom.xml b/build/pom.xml
index 5558434..ca6b672 100644
--- a/build/pom.xml
+++ b/build/pom.xml
@@ -25,7 +25,6 @@
         <relativePath>../parent</relativePath>
     </parent>
 
-    <groupId>org.apache.marmotta</groupId>
     <artifactId>build-reactor</artifactId>
     <packaging>pom</packaging>
 


[006/100] [abbrv] [partial] Reverting the erroneous merge by Sebastian according to the instructions in INFRA-6876

Posted by wi...@apache.org.
http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/platform/marmotta-core/src/main/resources/web/admin/js/lib/d3.v2.min.js
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/resources/web/admin/js/lib/d3.v2.min.js b/platform/marmotta-core/src/main/resources/web/admin/js/lib/d3.v2.min.js
deleted file mode 100644
index 521c420..0000000
--- a/platform/marmotta-core/src/main/resources/web/admin/js/lib/d3.v2.min.js
+++ /dev/null
@@ -1,4 +0,0 @@
-(function(){function e(a,b){try{for(var c in b)Object.defineProperty(a.prototype,c,{value:b[c],enumerable:!1})}catch(d){a.prototype=b}}function g(a){var b=-1,c=a.length,d=[];while(++b<c)d.push(a[b]);return d}function h(a){return Array.prototype.slice.call(a)}function k(){}function n(a){return a}function o(){return this}function p(){return!0}function q(a){return typeof a=="function"?a:function(){return a}}function r(a,b,c){return function(){var d=c.apply(b,arguments);return arguments.length?a:d}}function s(a){return a!=null&&!isNaN(a)}function t(a){return a.length}function v(a){return a==null}function w(a){return a.replace(/(^\s+)|(\s+$)/g,"").replace(/\s+/g," ")}function x(a){var b=1;while(a*b%1)b*=10;return b}function A(){}function B(a){function d(){var c=b,d=-1,e=c.length,f;while(++d<e)(f=c[d].on)&&f.apply(this,arguments);return a}var b=[],c=new k;return d.on=function(d,e){var f=c.get(d),g;return arguments.length<2?f&&f.on:(f&&(f.on=null,b=b.slice(0,g=b.indexOf(f)).concat(b.slice(
 g+1)),c.remove(d)),e&&b.push(c.set(d,{on:e})),a)},d}function E(a,b){return b-(a?1+Math.floor(Math.log(a+Math.pow(10,1+Math.floor(Math.log(a)/Math.LN10)-b))/Math.LN10):1)}function F(a){return a+""}function G(a){var b=a.lastIndexOf("."),c=b>=0?a.substring(b):(b=a.length,""),d=[];while(b>0)d.push(a.substring(b-=3,b+3));return d.reverse().join(",")+c}function I(a,b){return{scale:Math.pow(10,(8-b)*3),symbol:a}}function O(a){return function(b){return b<=0?0:b>=1?1:a(b)}}function P(a){return function(b){return 1-a(1-b)}}function Q(a){return function(b){return.5*(b<.5?a(2*b):2-a(2-2*b))}}function R(a){return a}function S(a){return function(b){return Math.pow(b,a)}}function T(a){return 1-Math.cos(a*Math.PI/2)}function U(a){return Math.pow(2,10*(a-1))}function V(a){return 1-Math.sqrt(1-a*a)}function W(a,b){var c;return arguments.length<2&&(b=.45),arguments.length<1?(a=1,c=b/4):c=b/(2*Math.PI)*Math.asin(1/a),function(d){return 1+a*Math.pow(2,10*-d)*Math.sin((d-c)*2*Math.PI/b)}}function X(a){re
 turn a||(a=1.70158),function(b){return b*b*((a+1)*b-a)}}function Y(a){return a<1/2.75?7.5625*a*a:a<2/2.75?7.5625*(a-=1.5/2.75)*a+.75:a<2.5/2.75?7.5625*(a-=2.25/2.75)*a+.9375:7.5625*(a-=2.625/2.75)*a+.984375}function Z(){d3.event.stopPropagation(),d3.event.preventDefault()}function $(){var a=d3.event,b;while(b=a.sourceEvent)a=b;return a}function _(a){var b=new A,c=0,d=arguments.length;while(++c<d)b[arguments[c]]=B(b);return b.of=function(c,d){return function(e){try{var f=e.sourceEvent=d3.event;e.target=a,d3.event=e,b[e.type].apply(c,d)}finally{d3.event=f}}},b}function bb(a){return a=="transform"?d3.interpolateTransform:d3.interpolate}function bc(a,b){return b=b-(a=+a)?1/(b-a):0,function(c){return(c-a)*b}}function bd(a,b){return b=b-(a=+a)?1/(b-a):0,function(c){return Math.max(0,Math.min(1,(c-a)*b))}}function be(a,b,c){return new bf(a,b,c)}function bf(a,b,c){this.r=a,this.g=b,this.b=c}function bg(a){return a<16?"0"+Math.max(0,a).toString(16):Math.min(255,a).toString(16)}function bh(a,
 b,c){var d=0,e=0,f=0,g,h,i;g=/([a-z]+)\((.*)\)/i.exec(a);if(g){h=g[2].split(",");switch(g[1]){case"hsl":return c(parseFloat(h[0]),parseFloat(h[1])/100,parseFloat(h[2])/100);case"rgb":return b(bj(h[0]),bj(h[1]),bj(h[2]))}}return(i=bk.get(a))?b(i.r,i.g,i.b):(a!=null&&a.charAt(0)==="#"&&(a.length===4?(d=a.charAt(1),d+=d,e=a.charAt(2),e+=e,f=a.charAt(3),f+=f):a.length===7&&(d=a.substring(1,3),e=a.substring(3,5),f=a.substring(5,7)),d=parseInt(d,16),e=parseInt(e,16),f=parseInt(f,16)),b(d,e,f))}function bi(a,b,c){var d=Math.min(a/=255,b/=255,c/=255),e=Math.max(a,b,c),f=e-d,g,h,i=(e+d)/2;return f?(h=i<.5?f/(e+d):f/(2-e-d),a==e?g=(b-c)/f+(b<c?6:0):b==e?g=(c-a)/f+2:g=(a-b)/f+4,g*=60):h=g=0,bl(g,h,i)}function bj(a){var b=parseFloat(a);return a.charAt(a.length-1)==="%"?Math.round(b*2.55):b}function bl(a,b,c){return new bm(a,b,c)}function bm(a,b,c){this.h=a,this.s=b,this.l=c}function bn(a,b,c){function f(a){return a>360?a-=360:a<0&&(a+=360),a<60?d+(e-d)*a/60:a<180?e:a<240?d+(e-d)*(240-a)/60:d}fu
 nction g(a){return Math.round(f(a)*255)}var d,e;return a%=360,a<0&&(a+=360),b=b<0?0:b>1?1:b,c=c<0?0:c>1?1:c,e=c<=.5?c*(1+b):c+b-c*b,d=2*c-e,be(g(a+120),g(a),g(a-120))}function bo(a){return j(a,bu),a}function bv(a){return function(){return bp(a,this)}}function bw(a){return function(){return bq(a,this)}}function by(a,b){function f(){if(b=this.classList)return b.add(a);var b=this.className,d=b.baseVal!=null,e=d?b.baseVal:b;c.lastIndex=0,c.test(e)||(e=w(e+" "+a),d?b.baseVal=e:this.className=e)}function g(){if(b=this.classList)return b.remove(a);var b=this.className,d=b.baseVal!=null,e=d?b.baseVal:b;e=w(e.replace(c," ")),d?b.baseVal=e:this.className=e}function h(){(b.apply(this,arguments)?f:g).call(this)}var c=new RegExp("(^|\\s+)"+d3.requote(a)+"(\\s+|$)","g");if(arguments.length<2){var d=this.node();if(e=d.classList)return e.contains(a);var e=d.className;return c.lastIndex=0,c.test(e.baseVal!=null?e.baseVal:e)}return this.each(typeof b=="function"?h:b?f:g)}function bz(a){return{__data_
 _:a}}function bA(a){return function(){return bt(this,a)}}function bB(a){return arguments.length||(a=d3.ascending),function(b,c){return a(b&&b.__data__,c&&c.__data__)}}function bD(a){return j(a,bE),a}function bF(a,b,c){j(a,bJ);var d=new k,e=d3.dispatch("start","end"),f=bR;return a.id=b,a.time=c,a.tween=function(b,c){return arguments.length<2?d.get(b):(c==null?d.remove(b):d.set(b,c),a)},a.ease=function(b){return arguments.length?(f=typeof b=="function"?b:d3.ease.apply(d3,arguments),a):f},a.each=function(b,c){return arguments.length<2?bS.call(a,b):(e.on(b,c),a)},d3.timer(function(g){return a.each(function(h,i,j){function p(a){return o.active>b?r():(o.active=b,d.forEach(function(a,b){(b=b.call(l,h,i))&&k.push(b)}),e.start.call(l,h,i),q(a)||d3.timer(q,0,c),1)}function q(a){if(o.active!==b)return r();var c=(a-m)/n,d=f(c),g=k.length;while(g>0)k[--g].call(l,d);if(c>=1)return r(),bL=b,e.end.call(l,h,i),bL=0,1}function r(){return--o.count||delete l.__transition__,1}var k=[],l=this,m=a[j][i].d
 elay,n=a[j][i].duration,o=l.__transition__||(l.__transition__={active:0,count:0});++o.count,m<=g?p(g):d3.timer(p,m,c)}),1},0,c),a}function bH(a,b,c){return c!=""&&bG}function bI(a,b){function d(a,d,e){var f=b.call(this,a,d);return f==null?e!=""&&bG:e!=f&&c(e,f)}function e(a,d,e){return e!=b&&c(e,b)}var c=bb(a);return typeof b=="function"?d:b==null?bH:(b+="",e)}function bS(a){var b=bL,c=bR,d=bP,e=bQ;bL=this.id,bR=this.ease();for(var f=0,g=this.length;f<g;f++)for(var h=this[f],i=0,j=h.length;i<j;i++){var k=h[i];k&&(bP=this[f][i].delay,bQ=this[f][i].duration,a.call(k=k.node,k.__data__,i,f))}return bL=b,bR=c,bP=d,bQ=e,this}function bW(){var a,b=Date.now(),c=bT;while(c)a=b-c.then,a>=c.delay&&(c.flush=c.callback(a)),c=c.next;var d=bX()-b;d>24?(isFinite(d)&&(clearTimeout(bV),bV=setTimeout(bW,d)),bU=0):(bU=1,bY(bW))}function bX(){var a=null,b=bT,c=Infinity;while(b)b.flush?b=a?a.next=b.next:bT=b.next:(c=Math.min(c,b.then+b.delay),b=(a=b).next);return c}function bZ(a){var b=[a.a,a.b],c=[a.c,a
 .d],d=b_(b),e=b$(b,c),f=b_(ca(c,b,-e))||0;b[0]*c[1]<c[0]*b[1]&&(b[0]*=-1,b[1]*=-1,d*=-1,e*=-1),this.rotate=(d?Math.atan2(b[1],b[0]):Math.atan2(-c[0],c[1]))*cb,this.translate=[a.e,a.f],this.scale=[d,f],this.skew=f?Math.atan2(e,f)*cb:0}function b$(a,b){return a[0]*b[0]+a[1]*b[1]}function b_(a){var b=Math.sqrt(b$(a,a));return b&&(a[0]/=b,a[1]/=b),b}function ca(a,b,c){return a[0]+=c*b[0],a[1]+=c*b[1],a}function cd(a,b){var c=a.ownerSVGElement||a;if(c.createSVGPoint){var d=c.createSVGPoint();if(cc<0&&(window.scrollX||window.scrollY)){c=d3.select(document.body).append("svg").style("position","absolute").style("top",0).style("left",0);var e=c[0][0].getScreenCTM();cc=!e.f&&!e.e,c.remove()}return cc?(d.x=b.pageX,d.y=b.pageY):(d.x=b.clientX,d.y=b.clientY),d=d.matrixTransform(a.getScreenCTM().inverse()),[d.x,d.y]}var f=a.getBoundingClientRect();return[b.clientX-f.left-a.clientLeft,b.clientY-f.top-a.clientTop]}function ce(){}function cf(a){var b=a[0],c=a[a.length-1];return b<c?[b,c]:[c,b]}funct
 ion cg(a){return a.rangeExtent?a.rangeExtent():cf(a.range())}function ch(a,b){var c=0,d=a.length-1,e=a[c],f=a[d],g;f<e&&(g=c,c=d,d=g,g=e,e=f,f=g);if(g=f-e)b=b(g),a[c]=b.floor(e),a[d]=b.ceil(f);return a}function ci(){return Math}function cj(a,b,c,d){function g(){var g=Math.min(a.length,b.length)>2?cq:cp,i=d?bd:bc;return e=g(a,b,i,c),f=g(b,a,i,d3.interpolate),h}function h(a){return e(a)}var e,f;return h.invert=function(a){return f(a)},h.domain=function(b){return arguments.length?(a=b.map(Number),g()):a},h.range=function(a){return arguments.length?(b=a,g()):b},h.rangeRound=function(a){return h.range(a).interpolate(d3.interpolateRound)},h.clamp=function(a){return arguments.length?(d=a,g()):d},h.interpolate=function(a){return arguments.length?(c=a,g()):c},h.ticks=function(b){return cn(a,b)},h.tickFormat=function(b){return co(a,b)},h.nice=function(){return ch(a,cl),g()},h.copy=function(){return cj(a,b,c,d)},g()}function ck(a,b){return d3.rebind(a,b,"range","rangeRound","interpolate","clam
 p")}function cl(a){return a=Math.pow(10,Math.round(Math.log(a)/Math.LN10)-1),{floor:function(b){return Math.floor(b/a)*a},ceil:function(b){return Math.ceil(b/a)*a}}}function cm(a,b){var c=cf(a),d=c[1]-c[0],e=Math.pow(10,Math.floor(Math.log(d/b)/Math.LN10)),f=b/d*e;return f<=.15?e*=10:f<=.35?e*=5:f<=.75&&(e*=2),c[0]=Math.ceil(c[0]/e)*e,c[1]=Math.floor(c[1]/e)*e+e*.5,c[2]=e,c}function cn(a,b){return d3.range.apply(d3,cm(a,b))}function co(a,b){return d3.format(",."+Math.max(0,-Math.floor(Math.log(cm(a,b)[2])/Math.LN10+.01))+"f")}function cp(a,b,c,d){var e=c(a[0],a[1]),f=d(b[0],b[1]);return function(a){return f(e(a))}}function cq(a,b,c,d){var e=[],f=[],g=0,h=Math.min(a.length,b.length)-1;a[h]<a[0]&&(a=a.slice().reverse(),b=b.slice().reverse());while(++g<=h)e.push(c(a[g-1],a[g])),f.push(d(b[g-1],b[g]));return function(b){var c=d3.bisect(a,b,1,h)-1;return f[c](e[c](b))}}function cr(a,b){function d(c){return a(b(c))}var c=b.pow;return d.invert=function(b){return c(a.invert(b))},d.domain=fu
 nction(e){return arguments.length?(b=e[0]<0?cu:ct,c=b.pow,a.domain(e.map(b)),d):a.domain().map(c)},d.nice=function(){return a.domain(ch(a.domain(),ci)),d},d.ticks=function(){var d=cf(a.domain()),e=[];if(d.every(isFinite)){var f=Math.floor(d[0]),g=Math.ceil(d[1]),h=c(d[0]),i=c(d[1]);if(b===cu){e.push(c(f));for(;f++<g;)for(var j=9;j>0;j--)e.push(c(f)*j)}else{for(;f<g;f++)for(var j=1;j<10;j++)e.push(c(f)*j);e.push(c(f))}for(f=0;e[f]<h;f++);for(g=e.length;e[g-1]>i;g--);e=e.slice(f,g)}return e},d.tickFormat=function(a,e){arguments.length<2&&(e=cs);if(arguments.length<1)return e;var f=a/d.ticks().length,g=b===cu?(h=-1e-12,Math.floor):(h=1e-12,Math.ceil),h;return function(a){return a/c(g(b(a)+h))<f?e(a):""}},d.copy=function(){return cr(a.copy(),b)},ck(d,a)}function ct(a){return Math.log(a<0?0:a)/Math.LN10}function cu(a){return-Math.log(a>0?0:-a)/Math.LN10}function cv(a,b){function e(b){return a(c(b))}var c=cw(b),d=cw(1/b);return e.invert=function(b){return d(a.invert(b))},e.domain=function
 (b){return arguments.length?(a.domain(b.map(c)),e):a.domain().map(d)},e.ticks=function(a){return cn(e.domain(),a)},e.tickFormat=function(a){return co(e.domain(),a)},e.nice=function(){return e.domain(ch(e.domain(),cl))},e.exponent=function(a){if(!arguments.length)return b;var f=e.domain();return c=cw(b=a),d=cw(1/b),e.domain(f)},e.copy=function(){return cv(a.copy(),b)},ck(e,a)}function cw(a){return function(b){return b<0?-Math.pow(-b,a):Math.pow(b,a)}}function cx(a,b){function f(b){return d[((c.get(b)||c.set(b,a.push(b)))-1)%d.length]}function g(b,c){return d3.range(a.length).map(function(a){return b+c*a})}var c,d,e;return f.domain=function(d){if(!arguments.length)return a;a=[],c=new k;var e=-1,g=d.length,h;while(++e<g)c.has(h=d[e])||c.set(h,a.push(h));return f[b.t](b.x,b.p)},f.range=function(a){return arguments.length?(d=a,e=0,b={t:"range",x:a},f):d},f.rangePoints=function(c,h){arguments.length<2&&(h=0);var i=c[0],j=c[1],k=(j-i)/(a.length-1+h);return d=g(a.length<2?(i+j)/2:i+k*h/2,k)
 ,e=0,b={t:"rangePoints",x:c,p:h},f},f.rangeBands=function(c,h){arguments.length<2&&(h=0);var i=c[1]<c[0],j=c[i-0],k=c[1-i],l=(k-j)/(a.length+h);return d=g(j+l*h,l),i&&d.reverse(),e=l*(1-h),b={t:"rangeBands",x:c,p:h},f},f.rangeRoundBands=function(c,h){arguments.length<2&&(h=0);var i=c[1]<c[0],j=c[i-0],k=c[1-i],l=Math.floor((k-j)/(a.length+h)),m=k-j-(a.length-h)*l;return d=g(j+Math.round(m/2),l),i&&d.reverse(),e=Math.round(l*(1-h)),b={t:"rangeRoundBands",x:c,p:h},f},f.rangeBand=function(){return e},f.rangeExtent=function(){return cf(b.x)},f.copy=function(){return cx(a,b)},f.domain(a)}function cC(a,b){function d(){var d=0,f=a.length,g=b.length;c=[];while(++d<g)c[d-1]=d3.quantile(a,d/g);return e}function e(a){return isNaN(a=+a)?NaN:b[d3.bisect(c,a)]}var c;return e.domain=function(b){return arguments.length?(a=b.filter(function(a){return!isNaN(a)}).sort(d3.ascending),d()):a},e.range=function(a){return arguments.length?(b=a,d()):b},e.quantiles=function(){return c},e.copy=function(){return
  cC(a,b)},d()}function cD(a,b,c){function f(b){return c[Math.max(0,Math.min(e,Math.floor(d*(b-a))))]}function g(){return d=c.length/(b-a),e=c.length-1,f}var d,e;return f.domain=function(c){return arguments.length?(a=+c[0],b=+c[c.length-1],g()):[a,b]},f.range=function(a){return arguments.length?(c=a,g()):c},f.copy=function(){return cD(a,b,c)},g()}function cE(a){function b(a){return+a}return b.invert=b,b.domain=b.range=function(c){return arguments.length?(a=c.map(b),b):a},b.ticks=function(b){return cn(a,b)},b.tickFormat=function(b){return co(a,b)},b.copy=function(){return cE(a)},b}function cH(a){return a.innerRadius}function cI(a){return a.outerRadius}function cJ(a){return a.startAngle}function cK(a){return a.endAngle}function cL(a){function h(e){function o(){h.push("M",f(a(i),g))}var h=[],i=[],j=-1,k=e.length,l,m=q(b),n=q(c);while(++j<k)d.call(this,l=e[j],j)?i.push([+m.call(this,l,j),+n.call(this,l,j)]):i.length&&(o(),i=[]);return i.length&&o(),h.length?h.join(""):null}var b=cM,c=cN,
 d=p,e=cO,f=cQ,g=.7;return h.x=function(a){return arguments.length?(b=a,h):b},h.y=function(a){return arguments.length?(c=a,h):c},h.defined=function(a){return arguments.length?(d=a,h):d},h.interpolate=function(a){return arguments.length?(cP.has(a+="")||(a=cO),f=cP.get(e=a),h):e},h.tension=function(a){return arguments.length?(g=a,h):g},h}function cM(a){return a[0]}function cN(a){return a[1]}function cQ(a){var b=0,c=a.length,d=a[0],e=[d[0],",",d[1]];while(++b<c)e.push("L",(d=a[b])[0],",",d[1]);return e.join("")}function cR(a){var b=0,c=a.length,d=a[0],e=[d[0],",",d[1]];while(++b<c)e.push("V",(d=a[b])[1],"H",d[0]);return e.join("")}function cS(a){var b=0,c=a.length,d=a[0],e=[d[0],",",d[1]];while(++b<c)e.push("H",(d=a[b])[0],"V",d[1]);return e.join("")}function cT(a,b){return a.length<4?cQ(a):a[1]+cW(a.slice(1,a.length-1),cX(a,b))}function cU(a,b){return a.length<3?cQ(a):a[0]+cW((a.push(a[0]),a),cX([a[a.length-2]].concat(a,[a[1]]),b))}function cV(a,b,c){return a.length<3?cQ(a):a[0]+cW(a,c
 X(a,b))}function cW(a,b){if(b.length<1||a.length!=b.length&&a.length!=b.length+2)return cQ(a);var c=a.length!=b.length,d="",e=a[0],f=a[1],g=b[0],h=g,i=1;c&&(d+="Q"+(f[0]-g[0]*2/3)+","+(f[1]-g[1]*2/3)+","+f[0]+","+f[1],e=a[1],i=2);if(b.length>1){h=b[1],f=a[i],i++,d+="C"+(e[0]+g[0])+","+(e[1]+g[1])+","+(f[0]-h[0])+","+(f[1]-h[1])+","+f[0]+","+f[1];for(var j=2;j<b.length;j++,i++)f=a[i],h=b[j],d+="S"+(f[0]-h[0])+","+(f[1]-h[1])+","+f[0]+","+f[1]}if(c){var k=a[i];d+="Q"+(f[0]+h[0]*2/3)+","+(f[1]+h[1]*2/3)+","+k[0]+","+k[1]}return d}function cX(a,b){var c=[],d=(1-b)/2,e,f=a[0],g=a[1],h=1,i=a.length;while(++h<i)e=f,f=g,g=a[h],c.push([d*(g[0]-e[0]),d*(g[1]-e[1])]);return c}function cY(a){if(a.length<3)return cQ(a);var b=1,c=a.length,d=a[0],e=d[0],f=d[1],g=[e,e,e,(d=a[1])[0]],h=[f,f,f,d[1]],i=[e,",",f];de(i,g,h);while(++b<c)d=a[b],g.shift(),g.push(d[0]),h.shift(),h.push(d[1]),de(i,g,h);b=-1;while(++b<2)g.shift(),g.push(d[0]),h.shift(),h.push(d[1]),de(i,g,h);return i.join("")}function cZ(a){i
 f(a.length<4)return cQ(a);var b=[],c=-1,d=a.length,e,f=[0],g=[0];while(++c<3)e=a[c],f.push(e[0]),g.push(e[1]);b.push(da(dd,f)+","+da(dd,g)),--c;while(++c<d)e=a[c],f.shift(),f.push(e[0]),g.shift(),g.push(e[1]),de(b,f,g);return b.join("")}function c$(a){var b,c=-1,d=a.length,e=d+4,f,g=[],h=[];while(++c<4)f=a[c%d],g.push(f[0]),h.push(f[1]);b=[da(dd,g),",",da(dd,h)],--c;while(++c<e)f=a[c%d],g.shift(),g.push(f[0]),h.shift(),h.push(f[1]),de(b,g,h);return b.join("")}function c_(a,b){var c=a.length-1,d=a[0][0],e=a[0][1],f=a[c][0]-d,g=a[c][1]-e,h=-1,i,j;while(++h<=c)i=a[h],j=h/c,i[0]=b*i[0]+(1-b)*(d+j*f),i[1]=b*i[1]+(1-b)*(e+j*g);return cY(a)}function da(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]+a[3]*b[3]}function de(a,b,c){a.push("C",da(db,b),",",da(db,c),",",da(dc,b),",",da(dc,c),",",da(dd,b),",",da(dd,c))}function df(a,b){return(b[1]-a[1])/(b[0]-a[0])}function dg(a){var b=0,c=a.length-1,d=[],e=a[0],f=a[1],g=d[0]=df(e,f);while(++b<c)d[b]=g+(g=df(e=f,f=a[b+1]));return d[b]=g,d}function dh(a
 ){var b=[],c,d,e,f,g=dg(a),h=-1,i=a.length-1;while(++h<i)c=df(a[h],a[h+1]),Math.abs(c)<1e-6?g[h]=g[h+1]=0:(d=g[h]/c,e=g[h+1]/c,f=d*d+e*e,f>9&&(f=c*3/Math.sqrt(f),g[h]=f*d,g[h+1]=f*e));h=-1;while(++h<=i)f=(a[Math.min(i,h+1)][0]-a[Math.max(0,h-1)][0])/(6*(1+g[h]*g[h])),b.push([f||0,g[h]*f||0]);return b}function di(a){return a.length<3?cQ(a):a[0]+cW(a,dh(a))}function dj(a){var b,c=-1,d=a.length,e,f;while(++c<d)b=a[c],e=b[0],f=b[1]+cF,b[0]=e*Math.cos(f),b[1]=e*Math.sin(f);return a}function dk(a){function l(g){function y(){l.push("M",h(a(n),k),j,i(a(m.reverse()),k),"Z")}var l=[],m=[],n=[],o=-1,p=g.length,r,s=q(b),t=q(d),u=b===c?function(){return w}:q(c),v=d===e?function(){return x}:q(e),w,x;while(++o<p)f.call(this,r=g[o],o)?(m.push([w=+s.call(this,r,o),x=+t.call(this,r,o)]),n.push([+u.call(this,r,o),+v.call(this,r,o)])):m.length&&(y(),m=[],n=[]);return m.length&&y(),l.length?l.join(""):null}var b=cM,c=cM,d=0,e=cN,f=p,g=cO,h=cQ,i=cQ,j="L",k=.7;return l.x=function(a){return arguments.lengt
 h?(b=c=a,l):c},l.x0=function(a){return arguments.length?(b=a,l):b},l.x1=function(a){return arguments.length?(c=a,l):c},l.y=function(a){return arguments.length?(d=e=a,l):e},l.y0=function(a){return arguments.length?(d=a,l):d},l.y1=function(a){return arguments.length?(e=a,l):e},l.defined=function(a){return arguments.length?(f=a,l):f},l.interpolate=function(a){return arguments.length?(cP.has(a+="")||(a=cO),h=cP.get(g=a),i=h.reverse||h,j=/-closed$/.test(a)?"M":"L",l):g},l.tension=function(a){return arguments.length?(k=a,l):k},l}function dl(a){return a.source}function dm(a){return a.target}function dn(a){return a.radius}function dp(a){return a.startAngle}function dq(a){return a.endAngle}function dr(a){return[a.x,a.y]}function ds(a){return function(){var b=a.apply(this,arguments),c=b[0],d=b[1]+cF;return[c*Math.cos(d),c*Math.sin(d)]}}function dt(){return 64}function du(){return"circle"}function dv(a){var b=Math.sqrt(a/Math.PI);return"M0,"+b+"A"+b+","+b+" 0 1,1 0,"+ -b+"A"+b+","+b+" 0 1,1 0,
 "+b+"Z"}function dz(a,b){a.attr("transform",function(a){return"translate("+b(a)+",0)"})}function dA(a,b){a.attr("transform",function(a){return"translate(0,"+b(a)+")"})}function dB(a,b,c){e=[];if(c&&b.length>1){var d=cf(a.domain()),e,f=-1,g=b.length,h=(b[1]-b[0])/++c,i,j;while(++f<g)for(i=c;--i>0;)(j=+b[f]-i*h)>=d[0]&&e.push(j);for(--f,i=0;++i<c&&(j=+b[f]+i*h)<d[1];)e.push(j)}return e}function dG(){dE||(dE=d3.select("body").append("div").style("visibility","hidden").style("top",0).style("height",0).style("width",0).style("overflow-y","scroll").append("div").style("height","2000px").node().parentNode);var a=d3.event,b;try{dE.scrollTop=1e3,dE.dispatchEvent(a),b=1e3-dE.scrollTop}catch(c){b=a.wheelDelta||-a.detail*5}return b}function dH(a){var b=a.source,c=a.target,d=dJ(b,c),e=[b];while(b!==d)b=b.parent,e.push(b);var f=e.length;while(c!==d)e.splice(f,0,c),c=c.parent;return e}function dI(a){var b=[],c=a.parent;while(c!=null)b.push(a),a=c,c=c.parent;return b.push(a),b}function dJ(a,b){if(a
 ===b)return a;var c=dI(a),d=dI(b),e=c.pop(),f=d.pop(),g=null;while(e===f)g=e,e=c.pop(),f=d.pop();return g}function dM(a){a.fixed|=2}function dN(a){a!==dL&&(a.fixed&=1)}function dO(){dL.fixed&=1,dK=dL=null}function dP(){dL.px=d3.event.x,dL.py=d3.event.y,dK.resume()}function dQ(a,b,c){var d=0,e=0;a.charge=0;if(!a.leaf){var f=a.nodes,g=f.length,h=-1,i;while(++h<g){i=f[h];if(i==null)continue;dQ(i,b,c),a.charge+=i.charge,d+=i.charge*i.cx,e+=i.charge*i.cy}}if(a.point){a.leaf||(a.point.x+=Math.random()-.5,a.point.y+=Math.random()-.5);var j=b*c[a.point.index];a.charge+=a.pointCharge=j,d+=j*a.point.x,e+=j*a.point.y}a.cx=d/a.charge,a.cy=e/a.charge}function dR(a){return 20}function dS(a){return 1}function dU(a){return a.x}function dV(a){return a.y}function dW(a,b,c){a.y0=b,a.y=c}function dZ(a){return d3.range(a.length)}function d$(a){var b=-1,c=a[0].length,d=[];while(++b<c)d[b]=0;return d}function d_(a){var b=1,c=0,d=a[0][1],e,f=a.length;for(;b<f;++b)(e=a[b][1])>d&&(c=b,d=e);return c}function 
 ea(a){return a.reduce(eb,0)}function eb(a,b){return a+b[1]}function ec(a,b){return ed(a,Math.ceil(Math.log(b.length)/Math.LN2+1))}function ed(a,b){var c=-1,d=+a[0],e=(a[1]-d)/b,f=[];while(++c<=b)f[c]=e*c+d;return f}function ee(a){return[d3.min(a),d3.max(a)]}function ef(a,b){return d3.rebind(a,b,"sort","children","value"),a.links=ej,a.nodes=function(b){return ek=!0,(a.nodes=a)(b)},a}function eg(a){return a.children}function eh(a){return a.value}function ei(a,b){return b.value-a.value}function ej(a){return d3.merge(a.map(function(a){return(a.children||[]).map(function(b){return{source:a,target:b}})}))}function el(a,b){return a.value-b.value}function em(a,b){var c=a._pack_next;a._pack_next=b,b._pack_prev=a,b._pack_next=c,c._pack_prev=b}function en(a,b){a._pack_next=b,b._pack_prev=a}function eo(a,b){var c=b.x-a.x,d=b.y-a.y,e=a.r+b.r;return e*e-c*c-d*d>.001}function ep(a){function l(a){b=Math.min(a.x-a.r,b),c=Math.max(a.x+a.r,c),d=Math.min(a.y-a.r,d),e=Math.max(a.y+a.r,e)}var b=Infinity,
 c=-Infinity,d=Infinity,e=-Infinity,f=a.length,g,h,i,j,k;a.forEach(eq),g=a[0],g.x=-g.r,g.y=0,l(g);if(f>1){h=a[1],h.x=h.r,h.y=0,l(h);if(f>2){i=a[2],eu(g,h,i),l(i),em(g,i),g._pack_prev=i,em(i,h),h=g._pack_next;for(var m=3;m<f;m++){eu(g,h,i=a[m]);var n=0,o=1,p=1;for(j=h._pack_next;j!==h;j=j._pack_next,o++)if(eo(j,i)){n=1;break}if(n==1)for(k=g._pack_prev;k!==j._pack_prev;k=k._pack_prev,p++)if(eo(k,i))break;n?(o<p||o==p&&h.r<g.r?en(g,h=j):en(g=k,h),m--):(em(g,i),h=i,l(i))}}}var q=(b+c)/2,r=(d+e)/2,s=0;for(var m=0;m<f;m++){var t=a[m];t.x-=q,t.y-=r,s=Math.max(s,t.r+Math.sqrt(t.x*t.x+t.y*t.y))}return a.forEach(er),s}function eq(a){a._pack_next=a._pack_prev=a}function er(a){delete a._pack_next,delete a._pack_prev}function es(a){var b=a.children;b&&b.length?(b.forEach(es),a.r=ep(b)):a.r=Math.sqrt(a.value)}function et(a,b,c,d){var e=a.children;a.x=b+=d*a.x,a.y=c+=d*a.y,a.r*=d;if(e){var f=-1,g=e.length;while(++f<g)et(e[f],b,c,d)}}function eu(a,b,c){var d=a.r+c.r,e=b.x-a.x,f=b.y-a.y;if(d&&(e||f))
 {var g=b.r+c.r,h=Math.sqrt(e*e+f*f),i=Math.max(-1,Math.min(1,(d*d+h*h-g*g)/(2*d*h))),j=Math.acos(i),k=i*(d/=h),l=Math.sin(j)*d;c.x=a.x+k*e+l*f,c.y=a.y+k*f-l*e}else c.x=a.x+d,c.y=a.y}function ev(a){return 1+d3.max(a,function(a){return a.y})}function ew(a){return a.reduce(function(a,b){return a+b.x},0)/a.length}function ex(a){var b=a.children;return b&&b.length?ex(b[0]):a}function ey(a){var b=a.children,c;return b&&(c=b.length)?ey(b[c-1]):a}function ez(a,b){return a.parent==b.parent?1:2}function eA(a){var b=a.children;return b&&b.length?b[0]:a._tree.thread}function eB(a){var b=a.children,c;return b&&(c=b.length)?b[c-1]:a._tree.thread}function eC(a,b){var c=a.children;if(c&&(e=c.length)){var d,e,f=-1;while(++f<e)b(d=eC(c[f],b),a)>0&&(a=d)}return a}function eD(a,b){return a.x-b.x}function eE(a,b){return b.x-a.x}function eF(a,b){return a.depth-b.depth}function eG(a,b){function c(a,d){var e=a.children;if(e&&(i=e.length)){var f,g=null,h=-1,i;while(++h<i)f=e[h],c(f,g),g=f}b(a,d)}c(a,null)}f
 unction eH(a){var b=0,c=0,d=a.children,e=d.length,f;while(--e>=0)f=d[e]._tree,f.prelim+=b,f.mod+=b,b+=f.shift+(c+=f.change)}function eI(a,b,c){a=a._tree,b=b._tree;var d=c/(b.number-a.number);a.change+=d,b.change-=d,b.shift+=c,b.prelim+=c,b.mod+=c}function eJ(a,b,c){return a._tree.ancestor.parent==b.parent?a._tree.ancestor:c}function eK(a){return{x:a.x,y:a.y,dx:a.dx,dy:a.dy}}function eL(a,b){var c=a.x+b[3],d=a.y+b[0],e=a.dx-b[1]-b[3],f=a.dy-b[0]-b[2];return e<0&&(c+=e/2,e=0),f<0&&(d+=f/2,f=0),{x:c,y:d,dx:e,dy:f}}function eM(a){return a.map(eN).join(",")}function eN(a){return/[",\n]/.test(a)?'"'+a.replace(/\"/g,'""')+'"':a}function eP(a,b){return function(c){return c&&a.hasOwnProperty(c.type)?a[c.type](c):b}}function eQ(a){return"m0,"+a+"a"+a+","+a+" 0 1,1 0,"+ -2*a+"a"+a+","+a+" 0 1,1 0,"+2*a+"z"}function eR(a,b){eS.hasOwnProperty(a.type)&&eS[a.type](a,b)}function eT(a,b){eR(a.geometry,b)}function eU(a,b){for(var c=a.features,d=0,e=c.length;d<e;d++)eR(c[d].geometry,b)}function eV(a,b
 ){for(var c=a.geometries,d=0,e=c.length;d<e;d++)eR(c[d],b)}function eW(a,b){for(var c=a.coordinates,d=0,e=c.length;d<e;d++)b.apply(null,c[d])}function eX(a,b){for(var c=a.coordinates,d=0,e=c.length;d<e;d++)for(var f=c[d],g=0,h=f.length;g<h;g++)b.apply(null,f[g])}function eY(a,b){for(var c=a.coordinates,d=0,e=c.length;d<e;d++)for(var f=c[d][0],g=0,h=f.length;g<h;g++)b.apply(null,f[g])}function eZ(a,b){b.apply(null,a.coordinates)}function e$(a,b){for(var c=a.coordinates[0],d=0,e=c.length;d<e;d++)b.apply(null,c[d])}function e_(a){return a.source}function fa(a){return a.target}function fb(a,b){function q(a){var b=Math.sin(o-(a*=o))/p,c=Math.sin(a)/p,f=b*g*d+c*m*j,i=b*g*e+c*m*k,l=b*h+c*n;return[Math.atan2(i,f)/eO,Math.atan2(l,Math.sqrt(f*f+i*i))/eO]}var c=a[0]*eO,d=Math.cos(c),e=Math.sin(c),f=a[1]*eO,g=Math.cos(f),h=Math.sin(f),i=b[0]*eO,j=Math.cos(i),k=Math.sin(i),l=b[1]*eO,m=Math.cos(l),n=Math.sin(l),o=q.d=Math.acos(Math.max(-1,Math.min(1,h*n+g*m*Math.cos(i-c)))),p=Math.sin(o);return q
 }function fe(a){var b=0,c=0;for(;;){if(a(b,c))return[b,c];b===0?(b=c+1,c=0):(b-=1,c+=1)}}function ff(a,b,c,d){var e,f,g,h,i,j,k;return e=d[a],f=e[0],g=e[1],e=d[b],h=e[0],i=e[1],e=d[c],j=e[0],k=e[1],(k-g)*(h-f)-(i-g)*(j-f)>0}function fg(a,b,c){return(c[0]-b[0])*(a[1]-b[1])<(c[1]-b[1])*(a[0]-b[0])}function fh(a,b,c,d){var e=a[0],f=b[0],g=c[0],h=d[0],i=a[1],j=b[1],k=c[1],l=d[1],m=e-g,n=f-e,o=h-g,p=i-k,q=j-i,r=l-k,s=(o*p-r*m)/(r*n-o*q);return[e+s*n,i+s*q]}function fj(a,b){var c={list:a.map(function(a,b){return{index:b,x:a[0],y:a[1]}}).sort(function(a,b){return a.y<b.y?-1:a.y>b.y?1:a.x<b.x?-1:a.x>b.x?1:0}),bottomSite:null},d={list:[],leftEnd:null,rightEnd:null,init:function(){d.leftEnd=d.createHalfEdge(null,"l"),d.rightEnd=d.createHalfEdge(null,"l"),d.leftEnd.r=d.rightEnd,d.rightEnd.l=d.leftEnd,d.list.unshift(d.leftEnd,d.rightEnd)},createHalfEdge:function(a,b){return{edge:a,side:b,vertex:null,l:null,r:null}},insert:function(a,b){b.l=a,b.r=a.r,a.r.l=b,a.r=b},leftBound:function(a){var b=d.
 leftEnd;do b=b.r;while(b!=d.rightEnd&&e.rightOf(b,a));return b=b.l,b},del:function(a){a.l.r=a.r,a.r.l=a.l,a.edge=null},right:function(a){return a.r},left:function(a){return a.l},leftRegion:function(a){return a.edge==null?c.bottomSite:a.edge.region[a.side]},rightRegion:function(a){return a.edge==null?c.bottomSite:a.edge.region[fi[a.side]]}},e={bisect:function(a,b){var c={region:{l:a,r:b},ep:{l:null,r:null}},d=b.x-a.x,e=b.y-a.y,f=d>0?d:-d,g=e>0?e:-e;return c.c=a.x*d+a.y*e+(d*d+e*e)*.5,f>g?(c.a=1,c.b=e/d,c.c/=d):(c.b=1,c.a=d/e,c.c/=e),c},intersect:function(a,b){var c=a.edge,d=b.edge;if(!c||!d||c.region.r==d.region.r)return null;var e=c.a*d.b-c.b*d.a;if(Math.abs(e)<1e-10)return null;var f=(c.c*d.b-d.c*c.b)/e,g=(d.c*c.a-c.c*d.a)/e,h=c.region.r,i=d.region.r,j,k;h.y<i.y||h.y==i.y&&h.x<i.x?(j=a,k=c):(j=b,k=d);var l=f>=k.region.r.x;return l&&j.side==="l"||!l&&j.side==="r"?null:{x:f,y:g}},rightOf:function(a,b){var c=a.edge,d=c.region.r,e=b.x>d.x;if(e&&a.side==="l")return 1;if(!e&&a.side==="r"
 )return 0;if(c.a===1){var f=b.y-d.y,g=b.x-d.x,h=0,i=0;!e&&c.b<0||e&&c.b>=0?i=h=f>=c.b*g:(i=b.x+b.y*c.b>c.c,c.b<0&&(i=!i),i||(h=1));if(!h){var j=d.x-c.region.l.x;i=c.b*(g*g-f*f)<j*f*(1+2*g/j+c.b*c.b),c.b<0&&(i=!i)}}else{var k=c.c-c.a*b.x,l=b.y-k,m=b.x-d.x,n=k-d.y;i=l*l>m*m+n*n}return a.side==="l"?i:!i},endPoint:function(a,c,d){a.ep[c]=d;if(!a.ep[fi[c]])return;b(a)},distance:function(a,b){var c=a.x-b.x,d=a.y-b.y;return Math.sqrt(c*c+d*d)}},f={list:[],insert:function(a,b,c){a.vertex=b,a.ystar=b.y+c;for(var d=0,e=f.list,g=e.length;d<g;d++){var h=e[d];if(a.ystar>h.ystar||a.ystar==h.ystar&&b.x>h.vertex.x)continue;break}e.splice(d,0,a)},del:function(a){for(var b=0,c=f.list,d=c.length;b<d&&c[b]!=a;++b);c.splice(b,1)},empty:function(){return f.list.length===0},nextEvent:function(a){for(var b=0,c=f.list,d=c.length;b<d;++b)if(c[b]==a)return c[b+1];return null},min:function(){var a=f.list[0];return{x:a.vertex.x,y:a.ystar}},extractMin:function(){return f.list.shift()}};d.init(),c.bottomSite=c.li
 st.shift();var g=c.list.shift(),h,i,j,k,l,m,n,o,p,q,r,s,t;for(;;){f.empty()||(h=f.min());if(g&&(f.empty()||g.y<h.y||g.y==h.y&&g.x<h.x))i=d.leftBound(g),j=d.right(i),n=d.rightRegion(i),s=e.bisect(n,g),m=d.createHalfEdge(s,"l"),d.insert(i,m),q=e.intersect(i,m),q&&(f.del(i),f.insert(i,q,e.distance(q,g))),i=m,m=d.createHalfEdge(s,"r"),d.insert(i,m),q=e.intersect(m,j),q&&f.insert(m,q,e.distance(q,g)),g=c.list.shift();else if(!f.empty())i=f.extractMin(),k=d.left(i),j=d.right(i),l=d.right(j),n=d.leftRegion(i),o=d.rightRegion(j),r=i.vertex,e.endPoint(i.edge,i.side,r),e.endPoint(j.edge,j.side,r),d.del(i),f.del(j),d.del(j),t="l",n.y>o.y&&(p=n,n=o,o=p,t="r"),s=e.bisect(n,o),m=d.createHalfEdge(s,t),d.insert(k,m),e.endPoint(s,fi[t],r),q=e.intersect(k,m),q&&(f.del(k),f.insert(k,q,e.distance(q,n))),q=e.intersect(m,l),q&&f.insert(m,q,e.distance(q,n));else break}for(i=d.right(d.leftEnd);i!=d.rightEnd;i=d.right(i))b(i.edge)}function fk(){return{leaf:!0,nodes:[],point:null}}function fl(a,b,c,d,e,f){if
 (!a(b,c,d,e,f)){var g=(c+e)*.5,h=(d+f)*.5,i=b.nodes;i[0]&&fl(a,i[0],c,d,g,h),i[1]&&fl(a,i[1],g,d,e,h),i[2]&&fl(a,i[2],c,h,g,f),i[3]&&fl(a,i[3],g,h,e,f)}}function fm(a){return{x:a[0],y:a[1]}}function fo(){this._=new Date(arguments.length>1?Date.UTC.apply(this,arguments):arguments[0])}function fq(a,b,c,d){var e,f,g=0,h=b.length,i=c.length;while(g<h){if(d>=i)return-1;e=b.charCodeAt(g++);if(e==37){f=fw[b.charAt(g++)];if(!f||(d=f(a,c,d))<0)return-1}else if(e!=c.charCodeAt(d++))return-1}return d}function fx(a,b,c){return fz.test(b.substring(c,c+=3))?c:-1}function fy(a,b,c){fA.lastIndex=0;var d=fA.exec(b.substring(c,c+10));return d?c+=d[0].length:-1}function fC(a,b,c){var d=fD.get(b.substring(c,c+=3).toLowerCase());return d==null?-1:(a.m=d,c)}function fE(a,b,c){fF.lastIndex=0;var d=fF.exec(b.substring(c,c+12));return d?(a.m=fG.get(d[0].toLowerCase()),c+=d[0].length):-1}function fI(a,b,c){return fq(a,fv.c.toString(),b,c)}function fJ(a,b,c){return fq(a,fv.x.toString(),b,c)}function fK(a,b,c)
 {return fq(a,fv.X.toString(),b,c)}function fL(a,b,c){fU.lastIndex=0;var d=fU.exec(b.substring(c,c+4));return d?(a.y=+d[0],c+=d[0].length):-1}function fM(a,b,c){fU.lastIndex=0;var d=fU.exec(b.substring(c,c+2));return d?(a.y=fN()+ +d[0],c+=d[0].length):-1}function fN(){return~~((new Date).getFullYear()/1e3)*1e3}function fO(a,b,c){fU.lastIndex=0;var d=fU.exec(b.substring(c,c+2));return d?(a.m=d[0]-1,c+=d[0].length):-1}function fP(a,b,c){fU.lastIndex=0;var d=fU.exec(b.substring(c,c+2));return d?(a.d=+d[0],c+=d[0].length):-1}function fQ(a,b,c){fU.lastIndex=0;var d=fU.exec(b.substring(c,c+2));return d?(a.H=+d[0],c+=d[0].length):-1}function fR(a,b,c){fU.lastIndex=0;var d=fU.exec(b.substring(c,c+2));return d?(a.M=+d[0],c+=d[0].length):-1}function fS(a,b,c){fU.lastIndex=0;var d=fU.exec(b.substring(c,c+2));return d?(a.S=+d[0],c+=d[0].length):-1}function fT(a,b,c){fU.lastIndex=0;var d=fU.exec(b.substring(c,c+3));return d?(a.L=+d[0],c+=d[0].length):-1}function fV(a,b,c){var d=fW.get(b.substring
 (c,c+=2).toLowerCase());return d==null?-1:(a.p=d,c)}function fX(a){var b=a.getTimezoneOffset(),c=b>0?"-":"+",d=~~(Math.abs(b)/60),e=Math.abs(b)%60;return c+fr(d)+fr(e)}function fZ(a){return a.toISOString()}function f$(a,b,c){function d(b){var c=a(b),d=f(c,1);return b-c<d-b?c:d}function e(c){return b(c=a(new fn(c-1)),1),c}function f(a,c){return b(a=new fn(+a),c),a}function g(a,d,f){var g=e(a),h=[];if(f>1)while(g<d)c(g)%f||h.push(new Date(+g)),b(g,1);else while(g<d)h.push(new Date(+g)),b(g,1);return h}function h(a,b,c){try{fn=fo;var d=new fo;return d._=a,g(d,b,c)}finally{fn=Date}}a.floor=a,a.round=d,a.ceil=e,a.offset=f,a.range=g;var i=a.utc=f_(a);return i.floor=i,i.round=f_(d),i.ceil=f_(e),i.offset=f_(f),i.range=h,a}function f_(a){return function(b,c){try{fn=fo;var d=new fo;return d._=b,a(d,c)._}finally{fn=Date}}}function ga(a,b,c){function d(b){return a(
-b)}return d.invert=function(b){return gc(a.invert(b))},d.domain=function(b){return arguments.length?(a.domain(b),d):a.domain().map(gc)},d.nice=function(a){var b=gb(d.domain());return d.domain([a.floor(b[0]),a.ceil(b[1])])},d.ticks=function(c,e){var f=gb(d.domain());if(typeof c!="function"){var g=f[1]-f[0],h=g/c,i=d3.bisect(gg,h);if(i==gg.length)return b.year(f,c);if(!i)return a.ticks(c).map(gc);Math.log(h/gg[i-1])<Math.log(gg[i]/h)&&--i,c=b[i],e=c[1],c=c[0].range}return c(f[0],new Date(+f[1]+1),e)},d.tickFormat=function(){return c},d.copy=function(){return ga(a.copy(),b,c)},d3.rebind(d,a,"range","rangeRound","interpolate","clamp")}function gb(a){var b=a[0],c=a[a.length-1];return b<c?[b,c]:[c,b]}function gc(a){return new Date(a)}function gd(a){return function(b){var c=a.length-1,d=a[c];while(!d[1](b))d=a[--c];return d[0](b)}}function ge(a){var b=new Date(a,0,1);return b.setFullYear(a),b}function gf(a){var b=a.getFullYear(),c=ge(b),d=ge(b+1);return b+(a-c)/(d-c)}function go(a){var b=n
 ew Date(Date.UTC(a,0,1));return b.setUTCFullYear(a),b}function gp(a){var b=a.getUTCFullYear(),c=go(b),d=go(b+1);return b+(a-c)/(d-c)}Date.now||(Date.now=function(){return+(new Date)});try{document.createElement("div").style.setProperty("opacity",0,"")}catch(a){var b=CSSStyleDeclaration.prototype,c=b.setProperty;b.setProperty=function(a,b,d){c.call(this,a,b+"",d)}}d3={version:"2.9.1"};var f=h;try{f(document.documentElement.childNodes)[0].nodeType}catch(i){f=g}var j=[].__proto__?function(a,b){a.__proto__=b}:function(a,b){for(var c in b)a[c]=b[c]};d3.map=function(a){var b=new k;for(var c in a)b.set(c,a[c]);return b},e(k,{has:function(a){return l+a in this},get:function(a){return this[l+a]},set:function(a,b){return this[l+a]=b},remove:function(a){return a=l+a,a in this&&delete this[a]},keys:function(){var a=[];return this.forEach(function(b){a.push(b)}),a},values:function(){var a=[];return this.forEach(function(b,c){a.push(c)}),a},entries:function(){var a=[];return this.forEach(function
 (b,c){a.push({key:b,value:c})}),a},forEach:function(a){for(var b in this)b.charCodeAt(0)===m&&a.call(this,b.substring(1),this[b])}});var l="\0",m=l.charCodeAt(0);d3.functor=q,d3.rebind=function(a,b){var c=1,d=arguments.length,e;while(++c<d)a[e=arguments[c]]=r(a,b,b[e]);return a},d3.ascending=function(a,b){return a<b?-1:a>b?1:a>=b?0:NaN},d3.descending=function(a,b){return b<a?-1:b>a?1:b>=a?0:NaN},d3.mean=function(a,b){var c=a.length,d,e=0,f=-1,g=0;if(arguments.length===1)while(++f<c)s(d=a[f])&&(e+=(d-e)/++g);else while(++f<c)s(d=b.call(a,a[f],f))&&(e+=(d-e)/++g);return g?e:undefined},d3.median=function(a,b){return arguments.length>1&&(a=a.map(b)),a=a.filter(s),a.length?d3.quantile(a.sort(d3.ascending),.5):undefined},d3.min=function(a,b){var c=-1,d=a.length,e,f;if(arguments.length===1){while(++c<d&&((e=a[c])==null||e!=e))e=undefined;while(++c<d)(f=a[c])!=null&&e>f&&(e=f)}else{while(++c<d&&((e=b.call(a,a[c],c))==null||e!=e))e=undefined;while(++c<d)(f=b.call(a,a[c],c))!=null&&e>f&&(e=f)
 }return e},d3.max=function(a,b){var c=-1,d=a.length,e,f;if(arguments.length===1){while(++c<d&&((e=a[c])==null||e!=e))e=undefined;while(++c<d)(f=a[c])!=null&&f>e&&(e=f)}else{while(++c<d&&((e=b.call(a,a[c],c))==null||e!=e))e=undefined;while(++c<d)(f=b.call(a,a[c],c))!=null&&f>e&&(e=f)}return e},d3.extent=function(a,b){var c=-1,d=a.length,e,f,g;if(arguments.length===1){while(++c<d&&((e=g=a[c])==null||e!=e))e=g=undefined;while(++c<d)(f=a[c])!=null&&(e>f&&(e=f),g<f&&(g=f))}else{while(++c<d&&((e=g=b.call(a,a[c],c))==null||e!=e))e=undefined;while(++c<d)(f=b.call(a,a[c],c))!=null&&(e>f&&(e=f),g<f&&(g=f))}return[e,g]},d3.random={normal:function(a,b){return arguments.length<2&&(b=1),arguments.length<1&&(a=0),function(){var c,d,e;do c=Math.random()*2-1,d=Math.random()*2-1,e=c*c+d*d;while(!e||e>1);return a+b*c*Math.sqrt(-2*Math.log(e)/e)}}},d3.sum=function(a,b){var c=0,d=a.length,e,f=-1;if(arguments.length===1)while(++f<d)isNaN(e=+a[f])||(c+=e);else while(++f<d)isNaN(e=+b.call(a,a[f],f))||(c+=e
 );return c},d3.quantile=function(a,b){var c=(a.length-1)*b+1,d=Math.floor(c),e=a[d-1],f=c-d;return f?e+f*(a[d]-e):e},d3.transpose=function(a){return d3.zip.apply(d3,a)},d3.zip=function(){if(!(e=arguments.length))return[];for(var a=-1,b=d3.min(arguments,t),c=new Array(b);++a<b;)for(var d=-1,e,f=c[a]=new Array(e);++d<e;)f[d]=arguments[d][a];return c},d3.bisector=function(a){return{left:function(b,c,d,e){arguments.length<3&&(d=0),arguments.length<4&&(e=b.length);while(d<e){var f=d+e>>1;a.call(b,b[f],f)<c?d=f+1:e=f}return d},right:function(b,c,d,e){arguments.length<3&&(d=0),arguments.length<4&&(e=b.length);while(d<e){var f=d+e>>1;c<a.call(b,b[f],f)?e=f:d=f+1}return d}}};var u=d3.bisector(function(a){return a});d3.bisectLeft=u.left,d3.bisect=d3.bisectRight=u.right,d3.first=function(a,b){var c=0,d=a.length,e=a[0],f;arguments.length===1&&(b=d3.ascending);while(++c<d)b.call(a,e,f=a[c])>0&&(e=f);return e},d3.last=function(a,b){var c=0,d=a.length,e=a[0],f;arguments.length===1&&(b=d3.ascending
 );while(++c<d)b.call(a,e,f=a[c])<=0&&(e=f);return e},d3.nest=function(){function f(c,g){if(g>=b.length)return e?e.call(a,c):d?c.sort(d):c;var h=-1,i=c.length,j=b[g++],l,m,n=new k,o,p={};while(++h<i)(o=n.get(l=j(m=c[h])))?o.push(m):n.set(l,[m]);return n.forEach(function(a){p[a]=f(n.get(a),g)}),p}function g(a,d){if(d>=b.length)return a;var e=[],f=c[d++],h;for(h in a)e.push({key:h,values:g(a[h],d)});return f&&e.sort(function(a,b){return f(a.key,b.key)}),e}var a={},b=[],c=[],d,e;return a.map=function(a){return f(a,0)},a.entries=function(a){return g(f(a,0),0)},a.key=function(c){return b.push(c),a},a.sortKeys=function(d){return c[b.length-1]=d,a},a.sortValues=function(b){return d=b,a},a.rollup=function(b){return e=b,a},a},d3.keys=function(a){var b=[];for(var c in a)b.push(c);return b},d3.values=function(a){var b=[];for(var c in a)b.push(a[c]);return b},d3.entries=function(a){var b=[];for(var c in a)b.push({key:c,value:a[c]});return b},d3.permute=function(a,b){var c=[],d=-1,e=b.length;whil
 e(++d<e)c[d]=a[b[d]];return c},d3.merge=function(a){return Array.prototype.concat.apply([],a)},d3.split=function(a,b){var c=[],d=[],e,f=-1,g=a.length;arguments.length<2&&(b=v);while(++f<g)b.call(d,e=a[f],f)?d=[]:(d.length||c.push(d),d.push(e));return c},d3.range=function(a,b,c){arguments.length<3&&(c=1,arguments.length<2&&(b=a,a=0));if((b-a)/c===Infinity)throw new Error("infinite range");var d=[],e=x(Math.abs(c)),f=-1,g;a*=e,b*=e,c*=e;if(c<0)while((g=a+c*++f)>b)d.push(g/e);else while((g=a+c*++f)<b)d.push(g/e);return d},d3.requote=function(a){return a.replace(y,"\\$&")};var y=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g;d3.round=function(a,b){return b?Math.round(a*(b=Math.pow(10,b)))/b:Math.round(a)},d3.xhr=function(a,b,c){var d=new XMLHttpRequest;arguments.length<3?(c=b,b=null):b&&d.overrideMimeType&&d.overrideMimeType(b),d.open("GET",a,!0),b&&d.setRequestHeader("Accept",b),d.onreadystatechange=function(){if(d.readyState===4){var a=d.status;c(a>=200&&a<300||a===304?d:null)}},d.send(null)},d3.t
 ext=function(a,b,c){function d(a){c(a&&a.responseText)}arguments.length<3&&(c=b,b=null),d3.xhr(a,b,d)},d3.json=function(a,b){d3.text(a,"application/json",function(a){b(a?JSON.parse(a):null)})},d3.html=function(a,b){d3.text(a,"text/html",function(a){if(a!=null){var c=document.createRange();c.selectNode(document.body),a=c.createContextualFragment(a)}b(a)})},d3.xml=function(a,b,c){function d(a){c(a&&a.responseXML)}arguments.length<3&&(c=b,b=null),d3.xhr(a,b,d)};var z={svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};d3.ns={prefix:z,qualify:function(a){var b=a.indexOf(":"),c=a;return b>=0&&(c=a.substring(0,b),a=a.substring(b+1)),z.hasOwnProperty(c)?{space:z[c],local:a}:a}},d3.dispatch=function(){var a=new A,b=-1,c=arguments.length;while(++b<c)a[arguments[b]]=B(a);return a},A.prototype.on=function(a,b){var c=a.indexOf("."),d="";return c>0&&(d=a.subst
 ring(c+1),a=a.substring(0,c)),arguments.length<2?this[a].on(d):this[a].on(d,b)},d3.format=function(a){var b=C.exec(a),c=b[1]||" ",d=b[3]||"",e=b[5],f=+b[6],g=b[7],h=b[8],i=b[9],j=1,k="",l=!1;h&&(h=+h.substring(1)),e&&(c="0",g&&(f-=Math.floor((f-1)/4)));switch(i){case"n":g=!0,i="g";break;case"%":j=100,k="%",i="f";break;case"p":j=100,k="%",i="r";break;case"d":l=!0,h=0;break;case"s":j=-1,i="r"}return i=="r"&&!h&&(i="g"),i=D.get(i)||F,function(a){if(l&&a%1)return"";var b=a<0&&(a=-a)?"−":d;if(j<0){var m=d3.formatPrefix(a,h);a*=m.scale,k=m.symbol}else a*=j;a=i(a,h);if(e){var n=a.length+b.length;n<f&&(a=(new Array(f-n+1)).join(c)+a),g&&(a=G(a)),a=b+a}else{g&&(a=G(a)),a=b+a;var n=a.length;n<f&&(a=(new Array(f-n+1)).join(c)+a)}return a+k}};var C=/(?:([^{])?([<>=^]))?([+\- ])?(#)?(0)?([0-9]+)?(,)?(\.[0-9]+)?([a-zA-Z%])?/,D=d3.map({g:function(a,b){return a.toPrecision(b)},e:function(a,b){return a.toExponential(b)},f:function(a,b){return a.toFixed(b)},r:function(a,b){return d3.round(a,b=E(a,b
 )).toFixed(Math.max(0,Math.min(20,b)))}}),H=["y","z","a","f","p","n","μ","m","","k","M","G","T","P","E","Z","Y"].map(I);d3.formatPrefix=function(a,b){var c=0;return a&&(a<0&&(a*=-1),b&&(a=d3.round(a,E(a,b))),c=1+Math.floor(1e-12+Math.log(a)/Math.LN10),c=Math.max(-24,Math.min(24,Math.floor((c<=0?c+1:c-1)/3)*3))),H[8+c/3]};var J=S(2),K=S(3),L=function(){return R},M=d3.map({linear:L,poly:S,quad:function(){return J},cubic:function(){return K},sin:function(){return T},exp:function(){return U},circle:function(){return V},elastic:W,back:X,bounce:function(){return Y}}),N=d3.map({"in":R,out:P,"in-out":Q,"out-in":function(a){return Q(P(a))}});d3.ease=function(a){var b=a.indexOf("-"),c=b>=0?a.substring(0,b):a,d=b>=0?a.substring(b+1):"in";return c=M.get(c)||L,d=N.get(d)||R,O(d(c.apply(null,Array.prototype.slice.call(arguments,1))))},d3.event=null,d3.interpolate=function(a,b){var c=d3.interpolators.length,d;while(--c>=0&&!(d=d3.interpolators[c](a,b)));return d},d3.interpolateNumber=function(a,b
 ){return b-=a,function(c){return a+b*c}},d3.interpolateRound=function(a,b){return b-=a,function(c){return Math.round(a+b*c)}},d3.interpolateString=function(a,b){var c,d,e,f=0,g=0,h=[],i=[],j,k;ba.lastIndex=0;for(d=0;c=ba.exec(b);++d)c.index&&h.push(b.substring(f,g=c.index)),i.push({i:h.length,x:c[0]}),h.push(null),f=ba.lastIndex;f<b.length&&h.push(b.substring(f));for(d=0,j=i.length;(c=ba.exec(a))&&d<j;++d){k=i[d];if(k.x==c[0]){if(k.i)if(h[k.i+1]==null){h[k.i-1]+=k.x,h.splice(k.i,1);for(e=d+1;e<j;++e)i[e].i--}else{h[k.i-1]+=k.x+h[k.i+1],h.splice(k.i,2);for(e=d+1;e<j;++e)i[e].i-=2}else if(h[k.i+1]==null)h[k.i]=k.x;else{h[k.i]=k.x+h[k.i+1],h.splice(k.i+1,1);for(e=d+1;e<j;++e)i[e].i--}i.splice(d,1),j--,d--}else k.x=d3.interpolateNumber(parseFloat(c[0]),parseFloat(k.x))}while(d<j)k=i.pop(),h[k.i+1]==null?h[k.i]=k.x:(h[k.i]=k.x+h[k.i+1],h.splice(k.i+1,1)),j--;return h.length===1?h[0]==null?i[0].x:function(){return b}:function(a){for(d=0;d<j;++d)h[(k=i[d]).i]=k.x(a);return h.join("")}},d3.
 interpolateTransform=function(a,b){var c=[],d=[],e,f=d3.transform(a),g=d3.transform(b),h=f.translate,i=g.translate,j=f.rotate,k=g.rotate,l=f.skew,m=g.skew,n=f.scale,o=g.scale;return h[0]!=i[0]||h[1]!=i[1]?(c.push("translate(",null,",",null,")"),d.push({i:1,x:d3.interpolateNumber(h[0],i[0])},{i:3,x:d3.interpolateNumber(h[1],i[1])})):i[0]||i[1]?c.push("translate("+i+")"):c.push(""),j!=k?d.push({i:c.push(c.pop()+"rotate(",null,")")-2,x:d3.interpolateNumber(j,k)}):k&&c.push(c.pop()+"rotate("+k+")"),l!=m?d.push({i:c.push(c.pop()+"skewX(",null,")")-2,x:d3.interpolateNumber(l,m)}):m&&c.push(c.pop()+"skewX("+m+")"),n[0]!=o[0]||n[1]!=o[1]?(e=c.push(c.pop()+"scale(",null,",",null,")"),d.push({i:e-4,x:d3.interpolateNumber(n[0],o[0])},{i:e-2,x:d3.interpolateNumber(n[1],o[1])})):(o[0]!=1||o[1]!=1)&&c.push(c.pop()+"scale("+o+")"),e=d.length,function(a){var b=-1,f;while(++b<e)c[(f=d[b]).i]=f.x(a);return c.join("")}},d3.interpolateRgb=function(a,b){a=d3.rgb(a),b=d3.rgb(b);var c=a.r,d=a.g,e=a.b,f=b.
 r-c,g=b.g-d,h=b.b-e;return function(a){return"#"+bg(Math.round(c+f*a))+bg(Math.round(d+g*a))+bg(Math.round(e+h*a))}},d3.interpolateHsl=function(a,b){a=d3.hsl(a),b=d3.hsl(b);var c=a.h,d=a.s,e=a.l,f=b.h-c,g=b.s-d,h=b.l-e;return function(a){return bn(c+f*a,d+g*a,e+h*a).toString()}},d3.interpolateArray=function(a,b){var c=[],d=[],e=a.length,f=b.length,g=Math.min(a.length,b.length),h;for(h=0;h<g;++h)c.push(d3.interpolate(a[h],b[h]));for(;h<e;++h)d[h]=a[h];for(;h<f;++h)d[h]=b[h];return function(a){for(h=0;h<g;++h)d[h]=c[h](a);return d}},d3.interpolateObject=function(a,b){var c={},d={},e;for(e in a)e in b?c[e]=bb(e)(a[e],b[e]):d[e]=a[e];for(e in b)e in a||(d[e]=b[e]);return function(a){for(e in c)d[e]=c[e](a);return d}};var ba=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g;d3.interpolators=[d3.interpolateObject,function(a,b){return b instanceof Array&&d3.interpolateArray(a,b)},function(a,b){return(typeof a=="string"||typeof b=="string")&&d3.interpolateString(a+"",b+"")},function(a,b){return
 (typeof b=="string"?bk.has(b)||/^(#|rgb\(|hsl\()/.test(b):b instanceof bf||b instanceof bm)&&d3.interpolateRgb(a,b)},function(a,b){return!isNaN(a=+a)&&!isNaN(b=+b)&&d3.interpolateNumber(a,b)}],d3.rgb=function(a,b,c){return arguments.length===1?a instanceof bf?be(a.r,a.g,a.b):bh(""+a,be,bn):be(~~a,~~b,~~c)},bf.prototype.brighter=function(a){a=Math.pow(.7,arguments.length?a:1);var b=this.r,c=this.g,d=this.b,e=30;return!b&&!c&&!d?be(e,e,e):(b&&b<e&&(b=e),c&&c<e&&(c=e),d&&d<e&&(d=e),be(Math.min(255,Math.floor(b/a)),Math.min(255,Math.floor(c/a)),Math.min(255,Math.floor(d/a))))},bf.prototype.darker=function(a){return a=Math.pow(.7,arguments.length?a:1),be(Math.floor(a*this.r),Math.floor(a*this.g),Math.floor(a*this.b))},bf.prototype.hsl=function(){return bi(this.r,this.g,this.b)},bf.prototype.toString=function(){return"#"+bg(this.r)+bg(this.g)+bg(this.b)};var bk=d3.map({aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#f
 fe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"
 #808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#8
 08000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"});bk.forEach(function(a,b){bk.set(a,bh(b,be,bn))}),d3.hsl=function(a,b,c){return arguments.length===1?a instanceof bm?bl(a.h,a.s,a.l):bh(""+a,bi,bl):bl(+a,+b,+c)},bm.prototype.brighter=f
 unction(a){return a=Math.pow(.7,arguments.length?a:1),bl(this.h,this.s,this.l/a)},bm.prototype.darker=function(a){return a=Math.pow(.7,arguments.length?a:1),bl(this.h,this.s,a*this.l)},bm.prototype.rgb=function(){return bn(this.h,this.s,this.l)},bm.prototype.toString=function(){return this.rgb().toString()};var bp=function(a,b){return b.querySelector(a)},bq=function(a,b){return b.querySelectorAll(a)},br=document.documentElement,bs=br.matchesSelector||br.webkitMatchesSelector||br.mozMatchesSelector||br.msMatchesSelector||br.oMatchesSelector,bt=function(a,b){return bs.call(a,b)};typeof Sizzle=="function"&&(bp=function(a,b){return Sizzle(a,b)[0]},bq=function(a,b){return Sizzle.uniqueSort(Sizzle(a,b))},bt=Sizzle.matchesSelector);var bu=[];d3.selection=function(){return bC},d3.selection.prototype=bu,bu.select=function(a){var b=[],c,d,e,f;typeof a!="function"&&(a=bv(a));for(var g=-1,h=this.length;++g<h;){b.push(c=[]),c.parentNode=(e=this[g]).parentNode;for(var i=-1,j=e.length;++i<j;)(f=e[
 i])?(c.push(d=a.call(f,f.__data__,i)),d&&"__data__"in f&&(d.__data__=f.__data__)):c.push(null)}return bo(b)},bu.selectAll=function(a){var b=[],c,d;typeof a!="function"&&(a=bw(a));for(var e=-1,g=this.length;++e<g;)for(var h=this[e],i=-1,j=h.length;++i<j;)if(d=h[i])b.push(c=f(a.call(d,d.__data__,i))),c.parentNode=d;return bo(b)},bu.attr=function(a,b){function d(){this.removeAttribute(a)}function e(){this.removeAttributeNS(a.space,a.local)}function f(){this.setAttribute(a,b)}function g(){this.setAttributeNS(a.space,a.local,b)}function h(){var c=b.apply(this,arguments);c==null?this.removeAttribute(a):this.setAttribute(a,c)}function i(){var c=b.apply(this,arguments);c==null?this.removeAttributeNS(a.space,a.local):this.setAttributeNS(a.space,a.local,c)}a=d3.ns.qualify(a);if(arguments.length<2){var c=this.node();return a.local?c.getAttributeNS(a.space,a.local):c.getAttribute(a)}return this.each(b==null?a.local?e:d:typeof b=="function"?a.local?i:h:a.local?g:f)},bu.classed=function(a,b){var 
 c=a.split(bx),d=c.length,e=-1;if(arguments.length>1){while(++e<d)by.call(this,c[e],b);return this}while(++e<d)if(!by.call(this,c[e]))return!1;return!0};var bx=/\s+/g;bu.style=function(a,b,c){function d(){this.style.removeProperty(a)}function e(){this.style.setProperty(a,b,c)}function f(){var d=b.apply(this,arguments);d==null?this.style.removeProperty(a):this.style.setProperty(a,d,c)}return arguments.length<3&&(c=""),arguments.length<2?window.getComputedStyle(this.node(),null).getPropertyValue(a):this.each(b==null?d:typeof b=="function"?f:e)},bu.property=function(a,b){function c(){delete this[a]}function d(){this[a]=b}function e(){var c=b.apply(this,arguments);c==null?delete this[a]:this[a]=c}return arguments.length<2?this.node()[a]:this.each(b==null?c:typeof b=="function"?e:d)},bu.text=function(a){return arguments.length<1?this.node().textContent:this.each(typeof a=="function"?function(){var b=a.apply(this,arguments);this.textContent=b==null?"":b}:a==null?function(){this.textContent
 =""}:function(){this.textContent=a})},bu.html=function(a){return arguments.length<1?this.node().innerHTML:this.each(typeof a=="function"?function(){var b=a.apply(this,arguments);this.innerHTML=b==null?"":b}:a==null?function(){this.innerHTML=""}:function(){this.innerHTML=a})},bu.append=function(a){function b(){return this.appendChild(document.createElementNS(this.namespaceURI,a))}function c(){return this.appendChild(document.createElementNS(a.space,a.local))}return a=d3.ns.qualify(a),this.select(a.local?c:b)},bu.insert=function(a,b){function c(){return this.insertBefore(document.createElementNS(this.namespaceURI,a),bp(b,this))}function d(){return this.insertBefore(document.createElementNS(a.space,a.local),bp(b,this))}return a=d3.ns.qualify(a),this.select(a.local?d:c)},bu.remove=function(){return this.each(function(){var a=this.parentNode;a&&a.removeChild(this)})},bu.data=function(a,b){function g(a,c){var d,e=a.length,f=c.length,g=Math.min(e,f),l=Math.max(e,f),m=[],n=[],o=[],p,q;if(b)
 {var r=new k,s=[],t,u=c.length;for(d=-1;++d<e;)t=b.call(p=a[d],p.__data__,d),r.has(t)?o[u++]=p:r.set(t,p),s.push(t);for(d=-1;++d<f;)t=b.call(c,q=c[d],d),r.has(t)?(m[d]=p=r.get(t),p.__data__=q,n[d]=o[d]=null):(n[d]=bz(q),m[d]=o[d]=null),r.remove(t);for(d=-1;++d<e;)r.has(s[d])&&(o[d]=a[d])}else{for(d=-1;++d<g;)p=a[d],q=c[d],p?(p.__data__=q,m[d]=p,n[d]=o[d]=null):(n[d]=bz(q),m[d]=o[d]=null);for(;d<f;++d)n[d]=bz(c[d]),m[d]=o[d]=null;for(;d<l;++d)o[d]=a[d],n[d]=m[d]=null}n.update=m,n.parentNode=m.parentNode=o.parentNode=a.parentNode,h.push(n),i.push(m),j.push(o)}var c=-1,d=this.length,e,f;if(!arguments.length){a=new Array(d=(e=this[0]).length);while(++c<d)if(f=e[c])a[c]=f.__data__;return a}var h=bD([]),i=bo([]),j=bo([]);if(typeof a=="function")while(++c<d)g(e=this[c],a.call(e,e.parentNode.__data__,c));else while(++c<d)g(e=this[c],a);return i.enter=function(){return h},i.exit=function(){return j},i},bu.datum=bu.map=function(a){return arguments.length<1?this.property("__data__"):this.prope
 rty("__data__",a)},bu.filter=function(a){var b=[],c,d,e;typeof a!="function"&&(a=bA(a));for(var f=0,g=this.length;f<g;f++){b.push(c=[]),c.parentNode=(d=this[f]).parentNode;for(var h=0,i=d.length;h<i;h++)(e=d[h])&&a.call(e,e.__data__,h)&&c.push(e)}return bo(b)},bu.order=function(){for(var a=-1,b=this.length;++a<b;)for(var c=this[a],d=c.length-1,e=c[d],f;--d>=0;)if(f=c[d])e&&e!==f.nextSibling&&e.parentNode.insertBefore(f,e),e=f;return this},bu.sort=function(a){a=bB.apply(this,arguments);for(var b=-1,c=this.length;++b<c;)this[b].sort(a);return this.order()},bu.on=function(a,b,c){arguments.length<3&&(c=!1);var d="__on"+a,e=a.indexOf(".");return e>0&&(a=a.substring(0,e)),arguments.length<2?(e=this.node()[d])&&e._:this.each(function(e,f){function i(a){var c=d3.event;d3.event=a;try{b.call(g,g.__data__,f)}finally{d3.event=c}}var g=this,h=g[d];h&&(g.removeEventListener(a,h,h.$),delete g[d]),b&&(g.addEventListener(a,g[d]=i,i.$=c),i._=b)})},bu.each=function(a){for(var b=-1,c=this.length;++b<c;
 )for(var d=this[b],e=-1,f=d.length;++e<f;){var g=d[e];g&&a.call(g,g.__data__,e,b)}return this},bu.call=function(a){return a.apply(this,(arguments[0]=this,arguments)),this},bu.empty=function(){return!this.node()},bu.node=function(a){for(var b=0,c=this.length;b<c;b++)for(var d=this[b],e=0,f=d.length;e<f;e++){var g=d[e];if(g)return g}return null},bu.transition=function(){var a=[],b,c;for(var d=-1,e=this.length;++d<e;){a.push(b=[]);for(var f=this[d],g=-1,h=f.length;++g<h;)b.push((c=f[g])?{node:c,delay:bP,duration:bQ}:null)}return bF(a,bL||++bK,Date.now())};var bC=bo([[document]]);bC[0].parentNode=br,d3.select=function(a){return typeof a=="string"?bC.select(a):bo([[a]])},d3.selectAll=function(a){return typeof a=="string"?bC.selectAll(a):bo([f(a)])};var bE=[];d3.selection.enter=bD,d3.selection.enter.prototype=bE,bE.append=bu.append,bE.insert=bu.insert,bE.empty=bu.empty,bE.node=bu.node,bE.select=function(a){var b=[],c,d,e,f,g;for(var h=-1,i=this.length;++h<i;){e=(f=this[h]).update,b.push(c
 =[]),c.parentNode=f.parentNode;for(var j=-1,k=f.length;++j<k;)(g=f[j])?(c.push(e[j]=d=a.call(f.parentNode,g.__data__,j)),d.__data__=g.__data__):c.push(null)}return bo(b)};var bG={},bJ=[],bK=0,bL=0,bM=0,bN=250,bO=d3.ease("cubic-in-out"),bP=bM,bQ=bN,bR=bO;bJ.call=bu.call,d3.transition=function(a){return arguments.length?bL?a.transition():a:bC.transition()},d3.transition.prototype=bJ,bJ.select=function(a){var b=[],c,d,e;typeof a!="function"&&(a=bv(a));for(var f=-1,g=this.length;++f<g;){b.push(c=[]);for(var h=this[f],i=-1,j=h.length;++i<j;)(e=h[i])&&(d=a.call(e.node,e.node.__data__,i))?("__data__"in e.node&&(d.__data__=e.node.__data__),c.push({node:d,delay:e.delay,duration:e.duration})):c.push(null)}return bF(b,this.id,this.time).ease(this.ease())},bJ.selectAll=function(a){var b=[],c,d,e;typeof a!="function"&&(a=bw(a));for(var f=-1,g=this.length;++f<g;)for(var h=this[f],i=-1,j=h.length;++i<j;)if(e=h[i]){d=a.call(e.node,e.node.__data__,i),b.push(c=[]);for(var k=-1,l=d.length;++k<l;)c.pus
 h({node:d[k],delay:e.delay,duration:e.duration})}return bF(b,this.id,this.time).ease(this.ease())},bJ.attr=function(a,b){return this.attrTween(a,bI(a,b))},bJ.attrTween=function(a,b){function d(a,d){var e=b.call(this,a,d,this.getAttribute(c));return e===bG?(this.removeAttribute(c),null):e&&function(a){this.setAttribute(c,e(a))}}function e(a,d){var e=b.call(this,a,d,this.getAttributeNS(c.space,c.local));return e===bG?(this.removeAttributeNS(c.space,c.local),null):e&&function(a){this.setAttributeNS(c.space,c.local,e(a))}}var c=d3.ns.qualify(a);return this.tween("attr."+a,c.local?e:d)},bJ.style=function(a,b,c){return arguments.length<3&&(c=""),this.styleTween(a,bI(a,b),c)},bJ.styleTween=function(a,b,c){return arguments.length<3&&(c=""),this.tween("style."+a,function(d,e){var f=b.call(this,d,e,window.getComputedStyle(this,null).getPropertyValue(a));return f===bG?(this.style.removeProperty(a),null):f&&function(b){this.style.setProperty(a,f(b),c)}})},bJ.text=function(a){return this.tween("
 text",function(b,c){this.textContent=typeof a=="function"?a.call(this,b,c):a})},bJ.remove=function(){return this.each("end.transition",function(){var a;!this.__transition__&&(a=this.parentNode)&&a.removeChild(this)})},bJ.delay=function(a){var b=this;return b.each(typeof a=="function"?function(c,d,e){b[e][d].delay=a.apply(this,arguments)|0}:(a|=0,function(c,d,e){b[e][d].delay=a}))},bJ.duration=function(a){var b=this;return b.each(typeof a=="function"?function(c,d,e){b[e][d].duration=Math.max(1,a.apply(this,arguments)|0)}:(a=Math.max(1,a|0),function(c,d,e){b[e][d].duration=a}))},bJ.transition=function(){return this.select(o)};var bT=null,bU,bV;d3.timer=function(a,b,c){var d=!1,e,f=bT;if(arguments.length<3){if(arguments.length<2)b=0;else if(!isFinite(b))return;c=Date.now()}while(f){if(f.callback===a){f.then=c,f.delay=b,d=!0;break}e=f,f=f.next}d||(bT={callback:a,then:c,delay:b,next:bT}),bU||(bV=clearTimeout(bV),bU=1,bY(bW))},d3.timer.flush=function(){var a,b=Date.now(),c=bT;while(c)a=b-
 c.then,c.delay||(c.flush=c.callback(a)),c=c.next;bX()};var bY=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(a){setTimeout(a,17)};d3.transform=function(a){var b=document.createElementNS(d3.ns.prefix.svg,"g"),c={a:1,b:0,c:0,d:1,e:0,f:0};return(d3.transform=function(a){b.setAttribute("transform",a);var d=b.transform.baseVal.consolidate();return new bZ(d?d.matrix:c)})(a)},bZ.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var cb=180/Math.PI;d3.mouse=function(a){return cd(a,$())};var cc=/WebKit/.test(navigator.userAgent)?-1:0;d3.touches=function(a,b){return arguments.length<2&&(b=$().touches),b?f(b).map(function(b){var c=cd(a,b);return c.identifier=b.identifier,c}):[]},d3.scale={},d3.scale.linear=function(){return cj([0,1],[0,1],d3.interpolate,!1)},d3.scale.log=function(){return cr
 (d3.scale.linear(),ct)};var cs=d3.format(".0e");ct.pow=function(a){return Math.pow(10,a)},cu.pow=function(a){return-Math.pow(10,-a)},d3.scale.pow=function(){return cv(d3.scale.linear(),1)},d3.scale.sqrt=function(){return d3.scale.pow().exponent(.5)},d3.scale.ordinal=function(){return cx([],{t:"range",x:[]})},d3.scale.category10=function(){return d3.scale.ordinal().range(cy)},d3.scale.category20=function(){return d3.scale.ordinal().range(cz)},d3.scale.category20b=function(){return d3.scale.ordinal().range(cA)},d3.scale.category20c=function(){return d3.scale.ordinal().range(cB)};var cy=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],cz=["#1f77b4","#aec7e8","#ff7f0e","#ffbb78","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5","#8c564b","#c49c94","#e377c2","#f7b6d2","#7f7f7f","#c7c7c7","#bcbd22","#dbdb8d","#17becf","#9edae5"],cA=["#393b79","#5254a3","#6b6ecf","#9c9ede","#637939","#8ca252","#b5cf6b","#cedb9c","#8c6d31","#bd9
 e39","#e7ba52","#e7cb94","#843c39","#ad494a","#d6616b","#e7969c","#7b4173","#a55194","#ce6dbd","#de9ed6"],cB=["#3182bd","#6baed6","#9ecae1","#c6dbef","#e6550d","#fd8d3c","#fdae6b","#fdd0a2","#31a354","#74c476","#a1d99b","#c7e9c0","#756bb1","#9e9ac8","#bcbddc","#dadaeb","#636363","#969696","#bdbdbd","#d9d9d9"];d3.scale.quantile=function(){return cC([],[])},d3.scale.quantize=function(){return cD(0,1,[0,1])},d3.scale.identity=function(){return cE([0,1])},d3.svg={},d3.svg.arc=function(){function e(){var e=a.apply(this,arguments),f=b.apply(this,arguments),g=c.apply(this,arguments)+cF,h=d.apply(this,arguments)+cF,i=(h<g&&(i=g,g=h,h=i),h-g),j=i<Math.PI?"0":"1",k=Math.cos(g),l=Math.sin(g),m=Math.cos(h),n=Math.sin(h);return i>=cG?e?"M0,"+f+"A"+f+","+f+" 0 1,1 0,"+ -f+"A"+f+","+f+" 0 1,1 0,"+f+"M0,"+e+"A"+e+","+e+" 0 1,0 0,"+ -e+"A"+e+","+e+" 0 1,0 0,"+e+"Z":"M0,"+f+"A"+f+","+f+" 0 1,1 0,"+ -f+"A"+f+","+f+" 0 1,1 0,"+f+"Z":e?"M"+f*k+","+f*l+"A"+f+","+f+" 0 "+j+",1 "+f*m+","+f*n+"L"+e*m+","+e*
 n+"A"+e+","+e+" 0 "+j+",0 "+e*k+","+e*l+"Z":"M"+f*k+","+f*l+"A"+f+","+f+" 0 "+j+",1 "+f*m+","+f*n+"L0,0"+"Z"}var a=cH,b=cI,c=cJ,d=cK;return e.innerRadius=function(b){return arguments.length?(a=q(b),e):a},e.outerRadius=function(a){return arguments.length?(b=q(a),e):b},e.startAngle=function(a){return arguments.length?(c=q(a),e):c},e.endAngle=function(a){return arguments.length?(d=q(a),e):d},e.centroid=function(){var e=(a.apply(this,arguments)+b.apply(this,arguments))/2,f=(c.apply(this,arguments)+d.apply(this,arguments))/2+cF;return[Math.cos(f)*e,Math.sin(f)*e]},e};var cF=-Math.PI/2,cG=2*Math.PI-1e-6;d3.svg.line=function(){return cL(n)};var cO="linear",cP=d3.map({linear:cQ,"step-before":cR,"step-after":cS,basis:cY,"basis-open":cZ,"basis-closed":c$,bundle:c_,cardinal:cV,"cardinal-open":cT,"cardinal-closed":cU,monotone:di}),db=[0,2/3,1/3,0],dc=[0,1/3,2/3,0],dd=[0,1/6,2/3,1/6];d3.svg.line.radial=function(){var a=cL(dj);return a.radius=a.x,delete a.x,a.angle=a.y,delete a.y,a},cR.reverse=cS
 ,cS.reverse=cR,d3.svg.area=function(){return dk(Object)},d3.svg.area.radial=function(){var a=dk(dj);return a.radius=a.x,delete a.x,a.innerRadius=a.x0,delete a.x0,a.outerRadius=a.x1,delete a.x1,a.angle=a.y,delete a.y,a.startAngle=a.y0,delete a.y0,a.endAngle=a.y1,delete a.y1,a},d3.svg.chord=function(){function f(c,d){var e=g(this,a,c,d),f=g(this,b,c,d);return"M"+e.p0+i(e.r,e.p1,e.a1-e.a0)+(h(e,f)?j(e.r,e.p1,e.r,e.p0):j(e.r,e.p1,f.r,f.p0)+i(f.r,f.p1,f.a1-f.a0)+j(f.r,f.p1,e.r,e.p0))+"Z"}function g(a,b,f,g){var h=b.call(a,f,g),i=c.call(a,h,g),j=d.call(a,h,g)+cF,k=e.call(a,h,g)+cF;return{r:i,a0:j,a1:k,p0:[i*Math.cos(j),i*Math.sin(j)],p1:[i*Math.cos(k),i*Math.sin(k)]}}function h(a,b){return a.a0==b.a0&&a.a1==b.a1}function i(a,b,c){return"A"+a+","+a+" 0 "+ +(c>Math.PI)+",1 "+b}function j(a,b,c,d){return"Q 0,0 "+d}var a=dl,b=dm,c=dn,d=cJ,e=cK;return f.radius=function(a){return arguments.length?(c=q(a),f):c},f.source=function(b){return arguments.length?(a=q(b),f):a},f.target=function(a){retur
 n arguments.length?(b=q(a),f):b},f.startAngle=function(a){return arguments.length?(d=q(a),f):d},f.endAngle=function(a){return arguments.length?(e=q(a),f):e},f},d3.svg.diagonal=function(){function d(d,e){var f=a.call(this,d,e),g=b.call(this,d,e),h=(f.y+g.y)/2,i=[f,{x:f.x,y:h},{x:g.x,y:h},g];return i=i.map(c),"M"+i[0]+"C"+i[1]+" "+i[2]+" "+i[3]}var a=dl,b=dm,c=dr;return d.source=function(b){return arguments.length?(a=q(b),d):a},d.target=function(a){return arguments.length?(b=q(a),d):b},d.projection=function(a){return arguments.length?(c=a,d):c},d},d3.svg.diagonal.radial=function(){var a=d3.svg.diagonal(),b=dr,c=a.projection;return a.projection=function(a){return arguments.length?c(ds(b=a)):b},a},d3.svg.mouse=d3.mouse,d3.svg.touches=d3.touches,d3.svg.symbol=function(){function c(c,d){return(dw.get(a.call(this,c,d))||dv)(b.call(this,c,d))}var a=du,b=dt;return c
-.type=function(b){return arguments.length?(a=q(b),c):a},c.size=function(a){return arguments.length?(b=q(a),c):b},c};var dw=d3.map({circle:dv,cross:function(a){var b=Math.sqrt(a/5)/2;return"M"+ -3*b+","+ -b+"H"+ -b+"V"+ -3*b+"H"+b+"V"+ -b+"H"+3*b+"V"+b+"H"+b+"V"+3*b+"H"+ -b+"V"+b+"H"+ -3*b+"Z"},diamond:function(a){var b=Math.sqrt(a/(2*dy)),c=b*dy;return"M0,"+ -b+"L"+c+",0"+" 0,"+b+" "+ -c+",0"+"Z"},square:function(a){var b=Math.sqrt(a)/2;return"M"+ -b+","+ -b+"L"+b+","+ -b+" "+b+","+b+" "+ -b+","+b+"Z"},"triangle-down":function(a){var b=Math.sqrt(a/dx),c=b*dx/2;return"M0,"+c+"L"+b+","+ -c+" "+ -b+","+ -c+"Z"},"triangle-up":function(a){var b=Math.sqrt(a/dx),c=b*dx/2;return"M0,"+ -c+"L"+b+","+c+" "+ -b+","+c+"Z"}});d3.svg.symbolTypes=dw.keys();var dx=Math.sqrt(3),dy=Math.tan(30*Math.PI/180);d3.svg.axis=function(){function k(k){k.each(function(){var k=d3.select(this),l=h==null?a.ticks?a.ticks.apply(a,g):a.domain():h,m=i==null?a.tickFormat?a.tickFormat.apply(a,g):String:i,n=dB(a,l,j),o=k
 .selectAll(".minor").data(n,String),p=o.enter().insert("line","g").attr("class","tick minor").style("opacity",1e-6),q=d3.transition(o.exit()).style("opacity",1e-6).remove(),r=d3.transition(o).style("opacity",1),s=k.selectAll("g").data(l,String),t=s.enter().insert("g","path").style("opacity",1e-6),u=d3.transition(s.exit()).style("opacity",1e-6).remove(),v=d3.transition(s).style("opacity",1),w,x=cg(a),y=k.selectAll(".domain").data([0]),z=y.enter().append("path").attr("class","domain"),A=d3.transition(y),B=a.copy(),C=this.__chart__||B;this.__chart__=B,t.append("line").attr("class","tick"),t.append("text"),v.select("text").text(m);switch(b){case"bottom":w=dz,p.attr("y2",d),r.attr("x2",0).attr("y2",d),t.select("line").attr("y2",c),t.select("text").attr("y",Math.max(c,0)+f),v.select("line").attr("x2",0).attr("y2",c),v.select("text").attr("x",0).attr("y",Math.max(c,0)+f).attr("dy",".71em").attr("text-anchor","middle"),A.attr("d","M"+x[0]+","+e+"V0H"+x[1]+"V"+e);break;case"top":w=dz,p.attr(
 "y2",-d),r.attr("x2",0).attr("y2",-d),t.select("line").attr("y2",-c),t.select("text").attr("y",-(Math.max(c,0)+f)),v.select("line").attr("x2",0).attr("y2",-c),v.select("text").attr("x",0).attr("y",-(Math.max(c,0)+f)).attr("dy","0em").attr("text-anchor","middle"),A.attr("d","M"+x[0]+","+ -e+"V0H"+x[1]+"V"+ -e);break;case"left":w=dA,p.attr("x2",-d),r.attr("x2",-d).attr("y2",0),t.select("line").attr("x2",-c),t.select("text").attr("x",-(Math.max(c,0)+f)),v.select("line").attr("x2",-c).attr("y2",0),v.select("text").attr("x",-(Math.max(c,0)+f)).attr("y",0).attr("dy",".32em").attr("text-anchor","end"),A.attr("d","M"+ -e+","+x[0]+"H0V"+x[1]+"H"+ -e);break;case"right":w=dA,p.attr("x2",d),r.attr("x2",d).attr("y2",0),t.select("line").attr("x2",c),t.select("text").attr("x",Math.max(c,0)+f),v.select("line").attr("x2",c).attr("y2",0),v.select("text").attr("x",Math.max(c,0)+f).attr("y",0).attr("dy",".32em").attr("text-anchor","start"),A.attr("d","M"+e+","+x[0]+"H0V"+x[1]+"H"+e)}if(a.ticks)t.call(w
 ,C),v.call(w,B),u.call(w,B),p.call(w,C),r.call(w,B),q.call(w,B);else{var D=B.rangeBand()/2,E=function(a){return B(a)+D};t.call(w,E),v.call(w,E)}})}var a=d3.scale.linear(),b="bottom",c=6,d=6,e=6,f=3,g=[10],h=null,i,j=0;return k.scale=function(b){return arguments.length?(a=b,k):a},k.orient=function(a){return arguments.length?(b=a,k):b},k.ticks=function(){return arguments.length?(g=arguments,k):g},k.tickValues=function(a){return arguments.length?(h=a,k):h},k.tickFormat=function(a){return arguments.length?(i=a,k):i},k.tickSize=function(a,b,f){if(!arguments.length)return c;var g=arguments.length-1;return c=+a,d=g>1?+b:c,e=g>0?+arguments[g]:c,k},k.tickPadding=function(a){return arguments.length?(f=+a,k):f},k.tickSubdivide=function(a){return arguments.length?(j=+a,k):j},k},d3.svg.brush=function(){function g(a){a.each(function(){var a=d3.select(this),e=a.selectAll(".background").data([0]),f=a.selectAll(".extent").data([0]),l=a.selectAll(".resize").data(d,String),m;a.style("pointer-events","
 all").on("mousedown.brush",k).on("touchstart.brush",k),e.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair"),f.enter().append("rect").attr("class","extent").style("cursor","move"),l.enter().append("g").attr("class",function(a){return"resize "+a}).style("cursor",function(a){return dC[a]}).append("rect").attr("x",function(a){return/[ew]$/.test(a)?-3:null}).attr("y",function(a){return/^[ns]/.test(a)?-3:null}).attr("width",6).attr("height",6).style("visibility","hidden"),l.style("display",g.empty()?"none":null),l.exit().remove(),b&&(m=cg(b),e.attr("x",m[0]).attr("width",m[1]-m[0]),i(a)),c&&(m=cg(c),e.attr("y",m[0]).attr("height",m[1]-m[0]),j(a)),h(a)})}function h(a){a.selectAll(".resize").attr("transform",function(a){return"translate("+e[+/e$/.test(a)][0]+","+e[+/^s/.test(a)][1]+")"})}function i(a){a.select(".extent").attr("x",e[0][0]),a.selectAll(".extent,.n>rect,.s>rect").attr("width",e[1][0]-e[0][0])}function j(a){a.select(".exte
 nt").attr("y",e[0][1]),a.selectAll(".extent,.e>rect,.w>rect").attr("height",e[1][1]-e[0][1])}function k(){function x(){var a=d3.event.changedTouches;return a?d3.touches(d,a)[0]:d3.mouse(d)}function y(){d3.event.keyCode==32&&(q||(r=null,s[0]-=e[1][0],s[1]-=e[1][1],q=2),Z())}function z(){d3.event.keyCode==32&&q==2&&(s[0]+=e[1][0],s[1]+=e[1][1],q=0,Z())}function A(){var a=x(),d=!1;t&&(a[0]+=t[0],a[1]+=t[1]),q||(d3.event.altKey?(r||(r=[(e[0][0]+e[1][0])/2,(e[0][1]+e[1][1])/2]),s[0]=e[+(a[0]<r[0])][0],s[1]=e[+(a[1]<r[1])][1]):r=null),o&&B(a,b,0)&&(i(m),d=!0),p&&B(a,c,1)&&(j(m),d=!0),d&&(h(m),l({type:"brush",mode:q?"move":"resize"}))}function B(a,b,c){var d=cg(b),g=d[0],h=d[1],i=s[c],j=e[1][c]-e[0][c],k,l;q&&(g-=i,h-=j+i),k=Math.max(g,Math.min(h,a[c])),q?l=(k+=i)+j:(r&&(i=Math.max(g,Math.min(h,2*r[c]-k))),i<k?(l=k,k=i):l=i);if(e[0][c]!==k||e[1][c]!==l)return f=null,e[0][c]=k,e[1][c]=l,!0}function C(){A(),m.style("pointer-events","all").selectAll(".resize").style("display",g.empty()?"none"
 :null),d3.select("body").style("cursor",null),u.on("mousemove.brush",null).on("mouseup.brush",null).on("touchmove.brush",null).on("touchend.brush",null).on("keydown.brush",null).on("keyup.brush",null),l({type:"brushend"}),Z()}var d=this,k=d3.select(d3.event.target),l=a.of(d,arguments),m=d3.select(d),n=k.datum(),o=!/^(n|s)$/.test(n)&&b,p=!/^(e|w)$/.test(n)&&c,q=k.classed("extent"),r,s=x(),t,u=d3.select(window).on("mousemove.brush",A).on("mouseup.brush",C).on("touchmove.brush",A).on("touchend.brush",C).on("keydown.brush",y).on("keyup.brush",z);if(q)s[0]=e[0][0]-s[0],s[1]=e[0][1]-s[1];else if(n){var v=+/w$/.test(n),w=+/^n/.test(n);t=[e[1-v][0]-s[0],e[1-w][1]-s[1]],s[0]=e[v][0],s[1]=e[w][1]}else d3.event.altKey&&(r=s.slice());m.style("pointer-events","none").selectAll(".resize").style("display",null),d3.select("body").style("cursor",k.style("cursor")),l({type:"brushstart"}),A(),Z()}var a=_(g,"brushstart","brush","brushend"),b=null,c=null,d=dD[0],e=[[0,0],[0,0]],f;return g.x=function(a){
 return arguments.length?(b=a,d=dD[!b<<1|!c],g):b},g.y=function(a){return arguments.length?(c=a,d=dD[!b<<1|!c],g):c},g.extent=function(a){var d,h,i,j,k;return arguments.length?(f=[[0,0],[0,0]],b&&(d=a[0],h=a[1],c&&(d=d[0],h=h[0]),f[0][0]=d,f[1][0]=h,b.invert&&(d=b(d),h=b(h)),h<d&&(k=d,d=h,h=k),e[0][0]=d|0,e[1][0]=h|0),c&&(i=a[0],j=a[1],b&&(i=i[1],j=j[1]),f[0][1]=i,f[1][1]=j,c.invert&&(i=c(i),j=c(j)),j<i&&(k=i,i=j,j=k),e[0][1]=i|0,e[1][1]=j|0),g):(a=f||e,b&&(d=a[0][0],h=a[1][0],f||(d=e[0][0],h=e[1][0],b.invert&&(d=b.invert(d),h=b.invert(h)),h<d&&(k=d,d=h,h=k))),c&&(i=a[0][1],j=a[1][1],f||(i=e[0][1],j=e[1][1],c.invert&&(i=c.invert(i),j=c.invert(j)),j<i&&(k=i,i=j,j=k))),b&&c?[[d,i],[h,j]]:b?[d,h]:c&&[i,j])},g.clear=function(){return f=null,e[0][0]=e[0][1]=e[1][0]=e[1][1]=0,g},g.empty=function(){return b&&e[0][0]===e[1][0]||c&&e[0][1]===e[1][1]},d3.rebind(g,a,"on")};var dC={n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw
 -resize"},dD=[["n","e","s","w","nw","ne","se","sw"],["e","w"],["n","s"],[]];d3.behavior={},d3.behavior.drag=function(){function c(){this.on("mousedown.drag",d).on("touchstart.drag",d)}function d(){function j(){var a=c.parentNode,b=d3.event.changedTouches;return b?d3.touches(a,b)[0]:d3.mouse(a)}function k(){if(!c.parentNode)return l();var a=j(),b=a[0]-g[0],e=a[1]-g[1];h|=b|e,g=a,Z(),d({type:"drag",x:a[0]+f[0],y:a[1]+f[1],dx:b,dy:e})}function l(){d({type:"dragend"}),h&&(Z(),d3.event.target===e&&i.on("click.drag",m,!0)),i.on("mousemove.drag",null).on("touchmove.drag",null).on("mouseup.drag",null).on("touchend.drag",null)}function m(){Z(),i.on("click.drag",null)}var c=this,d=a.of(c,arguments),e=d3.event.target,f,g=j(),h=0,i=d3.select(window).on("mousemove.drag",k).on("touchmove.drag",k).on("mouseup.drag",l,!0).on("touchend.drag",l,!0);b?(f=b.apply(c,arguments),f=[f.x-g[0],f.y-g[1]]):f=[0,0],Z(),d({type:"dragstart"})}var a=_(c,"drag","dragstart","dragend"),b=null;return c.origin=function
 (a){return arguments.length?(b=a,c):b},d3.rebind(c,a,"on")},d3.behavior.zoom=function(){function l(){this.on("mousedown.zoom",r).on("mousewheel.zoom",s).on("mousemove.zoom",t).on("DOMMouseScroll.zoom",s).on("dblclick.zoom",u).on("touchstart.zoom",v).on("touchmove.zoom",w).on("touchend.zoom",v)}function m(b){return[(b[0]-a[0])/c,(b[1]-a[1])/c]}function n(b){return[b[0]*c+a[0],b[1]*c+a[1]]}function o(a){c=Math.max(e[0],Math.min(e[1],a))}function p(b,c){c=n(c),a[0]+=b[0]-c[0],a[1]+=b[1]-c[1]}function q(b){h&&h.domain(g.range().map(function(b){return(b-a[0])/c}).map(g.invert)),j&&j.domain(i.range().map(function(b){return(b-a[1])/c}).map(i.invert)),d3.event.preventDefault(),b({type:"zoom",scale:c,translate:a})}function r(){function h(){d=1,p(d3.mouse(a),g),q(b)}function i(){d&&Z(),e.on("mousemove.zoom",null).on("mouseup.zoom",null),d&&d3.event.target===c&&e.on("click.zoom",j,!0)}function j(){Z(),e.on("click.zoom",null)}var a=this,b=f.of(a,arguments),c=d3.event.target,d=0,e=d3.select(wind
 ow).on("mousemove.zoom",h).on("mouseup.zoom",i),g=m(d3.mouse(a));window.focus(),Z()}function s(){b||(b=m(d3.mouse(this))),o(Math.pow(2,dG()*.002)*c),p(d3.mouse(this),b),q(f.of(this,arguments))}function t(){b=null}function u(){var a=d3.mouse(this),b=m(a);o(d3.event.shiftKey?c/2:c*2),p(a,b),q(f.of(this,arguments))}function v(){var a=d3.touches(this),e=Date.now();d=c,b={},a.forEach(function(a){b[a.identifier]=m(a)}),Z();if(a.length===1&&e-k<500){var g=a[0],h=m(a[0]);o(c*2),p(g,h),q(f.of(this,arguments))}k=e}function w(){var a=d3.touches(this),c=a[0],e=b[c.identifier];if(g=a[1]){var g,h=b[g.identifier];c=[(c[0]+g[0])/2,(c[1]+g[1])/2],e=[(e[0]+h[0])/2,(e[1]+h[1])/2],o(d3.event.scale*d)}p(c,e),q(f.of(this,arguments))}var a=[0,0],b,c=1,d,e=dF,f=_(l,"zoom"),g,h,i,j,k;return l.translate=function(b){return arguments.length?(a=b.map(Number),l):a},l.scale=function(a){return arguments.length?(c=+a,l):c},l.scaleExtent=function(a){return arguments.length?(e=a==null?dF:a.map(Number),l):e},l.x=funct
 ion(a){return arguments.length?(h=a,g=a.copy(),l):h},l.y=function(a){return arguments.length?(j=a,i=a.copy(),l):j},d3.rebind(l,f,"on")};var dE,dF=[0,Infinity];d3.layout={},d3.layout.bundle=function(){return function(a){var b=[],c=-1,d=a.length;while(++c<d)b.push(dH(a[c]));return b}},d3.layout.chord=function(){function j(){var a={},j=[],l=d3.range(e),m=[],n,o,p,q,r;b=[],c=[],n=0,q=-1;while(++q<e){o=0,r=-1;while(++r<e)o+=d[q][r];j.push(o),m.push(d3.range(e)),n+=o}g&&l.sort(function(a,b){return g(j[a],j[b])}),h&&m.forEach(function(a,b){a.sort(function(a,c){return h(d[b][a],d[b][c])})}),n=(2*Math.PI-f*e)/n,o=0,q=-1;while(++q<e){p=o,r=-1;while(++r<e){var s=l[q],t=m[s][r],u=d[s][t],v=o,w=o+=u*n;a[s+"-"+t]={index:s,subindex:t,startAngle:v,endAngle:w,value:u}}c[s]={index:s,startAngle:p,endAngle:o,value:(o-p)/n},o+=f}q=-1;while(++q<e){r=q-1;while(++r<e){var x=a[q+"-"+r],y=a[r+"-"+q];(x.value||y.value)&&b.push(x.value<y.value?{source:y,target:x}:{source:x,target:y})}}i&&k()}function k(){b.sor
 t(function(a,b){return i((a.source.value+a.target.value)/2,(b.source.value+b.target.value)/2)})}var a={},b,c,d,e,f=0,g,h,i;return a.matrix=function(f){return arguments.length?(e=(d=f)&&d.length,b=c=null,a):d},a.padding=function(d){return arguments.length?(f=d,b=c=null,a):f},a.sortGroups=function(d){return arguments.length?(g=d,b=c=null,a):g},a.sortSubgroups=function(c){return arguments.length?(h=c,b=null,a):h},a.sortChords=function(c){return arguments.length?(i=c,b&&k(),a):i},a.chords=function(){return b||j(),b},a.groups=function(){return c||j(),c},a},d3.layout.force=function(){function t(a){return function(b,c,d,e,f){if(b.point!==a){var g=b.cx-a.x,h=b.cy-a.y,i=1/Math.sqrt(g*g+h*h);if((e-c)*i<k){var j=b.charge*i*i;return a.px-=g*j,a.py-=h*j,!0}if(b.point&&isFinite(i)){var j=b.pointCharge*i*i;a.px-=g*j,a.py-=h*j}}return!b.charge}}function u(b){dM(dL=b),dK=a}var a={},b=d3.dispatch("start","tick","end"),c=[1,1],d,e,f=.9,g=dR,h=dS,i=-30,j=.1,k=.8,l,m=[],o=[],p,r,s;return a.tick=function
 (){if((e*=.99)<.005)return b.end({type:"end",alpha:e=0}),!0;var a=m.length,d=o.length,g,h,k,l,n,q,u,v,w;for(h=0;h<d;++h){k=o[h],l=k.source,n=k.target,v=n.x-l.x,w=n.y-l.y;if(q=v*v+w*w)q=e*r[h]*((q=Math.sqrt(q))-p[h])/q,v*=q,w*=q,n.x-=v*(u=l.weight/(n.weight+l.weight)),n.y-=w*u,l.x+=v*(u=1-u),l.y+=w*u}if(u=e*j){v=c[0]/2,w=c[1]/2,h=-1;if(u)while(++h<a)k=m[h],k.x+=(v-k.x)*u,k.y+=(w-k.y)*u}if(i){dQ(g=d3.geom.quadtree(m),e,s),h=-1;while(++h<a)(k=m[h]).fixed||g.visit(t(k))}h=-1;while(++h<a)k=m[h],k.fixed?(k.x=k.px,k.y=k.py):(k.x-=(k.px-(k.px=k.x))*f,k.y-=(k.py-(k.py=k.y))*f);b.tick({type:"tick",alpha:e})},a.nodes=function(b){return arguments.length?(m=b,a):m},a.links=function(b){return arguments.length?(o=b,a):o},a.size=function(b){return arguments.length?(c=b,a):c},a.linkDistance=function(b){return arguments.length?(g=q(b),a):g},a.distance=a.linkDistance,a.linkStrength=function(b){return arguments.length?(h=q(b),a):h},a.friction=function(b){return arguments.length?(f=b,a):f},a.charge=func
 tion(b){return arguments.length?(i=typeof b=="function"?b:+b,a):i},a.gravity=function(b){return arguments.length?(j=b,a):j},a.theta=function(b){return arguments.length?(k=b,a):k},a.alpha=function(c){return arguments.length?(e?c>0?e=c:e=0:c>0&&(b.start({type:"start",alpha:e=c}),d3.timer(a.tick)),a):e},a.start=function(){function q(a,c){var d=t(b),e=-1,f=d.length,g;while(++e<f)if(!isNaN(g=d[e][a]))return g;return Math.random()*c}function t(){if(!l){l=[];for(d=0;d<e;++d)l[d]=[];for(d=0;d<f;++d){var a=o[d];l[a.source.index].push(a.target),l[a.target.index].push(a.source)}}return l[b]}var b,d,e=m.length,f=o.length,j=c[0],k=c[1],l,n;for(b=0;b<e;++b)(n=m[b]).index=b,n.weight=0;p=[],r=[];for(b=0;b<f;++b)n=o[b],typeof n.source=="number"&&(n.source=m[n.source]),typeof n.target=="number"&&(n.target=m[n.target]),p[b]=g.call(this,n,b),r[b]=h.call(this,n,b),++n.source.weight,++n.target.weight;for(b=0;b<e;++b)n=m[b],isNaN(n.x)&&(n.x=q("x",j)),isNaN(n.y)&&(n.y=q("y",k)),isNaN(n.px)&&(n.px=n.x),isNa
 N(n.py)&&(n.py=n.y);s=[];if(typeof i=="function")for(b=0;b<e;++b)s[b]=+i.call(this,m[b],b);else for(b=0;b<e;++b)s[b]=i;return a.resume()},a.resume=function(){return a.alpha(.1)},a.stop=function(){return a.alpha(0)},a.drag=function(){d||(d=d3.behavior.drag().origin(n).on("dragstart",u).on("drag",dP).on("dragend",dO)),this.on("mouseover.force",dM).on("mouseout.force",dN).call(d)},d3.rebind(a,b,"on")};var dK,dL;d3.layout.partition=function(){function c(a,b,d,e){var f=a.children;a.x=b,a.y=a.depth*e,a.dx=d,a.dy=e;if(f&&(h=f.length)){var g=-1,h,i,j;d=a.value?d/a.value:0;while(++g<h)c(i=f[g],b,j=i.value*d,e),b+=j}}function d(a){var b=a.children,c=0;if(b&&(f=b.length)){var e=-1,f;while(++e<f)c=Math.max(c,d(b[e]))}return 1+c}function e(e,f){var g=a.call(this,e,f);return c(g[0],0,b[0],b[1]/d(g[0])),g}var a=d3.layout.hierarchy(),b=[1,1];return e.size=function(a){return arguments.length?(b=a,e):b},ef(e,a)},d3.layout.pie=function(){function f(g,h){var i=g.map(function(b,c){return+a.call(f,b,c)})
 ,j=+(typeof c=="function"?c.apply(this,arguments):c),k=((typeof e=="function"?e.apply(this,arguments):e)-c)/d3.sum(i),l=d3.range(g.length);b!=null&&l.sort(b===dT?function(a,b){return i[b]-i[a]}:function(a,c){return b(g[a],g[c])});var m=[];return l.forEach(function(a){m[a]={data:g[a],value:d=i[a],startAngle:j,endAngle:j+=d*k}}),m}var a=Number,b=dT,c=0,e=2*Math.PI;return f.value=function(b){return arguments.length?(a=b,f):a},f.sort=function(a){return arguments.length?(b=a,f):b},f.startAngle=function(a){return arguments.length?(c=a,f):c},f.endAngle=function(a){return arguments.length?(e=a,f):e},f};var dT={};d3.layout.stack=function(){function g(h,i){var j=h.map(function(b,c){return a.call(g,b,c)}),k=j.map(function(a,b){return a.map(function(a,b){return[e.call(g,a,b),f.call(g,a,b)]})}),l=b.call(g,k,i);j=d3.permute(j,l),k=d3.permute(k,l);var m=c.call(g,k,i),n=j.length,o=j[0].length,p,q,r;for(q=0;q<o;++q){d.call(g,j[0][q],r=m[q],k[0][q][1]);for(p=1;p<n;++p)d.call(g,j[p][q],r+=k[p-1][q][1]
 ,k[p][q][1])}return h}var a=n,b=dZ,c=d$,d=dW,e=dU,f=dV;return g.values=function(b){return arguments.length?(a=b,g):a},g.order=function(a){return arguments.length?(b=typeof a=="function"?a:dX.get(a)||dZ,g):b},g.offset=function(a){return arguments.length?(c=typeof a=="function"?a:dY.get(a)||d$,g):c},g.x=function(a){return arguments.length?(e=a,g):e},g.y=function(a){return arguments.length?(f=a,g):f},g.out=function(a){return arguments.length?(d=a,g):d},g};var dX=d3.map({"inside-out":function(a){var b=a.length,c,d,e=a.map(d_),f=a.map(ea),g=d3.range(b).sort(function(a,b){return e[a]-e[b]}),h=0,i=0,j=[],k=[];for(c=0;c<b;++c)d=g[c],h<i?(h+=f[d],j.push(d)):(i+=f[d],k.push(d));return k.reverse().concat(j)},reverse:function(a){return d3.range(a.length).reverse()},"default":dZ}),dY=d3.map({silhouette:function(a){var b=a.length,c=a[0].length,d=[],e=0,f,g,h,i=[];for(g=0;g<c;++g){for(f=0,h=0;f<b;f++)h+=a[f][g][1];h>e&&(e=h),d.push(h)}for(g=0;g<c;++g)i[g]=(e-d[g])/2;return i},wiggle:function(a){va
 r b=a.length,c=a[0],d=c.length,e=0,f,g,h,i,j,k,l,m,n,o=[];o[0]=m=n=0;for(g=1;g<d;++g){for(f=0,i=0;f<b;++f)i+=a[f][g][1];for(f=0,j=0,l=c[g][0]-c[g-1][0];f<b;++f){for(h=0,k=(a[f][g][1]-a[f][g-1][1])/(2*l);h<f;++h)k+=(a[h][g][1]-a[h][g-1][1])/l;j+=k*a[f][g][1]}o[g]=m-=i?j/i*l:0,m<n&&(n=m)}for(g=0;g<d;++g)o[g]-=n;return o},expand:function(a){var b=a.length,c=a[0].length,d=1/b,e,f,g,h=[];for(f=0;f<c;++f){for(e=0,g=0;e<b;e++)g+=a[e][f][1];if(g)for(e=0;e<b;e++)a[e][f][1]/=g;else for(e=0;e<b;e++)a[e][f][1]=d}for(f=0;f<c;++f)h[f]=0;return h},zero:d$});d3.layout.histogram=function(){function e(e,f){var g=[],h=e.map(b,this),i=c.call(this,h,f),j=d.call(this,i,h,f),k,f=-1,l=h.length,m=j.length-1,n=a?1:1/l,o;while(++f<m)k=g[f]=[],k.dx=j[f+1]-(k.x=j[f]),k.y=0;if(m>0){f=-1;while(++f<l)o=h[f],o>=i[0]&&o<=i[1]&&(k=g[d3.bisect(j,o,1,m)-1],k.y+=n,k.push(e[f]))}return g}var a=!0,b=Number,c=ee,d=ec;return e.value=function(a){return arguments.length?(b=a,e):b},e.range=function(a){return arguments.length?(
 c=q(a),e):c},e.bins=function(a){return arguments.length?(d=typeof a=="number"?function(b){return ed(b,a)}:q(a),e):d},e.frequency=function(b){return arguments.length?(a=!!b,e):a},e},d3.layout.hierarchy=function(){function e(f,h,i){var j=b.call(g,f,h),k=ek?f:{data:f};k.depth=h,i.push(k);if(j&&(m=j.length)){var l=-1,m,n=k.children=[],o=0,p=h+1;while(++l<m)d=e(j[l],p,i),d.parent=k,n.push(d),o+=d.value;a&&n.sort(a),c&&(k.value=o)}else c&&(k.value=+c.call(g,f,h)||0);return k}function f(a,b){var d=a.children,e=0;if(d&&(i=d.length)){var h=-1,i,j=b+1;while(++h<i)e+=f(d[h],j)}else c&&(e=+c.call(g,ek?a:a.data,b)||0);return c&&(a.value=e),e}function g(a){var b=[];return e(a,0,b),b}var a=ei,b=eg,c=eh;return g.sort=function(b){return arguments.length?(a=b,g):a},g.children=function(a){return arguments.length?(b=a,g):b},g.value=function(a){return arguments.length?(c=a,g):c},g.revalue=function(a){return f(a,0),a},g};var ek=!1;d3.layout.pack=function(){function c(c,d){var e=a.call(this,c,d),f=e[0];f.
 x=0,f.y=0,es(f);var g=b[0],h=b[1],i=1/Math.max(2*f.r/g,2*f.r/h);return et(f,g/2,h/2,i),e}var a=d3.layout.hierarchy().sort(el),b=[1,1];return c.size=function(a){return arguments.length?(b=a,c):b},ef(c,a)},d3.layout.cluster=function(){function d(d,e){var f=a.call(this,d,e),g=f[0],h,i=0,j,k;eG(g,function(a){var c=a.children;c&&c.length?(a.x=ew(c),a.y=ev(c)):(a.x=h?i+=b(a,h):0,a.y=0,h=a)});var l=ex(g),m=ey(g),n=l.x-b(l,m)/2,o=m.x+b(m,l)/2;return eG(g,function(a){a.x=(a.x-n)/(o-n)*c[0],a.y=(1-(g.y?a.y/g.y:1))*c[1]}),f}var a=d3.layout.hierarchy().sort(null).value(null),b=ez,c=[1,1];return d.separation=function(a){return arguments.length?(b=a,d):b},d.size=function(a){return arguments.length?(c=a,d):c},ef(d,a)},d3.layout.tree=function(){function d(d,e){function h(a,c){var d=a.children,e=a._tree;if(d&&(f=d.length)){var f,g=d[0],i,k=g,l,m=-1;while(++m<f)l=d[m],h(l,i),k=j(l,i,k),i=l;eH(a);var n=.5*(g._tree.prelim+l._tree.prelim);c?(e.prelim=c._tree.prelim+b(a,c),e.mod=e.prelim-n):e.prelim=n}el
 se c&&(e.prelim=c._tree.prelim+b(a,c))}function i(a,b){a.x=a._tree.prelim+b;var c=a.children;if(c&&(e=c.length)){var d=-1,e;b+=a._tree.mod;while(++d<e)i(c[d],b)}}function j(a,c,d){if(c){var e=a,f=a,g=c,h=a.parent.children[0],i=e._tree.mod,j=f._tree.mod,k=g._tree.mod,l=h._tree.mod,m;while(g=eB(g),e=eA(e),g&&e)h=eA(h),f=eB(f),f._tree.ancestor=a,m=g._tree.prelim+k-e._tree.prelim-i+b(g,e),m>0&&(eI(eJ(g,a,d),a,m),i+=m,j+=m),k+=g._tree.mod,i+=e._tree.mod,l+=h._tree.mod,j+=f._tree.mod;g&&!eB(f)&&(f._tree.thread=g,f._tree.mod+=k-j),e&&!eA(h)&&(h._tree.thread=e,h._tree.mod+=i-l,d=a)}return d}var f=a.call(this,d,e),g=f[0];eG(g,function(a,b){a._tree={ancestor:a,prelim:0,mod:0,change:0,shift:0,number:b?b._tree.number+1:0}}),h(g),i(g,-g._tree.prelim);var k=eC(g,eE),l=eC(g,eD),m=eC(g,eF),n=k.x-b(k,l)/2,o=l.x+b(l,k)/2,p=m.depth||1;return eG(g,function(a){a.x=(a.x-n)/(o-n)*c[0],a.y=a.depth/p*c[1],delete a._tree}),f}var a=d3.layout.hierarchy().sort(null).value(null),b=ez,c=[1,1];return d.separation=
 function(a){return arguments.length?(b=a,d):b},d.size=function(a){return arguments.length?(c=a,d):c},ef(d,a)},d3.layout.treemap=function(){function i(a,b){var c=-1,d=a.length,e,f;while(++c<d)f=(e=a[c]).value*(b<0?0:b),e.area=isNaN(f)||f<=0?0:f}function j(a){var b=a.children;if(b&&b.length){var c=e(a),d=[],f=b.slice(),g,h=Infinity,k,n=Math.min(c.dx,c.dy),o;i(f,c.dx*c.dy/a.value),d.area=0;while((o=f.length)>0)d.push(g=f[o-1]),d.area+=g.area,(k=l(d,n))<=h?(f.pop(),h=k):(d.area-=d.pop().area,m(d,n,c,!1),n=Math.min(c.dx,c.dy),d.length=d.area=0,h=Infinity);d.length&&(m(d,n,c,!0),d.length=d.area=0),b.forEach(j)}}function k(a){var b=a.children;if(b&&b.length){var c=e(a),d=b.slice(),f,g=[];i(d,c.dx*c.dy/a.value),g.area=0;while(f=d.pop())g.push(f),g.area+=f.area,f.z!=null&&(m(g,f.z?c.dx:c.dy,c,!d.length),g.length=g.area=0);b.forEach(k)}}function l(a,b){var c=a.area,d,e=0,f=Infinity,g=-1,i=a.length;while(++g<i){if(!(d=a[g].area))continue;d<f&&(f=d),d>e&&(e=d)}return c*=c,b*=b,c?Math.max(b*e*h/
 c,c/(b*f*h)):Infinity}function m(a,c,d,e){var f=-1,g=a.length,h=d.x,i=d.y,j=c?b(a.area/c):0,k;if(c==d.dx){if(e||j>d.dy)j=d.dy;while(++f<g)k=a[f],k.x=h,k.y=i,k.dy=j,h+=k.dx=Math.min(d.x+d.dx-h,j?b(k.area/j):0);k.z=!0,k.dx+=d.x+d.dx-h,d.y+=j,d.dy-=j}else{if(e||j>d.dx)j=d.dx;while(++f<g)k=a[f],k.x=h,k.y=i,k.dx=j,i+=k.dy=Math.min(d.y+d.dy-i,j?b(k.area/j):0);k.z=!1,k.dy+=d.y+d.dy-i,d.x+=j,d.dx-=j}}function n(b){var d=g||a(b),e=d[0];return e.x=0,e.y=0,e.dx=c[0],e.dy=c[1],g&&a.revalue(e),i([e],e

<TRUNCATED>

[014/100] [abbrv] [partial] Reverting the erroneous merge by Sebastian according to the instructions in INFRA-6876

Posted by wi...@apache.org.
http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/kiwi/kiwi-tripletable/src/test/java/org/apache/marmotta/kiwi/model/caching/TripleTableTest.java
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-tripletable/src/test/java/org/apache/marmotta/kiwi/model/caching/TripleTableTest.java b/libraries/kiwi/kiwi-tripletable/src/test/java/org/apache/marmotta/kiwi/model/caching/TripleTableTest.java
new file mode 100644
index 0000000..98858bc
--- /dev/null
+++ b/libraries/kiwi/kiwi-tripletable/src/test/java/org/apache/marmotta/kiwi/model/caching/TripleTableTest.java
@@ -0,0 +1,127 @@
+/*
+ * 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.kiwi.model.caching;
+
+import org.apache.commons.lang3.RandomStringUtils;
+import org.junit.Test;
+import org.openrdf.model.Literal;
+import org.openrdf.model.Statement;
+import org.openrdf.model.URI;
+import org.openrdf.model.impl.LiteralImpl;
+import org.openrdf.model.impl.StatementImpl;
+import org.openrdf.model.impl.URIImpl;
+
+import static org.junit.Assert.assertEquals;
+
+/**
+ * Test cases for triple tables.
+ *
+ * @author Sebastian Schaffert (sschaffert@apache.org)
+ */
+public class TripleTableTest {
+
+
+
+    @Test
+    public void testListTriples() {
+        URI subject1 = new URIImpl("http://localhost/"+ RandomStringUtils.randomAlphanumeric(8));
+        URI subject2 = new URIImpl("http://localhost/"+ RandomStringUtils.randomAlphanumeric(8));
+        URI predicate1 = new URIImpl("http://localhost/"+ RandomStringUtils.randomAlphanumeric(8));
+        URI predicate2 = new URIImpl("http://localhost/"+ RandomStringUtils.randomAlphanumeric(8));
+        Literal object1 = new LiteralImpl("http://localhost/"+ RandomStringUtils.random(40));
+        Literal object2 = new LiteralImpl("http://localhost/"+ RandomStringUtils.random(40));
+
+        Statement stmt1 = new StatementImpl(subject1,predicate1,object1);
+        Statement stmt2 = new StatementImpl(subject1,predicate1,object2);
+        Statement stmt3 = new StatementImpl(subject1,predicate2,object1);
+        Statement stmt4 = new StatementImpl(subject1,predicate2,object2);
+        Statement stmt5 = new StatementImpl(subject2,predicate1,object1);
+        Statement stmt6 = new StatementImpl(subject2,predicate1,object2);
+        Statement stmt7 = new StatementImpl(subject2,predicate2,object1);
+        Statement stmt8 = new StatementImpl(subject2,predicate2,object2);
+
+        TripleTable<Statement> table = new TripleTable<>();
+        table.add(stmt1);
+        table.add(stmt2);
+        table.add(stmt3);
+        table.add(stmt4);
+        table.add(stmt5);
+        table.add(stmt6);
+        table.add(stmt7);
+        //table.add(stmt8);
+
+        // tests
+
+        // 1. test existence and non-existence of a triple
+        assertEquals(1, table.listTriples(subject2,predicate2,object1,null, true).size());
+        assertEquals(0, table.listTriples(subject2,predicate2,object2,null, true).size());
+
+        // 2. test listing with wildcards
+        assertEquals(7, table.listTriples(null,null,null,null, true).size());
+        assertEquals(4, table.listTriples(subject1,null,null,null, true).size());
+        assertEquals(3, table.listTriples(subject2,null,null,null, true).size());
+        assertEquals(4, table.listTriples(null,predicate1,null,null, true).size());
+        assertEquals(3, table.listTriples(null,predicate2,null,null, true).size());
+        assertEquals(4, table.listTriples(null,null,object1,null, true).size());
+        assertEquals(3, table.listTriples(null,null,object2,null, true).size());
+        assertEquals(2, table.listTriples(subject1,predicate1,null,null, true).size());
+        assertEquals(1, table.listTriples(subject2,predicate2,null,null, true).size());
+    }
+
+    @Test
+    public void testRemoveTriples() {
+        URI subject1 = new URIImpl("http://localhost/"+ RandomStringUtils.randomAlphanumeric(8));
+        URI subject2 = new URIImpl("http://localhost/"+ RandomStringUtils.randomAlphanumeric(8));
+        URI predicate1 = new URIImpl("http://localhost/"+ RandomStringUtils.randomAlphanumeric(8));
+        URI predicate2 = new URIImpl("http://localhost/"+ RandomStringUtils.randomAlphanumeric(8));
+        Literal object1 = new LiteralImpl("http://localhost/"+ RandomStringUtils.random(40));
+        Literal object2 = new LiteralImpl("http://localhost/"+ RandomStringUtils.random(40));
+
+        Statement stmt1 = new StatementImpl(subject1,predicate1,object1);
+        Statement stmt2 = new StatementImpl(subject1,predicate1,object2);
+        Statement stmt3 = new StatementImpl(subject1,predicate2,object1);
+        Statement stmt4 = new StatementImpl(subject1,predicate2,object2);
+        Statement stmt5 = new StatementImpl(subject2,predicate1,object1);
+        Statement stmt6 = new StatementImpl(subject2,predicate1,object2);
+        Statement stmt7 = new StatementImpl(subject2,predicate2,object1);
+        Statement stmt8 = new StatementImpl(subject2,predicate2,object2);
+
+        TripleTable<Statement> table = new TripleTable<>();
+        table.add(stmt1);
+        table.add(stmt2);
+        table.add(stmt3);
+        table.add(stmt4);
+        table.add(stmt5);
+        table.add(stmt6);
+        table.add(stmt7);
+        table.add(stmt8);
+
+        // tests
+
+        // 1. test existence and non-existence of a triple
+        assertEquals(1, table.listTriples(subject2,predicate2,object1,null, true).size());
+        assertEquals(1, table.listTriples(subject2,predicate2,object2,null, true).size());
+
+
+        table.remove(stmt8);
+
+        assertEquals(1, table.listTriples(subject2,predicate2,object1,null, true).size());
+        assertEquals(0, table.listTriples(subject2,predicate2,object2,null, true).size());
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/kiwi/kiwi-versioning/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-versioning/pom.xml b/libraries/kiwi/kiwi-versioning/pom.xml
index 3d37f81..81c2a4c 100644
--- a/libraries/kiwi/kiwi-versioning/pom.xml
+++ b/libraries/kiwi/kiwi-versioning/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>kiwi-parent</artifactId>
-        <version>3.1.0-incubating-SNAPSHOT</version>
+        <version>3.1.0-incubating</version>
         <relativePath>../</relativePath>
     </parent>
 
@@ -74,8 +74,8 @@
             <artifactId>guava</artifactId>
         </dependency>
         <dependency>
-            <groupId>commons-lang</groupId>
-            <artifactId>commons-lang</artifactId>
+            <groupId>org.apache.commons</groupId>
+            <artifactId>commons-lang3</artifactId>
         </dependency>
         <dependency>
             <groupId>org.apache.marmotta</groupId>
@@ -129,7 +129,7 @@
             <scope>test</scope>
         </dependency>
         <dependency>
-            <groupId>org.jumpmind.symmetric.jdbc</groupId>
+            <groupId>org.postgresql</groupId>
             <artifactId>postgresql</artifactId>
             <scope>test</scope>
         </dependency>

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/kiwi/kiwi-versioning/src/main/java/org/apache/marmotta/kiwi/versioning/persistence/KiWiVersioningConnection.java
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-versioning/src/main/java/org/apache/marmotta/kiwi/versioning/persistence/KiWiVersioningConnection.java b/libraries/kiwi/kiwi-versioning/src/main/java/org/apache/marmotta/kiwi/versioning/persistence/KiWiVersioningConnection.java
index 054cf20..2ef8946 100644
--- a/libraries/kiwi/kiwi-versioning/src/main/java/org/apache/marmotta/kiwi/versioning/persistence/KiWiVersioningConnection.java
+++ b/libraries/kiwi/kiwi-versioning/src/main/java/org/apache/marmotta/kiwi/versioning/persistence/KiWiVersioningConnection.java
@@ -17,6 +17,7 @@
  */
 package org.apache.marmotta.kiwi.versioning.persistence;
 
+import com.google.common.base.Preconditions;
 import info.aduna.iteration.CloseableIteration;
 import info.aduna.iteration.EmptyIteration;
 import info.aduna.iteration.ExceptionConvertingIteration;
@@ -130,6 +131,65 @@ public class KiWiVersioningConnection extends KiWiConnection {
     }
 
     /**
+     * Remove the version with the id passed as argument, including all references to added and removed triples. The
+     * triples themselves are not deleted immediately, we let the garbage collector carry this out periodically.
+     * @param id
+     * @throws SQLException
+     */
+    public void removeVersion(Long id) throws SQLException {
+        Preconditions.checkNotNull(id);
+        Preconditions.checkArgument(id > 0);
+
+        requireJDBCConnection();
+
+        PreparedStatement removeAdded = getPreparedStatement("delete.version_added");
+        removeAdded.clearParameters();
+        removeAdded.setLong(1, id);
+        removeAdded.executeUpdate();
+
+        PreparedStatement removeRemoved = getPreparedStatement("delete.version_removed");
+        removeRemoved.clearParameters();
+        removeRemoved.setLong(1, id);
+        removeRemoved.executeUpdate();
+
+        PreparedStatement removeVersion = getPreparedStatement("delete.version");
+        removeVersion.clearParameters();
+        removeVersion.setLong(1, id);
+        removeVersion.executeUpdate();
+
+    }
+
+    /**
+     * Remove all versions until the date given as argument. Iterates over all versions and deletes them individually.
+     * Entries in join tables (added/removed triples) are also deleted, the triples themselves not. Deleted triples
+     * without version will later be cleaned up by the garbage collector
+     * @param until date until when to delete versions
+     * @throws SQLException
+     */
+    public void removeVersions(Date until) throws SQLException {
+        removeVersions(new Date(0), until);
+    }
+
+
+    /**
+     * Remove all versions in the given time interval. Iterates over all versions and deletes them individually.
+     * Entries in join tables (added/removed triples) are also deleted, the triples themselves not. Deleted triples
+     * without version will later be cleaned up by the garbage collector
+     * @param from date after which versions will be deleted
+     * @param to   date before which versions will be deleted
+     * @throws SQLException
+     */
+    public void removeVersions(Date from, Date to) throws SQLException {
+        CloseableIteration<Version, SQLException> it = listVersionsInternal(from,to);
+        while(it.hasNext()) {
+            Version next = it.next();
+            removeVersion(next.getId());
+        }
+    }
+
+
+
+    /**
      * Retrieve a version by its id. If the version does not exist, returns null
      *
      * @param id

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/kiwi/kiwi-versioning/src/main/java/org/apache/marmotta/kiwi/versioning/persistence/KiWiVersioningPersistence.java
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-versioning/src/main/java/org/apache/marmotta/kiwi/versioning/persistence/KiWiVersioningPersistence.java b/libraries/kiwi/kiwi-versioning/src/main/java/org/apache/marmotta/kiwi/versioning/persistence/KiWiVersioningPersistence.java
index 797c58c..a3bb6a6 100644
--- a/libraries/kiwi/kiwi-versioning/src/main/java/org/apache/marmotta/kiwi/versioning/persistence/KiWiVersioningPersistence.java
+++ b/libraries/kiwi/kiwi-versioning/src/main/java/org/apache/marmotta/kiwi/versioning/persistence/KiWiVersioningPersistence.java
@@ -46,10 +46,6 @@ public class KiWiVersioningPersistence {
 
     public KiWiVersioningPersistence(KiWiPersistence persistence) {
         this.persistence = persistence;
-
-        persistence.addNodeTableDependency("versions", "creator");
-        persistence.addTripleTableDependency("versions_added","triple_id");
-        persistence.addTripleTableDependency("versions_removed","triple_id");
     }
 
     /**
@@ -58,6 +54,10 @@ public class KiWiVersioningPersistence {
      */
     public void initDatabase() throws SQLException {
         persistence.initDatabase("versioning", new String[] {"versions", "versions_added", "versions_removed"});
+
+        persistence.addNodeTableDependency("versions", "creator");
+        persistence.addTripleTableDependency("versions_added","triple_id");
+        persistence.addTripleTableDependency("versions_removed","triple_id");
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/kiwi/kiwi-versioning/src/main/java/org/apache/marmotta/kiwi/versioning/sail/KiWiVersioningSail.java
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-versioning/src/main/java/org/apache/marmotta/kiwi/versioning/sail/KiWiVersioningSail.java b/libraries/kiwi/kiwi-versioning/src/main/java/org/apache/marmotta/kiwi/versioning/sail/KiWiVersioningSail.java
index 91de399..84f448b 100644
--- a/libraries/kiwi/kiwi-versioning/src/main/java/org/apache/marmotta/kiwi/versioning/sail/KiWiVersioningSail.java
+++ b/libraries/kiwi/kiwi-versioning/src/main/java/org/apache/marmotta/kiwi/versioning/sail/KiWiVersioningSail.java
@@ -34,6 +34,8 @@ import org.openrdf.model.Statement;
 import org.openrdf.model.URI;
 import org.openrdf.repository.RepositoryException;
 import org.openrdf.repository.RepositoryResult;
+import org.openrdf.repository.sail.SailRepositoryConnection;
+import org.openrdf.sail.SailConnection;
 import org.openrdf.sail.SailException;
 import org.openrdf.sail.StackableSail;
 import org.slf4j.Logger;
@@ -72,33 +74,33 @@ public class KiWiVersioningSail extends TransactionalSailWrapper implements Tran
 
     private SesameFilter<Statement> filter;
 
-	/**
-	 * Build a new {@link KiWiVersioningSail} based on the provided parent
-	 * {@link TransactionalSail}.
-	 * 
-	 * @param parent
-	 *            the {@link TransactionalSail} to base the
-	 *            {@link KiWiVersioningSail} on.
-	 */
+    /**
+     * Build a new {@link KiWiVersioningSail} based on the provided parent
+     * {@link TransactionalSail}.
+     *
+     * @param parent
+     *            the {@link TransactionalSail} to base the
+     *            {@link KiWiVersioningSail} on.
+     */
     public KiWiVersioningSail(TransactionalSail parent) {
         this(parent,new AlwaysTrueFilter<Statement>());
     }
 
-	/**
-	 * Build a new selective {@link KiWiVersioningSail} based on the provided
-	 * parent {@link TransactionalSail}. Only {@link Statement}s that are
-	 * accepted by the filter are included in versioning.
-	 * 
-	 * @param parent
-	 *            the {@link TransactionalSail} to base the
-	 *            {@link KiWiVersioningSail} on.
-	 * @param filter
-	 *            a {@link SesameFilter} to filter out {@link Statement}s that
-	 *            should not be versioned. Only a {@link Statement} that is
-	 *            accepted by this filter will be versioned.
-	 * 
-	 * @see SesameFilter#accept(Object)
-	 */
+    /**
+     * Build a new selective {@link KiWiVersioningSail} based on the provided
+     * parent {@link TransactionalSail}. Only {@link Statement}s that are
+     * accepted by the filter are included in versioning.
+     *
+     * @param parent
+     *            the {@link TransactionalSail} to base the
+     *            {@link KiWiVersioningSail} on.
+     * @param filter
+     *            a {@link SesameFilter} to filter out {@link Statement}s that
+     *            should not be versioned. Only a {@link Statement} that is
+     *            accepted by this filter will be versioned.
+     *
+     * @see SesameFilter#accept(Object)
+     */
     public KiWiVersioningSail(TransactionalSail parent, SesameFilter<Statement> filter) {
         super(parent);
         this.persistence = new KiWiVersioningPersistence(getBaseStore().getPersistence());
@@ -316,12 +318,80 @@ public class KiWiVersioningSail extends TransactionalSailWrapper implements Tran
         }
     }
 
+
+    /**
+     * Remove the version with the id passed as argument, including all references to added and removed triples. The
+     * triples themselves are not deleted immediately, we let the garbage collector carry this out periodically.
+     * @param id  the database ID of the version (see {@link Version#getId()})
+     * @throws SailException
+     */
+    public void removeVersion(Long id) throws SailException {
+        try {
+            final KiWiVersioningConnection connection = persistence.getConnection();
+            try {
+                connection.removeVersion(id);
+                connection.commit();
+            } finally {
+                connection.close();
+            }
+
+        } catch(SQLException ex) {
+            throw new SailException("database error while listing versions",ex);
+        }
+    }
+
+    /**
+     * Remove all versions until the date given as argument. Iterates over all versions and deletes them individually.
+     * Entries in join tables (added/removed triples) are also deleted, the triples themselves not. Deleted triples
+     * without version will later be cleaned up by the garbage collector
+     * @param until date until when to delete versions
+     * @throws SailException
+     */
+    public void removeVersions(Date until) throws SailException {
+        try {
+            final KiWiVersioningConnection connection = persistence.getConnection();
+            try {
+                connection.removeVersions(until);
+                connection.commit();
+            } finally {
+                connection.close();
+            }
+
+        } catch(SQLException ex) {
+            throw new SailException("database error while listing versions",ex);
+        }
+    }
+
+
+    /**
+     * Remove all versions in the given time interval. Iterates over all versions and deletes them individually.
+     * Entries in join tables (added/removed triples) are also deleted, the triples themselves not. Deleted triples
+     * without version will later be cleaned up by the garbage collector
+     * @param from date after which versions will be deleted
+     * @param to   date before which versions will be deleted
+     * @throws SailException
+     */
+    public void removeVersions(Date from, Date to) throws SailException {
+        try {
+            final KiWiVersioningConnection connection = persistence.getConnection();
+            try {
+                connection.removeVersions(from, to);
+                connection.commit();
+            } finally {
+                connection.close();
+            }
+
+        } catch(SQLException ex) {
+            throw new SailException("database error while listing versions",ex);
+        }
+    }
+
     /**
      * Return the version that is the most recent version for a resource given a reference date. The method will either
      * return the version that was current for the resource at the given date or return null in case such a version
      * does not exist (e.g. before the resource was created).
      *
-     * @param resource  the resource for which to find a version
+     * @param r         the resource for which to find a version
      * @param date      the reference date
      * @return the latest version of the resource at the given date, or null if such a version does not exist
      * @throws SQLException
@@ -405,6 +475,32 @@ public class KiWiVersioningSail extends TransactionalSailWrapper implements Tran
         }
     }
 
+    /**
+     * Revert (undo) the version given as argument. This method creates a new transaction, adds all triples
+     * that were deleted in the old version, removes all triples that were added in the old version, and commits
+     * the transaction, effectively creating a new (reverted) version.
+     *
+     * @param version    the version to revert
+     * @throws SailException in case reverting the version failed
+     */
+    public void revertVersion(Version version) throws SailException {
+        SailConnection con = getConnection();
+        try {
+            con.begin();
+
+            for(Statement stmt : version.getAddedTriples()) {
+                con.removeStatements(stmt.getSubject(), stmt.getPredicate(), stmt.getObject(), stmt.getContext());
+            }
+
+            for(Statement stmt : version.getRemovedTriples()) {
+                con.addStatement(stmt.getSubject(), stmt.getPredicate(), stmt.getObject(), stmt.getContext());
+            }
+
+            con.commit();
+        } finally {
+            con.close();
+        }
+    }
 
 
     @Override

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/kiwi/kiwi-versioning/src/main/resources/org/apache/marmotta/kiwi/persistence/h2/statements.properties
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-versioning/src/main/resources/org/apache/marmotta/kiwi/persistence/h2/statements.properties b/libraries/kiwi/kiwi-versioning/src/main/resources/org/apache/marmotta/kiwi/persistence/h2/statements.properties
index 1001040..e5b1ae3 100644
--- a/libraries/kiwi/kiwi-versioning/src/main/resources/org/apache/marmotta/kiwi/persistence/h2/statements.properties
+++ b/libraries/kiwi/kiwi-versioning/src/main/resources/org/apache/marmotta/kiwi/persistence/h2/statements.properties
@@ -48,4 +48,4 @@ store.version_removed = INSERT INTO versions_removed (version_id,triple_id) VALU
 
 delete.version_added   = DELETE FROM versions_added WHERE version_id = ?
 delete.version_removed = DELETE FROM versions_removed WHERE version_id = ?
-delete.version         = DELETE FROM verions WHERE id = ?
\ No newline at end of file
+delete.version         = DELETE FROM versions WHERE id = ?
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/kiwi/kiwi-versioning/src/main/resources/org/apache/marmotta/kiwi/persistence/mysql/statements.properties
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-versioning/src/main/resources/org/apache/marmotta/kiwi/persistence/mysql/statements.properties b/libraries/kiwi/kiwi-versioning/src/main/resources/org/apache/marmotta/kiwi/persistence/mysql/statements.properties
index 65a39a2..47d7f6a 100644
--- a/libraries/kiwi/kiwi-versioning/src/main/resources/org/apache/marmotta/kiwi/persistence/mysql/statements.properties
+++ b/libraries/kiwi/kiwi-versioning/src/main/resources/org/apache/marmotta/kiwi/persistence/mysql/statements.properties
@@ -19,6 +19,7 @@
 # get sequence numbers
 seq.versions.prep     = UPDATE seq_versions SET id=LAST_INSERT_ID(id+1);
 seq.versions          = SELECT LAST_INSERT_ID();
+seq.versions.set      = UPDATE seq_versions SET id=?;
 
 load.version_by_id    = SELECT id,creator,createdAt FROM versions WHERE id = ?
 load.version_between  = SELECT id,creator,createdAt FROM versions WHERE createdAt > ? AND createdAt <= ? ORDER BY createdAt ASC
@@ -49,4 +50,4 @@ store.version_removed = INSERT INTO versions_removed (version_id,triple_id) VALU
 
 delete.version_added   = DELETE FROM versions_added WHERE version_id = ?
 delete.version_removed = DELETE FROM versions_removed WHERE version_id = ?
-delete.version         = DELETE FROM verions WHERE id = ?
\ No newline at end of file
+delete.version         = DELETE FROM versions WHERE id = ?
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/kiwi/kiwi-versioning/src/main/resources/org/apache/marmotta/kiwi/persistence/pgsql/statements.properties
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-versioning/src/main/resources/org/apache/marmotta/kiwi/persistence/pgsql/statements.properties b/libraries/kiwi/kiwi-versioning/src/main/resources/org/apache/marmotta/kiwi/persistence/pgsql/statements.properties
index 442fb02..441adfc 100644
--- a/libraries/kiwi/kiwi-versioning/src/main/resources/org/apache/marmotta/kiwi/persistence/pgsql/statements.properties
+++ b/libraries/kiwi/kiwi-versioning/src/main/resources/org/apache/marmotta/kiwi/persistence/pgsql/statements.properties
@@ -18,6 +18,7 @@
 
 # get sequence numbers
 seq.versions          = SELECT nextval('seq_versions')
+seq.versions.set      = SELECT setval('seq_versions',?)
 
 load.version_by_id    = SELECT id,creator,createdAt FROM versions WHERE id = ?
 load.version_between  = SELECT id,creator,createdAt FROM versions WHERE createdAt >= ? AND createdAt <= ? ORDER BY createdAt ASC
@@ -49,7 +50,7 @@ store.version_removed = INSERT INTO versions_removed (version_id,triple_id) VALU
 
 delete.version_added   = DELETE FROM versions_added WHERE version_id = ?
 delete.version_removed = DELETE FROM versions_removed WHERE version_id = ?
-delete.version         = DELETE FROM verions WHERE id = ?
+delete.version         = DELETE FROM versions WHERE id = ?
 
 query.snapshot_size           = SELECT count(*) FROM triples WHERE createdAt <= ? AND (deleted = false OR deletedAt > ?)
 query.snapshot_size_ctx       = SELECT count(*) FROM triples WHERE context = ? AND createdAt <= ? AND (deleted = false OR deletedAt > ?)

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/kiwi/kiwi-versioning/src/test/java/org/apache/marmotta/kiwi/versioning/test/SnapshotRepositoryTest.java
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-versioning/src/test/java/org/apache/marmotta/kiwi/versioning/test/SnapshotRepositoryTest.java b/libraries/kiwi/kiwi-versioning/src/test/java/org/apache/marmotta/kiwi/versioning/test/SnapshotRepositoryTest.java
index 7cc52e3..0268db5 100644
--- a/libraries/kiwi/kiwi-versioning/src/test/java/org/apache/marmotta/kiwi/versioning/test/SnapshotRepositoryTest.java
+++ b/libraries/kiwi/kiwi-versioning/src/test/java/org/apache/marmotta/kiwi/versioning/test/SnapshotRepositoryTest.java
@@ -17,24 +17,26 @@
  */
 package org.apache.marmotta.kiwi.versioning.test;
 
-import org.apache.marmotta.kiwi.persistence.KiWiDialect;
-import org.apache.marmotta.kiwi.persistence.h2.H2Dialect;
-import org.apache.marmotta.kiwi.persistence.mysql.MySQLDialect;
-import org.apache.marmotta.kiwi.persistence.pgsql.PostgreSQLDialect;
+import static org.hamcrest.CoreMatchers.notNullValue;
+import static org.junit.Assume.assumeThat;
+import info.aduna.iteration.Iterations;
+
+import java.io.InputStream;
+import java.sql.SQLException;
+import java.util.Date;
+import java.util.List;
+
+import org.apache.marmotta.kiwi.config.KiWiConfiguration;
 import org.apache.marmotta.kiwi.sail.KiWiStore;
-import org.apache.marmotta.kiwi.test.helper.DBConnectionChecker;
+import org.apache.marmotta.kiwi.test.junit.KiWiDatabaseRunner;
 import org.apache.marmotta.kiwi.transactions.sail.KiWiTransactionalSail;
 import org.apache.marmotta.kiwi.versioning.repository.SnapshotRepository;
 import org.apache.marmotta.kiwi.versioning.sail.KiWiVersioningSail;
 import org.junit.After;
 import org.junit.Assert;
 import org.junit.Before;
-import org.junit.Rule;
 import org.junit.Test;
-import org.junit.rules.TestWatcher;
-import org.junit.runner.Description;
 import org.junit.runner.RunWith;
-import org.junit.runners.Parameterized;
 import org.openrdf.model.Statement;
 import org.openrdf.query.BooleanQuery;
 import org.openrdf.query.QueryLanguage;
@@ -45,84 +47,17 @@ import org.openrdf.rio.RDFFormat;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import java.io.InputStream;
-import java.sql.SQLException;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-
-import static org.hamcrest.CoreMatchers.notNullValue;
-import static org.junit.Assume.assumeThat;
-
 /**
- * This test verifies the snapshot functionality, i.e. if the snapshot connection works properly. It will try running
- * over all available databases. Except for in-memory databases like
- * H2 or Derby, database URLs must be passed as system property, or otherwise the test is skipped for this database.
- * Available system properties:
- * <ul>
- *     <li>PostgreSQL:
- *     <ul>
- *         <li>postgresql.url, e.g. jdbc:postgresql://localhost:5433/kiwitest?prepareThreshold=3</li>
- *         <li>postgresql.user (default: lmf)</li>
- *         <li>postgresql.pass (default: lmf)</li>
- *     </ul>
- *     </li>
- *     <li>MySQL:
- *     <ul>
- *         <li>mysql.url, e.g. jdbc:mysql://localhost:3306/kiwitest?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull</li>
- *         <li>mysql.user (default: lmf)</li>
- *         <li>mysql.pass (default: lmf</li>
- *     </ul>
- *     </li>
- *     <li>H2:
- *     <ul>
- *         <li>h2.url, e.g. jdbc:h2:mem;MVCC=true;DB_CLOSE_ON_EXIT=FALSE;DB_CLOSE_DELAY=10</li>
- *         <li>h2.user (default: lmf)</li>
- *         <li>h2.pass (default: lmf</li>
- *     </ul>
- *     </li>
- * </ul>
- * <p/>
+ * This test verifies the snapshot functionality, i.e. if the snapshot connection works properly. 
+ * 
  * @see org.apache.marmotta.kiwi.versioning.repository.SnapshotRepositoryConnection
  * @see org.apache.marmotta.kiwi.versioning.repository.SnapshotRepository
- * <p/>
- * Author: Sebastian Schaffert
+ * @author Sebastian Schaffert (sschaffert@apache.org)
  */
-@RunWith(Parameterized.class)
+@RunWith(KiWiDatabaseRunner.class)
 public class SnapshotRepositoryTest {
 
-    /**
-     * Return database configurations if the appropriate parameters have been set.
-     *
-     * @return an array (database name, url, user, password)
-     */
-    @Parameterized.Parameters(name="Database Test {index}: {0} at {1}")
-    public static Iterable<Object[]> databases() {
-        String[] databases = {"H2", "PostgreSQL", "MySQL"};
-
-        List<Object[]> result = new ArrayList<Object[]>(databases.length);
-        for(String database : databases) {
-            if(System.getProperty(database.toLowerCase()+".url") != null) {
-                result.add(new Object[] {
-                        database,
-                        System.getProperty(database.toLowerCase()+".url"),
-                        System.getProperty(database.toLowerCase()+".user","lmf"),
-                        System.getProperty(database.toLowerCase()+".pass","lmf")
-                });
-            }
-        }
-        return result;
-    }
-
-
-    private KiWiDialect dialect;
-
-    private String jdbcUrl;
-
-    private String jdbcUser;
-
-    private String jdbcPass;
-
+ 
     private KiWiStore store;
 
     private KiWiTransactionalSail tsail;
@@ -131,26 +66,16 @@ public class SnapshotRepositoryTest {
 
     private SnapshotRepository repository;
 
-    public SnapshotRepositoryTest(String database, String jdbcUrl, String jdbcUser, String jdbcPass) {
-        this.jdbcPass = jdbcPass;
-        this.jdbcUrl = jdbcUrl;
-        this.jdbcUser = jdbcUser;
-
-        if("H2".equals(database)) {
-            this.dialect = new H2Dialect();
-        } else if("MySQL".equals(database)) {
-            this.dialect = new MySQLDialect();
-        } else if("PostgreSQL".equals(database)) {
-            this.dialect = new PostgreSQLDialect();
-        }
-        
-        DBConnectionChecker.checkDatabaseAvailability(jdbcUrl, jdbcUser, jdbcPass, dialect);
+    private final KiWiConfiguration dbConfig;
+
+    public SnapshotRepositoryTest(KiWiConfiguration dbConfig) {
+        this.dbConfig = dbConfig;
     }
 
 
     @Before
     public void initDatabase() throws RepositoryException {
-        store = new KiWiStore("test",jdbcUrl,jdbcUser,jdbcPass,dialect, "http://localhost/context/default", "http://localhost/context/inferred");
+        store = new KiWiStore(dbConfig);
         tsail = new KiWiTransactionalSail(store);
         vsail = new KiWiVersioningSail(tsail);
         repository = new SnapshotRepository(vsail);
@@ -167,17 +92,6 @@ public class SnapshotRepositoryTest {
     final Logger logger =
             LoggerFactory.getLogger(this.getClass());
 
-    @Rule
-    public TestWatcher watchman = new TestWatcher() {
-        /**
-         * Invoked when a test is about to start
-         */
-        @Override
-        protected void starting(Description description) {
-            logger.info("{} being run...", description.getMethodName());
-        }
-    };
-
 
     @Test
     public void testSnapshotConnection() throws Exception {
@@ -378,17 +292,6 @@ public class SnapshotRepositoryTest {
      * @return
      */
     public static <E> List<E> asList(RepositoryResult<E> result) throws RepositoryException {
-        ArrayList<E> collection = new ArrayList<E>();
-        try {
-            while (result.hasNext()) {
-                collection.add(result.next());
-            }
-
-            return collection;
-        }
-        finally {
-            result.close();
-        }
+        return Iterations.asList(result);
     }
-
 }

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/kiwi/kiwi-versioning/src/test/java/org/apache/marmotta/kiwi/versioning/test/VersioningPersistenceTest.java
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-versioning/src/test/java/org/apache/marmotta/kiwi/versioning/test/VersioningPersistenceTest.java b/libraries/kiwi/kiwi-versioning/src/test/java/org/apache/marmotta/kiwi/versioning/test/VersioningPersistenceTest.java
index 9d723f3..49277a2 100644
--- a/libraries/kiwi/kiwi-versioning/src/test/java/org/apache/marmotta/kiwi/versioning/test/VersioningPersistenceTest.java
+++ b/libraries/kiwi/kiwi-versioning/src/test/java/org/apache/marmotta/kiwi/versioning/test/VersioningPersistenceTest.java
@@ -17,17 +17,21 @@
  */
 package org.apache.marmotta.kiwi.versioning.test;
 
-import org.apache.commons.lang.RandomStringUtils;
+import static org.hamcrest.Matchers.hasItems;
+import info.aduna.iteration.Iterations;
+
+import java.sql.SQLException;
+import java.util.Date;
+import java.util.List;
+
+import org.apache.commons.lang3.RandomStringUtils;
+import org.apache.marmotta.kiwi.config.KiWiConfiguration;
 import org.apache.marmotta.kiwi.model.rdf.KiWiStringLiteral;
 import org.apache.marmotta.kiwi.model.rdf.KiWiTriple;
 import org.apache.marmotta.kiwi.model.rdf.KiWiUriResource;
 import org.apache.marmotta.kiwi.persistence.KiWiConnection;
-import org.apache.marmotta.kiwi.persistence.KiWiDialect;
 import org.apache.marmotta.kiwi.persistence.KiWiPersistence;
-import org.apache.marmotta.kiwi.persistence.h2.H2Dialect;
-import org.apache.marmotta.kiwi.persistence.mysql.MySQLDialect;
-import org.apache.marmotta.kiwi.persistence.pgsql.PostgreSQLDialect;
-import org.apache.marmotta.kiwi.test.helper.DBConnectionChecker;
+import org.apache.marmotta.kiwi.test.junit.KiWiDatabaseRunner;
 import org.apache.marmotta.kiwi.versioning.model.Version;
 import org.apache.marmotta.kiwi.versioning.persistence.KiWiVersioningConnection;
 import org.apache.marmotta.kiwi.versioning.persistence.KiWiVersioningPersistence;
@@ -43,104 +47,27 @@ import org.junit.runners.Parameterized;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import java.sql.SQLException;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-
-import static org.hamcrest.Matchers.hasItems;
-
 /**
  * This test checks if the database persistence for the versioning functionality works properly.
- * It will try running over all available databases. Except for in-memory databases like
- * H2 or Derby, database URLs must be passed as system property, or otherwise the test is skipped for this database.
- * Available system properties:
- * <ul>
- *     <li>PostgreSQL:
- *     <ul>
- *         <li>postgresql.url, e.g. jdbc:postgresql://localhost:5433/kiwitest?prepareThreshold=3</li>
- *         <li>postgresql.user (default: lmf)</li>
- *         <li>postgresql.pass (default: lmf)</li>
- *     </ul>
- *     </li>
- *     <li>MySQL:
- *     <ul>
- *         <li>mysql.url, e.g. jdbc:mysql://localhost:3306/kiwitest?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull</li>
- *         <li>mysql.user (default: lmf)</li>
- *         <li>mysql.pass (default: lmf</li>
- *     </ul>
- *     </li>
- *     <li>H2:
- *     <ul>
- *         <li>h2.url, e.g. jdbc:h2:mem;MVCC=true;DB_CLOSE_ON_EXIT=FALSE;DB_CLOSE_DELAY=10</li>
- *         <li>h2.user (default: lmf)</li>
- *         <li>h2.pass (default: lmf</li>
- *     </ul>
- *     </li>
- * </ul>
- *
- * <p/>
- * Author: Sebastian Schaffert
+ * 
+ * @author Sebastian Schaffert (sschaffert@apache.org)
  */
-@RunWith(Parameterized.class)
+@RunWith(KiWiDatabaseRunner.class)
 public class VersioningPersistenceTest {
 
-
-    /**
-     * Return database configurations if the appropriate parameters have been set.
-     *
-     * @return an array (database name, url, user, password)
-     */
-    @Parameterized.Parameters(name="Database Test {index}: {0} at {1}")
-    public static Iterable<Object[]> databases() {
-        String[] databases = {"H2", "PostgreSQL", "MySQL"};
-
-        List<Object[]> result = new ArrayList<Object[]>(databases.length);
-        for(String database : databases) {
-            if(System.getProperty(database.toLowerCase()+".url") != null) {
-                result.add(new Object[] {
-                        database,
-                        System.getProperty(database.toLowerCase()+".url"),
-                        System.getProperty(database.toLowerCase()+".user","lmf"),
-                        System.getProperty(database.toLowerCase()+".pass","lmf")
-                });
-            }
-        }
-        return result;
-    }
-
-
-    private KiWiDialect dialect;
-
-    private String jdbcUrl;
-
-    private String jdbcUser;
-
-    private String jdbcPass;
-
     private KiWiPersistence persistence;
     private KiWiVersioningPersistence vpersistence;
+    private final KiWiConfiguration dbConfig;
 
-    public VersioningPersistenceTest(String database, String jdbcUrl, String jdbcUser, String jdbcPass) {
-        this.jdbcPass = jdbcPass;
-        this.jdbcUrl = jdbcUrl;
-        this.jdbcUser = jdbcUser;
-
-        if("H2".equals(database)) {
-            this.dialect = new H2Dialect();
-        } else if("MySQL".equals(database)) {
-            this.dialect = new MySQLDialect();
-        } else if("PostgreSQL".equals(database)) {
-            this.dialect = new PostgreSQLDialect();
-        }
-        
-        DBConnectionChecker.checkDatabaseAvailability(jdbcUrl, jdbcUser, jdbcPass, dialect);
+    public VersioningPersistenceTest(KiWiConfiguration dbConfig) {
+        this.dbConfig = dbConfig;
     }
 
 
     @Before
     public void initDatabase() throws SQLException {
-        persistence = new KiWiPersistence("test",jdbcUrl,jdbcUser,jdbcPass,dialect);
+        persistence = new KiWiPersistence(dbConfig);
+        persistence.initialise();
         persistence.initDatabase();
 
         vpersistence = new KiWiVersioningPersistence(persistence);
@@ -158,24 +85,13 @@ public class VersioningPersistenceTest {
     final Logger logger =
             LoggerFactory.getLogger(this.getClass());
 
-    @Rule
-    public TestWatcher watchman = new TestWatcher() {
-        /**
-         * Invoked when a test is about to start
-         */
-        @Override
-        protected void starting(Description description) {
-            logger.info("{} being run...", description.getMethodName());
-        }
-    };
-
     @Test
     public void testTablesCreateDrop() throws Exception {
         // test if database exists and has a version
         KiWiConnection connection = vpersistence.getConnection();
         try {
             Assert.assertThat(connection.getDatabaseTables(), hasItems("versions", "versions_added", "versions_removed"));
-            Assert.assertEquals(1, connection.getDatabaseVersion());
+            Assert.assertEquals(2, connection.getDatabaseVersion());
 
             connection.commit();
         } finally {
@@ -195,13 +111,13 @@ public class VersioningPersistenceTest {
             KiWiStringLiteral object_2 = new KiWiStringLiteral(RandomStringUtils.randomAlphanumeric(32));
             KiWiUriResource context  = new KiWiUriResource("http://localhost/context/"+RandomStringUtils.randomAlphanumeric(8));
 
-            connection.storeNode(subject1);
-            connection.storeNode(subject2);
-            connection.storeNode(pred_1);
-            connection.storeNode(pred_2);
-            connection.storeNode(object_1);
-            connection.storeNode(object_2);
-            connection.storeNode(context);
+            connection.storeNode(subject1, false);
+            connection.storeNode(subject2, false);
+            connection.storeNode(pred_1, false);
+            connection.storeNode(pred_2, false);
+            connection.storeNode(object_1, false);
+            connection.storeNode(object_2, false);
+            connection.storeNode(context, false);
 
             KiWiTriple triple1 = new KiWiTriple(subject1,pred_1,object_1,context);
             KiWiTriple triple2 = new KiWiTriple(subject2,pred_2,object_2,context);
@@ -217,13 +133,13 @@ public class VersioningPersistenceTest {
             connection.commit();
 
             // check if listVersions now gives exactly one version
-            List<Version> list1 = connection.listVersions().asList();
+            List<Version> list1 = Iterations.asList(connection.listVersions());
             Assert.assertEquals("there should be exactly one version",1,list1.size());
             Assert.assertEquals("contents of version differ", version1, list1.get(0));
             Assert.assertEquals("version id is not 1", 1L, (long)list1.get(0).getId());
 
             // check if listVersions with subject1 now gives exactly one version
-            List<Version> listr1 = connection.listVersions(subject1).asList();
+            List<Version> listr1 = Iterations.asList(connection.listVersions(subject1));
             Assert.assertEquals("there should be exactly one version", 1, listr1.size());
             Assert.assertEquals("contents of version differ", version1, listr1.get(0));
             Assert.assertEquals("version id is not 1", 1L, (long)listr1.get(0).getId());
@@ -237,13 +153,13 @@ public class VersioningPersistenceTest {
             connection.commit();
 
             // check if listVersions now gives exactly two versions
-            List<Version> list2 = connection.listVersions().asList();
+            List<Version> list2 = Iterations.asList(connection.listVersions());
             Assert.assertEquals("there should be exactly two version",2,list2.size());
             Assert.assertEquals("contents of version differ", version2, list2.get(1));
 
 
             // check if listVersions with subject1 still gives exactly one version
-            List<Version> listr2 = connection.listVersions(subject1).asList();
+            List<Version> listr2 = Iterations.asList(connection.listVersions(subject1));
             Assert.assertEquals("there should be exactly one version", 2, listr2.size());
             Assert.assertEquals("contents of version differ", version1, listr2.get(0));
             Assert.assertEquals("version id is not 1", 1L, (long)listr2.get(0).getId());
@@ -271,12 +187,12 @@ public class VersioningPersistenceTest {
             KiWiStringLiteral object_2 = new KiWiStringLiteral(RandomStringUtils.randomAlphanumeric(32));
             KiWiUriResource context  = new KiWiUriResource("http://localhost/context/"+RandomStringUtils.randomAlphanumeric(8));
 
-            connection.storeNode(subject);
-            connection.storeNode(pred_1);
-            connection.storeNode(pred_2);
-            connection.storeNode(object_1);
-            connection.storeNode(object_2);
-            connection.storeNode(context);
+            connection.storeNode(subject, false);
+            connection.storeNode(pred_1, false);
+            connection.storeNode(pred_2, false);
+            connection.storeNode(object_1, false);
+            connection.storeNode(object_2, false);
+            connection.storeNode(context, false);
 
             KiWiTriple triple1 = new KiWiTriple(subject,pred_1,object_1,context);
             KiWiTriple triple2 = new KiWiTriple(subject,pred_2,object_2,context);
@@ -320,7 +236,7 @@ public class VersioningPersistenceTest {
 
 
             // now we test different ways of listing versions between dates
-            List<Version> list1 = connection.listVersions(date1,date2).asList();
+            List<Version> list1 = Iterations.asList(connection.listVersions(date1,date2));
             Assert.assertEquals("there should be exactly one version from "+date1+" to "+date2,1,list1.size());
             Assert.assertEquals("contents of version differ", version1, list1.get(0));
             Assert.assertEquals("version id is not 1", 1L, (long)list1.get(0).getId());
@@ -331,21 +247,21 @@ public class VersioningPersistenceTest {
             Assert.assertEquals("latest version is not the expected version", version1,latest2);
 
             // check if listVersions with subject1 now gives exactly one version
-            List<Version> listr1 = connection.listVersions(subject,date1,date2).asList();
+            List<Version> listr1 = Iterations.asList(connection.listVersions(subject,date1,date2));
             Assert.assertEquals("there should be exactly one version", 1, listr1.size());
             Assert.assertEquals("contents of version differ", version1, listr1.get(0));
             Assert.assertEquals("version id is not 1", 1L, (long)listr1.get(0).getId());
 
 
-            List<Version> list2 = connection.listVersions(date2,date3).asList();
+            List<Version> list2 = Iterations.asList(connection.listVersions(date2,date3));
             Assert.assertEquals("there should be exactly one version from "+date2+" to "+date3,1,list2.size());
             Assert.assertEquals("contents of version differ", version2, list2.get(0));
             Assert.assertEquals("version id is not 2", 2L, (long)list2.get(0).getId());
 
-            List<Version> list3 = connection.listVersions(date3,new Date()).asList();
+            List<Version> list3 = Iterations.asList(connection.listVersions(date3,new Date()));
             Assert.assertEquals("there should be no version from "+date3+" to now",0,list3.size());
 
-            List<Version> list4 = connection.listVersions(date1,date3).asList();
+            List<Version> list4 = Iterations.asList(connection.listVersions(date1,date3));
             Assert.assertEquals("there should be exactly two versions from "+date1+" to "+date3,2,list4.size());
             Assert.assertEquals("contents of version1 differ", version1, list4.get(0));
             Assert.assertEquals("contents of version2 differ", version2, list4.get(1));
@@ -359,6 +275,78 @@ public class VersioningPersistenceTest {
 
     }
 
+
+    @Test
+    public void testCreateRemoveVersions() throws Exception {
+        KiWiVersioningConnection connection = vpersistence.getConnection();
+        try {
+            KiWiUriResource subject1  = new KiWiUriResource("http://localhost/resource/"+ RandomStringUtils.randomAlphanumeric(8));
+            KiWiUriResource subject2  = new KiWiUriResource("http://localhost/resource/"+ RandomStringUtils.randomAlphanumeric(8));
+            KiWiUriResource pred_1   = new KiWiUriResource("http://localhost/predicate/P1");
+            KiWiUriResource pred_2   = new KiWiUriResource("http://localhost/predicate/P2");
+            KiWiUriResource object_1 = new KiWiUriResource("http://localhost/resource/"+RandomStringUtils.randomAlphanumeric(8));
+            KiWiStringLiteral object_2 = new KiWiStringLiteral(RandomStringUtils.randomAlphanumeric(32));
+            KiWiUriResource context  = new KiWiUriResource("http://localhost/context/"+RandomStringUtils.randomAlphanumeric(8));
+
+            connection.storeNode(subject1, false);
+            connection.storeNode(subject2, false);
+            connection.storeNode(pred_1, false);
+            connection.storeNode(pred_2, false);
+            connection.storeNode(object_1, false);
+            connection.storeNode(object_2, false);
+            connection.storeNode(context, false);
+
+            KiWiTriple triple1 = new KiWiTriple(subject1,pred_1,object_1,context);
+            KiWiTriple triple2 = new KiWiTriple(subject2,pred_2,object_2,context);
+
+            connection.storeTriple(triple1);
+            connection.storeTriple(triple2);
+            connection.commit();
+
+            Version version1 = new Version();
+            version1.setCommitTime(new Date());
+            version1.addTriple(triple1);
+            connection.storeVersion(version1);
+            connection.commit();
+
+            // check if listVersions now gives exactly one version
+            List<Version> list1 = Iterations.asList(connection.listVersions());
+            Assert.assertEquals("there should be exactly one version",1,list1.size());
+            Assert.assertEquals("contents of version differ", version1, list1.get(0));
+            Assert.assertEquals("version id is not 1", 1L, (long)list1.get(0).getId());
+
+            Version version2 = new Version();
+            version2.setCommitTime(new Date());
+            version2.addTriple(triple2);
+            version2.removeTriple(triple1);
+            connection.storeVersion(version2);
+            connection.commit();
+
+            // check if listVersions now gives exactly two versions
+            List<Version> list2 = Iterations.asList(connection.listVersions());
+            Assert.assertEquals("there should be exactly two version",2,list2.size());
+            Assert.assertEquals("contents of version differ", version2, list2.get(1));
+
+            connection.commit();
+
+            connection.removeVersion(version1.getId());
+            connection.commit();
+
+            // check if listVersions now gives exactly two versions
+            List<Version> list3 = Iterations.asList(connection.listVersions());
+            Assert.assertEquals("there should be exactly one version",1,list3.size());
+            Assert.assertEquals("contents of version differ", version2, list3.get(0));
+
+            connection.commit();
+
+        } finally {
+            connection.close();
+        }
+
+    }
+
+
+
     /**
      * MYSQL rounds timestamps to the second, so it is sometimes necessary to sleep before doing a test
      */

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/kiwi/kiwi-versioning/src/test/java/org/apache/marmotta/kiwi/versioning/test/VersioningRepositoryTest.java
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-versioning/src/test/java/org/apache/marmotta/kiwi/versioning/test/VersioningRepositoryTest.java b/libraries/kiwi/kiwi-versioning/src/test/java/org/apache/marmotta/kiwi/versioning/test/VersioningRepositoryTest.java
index f0b720a..76f8375 100644
--- a/libraries/kiwi/kiwi-versioning/src/test/java/org/apache/marmotta/kiwi/versioning/test/VersioningRepositoryTest.java
+++ b/libraries/kiwi/kiwi-versioning/src/test/java/org/apache/marmotta/kiwi/versioning/test/VersioningRepositoryTest.java
@@ -17,12 +17,19 @@
  */
 package org.apache.marmotta.kiwi.versioning.test;
 
-import org.apache.marmotta.kiwi.persistence.KiWiDialect;
-import org.apache.marmotta.kiwi.persistence.h2.H2Dialect;
+import static org.hamcrest.CoreMatchers.notNullValue;
+import static org.junit.Assume.assumeThat;
+import info.aduna.iteration.Iterations;
+
+import java.io.InputStream;
+import java.sql.SQLException;
+import java.util.Date;
+import java.util.List;
+
+import org.apache.marmotta.kiwi.config.KiWiConfiguration;
 import org.apache.marmotta.kiwi.persistence.mysql.MySQLDialect;
-import org.apache.marmotta.kiwi.persistence.pgsql.PostgreSQLDialect;
 import org.apache.marmotta.kiwi.sail.KiWiStore;
-import org.apache.marmotta.kiwi.test.helper.DBConnectionChecker;
+import org.apache.marmotta.kiwi.test.junit.KiWiDatabaseRunner;
 import org.apache.marmotta.kiwi.transactions.sail.KiWiTransactionalSail;
 import org.apache.marmotta.kiwi.versioning.model.Version;
 import org.apache.marmotta.kiwi.versioning.sail.KiWiVersioningSail;
@@ -34,7 +41,7 @@ import org.junit.Test;
 import org.junit.rules.TestWatcher;
 import org.junit.runner.Description;
 import org.junit.runner.RunWith;
-import org.junit.runners.Parameterized;
+import org.openrdf.model.URI;
 import org.openrdf.repository.Repository;
 import org.openrdf.repository.RepositoryConnection;
 import org.openrdf.repository.RepositoryException;
@@ -44,82 +51,15 @@ import org.openrdf.rio.RDFFormat;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import java.io.InputStream;
-import java.sql.SQLException;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-
-import static org.hamcrest.CoreMatchers.notNullValue;
-import static org.junit.Assume.assumeThat;
-
 /**
  * This test checks if the versioning functionality itself works, i.e. the system properly creates versions on
- * transaction commits. It will try running over all available databases. Except for in-memory databases like
- * H2 or Derby, database URLs must be passed as system property, or otherwise the test is skipped for this database.
- * Available system properties:
- * <ul>
- *     <li>PostgreSQL:
- *     <ul>
- *         <li>postgresql.url, e.g. jdbc:postgresql://localhost:5433/kiwitest?prepareThreshold=3</li>
- *         <li>postgresql.user (default: lmf)</li>
- *         <li>postgresql.pass (default: lmf)</li>
- *     </ul>
- *     </li>
- *     <li>MySQL:
- *     <ul>
- *         <li>mysql.url, e.g. jdbc:mysql://localhost:3306/kiwitest?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull</li>
- *         <li>mysql.user (default: lmf)</li>
- *         <li>mysql.pass (default: lmf</li>
- *     </ul>
- *     </li>
- *     <li>H2:
- *     <ul>
- *         <li>h2.url, e.g. jdbc:h2:mem;MVCC=true;DB_CLOSE_ON_EXIT=FALSE;DB_CLOSE_DELAY=10</li>
- *         <li>h2.user (default: lmf)</li>
- *         <li>h2.pass (default: lmf</li>
- *     </ul>
- *     </li>
- * </ul>
- *
- * <p/>
- * Author: Sebastian Schaffert
+ * transaction commits. 
+ * 
+ * @author Sebastian Schaffert (sschaffert@apache.org)
  */
-@RunWith(Parameterized.class)
+@RunWith(KiWiDatabaseRunner.class)
 public class VersioningRepositoryTest {
 
-    /**
-     * Return database configurations if the appropriate parameters have been set.
-     *
-     * @return an array (database name, url, user, password)
-     */
-    @Parameterized.Parameters(name="Database Test {index}: {0} at {1}")
-    public static Iterable<Object[]> databases() {
-        String[] databases = {"H2", "PostgreSQL", "MySQL"};
-
-        List<Object[]> result = new ArrayList<Object[]>(databases.length);
-        for(String database : databases) {
-            if(System.getProperty(database.toLowerCase()+".url") != null) {
-                result.add(new Object[] {
-                        database,
-                        System.getProperty(database.toLowerCase()+".url"),
-                        System.getProperty(database.toLowerCase()+".user","lmf"),
-                        System.getProperty(database.toLowerCase()+".pass","lmf")
-                });
-            }
-        }
-        return result;
-    }
-
-
-    private KiWiDialect dialect;
-
-    private String jdbcUrl;
-
-    private String jdbcUser;
-
-    private String jdbcPass;
-
     private KiWiStore store;
 
     private KiWiTransactionalSail tsail;
@@ -128,26 +68,16 @@ public class VersioningRepositoryTest {
 
     private Repository repository;
 
-    public VersioningRepositoryTest(String database, String jdbcUrl, String jdbcUser, String jdbcPass) {
-        this.jdbcPass = jdbcPass;
-        this.jdbcUrl = jdbcUrl;
-        this.jdbcUser = jdbcUser;
-
-        if("H2".equals(database)) {
-            this.dialect = new H2Dialect();
-        } else if("MySQL".equals(database)) {
-            this.dialect = new MySQLDialect();
-        } else if("PostgreSQL".equals(database)) {
-            this.dialect = new PostgreSQLDialect();
-        }
-        
-        DBConnectionChecker.checkDatabaseAvailability(jdbcUrl, jdbcUser, jdbcPass, dialect);
+    private final KiWiConfiguration dbConfig;
+
+    public VersioningRepositoryTest(KiWiConfiguration dbConfig) {
+        this.dbConfig = dbConfig;
     }
 
 
     @Before
     public void initDatabase() throws RepositoryException {
-        store = new KiWiStore("test",jdbcUrl,jdbcUser,jdbcPass,dialect, "http://localhost/context/default", "http://localhost/context/inferred");
+        store = new KiWiStore(dbConfig);
         tsail = new KiWiTransactionalSail(store);
         vsail = new KiWiVersioningSail(tsail);
         repository = new SailRepository(vsail);
@@ -164,18 +94,6 @@ public class VersioningRepositoryTest {
     final Logger logger =
             LoggerFactory.getLogger(this.getClass());
 
-    @Rule
-    public TestWatcher watchman = new TestWatcher() {
-        /**
-         * Invoked when a test is about to start
-         */
-        @Override
-        protected void starting(Description description) {
-            logger.info("{} being run...", description.getMethodName());
-        }
-    };
-
-
     /**
      * This test imports three small RDF files in sequence and checks afterwards that the number of versions
      * is correct and they contain the correct information
@@ -249,10 +167,99 @@ public class VersioningRepositoryTest {
 
 
     /**
+     * This test imports three small RDF files in sequence and checks afterwards that the number of versions
+     * is correct and they contain the correct information
+     * @throws Exception
+     */
+    @Test
+    public void testRevertVersions() throws Exception {
+        // import three files in sequence and check if the versions are created properly
+
+        Date date1 = new Date();
+
+        mysqlSleep();
+
+        // base data
+        InputStream baseData = this.getClass().getResourceAsStream("version-base.rdf");
+        assumeThat("Could not load test-data: version-base.rdf", baseData, notNullValue(InputStream.class));
+
+        RepositoryConnection connectionBase = repository.getConnection();
+        try {
+            connectionBase.add(baseData, "http://marmotta.incubator.apache.org/testing/ns1/", RDFFormat.RDFXML);
+            connectionBase.commit();
+        } finally {
+            connectionBase.close();
+        }
+
+        mysqlSleep();
+
+        Date date2 = new Date();
+
+        mysqlSleep();
+
+        // update 1
+        InputStream update1Data = this.getClass().getResourceAsStream("version-update1.rdf");
+        assumeThat("Could not load test-data: version-update1.rdf", update1Data, notNullValue(InputStream.class));
+
+        RepositoryConnection connectionUpdate1 = repository.getConnection();
+        try {
+            connectionUpdate1.add(update1Data, "http://marmotta.incubator.apache.org/testing/ns1/", RDFFormat.RDFXML);
+            connectionUpdate1.commit();
+        } finally {
+            connectionUpdate1.close();
+        }
+
+        // update 2
+        InputStream update2Data = this.getClass().getResourceAsStream("version-update2.rdf");
+        assumeThat("Could not load test-data: version-update2.rdf", update2Data, notNullValue(InputStream.class));
+
+        RepositoryConnection connectionUpdate2 = repository.getConnection();
+        try {
+            connectionUpdate2.add(update2Data, "http://marmotta.incubator.apache.org/testing/ns1/", RDFFormat.RDFXML);
+            connectionUpdate2.commit();
+        } finally {
+            connectionUpdate2.close();
+        }
+
+        // list all versions
+        List<Version> versions = asList(vsail.listVersions());
+        Assert.assertEquals("expected 3 versions!", 3, versions.size());
+        Assert.assertEquals(1, (long)versions.get(0).getId());
+
+        URI subject = repository.getValueFactory().createURI("http://marmotta.incubator.apache.org/testing/ns1/R1");
+        URI predicate = repository.getValueFactory().createURI("http://marmotta.incubator.apache.org/testing/ns1/P2");
+
+        RepositoryConnection connectionBeforeRevert = repository.getConnection();
+        try {
+            Assert.assertTrue(connectionBeforeRevert.hasStatement(subject,predicate,null,true));
+        } finally {
+            connectionBeforeRevert.close();
+        }
+
+        // revert version; afterwards we expect there to be 4 versions
+        vsail.revertVersion(versions.get(0));
+
+        List<Version> versions2 = asList(vsail.listVersions());
+        Assert.assertEquals("expected 4 versions!", 4, versions2.size());
+
+        // the repository should now lo longer contain any P2 property for ns1:C
+        RepositoryConnection connectionAfterRevert = repository.getConnection();
+        try {
+            Assert.assertFalse(connectionAfterRevert.hasStatement(subject, predicate, null, true));
+        } finally {
+            connectionAfterRevert.close();
+        }
+
+
+
+    }
+
+
+    /**
      * MYSQL rounds timestamps to the second, so it is sometimes necessary to sleep before doing a test
      */
     private  void mysqlSleep() {
-        if(this.dialect instanceof MySQLDialect) {
+        if(this.dbConfig.getDialect() instanceof MySQLDialect) {
             try {
                 Thread.sleep(1000);
             } catch (InterruptedException e) {
@@ -267,16 +274,6 @@ public class VersioningRepositoryTest {
      * @return
      */
     public static <E> List<E> asList(RepositoryResult<E> result) throws RepositoryException {
-        ArrayList<E> collection = new ArrayList<E>();
-        try {
-            while (result.hasNext()) {
-                collection.add(result.next());
-            }
-
-            return collection;
-        }
-        finally {
-            result.close();
-        }
+        return Iterations.asList(result);
     }
 }

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/kiwi/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/kiwi/pom.xml b/libraries/kiwi/pom.xml
index 39132c6..665f70d 100644
--- a/libraries/kiwi/pom.xml
+++ b/libraries/kiwi/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>
 
@@ -64,10 +64,6 @@
                     <version>2.13</version>
                     <configuration>
                         <systemPropertyVariables>
-                            <h2.url>jdbc:h2:mem:test;MVCC=true;DB_CLOSE_ON_EXIT=TRUE</h2.url>
-                            <h2.user>sa</h2.user>
-                            <h2.pass />
-
                             <!-- enable or pass on command line for testing local PostgreSQL -->
                             <postgresql.url>jdbc:postgresql://localhost:5433/kiwitest?prepareThreshold=3</postgresql.url>
                             <postgresql.user>lmf</postgresql.user>
@@ -88,10 +84,21 @@
                 <plugin> <!-- generate JRebel Configuration -->
                     <groupId>org.zeroturnaround</groupId>
                     <artifactId>jrebel-maven-plugin</artifactId>
+                    <executions>
+                        <execution>
+                            <id>generate-rebel-xml</id>
+                            <phase>process-resources</phase>
+                            <goals>
+                                <goal>generate</goal>
+                            </goals>
+                        </execution>
+                    </executions>
                     <configuration>
-                        <relativePath>../../</relativePath>
+                        <relativePath>../../../</relativePath>
+                        <rootPath>$${rebel.root}</rootPath>
                     </configuration>
                 </plugin>
+
             </plugins>
         </pluginManagement>
         <plugins>
@@ -100,19 +107,6 @@
                 <artifactId>maven-surefire-plugin</artifactId>
             </plugin>
 
-            <!-- do not install / deploy reactor -->
-            <plugin>
-                <artifactId>maven-deploy-plugin</artifactId>
-                <configuration>
-                    <skip>true</skip>
-                </configuration>
-            </plugin>
-            <plugin>
-                <artifactId>maven-install-plugin</artifactId>
-                <configuration>
-                    <skip>true</skip>
-                </configuration>
-            </plugin>
         </plugins>
     </build>
 
@@ -135,6 +129,7 @@
         <module>kiwi-tripletable</module>
         <module>kiwi-versioning</module>
         <module>kiwi-reasoner</module>
+        <module>kiwi-sparql</module>
     </modules>
 
 </project>

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldcache/ldcache-api/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldcache/ldcache-api/pom.xml b/libraries/ldcache/ldcache-api/pom.xml
index 8462669..13dbd08 100644
--- a/libraries/ldcache/ldcache-api/pom.xml
+++ b/libraries/ldcache/ldcache-api/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>
 
@@ -32,6 +32,30 @@
         Interfaces and Data Model for the Linked Data Caching component.
     </description>
 
+    <build>
+        <pluginManagement>
+            <plugins>
+                <plugin> <!-- generate JRebel Configuration -->
+                    <groupId>org.zeroturnaround</groupId>
+                    <artifactId>jrebel-maven-plugin</artifactId>
+                    <executions>
+                        <execution>
+                            <id>generate-rebel-xml</id>
+                            <phase>process-resources</phase>
+                            <goals>
+                                <goal>generate</goal>
+                            </goals>
+                        </execution>
+                    </executions>
+                    <configuration>
+                        <relativePath>../../../</relativePath>
+                        <rootPath>$${rebel.root}</rootPath>
+                    </configuration>
+                </plugin>
+            </plugins>
+        </pluginManagement>
+    </build>
+
     <dependencies>
 
         <dependency>

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldcache/ldcache-api/src/main/java/org/apache/marmotta/ldcache/api/LDCachingBackend.java
----------------------------------------------------------------------
diff --git a/libraries/ldcache/ldcache-api/src/main/java/org/apache/marmotta/ldcache/api/LDCachingBackend.java b/libraries/ldcache/ldcache-api/src/main/java/org/apache/marmotta/ldcache/api/LDCachingBackend.java
index 3e9bc50..a121e20 100644
--- a/libraries/ldcache/ldcache-api/src/main/java/org/apache/marmotta/ldcache/api/LDCachingBackend.java
+++ b/libraries/ldcache/ldcache-api/src/main/java/org/apache/marmotta/ldcache/api/LDCachingBackend.java
@@ -60,6 +60,14 @@ public interface LDCachingBackend {
 
 
     /**
+     * Return true in case the resource is a cached resource.
+     *
+     * @param resource the URI of the resource to check
+     * @return true in case the resource is a cached resource
+     */
+    public boolean isCached(String resource)  throws RepositoryException;
+
+    /**
      * Carry out any initialization tasks that might be necessary
      */
     public void initialize();

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldcache/ldcache-api/src/main/java/org/apache/marmotta/ldcache/model/CacheEntry.java
----------------------------------------------------------------------
diff --git a/libraries/ldcache/ldcache-api/src/main/java/org/apache/marmotta/ldcache/model/CacheEntry.java b/libraries/ldcache/ldcache-api/src/main/java/org/apache/marmotta/ldcache/model/CacheEntry.java
index 61bef7a..4c7db25 100644
--- a/libraries/ldcache/ldcache-api/src/main/java/org/apache/marmotta/ldcache/model/CacheEntry.java
+++ b/libraries/ldcache/ldcache-api/src/main/java/org/apache/marmotta/ldcache/model/CacheEntry.java
@@ -52,41 +52,83 @@ public class CacheEntry {
     private Integer updateCount;
 
 
+    /**
+     * The number of triples that have been retrieved in the last cache refresh.
+     */
+    private Integer tripleCount;
+
 
     public CacheEntry() {
     }
 
 
+    /**
+     * The URI resource managed by this cache entry.
+     */
     public URI getResource() {
         return resource;
     }
 
+    /**
+     * The URI resource managed by this cache entry.
+     */
     public void setResource(URI resource) {
         this.resource = resource;
     }
 
+    /**
+     * The date when this resource has been retrieved the last time.
+     */
     public Date getLastRetrieved() {
         return lastRetrieved;
     }
 
+    /**
+     * The date when this resource has been retrieved the last time.
+     */
     public void setLastRetrieved(Date lastRetrieved) {
         this.lastRetrieved = new Date(lastRetrieved.getTime());
     }
 
+    /**
+     * The date when this resource needs to be retrieved again according to expiry configuration.
+     */
     public Date getExpiryDate() {
         return expiryDate;
     }
 
+    /**
+     * The date when this resource needs to be retrieved again according to expiry configuration.
+     */
     public void setExpiryDate(Date expiryDate) {
         this.expiryDate = new Date(expiryDate.getTime());
     }
 
+    /**
+     * The number of times this resource has already been updated.
+     */
     public Integer getUpdateCount() {
         return updateCount;
     }
 
+    /**
+     * The number of times this resource has already been updated.
+     */
     public void setUpdateCount(Integer updateCount) {
         this.updateCount = updateCount;
     }
 
+    /**
+     * The number of triples that have been retrieved in the last cache refresh.
+     */
+    public Integer getTripleCount() {
+        return tripleCount;
+    }
+
+    /**
+     * The number of triples that have been retrieved in the last cache refresh.
+     */
+    public void setTripleCount(Integer tripleCount) {
+        this.tripleCount = tripleCount;
+    }
 }

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldcache/ldcache-backend-ehcache/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldcache/ldcache-backend-ehcache/pom.xml b/libraries/ldcache/ldcache-backend-ehcache/pom.xml
index 86a9d92..0df8bea 100644
--- a/libraries/ldcache/ldcache-backend-ehcache/pom.xml
+++ b/libraries/ldcache/ldcache-backend-ehcache/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>
 
@@ -34,6 +34,30 @@
     </description>
 
 
+    <build>
+        <pluginManagement>
+            <plugins>
+                <plugin> <!-- generate JRebel Configuration -->
+                    <groupId>org.zeroturnaround</groupId>
+                    <artifactId>jrebel-maven-plugin</artifactId>
+                    <executions>
+                        <execution>
+                            <id>generate-rebel-xml</id>
+                            <phase>process-resources</phase>
+                            <goals>
+                                <goal>generate</goal>
+                            </goals>
+                        </execution>
+                    </executions>
+                    <configuration>
+                        <relativePath>../../../</relativePath>
+                        <rootPath>$${rebel.root}</rootPath>
+                    </configuration>
+                </plugin>
+            </plugins>
+        </pluginManagement>
+    </build>
+
     <dependencies>
 
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldcache/ldcache-backend-file/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldcache/ldcache-backend-file/pom.xml b/libraries/ldcache/ldcache-backend-file/pom.xml
index c7d567b..881b2bf 100644
--- a/libraries/ldcache/ldcache-backend-file/pom.xml
+++ b/libraries/ldcache/ldcache-backend-file/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>
 
@@ -34,8 +34,27 @@
 
 
     <build>
-        <plugins>
-        </plugins>
+        <pluginManagement>
+            <plugins>
+                <plugin> <!-- generate JRebel Configuration -->
+                    <groupId>org.zeroturnaround</groupId>
+                    <artifactId>jrebel-maven-plugin</artifactId>
+                    <executions>
+                        <execution>
+                            <id>generate-rebel-xml</id>
+                            <phase>process-resources</phase>
+                            <goals>
+                                <goal>generate</goal>
+                            </goals>
+                        </execution>
+                    </executions>
+                    <configuration>
+                        <relativePath>../../../</relativePath>
+                        <rootPath>$${rebel.root}</rootPath>
+                    </configuration>
+                </plugin>
+            </plugins>
+        </pluginManagement>
     </build>
 
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldcache/ldcache-backend-file/src/main/java/org/apache/marmotta/ldcache/backend/file/LDCachingFileBackend.java
----------------------------------------------------------------------
diff --git a/libraries/ldcache/ldcache-backend-file/src/main/java/org/apache/marmotta/ldcache/backend/file/LDCachingFileBackend.java b/libraries/ldcache/ldcache-backend-file/src/main/java/org/apache/marmotta/ldcache/backend/file/LDCachingFileBackend.java
index 937ace5..bff143a 100644
--- a/libraries/ldcache/ldcache-backend-file/src/main/java/org/apache/marmotta/ldcache/backend/file/LDCachingFileBackend.java
+++ b/libraries/ldcache/ldcache-backend-file/src/main/java/org/apache/marmotta/ldcache/backend/file/LDCachingFileBackend.java
@@ -35,9 +35,11 @@ import org.apache.marmotta.ldcache.backend.file.repository.LDCachingFileReposito
 import org.apache.marmotta.ldcache.backend.file.util.FileBackendUtils;
 import org.apache.marmotta.ldcache.model.CacheEntry;
 import org.openrdf.model.ValueFactory;
+import org.openrdf.model.impl.ValueFactoryImpl;
 import org.openrdf.repository.Repository;
 import org.openrdf.repository.RepositoryException;
 import org.openrdf.repository.sail.SailRepository;
+import org.openrdf.sail.SailException;
 import org.openrdf.sail.nativerdf.NativeStore;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -109,6 +111,26 @@ public class LDCachingFileBackend implements LDCachingBackend {
         };
     }
 
+    /**
+     * Return true in case the resource is a cached resource.
+     *
+     * @param resource the URI of the resource to check
+     * @return true in case the resource is a cached resource
+     */
+    @Override
+    public boolean isCached(String resource) throws RepositoryException {
+        try {
+            final File dataFile = FileBackendUtils.getMetaFile(resource, storageDir);
+            if (!(dataFile.exists())) return false;
+            final CacheEntry ce = FileBackendUtils.readCacheEntry(dataFile, new ValueFactoryImpl());
+            //return ce != null && !FileBackendUtils.isExpired(ce) && ce.getTripleCount() > 0;
+            return ce != null && ce.getTripleCount() > 0;
+        } catch (IOException e) {
+            throw new RepositoryException(e);
+        }
+    }
+
+
     /* (non-Javadoc)
      * @see org.apache.marmotta.ldcache.api.LDCachingBackend#initialize()
      */

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldcache/ldcache-backend-file/src/main/java/org/apache/marmotta/ldcache/backend/file/util/FileBackendUtils.java
----------------------------------------------------------------------
diff --git a/libraries/ldcache/ldcache-backend-file/src/main/java/org/apache/marmotta/ldcache/backend/file/util/FileBackendUtils.java b/libraries/ldcache/ldcache-backend-file/src/main/java/org/apache/marmotta/ldcache/backend/file/util/FileBackendUtils.java
index ea90433..a24902c 100644
--- a/libraries/ldcache/ldcache-backend-file/src/main/java/org/apache/marmotta/ldcache/backend/file/util/FileBackendUtils.java
+++ b/libraries/ldcache/ldcache-backend-file/src/main/java/org/apache/marmotta/ldcache/backend/file/util/FileBackendUtils.java
@@ -101,7 +101,8 @@ public class FileBackendUtils {
 				ce.setLastRetrieved(new Date(Long.parseLong(br.readLine().replaceFirst("#.*$", "").trim())));
 				ce.setExpiryDate(new Date(Long.parseLong(br.readLine().replaceFirst("#.*$", "").trim())));
 				ce.setUpdateCount(Integer.parseInt(br.readLine().replaceFirst("#.*$", "").trim()));
-				
+                ce.setTripleCount(Integer.parseInt(br.readLine().replaceFirst("#.*$", "").trim()));
+
 				return ce;
 			} finally {
 				br.close();
@@ -120,6 +121,8 @@ public class FileBackendUtils {
 				ps.printf("%tQ # last retrieved: %<tF %<tT.%<tL%n", ce.getLastRetrieved());
 				ps.printf("%tQ # expires: %<tF %<tT.%<tL%n", ce.getExpiryDate());
 				ps.printf("%d # %<d updates%n", ce.getUpdateCount());
+                ps.printf("%d # %<d triples%n", ce.getTripleCount());
+                ps.flush();
 			} finally {
 				ps.close();
 			}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldcache/ldcache-backend-file/src/test/java/org/apache/marmotta/ldcache/backend/file/test/LDCacheBackendTest.java
----------------------------------------------------------------------
diff --git a/libraries/ldcache/ldcache-backend-file/src/test/java/org/apache/marmotta/ldcache/backend/file/test/LDCacheBackendTest.java b/libraries/ldcache/ldcache-backend-file/src/test/java/org/apache/marmotta/ldcache/backend/file/test/LDCacheBackendTest.java
index 2061c9f..0a24002 100644
--- a/libraries/ldcache/ldcache-backend-file/src/test/java/org/apache/marmotta/ldcache/backend/file/test/LDCacheBackendTest.java
+++ b/libraries/ldcache/ldcache-backend-file/src/test/java/org/apache/marmotta/ldcache/backend/file/test/LDCacheBackendTest.java
@@ -19,7 +19,7 @@ package org.apache.marmotta.ldcache.backend.file.test;
 import com.google.common.io.Files;
 import info.aduna.iteration.CloseableIteration;
 import org.apache.commons.io.FileUtils;
-import org.apache.commons.lang.RandomStringUtils;
+import org.apache.commons.lang3.RandomStringUtils;
 import org.apache.marmotta.ldcache.api.LDCachingConnection;
 import org.apache.marmotta.ldcache.backend.file.LDCachingFileBackend;
 import org.apache.marmotta.ldcache.model.CacheEntry;
@@ -160,9 +160,12 @@ public class LDCacheBackendTest {
             entry1.setLastRetrieved(new Date());
             entry1.setUpdateCount(1);
             entry1.setResource(subject1);
+            entry1.setTripleCount(1);
             con.addCacheEntry(subject1, entry1);
             con.commit();
 
+            Assert.assertTrue(backend.isCached(subject1.stringValue()));
+            Assert.assertFalse(backend.isCached(subject2.stringValue()));
             Assert.assertEquals(1,asList(backend.listCacheEntries()).size());
             Assert.assertEquals(0,asList(backend.listExpiredEntries()).size());
 
@@ -172,10 +175,13 @@ public class LDCacheBackendTest {
             entry2.setLastRetrieved(new Date());
             entry2.setUpdateCount(1);
             entry2.setResource(subject2);
+            entry2.setTripleCount(1);
             con.addCacheEntry(subject2,entry2);
 
             con.commit();
 
+            Assert.assertTrue(backend.isCached(subject1.stringValue()));
+            Assert.assertTrue(backend.isCached(subject2.stringValue()));
             Assert.assertEquals(2,asList(backend.listCacheEntries()).size());
             Assert.assertEquals(1,asList(backend.listExpiredEntries()).size());
 
@@ -183,6 +189,8 @@ public class LDCacheBackendTest {
             con.removeCacheEntry(subject1);
             con.commit();
 
+            Assert.assertFalse(backend.isCached(subject1.stringValue()));
+            Assert.assertTrue(backend.isCached(subject2.stringValue()));
             Assert.assertEquals(1,asList(backend.listCacheEntries()).size());
             Assert.assertEquals(1,asList(backend.listExpiredEntries()).size());
         } catch(RepositoryException ex) {

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldcache/ldcache-backend-kiwi/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldcache/ldcache-backend-kiwi/pom.xml b/libraries/ldcache/ldcache-backend-kiwi/pom.xml
index 356eacd..1fab347 100644
--- a/libraries/ldcache/ldcache-backend-kiwi/pom.xml
+++ b/libraries/ldcache/ldcache-backend-kiwi/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>
 
@@ -34,6 +34,27 @@
     </description>
 
     <build>
+        <pluginManagement>
+            <plugins>
+                <plugin> <!-- generate JRebel Configuration -->
+                    <groupId>org.zeroturnaround</groupId>
+                    <artifactId>jrebel-maven-plugin</artifactId>
+                    <executions>
+                        <execution>
+                            <id>generate-rebel-xml</id>
+                            <phase>process-resources</phase>
+                            <goals>
+                                <goal>generate</goal>
+                            </goals>
+                        </execution>
+                    </executions>
+                    <configuration>
+                        <relativePath>../../../</relativePath>
+                        <rootPath>$${rebel.root}</rootPath>
+                    </configuration>
+                </plugin>
+            </plugins>
+        </pluginManagement>
         <plugins>
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
@@ -140,7 +161,7 @@
             <scope>test</scope>
         </dependency>
         <dependency>
-            <groupId>org.jumpmind.symmetric.jdbc</groupId>
+            <groupId>org.postgresql</groupId>
             <artifactId>postgresql</artifactId>
             <scope>test</scope>
         </dependency>

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldcache/ldcache-backend-kiwi/src/main/java/org/apache/marmotta/ldcache/backend/kiwi/LDCachingKiWiBackend.java
----------------------------------------------------------------------
diff --git a/libraries/ldcache/ldcache-backend-kiwi/src/main/java/org/apache/marmotta/ldcache/backend/kiwi/LDCachingKiWiBackend.java b/libraries/ldcache/ldcache-backend-kiwi/src/main/java/org/apache/marmotta/ldcache/backend/kiwi/LDCachingKiWiBackend.java
index 3e90e1e..0d7870b 100644
--- a/libraries/ldcache/ldcache-backend-kiwi/src/main/java/org/apache/marmotta/ldcache/backend/kiwi/LDCachingKiWiBackend.java
+++ b/libraries/ldcache/ldcache-backend-kiwi/src/main/java/org/apache/marmotta/ldcache/backend/kiwi/LDCachingKiWiBackend.java
@@ -23,6 +23,7 @@ import org.apache.marmotta.kiwi.sail.KiWiStore;
 import org.apache.marmotta.ldcache.api.LDCachingBackend;
 import org.apache.marmotta.ldcache.api.LDCachingConnection;
 import org.apache.marmotta.ldcache.backend.kiwi.persistence.LDCachingKiWiPersistence;
+import org.apache.marmotta.ldcache.backend.kiwi.persistence.LDCachingKiWiPersistenceConnection;
 import org.apache.marmotta.ldcache.backend.kiwi.repository.LDCachingSailRepositoryConnection;
 import org.apache.marmotta.ldcache.backend.kiwi.sail.LDCachingKiWiSail;
 import org.apache.marmotta.ldcache.backend.kiwi.sail.LDCachingKiWiSailConnection;
@@ -177,6 +178,28 @@ public class LDCachingKiWiBackend implements LDCachingBackend {
     }
 
 
+    /**
+     * Return true in case the resource is a cached resource.
+     *
+     * @param resource the URI of the resource to check
+     * @return true in case the resource is a cached resource
+     */
+    @Override
+    public boolean isCached(String resource) throws RepositoryException {
+        try {
+            LDCachingKiWiPersistenceConnection con = persistence.getConnection();
+            try {
+                CacheEntry entry = con.getCacheEntry(resource);
+                return  entry != null && entry.getTripleCount() > 0;
+            } finally {
+                con.commit();
+                con.close();
+            }
+        } catch (SQLException e) {
+            throw new RepositoryException(e);
+        }
+    }
+
     public LDCachingKiWiPersistence getPersistence() {
         return persistence;
     }

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldcache/ldcache-backend-kiwi/src/main/java/org/apache/marmotta/ldcache/backend/kiwi/persistence/LDCachingKiWiPersistenceConnection.java
----------------------------------------------------------------------
diff --git a/libraries/ldcache/ldcache-backend-kiwi/src/main/java/org/apache/marmotta/ldcache/backend/kiwi/persistence/LDCachingKiWiPersistenceConnection.java b/libraries/ldcache/ldcache-backend-kiwi/src/main/java/org/apache/marmotta/ldcache/backend/kiwi/persistence/LDCachingKiWiPersistenceConnection.java
index aba5c2f..63e4063 100644
--- a/libraries/ldcache/ldcache-backend-kiwi/src/main/java/org/apache/marmotta/ldcache/backend/kiwi/persistence/LDCachingKiWiPersistenceConnection.java
+++ b/libraries/ldcache/ldcache-backend-kiwi/src/main/java/org/apache/marmotta/ldcache/backend/kiwi/persistence/LDCachingKiWiPersistenceConnection.java
@@ -85,6 +85,7 @@ public class LDCachingKiWiPersistenceConnection  {
         entry.setExpiryDate(new Date(row.getTimestamp("expires_at").getTime()));
         entry.setUpdateCount(row.getInt("update_count"));
         entry.setResource((URI) connection.loadNodeById(row.getLong("resource_id")));
+        entry.setTripleCount(row.getInt("triple_count"));
 
         entryIdCache.put(new Element(id,entry));
         entryResourceCache.put(new Element(entry.getResource().stringValue(),entry));
@@ -145,12 +146,16 @@ public class LDCachingKiWiPersistenceConnection  {
             kEntry.setLastRetrieved(entry.getLastRetrieved());
             kEntry.setUpdateCount(entry.getUpdateCount());
             kEntry.setResource(entry.getResource());
+            kEntry.setTripleCount(entry.getTripleCount());
         }
 
         if(! (entry.getResource() instanceof KiWiResource) || ((KiWiResource) entry.getResource()).getId() == null) {
             throw new IllegalStateException("the resource contained in the cache entry is not a KiWiResource!");
         }
 
+        // needed before the entry can be inserted
+        connection.flushBatch();
+
         kEntry.setId(connection.getNextSequence("seq.ldcache"));
 
         PreparedStatement insertEntry = connection.getPreparedStatement("store.entry");
@@ -159,6 +164,7 @@ public class LDCachingKiWiPersistenceConnection  {
         insertEntry.setTimestamp(3,new Timestamp(kEntry.getExpiryDate().getTime()));
         insertEntry.setLong(4,((KiWiNode)kEntry.getResource()).getId());
         insertEntry.setInt(5, kEntry.getUpdateCount());
+        insertEntry.setInt(6, kEntry.getTripleCount());
         insertEntry.executeUpdate();
 
         log.debug("persisted ld-cache entry with id {}", kEntry.getId());
@@ -326,7 +332,7 @@ public class LDCachingKiWiPersistenceConnection  {
      * @throws java.sql.SQLException
      */
     public void storeNode(KiWiNode node) throws SQLException {
-        connection.storeNode(node);
+        connection.storeNode(node, false);
     }
 
     /**


[019/100] [abbrv] [partial] Reverting the erroneous merge by Sebastian according to the instructions in INFRA-6876

Posted by wi...@apache.org.
http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/kiwi/kiwi-sparql/src/main/java/org/apache/marmotta/kiwi/sparql/sqlmapper/UnionOptimizer.java
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-sparql/src/main/java/org/apache/marmotta/kiwi/sparql/sqlmapper/UnionOptimizer.java b/libraries/kiwi/kiwi-sparql/src/main/java/org/apache/marmotta/kiwi/sparql/sqlmapper/UnionOptimizer.java
deleted file mode 100644
index e3ab76c..0000000
--- a/libraries/kiwi/kiwi-sparql/src/main/java/org/apache/marmotta/kiwi/sparql/sqlmapper/UnionOptimizer.java
+++ /dev/null
@@ -1,239 +0,0 @@
-/**
- * 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.platform.sparql.services.evaluation.sql;
-
-import org.openrdf.query.algebra.*;
-import org.openrdf.query.algebra.helpers.QueryModelVisitorBase;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * Move unions that are contained in Joins or LeftJoins out (switch positions of union and join)
- * <p/>
- * Author: Sebastian Schaffert
- */
-public class UnionOptimizer  extends QueryModelVisitorBase<RuntimeException> {
-
-    public UnionOptimizer() {
-    }
-
-    public void optimize(TupleExpr expr) {
-        expr.visit(this);
-    }
-
-
-    // rewrite multiprojection so that each projection gets a unique name and turn it into a projection
-
-
-    @Override
-    public void meet(MultiProjection node) throws RuntimeException {
-        int projectionCounter = 0;
-
-        List<ProjectionElem> projectionElemList = new ArrayList<ProjectionElem>();
-        for(ProjectionElemList elems : node.getProjections()) {
-            projectionCounter++;
-
-            for(ProjectionElem elem : elems.getElements()) {
-                ProjectionElem celem = elem.clone();
-                celem.setTargetName("_multi_"+elem.getTargetName()+"_"+projectionCounter);
-                projectionElemList.add(celem);
-            }
-        }
-        ProjectionElemList projections = new ProjectionElemList(projectionElemList);
-
-        Projection projection = new Projection(node.getArg().clone(),projections);
-        node.replaceWith(projection);
-        projection.visit(this);
-    }
-
-    @Override
-    public void meet(Union node) throws RuntimeException {
-        if(node.getParentNode() instanceof Join || node.getParentNode() instanceof LeftJoin) {
-            // move the other arg of the join inside the union
-            BinaryTupleOperator parent = (BinaryTupleOperator)node.getParentNode();
-            if(node == parent.getLeftArg()) {
-                // transform Join(Union(X,Y),Z) into Union(Join(X,Z),Join(Y,Z))
-
-                // parent is the join, so we create two copies of it
-                BinaryTupleOperator join1 = parent.clone();
-                BinaryTupleOperator join2 = parent.clone();
-
-                // take the left argument of the union and the right argument of the join, and put them into join1
-                join1.setLeftArg(node.getLeftArg());
-                join1.setRightArg(parent.getRightArg());
-
-                // take the right argument of the union and the right argument of the join, and put them into join2
-                join2.setLeftArg(node.getRightArg());
-                join2.setRightArg(parent.getRightArg());
-
-                // copy the union node to a new union node, and set the two new joins as arguments
-                Union union = node.clone();
-                union.setLeftArg(join1);
-                union.setRightArg(join2);
-
-                // replace parent by the new union
-                parent.replaceWith(union);
-
-                union.visit(this);
-            } else if(node == parent.getRightArg()) {
-                // transform Join(X,Union(Y,Z)) into Union(Join(X,Y),Join(X,Z))
-
-                // parent is the join, so we create two copies of it
-                BinaryTupleOperator join1 = parent.clone();
-                BinaryTupleOperator join2 = parent.clone();
-
-                // take the the left argument of the join and the left argument of the union , and put them into join1
-                join1.setLeftArg(parent.getLeftArg());
-                join1.setRightArg(node.getLeftArg());
-
-                // take the the left argument of the join and the right argument of the union , and put them into join1
-                join2.setLeftArg(parent.getLeftArg());
-                join2.setRightArg(node.getRightArg());
-
-                // copy the union node to a new union node, and set the two new joins as arguments
-                Union union = node.clone();
-                union.setLeftArg(join1);
-                union.setRightArg(join2);
-
-                // replace parent by the new union
-                parent.replaceWith(union);
-
-                union.visit(this);
-            }
-
-        }
-    }
-
-    @Override
-    public void meet(Intersection node) throws RuntimeException {
-        if(node.getParentNode() instanceof Join || node.getParentNode() instanceof LeftJoin) {
-            // move the other arg of the join inside the union
-            BinaryTupleOperator parent = (BinaryTupleOperator)node.getParentNode();
-            if(node == parent.getLeftArg()) {
-                // transform Join(Union(X,Y),Z) into Union(Join(X,Z),Join(Y,Z))
-
-                // parent is the join, so we create two copies of it
-                BinaryTupleOperator join1 = parent.clone();
-                BinaryTupleOperator join2 = parent.clone();
-
-                // take the left argument of the union and the right argument of the join, and put them into join1
-                join1.setLeftArg(node.getLeftArg());
-                join1.setRightArg(parent.getRightArg());
-
-                // take the right argument of the union and the right argument of the join, and put them into join2
-                join2.setLeftArg(node.getRightArg());
-                join2.setRightArg(parent.getRightArg());
-
-                // copy the union node to a new union node, and set the two new joins as arguments
-                Intersection intersection = node.clone();
-                intersection.setLeftArg(join1);
-                intersection.setRightArg(join2);
-
-                // replace parent by the new union
-                parent.replaceWith(intersection);
-
-                intersection.visit(this);
-            } else if(node == parent.getRightArg()) {
-                // transform Join(X,Union(Y,Z)) into Union(Join(X,Y),Join(X,Z))
-
-                // parent is the join, so we create two copies of it
-                BinaryTupleOperator join1 = parent.clone();
-                BinaryTupleOperator join2 = parent.clone();
-
-                // take the the left argument of the join and the left argument of the union , and put them into join1
-                join1.setLeftArg(parent.getLeftArg());
-                join1.setRightArg(node.getLeftArg());
-
-                // take the the left argument of the join and the right argument of the union , and put them into join1
-                join2.setLeftArg(parent.getLeftArg());
-                join2.setRightArg(node.getRightArg());
-
-                // copy the union node to a new union node, and set the two new joins as arguments
-                Intersection intersection = node.clone();
-                intersection.setLeftArg(join1);
-                intersection.setRightArg(join2);
-
-                // replace parent by the new union
-                parent.replaceWith(intersection);
-
-                intersection.visit(this);
-            }
-
-        }
-    }
-
-    @Override
-    public void meet(Difference node) throws RuntimeException {
-        if(node.getParentNode() instanceof Join || node.getParentNode() instanceof LeftJoin) {
-            // move the other arg of the join inside the union
-            BinaryTupleOperator parent = (BinaryTupleOperator)node.getParentNode();
-            if(node == parent.getLeftArg()) {
-                // transform Join(Union(X,Y),Z) into Union(Join(X,Z),Join(Y,Z))
-
-                // parent is the join, so we create two copies of it
-                BinaryTupleOperator join1 = parent.clone();
-                BinaryTupleOperator join2 = parent.clone();
-
-                // take the left argument of the union and the right argument of the join, and put them into join1
-                join1.setLeftArg(node.getLeftArg());
-                join1.setRightArg(parent.getRightArg());
-
-                // take the right argument of the union and the right argument of the join, and put them into join2
-                join2.setLeftArg(node.getRightArg());
-                join2.setRightArg(parent.getRightArg());
-
-                // copy the union node to a new union node, and set the two new joins as arguments
-                Difference difference = node.clone();
-                difference.setLeftArg(join1);
-                difference.setRightArg(join2);
-
-                // replace parent by the new union
-                parent.replaceWith(difference);
-
-                difference.visit(this);
-            } else if(node == parent.getRightArg()) {
-                // transform Join(X,Union(Y,Z)) into Union(Join(X,Y),Join(X,Z))
-
-                // parent is the join, so we create two copies of it
-                BinaryTupleOperator join1 = parent.clone();
-                BinaryTupleOperator join2 = parent.clone();
-
-                // take the the left argument of the join and the left argument of the union , and put them into join1
-                join1.setLeftArg(parent.getLeftArg());
-                join1.setRightArg(node.getLeftArg());
-
-                // take the the left argument of the join and the right argument of the union , and put them into join1
-                join2.setLeftArg(parent.getLeftArg());
-                join2.setRightArg(node.getRightArg());
-
-                // copy the union node to a new union node, and set the two new joins as arguments
-                Difference difference = node.clone();
-                difference.setLeftArg(join1);
-                difference.setRightArg(join2);
-
-                // replace parent by the new union
-                parent.replaceWith(difference);
-
-                difference.visit(this);
-            }
-
-        }
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/kiwi/kiwi-sparql/src/test/java/org/apache/marmotta/kiwi/sparql/test/ComplexKiWiSparqlQueryTest.java
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-sparql/src/test/java/org/apache/marmotta/kiwi/sparql/test/ComplexKiWiSparqlQueryTest.java b/libraries/kiwi/kiwi-sparql/src/test/java/org/apache/marmotta/kiwi/sparql/test/ComplexKiWiSparqlQueryTest.java
new file mode 100644
index 0000000..0fba8b2
--- /dev/null
+++ b/libraries/kiwi/kiwi-sparql/src/test/java/org/apache/marmotta/kiwi/sparql/test/ComplexKiWiSparqlQueryTest.java
@@ -0,0 +1,53 @@
+/*
+ * 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.kiwi.sparql.test;
+
+import org.apache.marmotta.kiwi.config.KiWiConfiguration;
+import org.apache.marmotta.kiwi.sail.KiWiStore;
+import org.apache.marmotta.kiwi.sparql.sail.KiWiSparqlSail;
+import org.apache.marmotta.kiwi.test.junit.KiWiDatabaseRunner;
+import org.junit.runner.RunWith;
+import org.openrdf.query.parser.sparql.ComplexSPARQLQueryTest;
+import org.openrdf.repository.Repository;
+import org.openrdf.repository.sail.SailRepository;
+
+
+/**
+ * Run the Sesame Complex SPARQL Query Test Suite.
+
+ * @author Jakob Frank <ja...@apache.org>
+ *
+ */
+@RunWith(KiWiDatabaseRunner.class)
+public class ComplexKiWiSparqlQueryTest extends ComplexSPARQLQueryTest {
+    
+ 
+    private final KiWiConfiguration config;
+
+    public ComplexKiWiSparqlQueryTest(KiWiConfiguration config) {
+        this.config = config;
+    }
+    
+    @Override
+    protected Repository newRepository() throws Exception {
+        KiWiStore store = new KiWiStore(config);
+        KiWiSparqlSail ssail = new KiWiSparqlSail(store);
+        return new SailRepository(ssail);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/kiwi/kiwi-sparql/src/test/java/org/apache/marmotta/kiwi/sparql/test/KiWiSparqlJoinTest.java
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-sparql/src/test/java/org/apache/marmotta/kiwi/sparql/test/KiWiSparqlJoinTest.java b/libraries/kiwi/kiwi-sparql/src/test/java/org/apache/marmotta/kiwi/sparql/test/KiWiSparqlJoinTest.java
new file mode 100644
index 0000000..ad7d701
--- /dev/null
+++ b/libraries/kiwi/kiwi-sparql/src/test/java/org/apache/marmotta/kiwi/sparql/test/KiWiSparqlJoinTest.java
@@ -0,0 +1,322 @@
+/*
+ * 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.kiwi.sparql.test;
+
+import info.aduna.iteration.Iterations;
+
+import java.io.IOException;
+import java.sql.SQLException;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.io.IOUtils;
+import org.apache.marmotta.kiwi.config.KiWiConfiguration;
+import org.apache.marmotta.kiwi.sail.KiWiStore;
+import org.apache.marmotta.kiwi.sparql.sail.KiWiSparqlSail;
+import org.apache.marmotta.kiwi.test.junit.KiWiDatabaseRunner;
+import org.junit.After;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.TestWatcher;
+import org.junit.runner.Description;
+import org.junit.runner.RunWith;
+import org.openrdf.query.Binding;
+import org.openrdf.query.BindingSet;
+import org.openrdf.query.QueryEvaluationException;
+import org.openrdf.query.QueryLanguage;
+import org.openrdf.query.TupleQuery;
+import org.openrdf.query.TupleQueryResult;
+import org.openrdf.repository.Repository;
+import org.openrdf.repository.RepositoryConnection;
+import org.openrdf.repository.RepositoryException;
+import org.openrdf.repository.sail.SailRepository;
+import org.openrdf.rio.RDFFormat;
+import org.openrdf.rio.RDFParseException;
+import org.openrdf.sail.memory.MemoryStore;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.google.common.base.Function;
+import com.google.common.collect.Lists;
+
+/**
+ * Test the KiWi SPARQL Join optimization.
+ * @author Sebastian Schaffert (sschaffert@apache.org)
+ */
+@RunWith(KiWiDatabaseRunner.class)
+public class KiWiSparqlJoinTest {
+
+
+    private KiWiStore store;
+
+    private KiWiSparqlSail ssail;
+
+    private Repository repository;
+
+    // reference repository for checking if the results are the same
+    private Repository reference;
+
+    private final KiWiConfiguration dbConfig;
+
+    public KiWiSparqlJoinTest(KiWiConfiguration dbConfig) {
+        this.dbConfig = dbConfig;
+    }
+
+
+    @Before
+    public void initDatabase() throws RepositoryException, IOException, RDFParseException {
+        store = new KiWiStore(dbConfig);
+        ssail = new KiWiSparqlSail(store);
+        repository = new SailRepository(ssail);
+        repository.initialize();
+
+        // load demo data
+        RepositoryConnection con = repository.getConnection();
+        try {
+            con.begin();
+
+            con.add(this.getClass().getResourceAsStream("demo-data.foaf"), "http://localhost/test/", RDFFormat.RDFXML);
+
+            con.commit();
+        } finally {
+            con.close();
+        }
+
+        reference = new SailRepository(new MemoryStore());
+        reference.initialize();
+
+        // load demo data
+        RepositoryConnection con2 = reference.getConnection();
+        try {
+            con2.begin();
+
+            con2.add(this.getClass().getResourceAsStream("demo-data.foaf"), "http://localhost/test/", RDFFormat.RDFXML);
+
+            con2.commit();
+        } finally {
+            con2.close();
+        }
+    }
+
+    @After
+    public void dropDatabase() throws RepositoryException, SQLException {
+        store.getPersistence().dropDatabase();
+        repository.shutDown();
+    }
+
+    final Logger logger =
+            LoggerFactory.getLogger(this.getClass());
+
+    @Rule
+    public TestWatcher watchman = new TestWatcher() {
+        /**
+         * Invoked when a test is about to start
+         */
+        @Override
+        protected void starting(Description description) {
+            logger.info("{} being run...", description.getMethodName());
+        }
+    };
+
+
+    /**
+     * This method tests a simple triple join with two triple patterns.
+     * @throws Exception
+     */
+    @Test
+    public void testQuery1() throws Exception {
+        testQuery("query1.sparql");
+    }
+
+    @Test
+    public void testQuery2() throws Exception {
+        testQuery("query2.sparql");
+    }
+
+    @Test
+    public void testQuery3() throws Exception {
+        testQuery("query3.sparql");
+    }
+
+    @Test
+    public void testQuery4() throws Exception {
+        testQuery("query4.sparql");
+    }
+
+    // numeric comparison
+    @Test
+    public void testQuery5() throws Exception {
+        testQuery("query5.sparql");
+    }
+
+    // language match
+    @Test
+    public void testQuery6() throws Exception {
+        testQuery("query6.sparql");
+    }
+
+    // math expression
+    @Test
+    public void testQuery7() throws Exception {
+        testQuery("query7.sparql");
+    }
+
+    // isLiteral
+    @Test
+    public void testQuery8() throws Exception {
+        testQuery("query8.sparql");
+    }
+
+    // isURI
+    @Test
+    public void testQuery9() throws Exception {
+        testQuery("query9.sparql");
+    }
+
+    // term comparison
+    @Test
+    public void testQuery10() throws Exception {
+        testQuery("query10.sparql");
+    }
+
+    // optional
+    @Test
+    public void testQuery11() throws Exception {
+        testQuery("query11.sparql");
+    }
+
+    // optional with join
+    @Test
+    public void testQuery12() throws Exception {
+        testQuery("query12.sparql");
+    }
+
+    // nested query
+    @Test
+    public void testQuery13() throws Exception {
+        testQuery("query13.sparql");
+    }
+
+    // boolean filter
+    @Test
+    public void testQuery14() throws Exception {
+        testQuery("query14.sparql");
+    }
+
+    private void testQuery(String filename) throws Exception {
+        String queryString = IOUtils.toString(this.getClass().getResourceAsStream(filename), "UTF-8");
+
+        RepositoryConnection con1 = repository.getConnection();
+        RepositoryConnection con2 = reference.getConnection();
+        try {
+            con1.begin();
+
+            TupleQuery query1 = con1.prepareTupleQuery(QueryLanguage.SPARQL, queryString);
+            TupleQueryResult result1 = query1.evaluate();
+
+            con1.commit();
+
+            Assert.assertTrue(result1.hasNext());
+
+
+            con2.begin();
+
+            TupleQuery query2 = con2.prepareTupleQuery(QueryLanguage.SPARQL, queryString);
+            TupleQueryResult result2 = query2.evaluate();
+
+            con2.commit();
+
+            compareResults(result1,result2);
+
+        } catch(RepositoryException ex) {
+            con1.rollback();
+        } finally {
+            con1.close();
+            con2.close();
+        }
+    }
+
+
+    private void compareResults(TupleQueryResult result1, TupleQueryResult result2) throws QueryEvaluationException {
+        List<BindingSet> bindingSets1 = Iterations.asList(result1);
+        List<BindingSet> bindingSets2 = Iterations.asList(result2);
+
+        Set<Set<Pair>> set1 = new HashSet<Set<Pair>>(Lists.transform(bindingSets1,new BindingSetPairFunction()));
+        Set<Set<Pair>> set2 = new HashSet<Set<Pair>>(Lists.transform(bindingSets2,new BindingSetPairFunction()));
+
+        Assert.assertTrue(CollectionUtils.isEqualCollection(set1, set2));
+    }
+
+
+    private static class BindingSetPairFunction implements Function<BindingSet, Set<Pair>> {
+        @Override
+        public Set<Pair> apply(BindingSet input) {
+            Set<Pair> result = new HashSet<Pair>();
+
+            for(Binding b : input) {
+                Pair p = new Pair(b.getName(), b.getValue() != null ? b.getValue().stringValue() : null);
+                result.add(p);
+            }
+
+            return result;
+        }
+    }
+
+    private static class Pair {
+        String key, value;
+
+        private Pair(String key, String value) {
+            this.key = key;
+            this.value = value;
+        }
+
+        private String getKey() {
+            return key;
+        }
+
+        private String getValue() {
+            return value;
+        }
+
+        @Override
+        public boolean equals(Object o) {
+            if (this == o) return true;
+            if (o == null || getClass() != o.getClass()) return false;
+
+            Pair pair = (Pair) o;
+
+            if (!key.equals(pair.getKey())) return false;
+            if (value != null ? !value.equals(pair.getValue()) : pair.getValue() != null) return false;
+
+            return true;
+        }
+
+        @Override
+        public int hashCode() {
+            int result = key.hashCode();
+            result = 31 * result + (value != null ? value.hashCode() : 0);
+            return result;
+        }
+    }
+
+
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/kiwi/kiwi-sparql/src/test/java/org/apache/marmotta/kiwi/sparql/test/KiWiSparqlUpdateTest.java
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-sparql/src/test/java/org/apache/marmotta/kiwi/sparql/test/KiWiSparqlUpdateTest.java b/libraries/kiwi/kiwi-sparql/src/test/java/org/apache/marmotta/kiwi/sparql/test/KiWiSparqlUpdateTest.java
new file mode 100644
index 0000000..4e3f20e
--- /dev/null
+++ b/libraries/kiwi/kiwi-sparql/src/test/java/org/apache/marmotta/kiwi/sparql/test/KiWiSparqlUpdateTest.java
@@ -0,0 +1,51 @@
+/*
+ * 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.kiwi.sparql.test;
+
+import org.apache.marmotta.kiwi.config.KiWiConfiguration;
+import org.apache.marmotta.kiwi.sail.KiWiStore;
+import org.apache.marmotta.kiwi.sparql.sail.KiWiSparqlSail;
+import org.apache.marmotta.kiwi.test.junit.KiWiDatabaseRunner;
+import org.junit.runner.RunWith;
+import org.openrdf.query.parser.sparql.SPARQLUpdateTest;
+import org.openrdf.repository.Repository;
+import org.openrdf.repository.sail.SailRepository;
+
+
+/**
+ * Run the Sesame SPARQL Update Test Suite.
+ * @author Jakob Frank <ja...@apache.org>
+ *
+ */
+@RunWith(KiWiDatabaseRunner.class)
+public class KiWiSparqlUpdateTest extends SPARQLUpdateTest {
+
+    private final KiWiConfiguration config;
+
+    public KiWiSparqlUpdateTest(KiWiConfiguration config) {
+        this.config = config;
+    }
+
+    @Override
+    protected Repository newRepository() throws Exception {
+        KiWiStore store = new KiWiStore(config);
+        KiWiSparqlSail ssail = new KiWiSparqlSail(store);
+        return new SailRepository(ssail);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/kiwi/kiwi-sparql/src/test/resources/org/apache/marmotta/kiwi/sparql/test/demo-data.foaf
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-sparql/src/test/resources/org/apache/marmotta/kiwi/sparql/test/demo-data.foaf b/libraries/kiwi/kiwi-sparql/src/test/resources/org/apache/marmotta/kiwi/sparql/test/demo-data.foaf
new file mode 100644
index 0000000..219c341
--- /dev/null
+++ b/libraries/kiwi/kiwi-sparql/src/test/resources/org/apache/marmotta/kiwi/sparql/test/demo-data.foaf
@@ -0,0 +1,78 @@
+<!--
+  ~ 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.
+  -->
+
+<rdf:RDF
+        xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+        xmlns:foaf="http://xmlns.com/foaf/0.1/"
+        xmlns:dc="http://purl.org/dc/elements/1.1/">
+
+    <foaf:Person rdf:about="http://localhost:8080/LMF/resource/hans_meier" xmlns:foaf="http://xmlns.com/foaf/0.1/">
+        <foaf:name>Hans Meier</foaf:name>
+        <dc:description xml:lang="en">Hans Meier is a software engineer living in Salzburg</dc:description>
+        <dc:description xml:lang="de">Hans Meier ist ein Softwareentwickler aus Salzburg</dc:description>
+        <foaf:interest rdf:resource="http://rdf.freebase.com/ns/en.software_engineering"/>
+        <foaf:interest rdf:resource="http://rdf.freebase.com/ns/en.linux"/>
+        <foaf:interest rdf:resource="http://dbpedia.org/resource/Java" />
+        <foaf:interest rdf:resource="http://dbpedia.org/resource/Climbing"/>
+        <foaf:based_near rdf:resource="http://sws.geonames.org/2766824/"/>
+        <foaf:depiction rdf:resource="http://localhost:8080/LMF/resource/hans_meier.jpg"/>
+
+        <foaf:age rdf:datatype="http://www.w3.org/2001/XMLSchema#integer">29</foaf:age>
+
+        <foaf:knows rdf:resource="http://localhost:8080/LMF/resource/sepp_huber" />
+        <foaf:knows rdf:resource="http://localhost:8080/LMF/resource/anna_schmidt"/>
+
+        <foaf:account>
+            <foaf:OnlineAccount>
+                <foaf:accountName>Example</foaf:accountName>
+                <foaf:accountServiceHomepage>http://www.example.com</foaf:accountServiceHomepage>
+            </foaf:OnlineAccount>
+        </foaf:account>
+    </foaf:Person>
+
+    <foaf:Person rdf:about="http://localhost:8080/LMF/resource/sepp_huber" xmlns:foaf="http://xmlns.com/foaf/0.1/">
+        <foaf:name>Sepp Huber</foaf:name>
+        <dc:description xml:lang="en">Sepp Huber is an alpinist living in Traunstein. He is a good climber, but not as famous as his cousin Alexander Huber.</dc:description>
+        <dc:description xml:lang="de-DE">Sepp Huber ist ein Bergsteiger aus Traunstein. Er ist ein guter Kletterer.</dc:description>
+        <foaf:interest rdf:resource="http://dbpedia.org/resource/Mountaineering"/>
+        <foaf:interest rdf:resource="http://dbpedia.org/resource/Climbing"/>
+        <foaf:interest rdf:resource="http://localhost:8080/LMF/resource/Chess" />
+        <foaf:based_near rdf:resource="http://dbpedia.org/resource/Traunstein"/>
+
+        <foaf:age rdf:datatype="http://www.w3.org/2001/XMLSchema#integer">31</foaf:age>
+
+
+        <foaf:knows rdf:resource="http://dbpedia.org/resource/Alexander_Huber" />
+        <foaf:knows rdf:resource="http://localhost:8080/LMF/resource/hans_meier" />
+    </foaf:Person>
+
+    <foaf:Person rdf:about="http://localhost:8080/LMF/resource/anna_schmidt" xmlns:foaf="http://xmlns.com/foaf/0.1/">
+        <foaf:name>Anna Schmidt</foaf:name>
+        <dc:description xml:lang="en">Anna Schmidt is working as PR manager for mountaineers coming from Garmisch-Partenkirchen. She likes mountaineering and is also a Linux enthusiast.</dc:description>
+        <foaf:interest>Literal Interest</foaf:interest>
+        <foaf:interest rdf:resource="http://dbpedia.org/resource/Mountaineering"/>
+        <foaf:interest rdf:resource="http://dbpedia.org/resource/Linux"/>
+        <foaf:interest rdf:resource="http://localhost:8080/LMF/resource/Chess" />
+        <foaf:based_near rdf:resource="http://dbpedia.org/resource/Garmisch-Partenkirchen"/>
+        <foaf:depiction rdf:resource="http://localhost:8080/LMF/resource/anna_schmidt.jpg"/>
+
+        <foaf:knows rdf:resource="http://dbpedia.org/resource/Alexander_Huber" />
+        <foaf:knows rdf:resource="http://localhost:8080/LMF/resource/sepp_huber" />
+    </foaf:Person>
+
+
+</rdf:RDF>

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/kiwi/kiwi-sparql/src/test/resources/org/apache/marmotta/kiwi/sparql/test/query1.sparql
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-sparql/src/test/resources/org/apache/marmotta/kiwi/sparql/test/query1.sparql b/libraries/kiwi/kiwi-sparql/src/test/resources/org/apache/marmotta/kiwi/sparql/test/query1.sparql
new file mode 100644
index 0000000..3916c58
--- /dev/null
+++ b/libraries/kiwi/kiwi-sparql/src/test/resources/org/apache/marmotta/kiwi/sparql/test/query1.sparql
@@ -0,0 +1,23 @@
+#
+# 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.
+#
+PREFIX foaf: <http://xmlns.com/foaf/0.1/>
+
+SELECT ?p1 ?p3 WHERE {
+    ?p1 foaf:knows ?p2 .
+    ?p2 foaf:knows ?p3
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/kiwi/kiwi-sparql/src/test/resources/org/apache/marmotta/kiwi/sparql/test/query10.sparql
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-sparql/src/test/resources/org/apache/marmotta/kiwi/sparql/test/query10.sparql b/libraries/kiwi/kiwi-sparql/src/test/resources/org/apache/marmotta/kiwi/sparql/test/query10.sparql
new file mode 100644
index 0000000..16fa6fc
--- /dev/null
+++ b/libraries/kiwi/kiwi-sparql/src/test/resources/org/apache/marmotta/kiwi/sparql/test/query10.sparql
@@ -0,0 +1,27 @@
+#
+# 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.
+#
+PREFIX foaf: <http://xmlns.com/foaf/0.1/>
+PREFIX dc: <http://purl.org/dc/elements/1.1/>
+
+SELECT ?fn1 ?fn2 WHERE {
+    ?p1 foaf:name ?fn1 .
+    ?p1 foaf:interest ?interest1 .
+    ?p2 foaf:name ?fn2 .
+    ?p2 foaf:interest ?interest2 .
+    FILTER( ?interest1 = ?interest2 )
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/kiwi/kiwi-sparql/src/test/resources/org/apache/marmotta/kiwi/sparql/test/query11.sparql
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-sparql/src/test/resources/org/apache/marmotta/kiwi/sparql/test/query11.sparql b/libraries/kiwi/kiwi-sparql/src/test/resources/org/apache/marmotta/kiwi/sparql/test/query11.sparql
new file mode 100644
index 0000000..2b6f701
--- /dev/null
+++ b/libraries/kiwi/kiwi-sparql/src/test/resources/org/apache/marmotta/kiwi/sparql/test/query11.sparql
@@ -0,0 +1,25 @@
+#
+# 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.
+#
+PREFIX foaf: <http://xmlns.com/foaf/0.1/>
+PREFIX dc: <http://purl.org/dc/elements/1.1/>
+
+SELECT ?p1 ?fn ?age ?i WHERE {
+    ?p1 foaf:name ?fn .
+    OPTIONAL { ?p1 foaf:age ?age } .
+    ?p1 foaf:interest ?i
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/kiwi/kiwi-sparql/src/test/resources/org/apache/marmotta/kiwi/sparql/test/query12.sparql
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-sparql/src/test/resources/org/apache/marmotta/kiwi/sparql/test/query12.sparql b/libraries/kiwi/kiwi-sparql/src/test/resources/org/apache/marmotta/kiwi/sparql/test/query12.sparql
new file mode 100644
index 0000000..9b075c2
--- /dev/null
+++ b/libraries/kiwi/kiwi-sparql/src/test/resources/org/apache/marmotta/kiwi/sparql/test/query12.sparql
@@ -0,0 +1,24 @@
+#
+# 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.
+#
+PREFIX foaf: <http://xmlns.com/foaf/0.1/>
+PREFIX dc: <http://purl.org/dc/elements/1.1/>
+
+SELECT ?p1 ?fn ?p2 ?age WHERE {
+    ?p1 foaf:name ?fn .
+    OPTIONAL { ?p1 foaf:knows ?p2 . ?p2 foaf:age ?age }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/kiwi/kiwi-sparql/src/test/resources/org/apache/marmotta/kiwi/sparql/test/query13.sparql
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-sparql/src/test/resources/org/apache/marmotta/kiwi/sparql/test/query13.sparql b/libraries/kiwi/kiwi-sparql/src/test/resources/org/apache/marmotta/kiwi/sparql/test/query13.sparql
new file mode 100644
index 0000000..1d4b892
--- /dev/null
+++ b/libraries/kiwi/kiwi-sparql/src/test/resources/org/apache/marmotta/kiwi/sparql/test/query13.sparql
@@ -0,0 +1,28 @@
+#
+# 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.
+#
+PREFIX foaf: <http://xmlns.com/foaf/0.1/>
+PREFIX dc: <http://purl.org/dc/elements/1.1/>
+
+SELECT ?p1 ?fn ?friends WHERE {
+    ?p1 foaf:name ?fn .
+    {
+        SELECT (COUNT(?friend) as ?friends) WHERE {
+            ?p1 foaf:knows ?friend
+        } GROUP BY ?p1
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/kiwi/kiwi-sparql/src/test/resources/org/apache/marmotta/kiwi/sparql/test/query14.sparql
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-sparql/src/test/resources/org/apache/marmotta/kiwi/sparql/test/query14.sparql b/libraries/kiwi/kiwi-sparql/src/test/resources/org/apache/marmotta/kiwi/sparql/test/query14.sparql
new file mode 100644
index 0000000..978115e
--- /dev/null
+++ b/libraries/kiwi/kiwi-sparql/src/test/resources/org/apache/marmotta/kiwi/sparql/test/query14.sparql
@@ -0,0 +1,25 @@
+#
+# 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.
+#
+PREFIX foaf: <http://xmlns.com/foaf/0.1/>
+PREFIX dc: <http://purl.org/dc/elements/1.1/>
+
+SELECT ?p1 ?fn ?age WHERE {
+    ?p1 foaf:name ?fn .
+    ?p1 foaf:age ?age .
+    FILTER( ?age > 30 && regex(str(?p1), "^http://localhost:8080/LMF/resource/sepp.*") )
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/kiwi/kiwi-sparql/src/test/resources/org/apache/marmotta/kiwi/sparql/test/query2.sparql
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-sparql/src/test/resources/org/apache/marmotta/kiwi/sparql/test/query2.sparql b/libraries/kiwi/kiwi-sparql/src/test/resources/org/apache/marmotta/kiwi/sparql/test/query2.sparql
new file mode 100644
index 0000000..612202b
--- /dev/null
+++ b/libraries/kiwi/kiwi-sparql/src/test/resources/org/apache/marmotta/kiwi/sparql/test/query2.sparql
@@ -0,0 +1,25 @@
+#
+# 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.
+#
+PREFIX foaf: <http://xmlns.com/foaf/0.1/>
+PREFIX dc: <http://purl.org/dc/elements/1.1/>
+
+SELECT ?p1 ?fn ?desc ?friend WHERE {
+    ?p1 foaf:name ?fn .
+    ?p1 dc:description ?desc .
+    ?p1 foaf:knows ?friend
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/kiwi/kiwi-sparql/src/test/resources/org/apache/marmotta/kiwi/sparql/test/query3.sparql
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-sparql/src/test/resources/org/apache/marmotta/kiwi/sparql/test/query3.sparql b/libraries/kiwi/kiwi-sparql/src/test/resources/org/apache/marmotta/kiwi/sparql/test/query3.sparql
new file mode 100644
index 0000000..26b7041
--- /dev/null
+++ b/libraries/kiwi/kiwi-sparql/src/test/resources/org/apache/marmotta/kiwi/sparql/test/query3.sparql
@@ -0,0 +1,24 @@
+#
+# 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.
+#
+PREFIX foaf: <http://xmlns.com/foaf/0.1/>
+PREFIX dc: <http://purl.org/dc/elements/1.1/>
+
+SELECT ?p1 ?fn ?desc ?friend WHERE {
+    ?p1 foaf:name ?fn .
+    FILTER( regex(?fn, "Anna.*") )
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/kiwi/kiwi-sparql/src/test/resources/org/apache/marmotta/kiwi/sparql/test/query4.sparql
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-sparql/src/test/resources/org/apache/marmotta/kiwi/sparql/test/query4.sparql b/libraries/kiwi/kiwi-sparql/src/test/resources/org/apache/marmotta/kiwi/sparql/test/query4.sparql
new file mode 100644
index 0000000..6742145
--- /dev/null
+++ b/libraries/kiwi/kiwi-sparql/src/test/resources/org/apache/marmotta/kiwi/sparql/test/query4.sparql
@@ -0,0 +1,24 @@
+#
+# 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.
+#
+PREFIX foaf: <http://xmlns.com/foaf/0.1/>
+PREFIX dc: <http://purl.org/dc/elements/1.1/>
+
+SELECT ?p1 ?fn ?desc ?friend WHERE {
+    ?p1 foaf:name ?fn .
+    FILTER( regex(str(?p1), "^http://localhost:8080/LMF/resource/sepp.*") )
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/kiwi/kiwi-sparql/src/test/resources/org/apache/marmotta/kiwi/sparql/test/query5.sparql
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-sparql/src/test/resources/org/apache/marmotta/kiwi/sparql/test/query5.sparql b/libraries/kiwi/kiwi-sparql/src/test/resources/org/apache/marmotta/kiwi/sparql/test/query5.sparql
new file mode 100644
index 0000000..8d0000d
--- /dev/null
+++ b/libraries/kiwi/kiwi-sparql/src/test/resources/org/apache/marmotta/kiwi/sparql/test/query5.sparql
@@ -0,0 +1,25 @@
+#
+# 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.
+#
+PREFIX foaf: <http://xmlns.com/foaf/0.1/>
+PREFIX dc: <http://purl.org/dc/elements/1.1/>
+
+SELECT ?p1 ?fn ?age WHERE {
+    ?p1 foaf:name ?fn .
+    ?p1 foaf:age ?age .
+    FILTER( ?age > 30 )
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/kiwi/kiwi-sparql/src/test/resources/org/apache/marmotta/kiwi/sparql/test/query6.sparql
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-sparql/src/test/resources/org/apache/marmotta/kiwi/sparql/test/query6.sparql b/libraries/kiwi/kiwi-sparql/src/test/resources/org/apache/marmotta/kiwi/sparql/test/query6.sparql
new file mode 100644
index 0000000..5bdfbb1
--- /dev/null
+++ b/libraries/kiwi/kiwi-sparql/src/test/resources/org/apache/marmotta/kiwi/sparql/test/query6.sparql
@@ -0,0 +1,25 @@
+#
+# 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.
+#
+PREFIX foaf: <http://xmlns.com/foaf/0.1/>
+PREFIX dc: <http://purl.org/dc/elements/1.1/>
+
+SELECT ?p1 ?fn ?d WHERE {
+    ?p1 foaf:name ?fn .
+    ?p1 dc:description ?d .
+    FILTER( langMatches(lang(?d), "de") )
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/kiwi/kiwi-sparql/src/test/resources/org/apache/marmotta/kiwi/sparql/test/query7.sparql
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-sparql/src/test/resources/org/apache/marmotta/kiwi/sparql/test/query7.sparql b/libraries/kiwi/kiwi-sparql/src/test/resources/org/apache/marmotta/kiwi/sparql/test/query7.sparql
new file mode 100644
index 0000000..151caa2
--- /dev/null
+++ b/libraries/kiwi/kiwi-sparql/src/test/resources/org/apache/marmotta/kiwi/sparql/test/query7.sparql
@@ -0,0 +1,25 @@
+#
+# 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.
+#
+PREFIX foaf: <http://xmlns.com/foaf/0.1/>
+PREFIX dc: <http://purl.org/dc/elements/1.1/>
+
+SELECT ?p1 ?fn ?age WHERE {
+    ?p1 foaf:name ?fn .
+    ?p1 foaf:age ?age .
+    FILTER( 2013 - ?age > 1983 )
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/kiwi/kiwi-sparql/src/test/resources/org/apache/marmotta/kiwi/sparql/test/query8.sparql
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-sparql/src/test/resources/org/apache/marmotta/kiwi/sparql/test/query8.sparql b/libraries/kiwi/kiwi-sparql/src/test/resources/org/apache/marmotta/kiwi/sparql/test/query8.sparql
new file mode 100644
index 0000000..139e1cd
--- /dev/null
+++ b/libraries/kiwi/kiwi-sparql/src/test/resources/org/apache/marmotta/kiwi/sparql/test/query8.sparql
@@ -0,0 +1,25 @@
+#
+# 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.
+#
+PREFIX foaf: <http://xmlns.com/foaf/0.1/>
+PREFIX dc: <http://purl.org/dc/elements/1.1/>
+
+SELECT ?p1 ?fn ?interest WHERE {
+    ?p1 foaf:name ?fn .
+    ?p1 foaf:interest ?interest .
+    FILTER( isLiteral(?interest) )
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/kiwi/kiwi-sparql/src/test/resources/org/apache/marmotta/kiwi/sparql/test/query9.sparql
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-sparql/src/test/resources/org/apache/marmotta/kiwi/sparql/test/query9.sparql b/libraries/kiwi/kiwi-sparql/src/test/resources/org/apache/marmotta/kiwi/sparql/test/query9.sparql
new file mode 100644
index 0000000..b07ad16
--- /dev/null
+++ b/libraries/kiwi/kiwi-sparql/src/test/resources/org/apache/marmotta/kiwi/sparql/test/query9.sparql
@@ -0,0 +1,25 @@
+#
+# 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.
+#
+PREFIX foaf: <http://xmlns.com/foaf/0.1/>
+PREFIX dc: <http://purl.org/dc/elements/1.1/>
+
+SELECT ?p1 ?fn ?interest WHERE {
+    ?p1 foaf:name ?fn .
+    ?p1 foaf:interest ?interest .
+    FILTER( isURI(?interest) )
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/kiwi/kiwi-transactions/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-transactions/pom.xml b/libraries/kiwi/kiwi-transactions/pom.xml
index 4be1e0a..07d3b2d 100644
--- a/libraries/kiwi/kiwi-transactions/pom.xml
+++ b/libraries/kiwi/kiwi-transactions/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>kiwi-parent</artifactId>
-        <version>3.1.0-incubating-SNAPSHOT</version>
+        <version>3.1.0-incubating</version>
         <relativePath>../</relativePath>
     </parent>
 
@@ -63,8 +63,8 @@
             <artifactId>guava</artifactId>
         </dependency>
         <dependency>
-            <groupId>commons-lang</groupId>
-            <artifactId>commons-lang</artifactId>
+            <groupId>org.apache.commons</groupId>
+            <artifactId>commons-lang3</artifactId>
         </dependency>
         <dependency>
             <groupId>org.apache.marmotta</groupId>
@@ -124,7 +124,7 @@
             <scope>test</scope>
         </dependency>
         <dependency>
-            <groupId>org.jumpmind.symmetric.jdbc</groupId>
+            <groupId>org.postgresql</groupId>
             <artifactId>postgresql</artifactId>
             <scope>test</scope>
         </dependency>

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/kiwi/kiwi-transactions/src/test/java/org/apache/marmotta/kiwi/test/TransactionTest.java
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-transactions/src/test/java/org/apache/marmotta/kiwi/test/TransactionTest.java b/libraries/kiwi/kiwi-transactions/src/test/java/org/apache/marmotta/kiwi/test/TransactionTest.java
index 52b92b1..6882ddf 100644
--- a/libraries/kiwi/kiwi-transactions/src/test/java/org/apache/marmotta/kiwi/test/TransactionTest.java
+++ b/libraries/kiwi/kiwi-transactions/src/test/java/org/apache/marmotta/kiwi/test/TransactionTest.java
@@ -17,16 +17,19 @@
  */
 package org.apache.marmotta.kiwi.test;
 
+import static org.hamcrest.CoreMatchers.hasItems;
+import static org.hamcrest.CoreMatchers.notNullValue;
+import static org.junit.Assume.assumeThat;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.sql.SQLException;
+import java.util.List;
+
 import org.apache.marmotta.commons.sesame.repository.ResourceUtils;
-import com.google.common.base.Function;
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.Iterables;
-import org.apache.marmotta.kiwi.persistence.KiWiDialect;
-import org.apache.marmotta.kiwi.persistence.h2.H2Dialect;
-import org.apache.marmotta.kiwi.persistence.mysql.MySQLDialect;
-import org.apache.marmotta.kiwi.persistence.pgsql.PostgreSQLDialect;
+import org.apache.marmotta.kiwi.config.KiWiConfiguration;
 import org.apache.marmotta.kiwi.sail.KiWiStore;
-import org.apache.marmotta.kiwi.test.helper.DBConnectionChecker;
+import org.apache.marmotta.kiwi.test.junit.KiWiDatabaseRunner;
 import org.apache.marmotta.kiwi.transactions.api.TransactionListener;
 import org.apache.marmotta.kiwi.transactions.model.TransactionData;
 import org.apache.marmotta.kiwi.transactions.sail.KiWiTransactionalSail;
@@ -38,7 +41,6 @@ import org.junit.Test;
 import org.junit.rules.TestWatcher;
 import org.junit.runner.Description;
 import org.junit.runner.RunWith;
-import org.junit.runners.Parameterized;
 import org.openrdf.model.Resource;
 import org.openrdf.repository.Repository;
 import org.openrdf.repository.RepositoryConnection;
@@ -49,82 +51,19 @@ import org.openrdf.rio.RDFParseException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import java.io.IOException;
-import java.io.InputStream;
-import java.sql.SQLException;
-import java.util.ArrayList;
-import java.util.List;
-
-import static org.hamcrest.CoreMatchers.hasItems;
-import static org.hamcrest.CoreMatchers.notNullValue;
-import static org.junit.Assume.assumeThat;
+import com.google.common.base.Function;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.Iterables;
 
 /**
- * Test the Sesame repository functionality backed by the KiWi triple store. It will try running over all
- * available databases. Except for in-memory databases like H2 or Derby, database URLs must be passed as
- * system property, or otherwise the test is skipped for this database. Available system properties:
- * <ul>
- *     <li>PostgreSQL:
- *     <ul>
- *         <li>postgresql.url, e.g. jdbc:postgresql://localhost:5433/kiwitest?prepareThreshold=3</li>
- *         <li>postgresql.user (default: lmf)</li>
- *         <li>postgresql.pass (default: lmf)</li>
- *     </ul>
- *     </li>
- *     <li>MySQL:
- *     <ul>
- *         <li>mysql.url, e.g. jdbc:mysql://localhost:3306/kiwitest?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull</li>
- *         <li>mysql.user (default: lmf)</li>
- *         <li>mysql.pass (default: lmf)</li>
- *     </ul>
- *     </li>
- *     <li>H2:
- *     <ul>
- *         <li>h2.url, e.g. jdbc:h2:mem;MVCC=true;DB_CLOSE_ON_EXIT=FALSE;DB_CLOSE_DELAY=10</li>
- *         <li>h2.user (default: lmf)</li>
- *         <li>h2.pass (default: lmf)</li>
- *     </ul>
- *     </li>
- * </ul>
- * <p/>
- * Author: Sebastian Schaffert
+ * Test the Sesame repository functionality backed by the KiWi triple store. 
+ * 
+ * @author Sebastian Schaffert (sschaffert@apache.org)
  */
-@RunWith(Parameterized.class)
+@RunWith(KiWiDatabaseRunner.class)
 public class TransactionTest {
     private static Logger log = LoggerFactory.getLogger(TransactionTest.class);
 
-    /**
-     * Return database configurations if the appropriate parameters have been set.
-     *
-     * @return an array (database name, url, user, password)
-     */
-    @Parameterized.Parameters(name="Database Test {index}: {0} at {1}")
-    public static Iterable<Object[]> databases() {
-        String[] databases = {"H2", "PostgreSQL", "MySQL"};
-
-        List<Object[]> result = new ArrayList<Object[]>(databases.length);
-        for(String database : databases) {
-            if(System.getProperty(database.toLowerCase()+".url") != null) {
-                result.add(new Object[] {
-                        database,
-                        System.getProperty(database.toLowerCase()+".url"),
-                        System.getProperty(database.toLowerCase()+".user","lmf"),
-                        System.getProperty(database.toLowerCase()+".pass","lmf")
-                });
-            }
-        }
-        return result;
-    }
-
-
-    private KiWiDialect dialect;
-
-    private String jdbcUrl;
-
-    private String jdbcUser;
-
-    private String jdbcPass;
-
     private Repository repository;
 
     private KiWiStore store;
@@ -133,25 +72,15 @@ public class TransactionTest {
 
     private MockListener listener;
 
-    public TransactionTest(String database, String jdbcUrl, String jdbcUser, String jdbcPass) {
-        this.jdbcPass = jdbcPass;
-        this.jdbcUrl = jdbcUrl;
-        this.jdbcUser = jdbcUser;
-
-        if("H2".equals(database)) {
-            this.dialect = new H2Dialect();
-        } else if("MySQL".equals(database)) {
-            this.dialect = new MySQLDialect();
-        } else if("PostgreSQL".equals(database)) {
-            this.dialect = new PostgreSQLDialect();
-        }
-        
-        DBConnectionChecker.checkDatabaseAvailability(jdbcUrl, jdbcUser, jdbcPass, dialect);
+    private final KiWiConfiguration kiwiConfiguration;
+
+    public TransactionTest(KiWiConfiguration configuration) {
+        this.kiwiConfiguration = configuration;
     }
 
     @Before
     public void initDatabase() throws RepositoryException {
-        store = new KiWiStore("test",jdbcUrl,jdbcUser,jdbcPass,dialect, "http://localhost/context/default", "http://localhost/context/inferred");
+        store = new KiWiStore(kiwiConfiguration);
         tstore = new KiWiTransactionalSail(store);
         listener = new MockListener();
         tstore.addTransactionListener(listener);
@@ -165,17 +94,6 @@ public class TransactionTest {
         repository.shutDown();
     }
 
-    @Rule
-    public TestWatcher watchman = new TestWatcher() {
-        /**
-         * Invoked when a test is about to start
-         */
-        @Override
-        protected void starting(Description description) {
-            log.info("{} being run...", description.getMethodName());
-        }
-    };
-
 
     /**
      * Test importing data; the test will load a small sample RDF file and check whether the expected resources are
@@ -234,7 +152,7 @@ public class TransactionTest {
             connection.begin();
             List<String> resources = ImmutableList.copyOf(
                     Iterables.transform(
-                            ResourceUtils.listResources(connection),
+                            ResourceUtils.listSubjects(connection),
                             new Function<Resource, String>() {
                                 @Override
                                 public String apply(Resource input) {

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/kiwi/kiwi-triplestore/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-triplestore/pom.xml b/libraries/kiwi/kiwi-triplestore/pom.xml
index 6249f8d..ac82859 100644
--- a/libraries/kiwi/kiwi-triplestore/pom.xml
+++ b/libraries/kiwi/kiwi-triplestore/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>kiwi-parent</artifactId>
-        <version>3.1.0-incubating-SNAPSHOT</version>
+        <version>3.1.0-incubating</version>
         <relativePath>../</relativePath>
     </parent>
 
@@ -36,7 +36,6 @@
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-jar-plugin</artifactId>
-                <version>2.4</version>
                 <executions>
                     <execution>
                         <goals>
@@ -106,8 +105,8 @@
             <artifactId>guava</artifactId>
         </dependency>
         <dependency>
-            <groupId>commons-lang</groupId>
-            <artifactId>commons-lang</artifactId>
+            <groupId>org.apache.commons</groupId>
+            <artifactId>commons-lang3</artifactId>
         </dependency>
         <dependency>
             <groupId>org.apache.marmotta</groupId>
@@ -151,7 +150,7 @@
             <scope>test</scope>
         </dependency>
         <dependency>
-            <groupId>org.jumpmind.symmetric.jdbc</groupId>
+            <groupId>org.postgresql</groupId>
             <artifactId>postgresql</artifactId>
             <scope>test</scope>
         </dependency>
@@ -176,6 +175,18 @@
             <artifactId>sesame-repository-sail</artifactId>
             <scope>test</scope>
         </dependency>
+        <dependency>
+            <groupId>org.openrdf.sesame</groupId>
+            <artifactId>sesame-store-testsuite</artifactId>
+            <scope>test</scope>
+        </dependency>
+        
+        <dependency>
+            <groupId>com.google.code.tempus-fugit</groupId>
+            <artifactId>tempus-fugit</artifactId>
+            <scope>test</scope>
+        </dependency>
+
 
     </dependencies>
     

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/kiwi/kiwi-triplestore/src/main/java/org/apache/marmotta/kiwi/config/KiWiConfiguration.java
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-triplestore/src/main/java/org/apache/marmotta/kiwi/config/KiWiConfiguration.java b/libraries/kiwi/kiwi-triplestore/src/main/java/org/apache/marmotta/kiwi/config/KiWiConfiguration.java
index ca3a05c..6767100 100644
--- a/libraries/kiwi/kiwi-triplestore/src/main/java/org/apache/marmotta/kiwi/config/KiWiConfiguration.java
+++ b/libraries/kiwi/kiwi-triplestore/src/main/java/org/apache/marmotta/kiwi/config/KiWiConfiguration.java
@@ -33,20 +33,82 @@ import org.apache.marmotta.kiwi.persistence.KiWiDialect;
  */
 public class KiWiConfiguration {
 
+    /**
+     * A unique name for identifying this instance of KiWiPersistence. Can be used in case there are several
+     * instances running in the same environment.
+     */
     private String name;
     private String jdbcUrl;
     private String dbUser;
     private String dbPassword;
+
+    /**
+     * The default context to use when no explicit context is given in createStatement. The KiWi triple store
+     * does not support null values for the context of a triple, so this URL must be set to an appropriate value
+     */
+    private String defaultContext;
+
+    /**
+     * The context to use for storing all inferred triples. The value set here will override all contexts
+     * given to addInferredTriple, because KiWi always stores all inferred triples in the same context.
+     */
+    private String inferredContext;
+
+
+    /**
+     * The SQL dialect to use
+     */
     private KiWiDialect dialect;
 
+    /**
+     * A flag indicating if the query logging (Tomcat JDBC SlowQueryReport) is enabled or not.
+     */
+    private boolean queryLoggingEnabled = false;
+
+    /**
+     * Enable batched commit (if supported by the database dialect). If this is enabled, the KiWiConnection will
+     * use an in-memory buffer for stored triples and nodes that are committed in a batch once the limit is reached
+     * or the connection committed. Enabling this can significantly improve the performance (EXPERIMENTAL).
+     */
+    private boolean batchCommit;
+
+    private int batchSize = 10000;
+
+    /**
+     * Size of the database cursor for pre-fetching rows on database supporting this feature. If the size is set to 0,
+     * no cursor is used and all rows are retrieved in one batch.
+     *
+     * @see java.sql.PreparedStatement#setFetchSize(int)
+     */
+    private int cursorSize = 1000;
+
+    /**
+     * If enabled, and batchCommit is also true, load sequence values into static memory fields once and increment
+     * values purely in-memory. The last value is then written back on batch commits.
+     */
+    private boolean memorySequences = true;
+
+
+    private boolean commitSequencesOnCommit = true;
+
+
     public KiWiConfiguration(String name, String jdbcUrl, String dbUser, String dbPassword, KiWiDialect dialect) {
+        this(name, jdbcUrl, dbUser, dbPassword, dialect, null, null);
+    }
+
+    public KiWiConfiguration(String name, String jdbcUrl, String dbUser, String dbPassword, KiWiDialect dialect, String defaultContext, String inferredContext) {
         this.dbPassword = dbPassword;
         this.dbUser = dbUser;
         this.dialect = dialect;
         this.jdbcUrl = jdbcUrl;
         this.name = name;
+        this.defaultContext = defaultContext;
+        this.inferredContext = inferredContext;
+
+        batchCommit = dialect.isBatchSupported();
     }
 
+
     public String getDbPassword() {
         return dbPassword;
     }
@@ -66,4 +128,105 @@ public class KiWiConfiguration {
     public String getName() {
         return name;
     }
+
+    public boolean isQueryLoggingEnabled() {
+        return queryLoggingEnabled;
+    }
+
+    public void setQueryLoggingEnabled(boolean queryLoggingEnabled) {
+        this.queryLoggingEnabled = queryLoggingEnabled;
+    }
+
+    public String getDefaultContext() {
+        return defaultContext;
+    }
+
+    public void setDefaultContext(String defaultContext) {
+        this.defaultContext = defaultContext;
+    }
+
+    public String getInferredContext() {
+        return inferredContext;
+    }
+
+    public void setInferredContext(String inferredContext) {
+        this.inferredContext = inferredContext;
+    }
+
+    /**
+     * Return true if batched commit is enabled. If this is enabled, the KiWiConnection will
+     * use an in-memory buffer for stored triples and nodes that are committed in a batch once the limit is reached
+     * or the connection committed. Enabling this can significantly improve the performance (EXPERIMENTAL).
+     */
+    public boolean isBatchCommit() {
+        return batchCommit;
+    }
+
+    /**
+     * Enable batched commit (if supported by the database dialect). If this is enabled, the KiWiConnection will
+     * use an in-memory buffer for stored triples and nodes that are committed in a batch once the limit is reached
+     * or the connection committed. Enabling this can significantly improve the performance (EXPERIMENTAL).
+     */
+    public void setBatchCommit(boolean batchCommit) {
+        if(dialect.isBatchSupported()) {
+            this.batchCommit = batchCommit;
+        }
+    }
+
+    public int getBatchSize() {
+        return batchSize;
+    }
+
+    public void setBatchSize(int batchSize) {
+        this.batchSize = batchSize;
+    }
+
+    /**
+     * Size of the database cursor for pre-fetching rows on database supporting this feature. If the size is set to 0,
+     * no cursor is used and all rows are retrieved in one batch.
+     *
+     * @see java.sql.PreparedStatement#setFetchSize(int)
+     */
+    public int getCursorSize() {
+        return cursorSize;
+    }
+
+    /**
+     * Size of the database cursor for pre-fetching rows on database supporting this feature. If the size is set to 0,
+     * no cursor is used and all rows are retrieved in one batch.
+     *
+     * @see java.sql.PreparedStatement#setFetchSize(int)
+     */
+    public void setCursorSize(int cursorSize) {
+        this.cursorSize = cursorSize;
+    }
+
+    public boolean isMemorySequences() {
+        return memorySequences;
+    }
+
+    /**
+     * Enable in-memory sequences. If enabled, and batchCommit is also true, load sequence values into static memory
+     * fields once and increment values purely in-memory. The last value is then written back on batch commits. This
+     * feature can avoid many database accesses and connections and therefore give significant performance improvements.
+     * (EXPERIMENTAL).
+     */
+    public void setMemorySequences(boolean memorySequences) {
+        this.memorySequences = memorySequences;
+    }
+
+
+    public boolean isCommitSequencesOnCommit() {
+        return commitSequencesOnCommit;
+    }
+
+    /**
+     * This flag determines whether memory sequences should be stored back into the database on every commit or only
+     * when the repository shuts down. Saving back on every commit is safer, but has less performance.
+     *
+     * @param commitSequencesOnCommit
+     */
+    public void setCommitSequencesOnCommit(boolean commitSequencesOnCommit) {
+        this.commitSequencesOnCommit = commitSequencesOnCommit;
+    }
 }

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/kiwi/kiwi-triplestore/src/main/java/org/apache/marmotta/kiwi/model/rdf/KiWiAnonResource.java
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-triplestore/src/main/java/org/apache/marmotta/kiwi/model/rdf/KiWiAnonResource.java b/libraries/kiwi/kiwi-triplestore/src/main/java/org/apache/marmotta/kiwi/model/rdf/KiWiAnonResource.java
index 1f3d37a..64801be 100644
--- a/libraries/kiwi/kiwi-triplestore/src/main/java/org/apache/marmotta/kiwi/model/rdf/KiWiAnonResource.java
+++ b/libraries/kiwi/kiwi-triplestore/src/main/java/org/apache/marmotta/kiwi/model/rdf/KiWiAnonResource.java
@@ -29,14 +29,8 @@ import org.openrdf.model.BNode;
  */
 public class KiWiAnonResource extends KiWiResource implements BNode {
 
-    private static HashFunction hasher = Hashing.goodFastHash(16);
-
     private static final long serialVersionUID = -873594698794527452L;
 
-    // @Transient
-    private transient HashCode goodHashCode;
-
-
     private String anonId;
 
     public KiWiAnonResource() {
@@ -110,9 +104,6 @@ public class KiWiAnonResource extends KiWiResource implements BNode {
 
     @Override
     public int hashCode() {
-        if(goodHashCode == null) {
-            goodHashCode = hasher.newHasher().putChar('A').putString(anonId).hash();
-        }
-        return goodHashCode.hashCode();
+        return anonId.hashCode();
     }
 }

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/kiwi/kiwi-triplestore/src/main/java/org/apache/marmotta/kiwi/model/rdf/KiWiLiteral.java
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-triplestore/src/main/java/org/apache/marmotta/kiwi/model/rdf/KiWiLiteral.java b/libraries/kiwi/kiwi-triplestore/src/main/java/org/apache/marmotta/kiwi/model/rdf/KiWiLiteral.java
index d373254..e96220e 100644
--- a/libraries/kiwi/kiwi-triplestore/src/main/java/org/apache/marmotta/kiwi/model/rdf/KiWiLiteral.java
+++ b/libraries/kiwi/kiwi-triplestore/src/main/java/org/apache/marmotta/kiwi/model/rdf/KiWiLiteral.java
@@ -17,20 +17,17 @@
  */
 package org.apache.marmotta.kiwi.model.rdf;
 
+import java.math.BigDecimal;
+import java.math.BigInteger;
+import java.util.Locale;
+
+import javax.xml.datatype.XMLGregorianCalendar;
+
 import org.apache.marmotta.commons.sesame.model.Namespaces;
-import com.google.common.hash.HashCode;
-import com.google.common.hash.HashFunction;
-import com.google.common.hash.Hasher;
-import com.google.common.hash.Hashing;
 import org.openrdf.model.Literal;
 import org.openrdf.model.URI;
 import org.openrdf.model.datatypes.XMLDatatypeUtil;
 
-import javax.xml.datatype.XMLGregorianCalendar;
-import java.math.BigDecimal;
-import java.math.BigInteger;
-import java.util.Locale;
-
 /**
  * KiWiLiterals store literal information from the knowledge base. They directly
  * correspond to an RDF literal stored in Sesame. KiWiLiterals are
@@ -44,23 +41,12 @@ import java.util.Locale;
  */
 public abstract class KiWiLiteral extends KiWiNode implements Literal {
 
-    private static HashFunction hasher = Hashing.goodFastHash(32);
-
-    //@Transient
-    private HashCode goodHashCode;
-
     /**
      * 
      */
     private static final long serialVersionUID = 1772323725671607249L;
 
 
-    /**
-     * An internal checksum of the content of the literal, used to efficiently check equality.
-     */
-    private String contentMd5;
-
-
     private Locale locale;
 
     private KiWiUriResource type;
@@ -180,17 +166,7 @@ public abstract class KiWiLiteral extends KiWiNode implements Literal {
 
     @Override
     public int hashCode() {
-        if(goodHashCode == null) {
-            Hasher hash = hasher.newHasher().putChar('L').putString(getContent());
-            if(getLocale() != null) {
-                hash.putString(getLocale().toString());
-            }
-            if(getType() != null) {
-                hash.putString(getType().stringValue());
-            }
-            goodHashCode = hash.hash();
-        }
-        return goodHashCode.hashCode();
+        return this.getLabel().hashCode();
     }
 
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/kiwi/kiwi-triplestore/src/main/java/org/apache/marmotta/kiwi/model/rdf/KiWiNamespace.java
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-triplestore/src/main/java/org/apache/marmotta/kiwi/model/rdf/KiWiNamespace.java b/libraries/kiwi/kiwi-triplestore/src/main/java/org/apache/marmotta/kiwi/model/rdf/KiWiNamespace.java
index 83ec60c..42957f3 100644
--- a/libraries/kiwi/kiwi-triplestore/src/main/java/org/apache/marmotta/kiwi/model/rdf/KiWiNamespace.java
+++ b/libraries/kiwi/kiwi-triplestore/src/main/java/org/apache/marmotta/kiwi/model/rdf/KiWiNamespace.java
@@ -57,7 +57,6 @@ public class KiWiNamespace implements Namespace, Serializable {
 
     public String getPrefix() {
         return prefix;
-        
     }
 
     public void setPrefix(String prefix) {
@@ -159,4 +158,10 @@ public class KiWiNamespace implements Namespace, Serializable {
         result = 31 * result + (deleted != null ? deleted.hashCode() : 0);
         return result;
     }
+
+	@Override
+	public int compareTo(Namespace other) {
+		return uri.compareTo(other.getName());
+	}
+	
 }

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/kiwi/kiwi-triplestore/src/main/java/org/apache/marmotta/kiwi/model/rdf/KiWiTriple.java
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-triplestore/src/main/java/org/apache/marmotta/kiwi/model/rdf/KiWiTriple.java b/libraries/kiwi/kiwi-triplestore/src/main/java/org/apache/marmotta/kiwi/model/rdf/KiWiTriple.java
index 58ff9f4..4f1b21c 100644
--- a/libraries/kiwi/kiwi-triplestore/src/main/java/org/apache/marmotta/kiwi/model/rdf/KiWiTriple.java
+++ b/libraries/kiwi/kiwi-triplestore/src/main/java/org/apache/marmotta/kiwi/model/rdf/KiWiTriple.java
@@ -98,7 +98,6 @@ public class KiWiTriple  implements Statement, Serializable {
         assert(subject  != null);
         assert(predicate != null);
         assert(object   != null);
-        assert(context  != null);
 	}
 
    /**
@@ -221,7 +220,7 @@ public class KiWiTriple  implements Statement, Serializable {
      * @param deletedAt
      */
     public void setDeletedAt(Date deletedAt) {
-        this.deletedAt = new Date(deletedAt.getTime());
+        this.deletedAt = deletedAt != null ? new Date(deletedAt.getTime()) : null;
     }
 
     /**
@@ -259,12 +258,10 @@ public class KiWiTriple  implements Statement, Serializable {
     @Override
     public boolean equals(Object o) {
         if (this == o) return true;
-//        if (!(o instanceof KiWiTriple)) return false;
 
-
-        KiWiTriple triple = (KiWiTriple) o;
-
-        if (!getContext().equals(triple.getContext())) return false;
+        Statement triple = (Statement) o;
+//        changed according to https://openrdf.atlassian.net/browse/SES-1924
+//        if (!getContext().equals(triple.getContext())) return false;
         if (!getObject().equals(triple.getObject())) return false;
         if (!getPredicate().equals(triple.getPredicate())) return false;
         return getSubject().equals(triple.getSubject());
@@ -273,11 +270,7 @@ public class KiWiTriple  implements Statement, Serializable {
 
     @Override
     public int hashCode() {
-        int result = getSubject().hashCode();
-        result = 31 * result + getPredicate().hashCode();
-        result = 31 * result + getObject().hashCode();
-        result = 31 * result + getContext().hashCode();
-        return result;
+        return 961 * getSubject().hashCode() + 31 * getPredicate().hashCode() + getObject().hashCode();
     }
 
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/kiwi/kiwi-triplestore/src/main/java/org/apache/marmotta/kiwi/model/rdf/KiWiUriResource.java
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-triplestore/src/main/java/org/apache/marmotta/kiwi/model/rdf/KiWiUriResource.java b/libraries/kiwi/kiwi-triplestore/src/main/java/org/apache/marmotta/kiwi/model/rdf/KiWiUriResource.java
index e9f64c0..4709463 100644
--- a/libraries/kiwi/kiwi-triplestore/src/main/java/org/apache/marmotta/kiwi/model/rdf/KiWiUriResource.java
+++ b/libraries/kiwi/kiwi-triplestore/src/main/java/org/apache/marmotta/kiwi/model/rdf/KiWiUriResource.java
@@ -33,10 +33,11 @@ public class KiWiUriResource extends KiWiResource implements URI {
 
 	private static final long serialVersionUID = -6399293877969640084L;
 
-	private static HashFunction hasher = Hashing.goodFastHash(16);
+    /**
+     * The MemURI's hash code, 0 if not yet initialized.
+     */
+    private int hashCode = 0;
 
-    //@Transient
-    private HashCode goodHashCode;
 
     private String uri;
 
@@ -134,11 +135,11 @@ public class KiWiUriResource extends KiWiResource implements URI {
 
     @Override
     public int hashCode() {
-        if(goodHashCode == null) {
-            goodHashCode = hasher.newHasher().putChar('U').putString(getUri()).hash();
+        if (hashCode == 0) {
+            hashCode = toString().hashCode();
         }
 
-        return goodHashCode.hashCode();
+        return hashCode;
     }
 
 


[044/100] [abbrv] [partial] Reverting the erroneous merge by Sebastian according to the instructions in INFRA-6876

Posted by wi...@apache.org.
http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/marmotta-commons/src/ext/java/javolution/util/service/package-info.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-commons/src/ext/java/javolution/util/service/package-info.java b/commons/marmotta-commons/src/ext/java/javolution/util/service/package-info.java
new file mode 100644
index 0000000..26fa4aa
--- /dev/null
+++ b/commons/marmotta-commons/src/ext/java/javolution/util/service/package-info.java
@@ -0,0 +1,6 @@
+/**
+<p> Service interfaces to be implemented by {@code javolution.util.*} 
+    collections and collections views.</p> 
+ */
+package javolution.util.service;
+

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/marmotta-commons/src/main/java/org/apache/marmotta/commons/collections/CollectionUtils.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-commons/src/main/java/org/apache/marmotta/commons/collections/CollectionUtils.java b/commons/marmotta-commons/src/main/java/org/apache/marmotta/commons/collections/CollectionUtils.java
index 7c4fd6f..0b9785f 100644
--- a/commons/marmotta-commons/src/main/java/org/apache/marmotta/commons/collections/CollectionUtils.java
+++ b/commons/marmotta-commons/src/main/java/org/apache/marmotta/commons/collections/CollectionUtils.java
@@ -17,6 +17,8 @@
  */
 package org.apache.marmotta.commons.collections;
 
+import com.google.common.base.Equivalence;
+
 import java.text.Format;
 import java.util.ArrayList;
 import java.util.Collection;

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/marmotta-commons/src/main/java/org/apache/marmotta/commons/collections/EquivalenceHashMap.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-commons/src/main/java/org/apache/marmotta/commons/collections/EquivalenceHashMap.java b/commons/marmotta-commons/src/main/java/org/apache/marmotta/commons/collections/EquivalenceHashMap.java
new file mode 100644
index 0000000..451f2ac
--- /dev/null
+++ b/commons/marmotta-commons/src/main/java/org/apache/marmotta/commons/collections/EquivalenceHashMap.java
@@ -0,0 +1,563 @@
+/*
+ * 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.commons.collections;
+
+import com.google.common.base.Equivalence;
+import com.google.common.base.Function;
+import com.google.common.collect.Collections2;
+import com.google.common.collect.Iterators;
+import com.google.common.collect.Maps;
+import com.google.common.collect.Sets;
+
+import java.lang.reflect.Array;
+import java.util.*;
+
+/**
+ * A hashmap implementation accepting different notions of equvialence for keys (based on the Guava Equivalence class).
+ *
+ * @author Sebastian Schaffert (sschaffert@apache.org)
+ */
+public class EquivalenceHashMap<K,V> implements Map<K,V> {
+
+    private Equivalence equivalence;
+
+    private HashMap<ElementWrapper, V> delegate;
+
+
+    private UnwrapFunction unwrapper = new UnwrapFunction();
+    private WrapFunction   wrapper   = new WrapFunction();
+
+
+    public EquivalenceHashMap(Equivalence equivalence) {
+        this.equivalence = equivalence;
+        this.delegate = new HashMap<>();
+    }
+
+    /**
+     * Removes all of the mappings from this map (optional operation).
+     * The map will be empty after this call returns.
+     *
+     * @throws UnsupportedOperationException if the <tt>clear</tt> operation
+     *                                       is not supported by this map
+     */
+    @Override
+    public void clear() {
+        delegate.clear();
+    }
+
+    /**
+     * Returns the number of key-value mappings in this map.  If the
+     * map contains more than <tt>Integer.MAX_VALUE</tt> elements, returns
+     * <tt>Integer.MAX_VALUE</tt>.
+     *
+     * @return the number of key-value mappings in this map
+     */
+    @Override
+    public int size() {
+        return delegate.size();
+    }
+
+    /**
+     * Returns <tt>true</tt> if this map contains no key-value mappings.
+     *
+     * @return <tt>true</tt> if this map contains no key-value mappings
+     */
+    @Override
+    public boolean isEmpty() {
+        return delegate.isEmpty();
+    }
+
+    /**
+     * Returns <tt>true</tt> if this map contains a mapping for the specified
+     * key.  More formally, returns <tt>true</tt> if and only if
+     * this map contains a mapping for a key <tt>k</tt> such that
+     * <tt>(key==null ? k==null : key.equals(k))</tt>.  (There can be
+     * at most one such mapping.)
+     *
+     * @param key key whose presence in this map is to be tested
+     * @return <tt>true</tt> if this map contains a mapping for the specified
+     *         key
+     * @throws ClassCastException   if the key is of an inappropriate type for
+     *                              this map
+     *                              (<a href="Collection.html#optional-restrictions">optional</a>)
+     * @throws NullPointerException if the specified key is null and this map
+     *                              does not permit null keys
+     *                              (<a href="Collection.html#optional-restrictions">optional</a>)
+     */
+    @Override
+    public boolean containsKey(Object key) {
+        return delegate.containsKey(new ElementWrapper((K)key));
+    }
+
+    /**
+     * Returns <tt>true</tt> if this map maps one or more keys to the
+     * specified value.  More formally, returns <tt>true</tt> if and only if
+     * this map contains at least one mapping to a value <tt>v</tt> such that
+     * <tt>(value==null ? v==null : value.equals(v))</tt>.  This operation
+     * will probably require time linear in the map size for most
+     * implementations of the <tt>Map</tt> interface.
+     *
+     * @param value value whose presence in this map is to be tested
+     * @return <tt>true</tt> if this map maps one or more keys to the
+     *         specified value
+     * @throws ClassCastException   if the value is of an inappropriate type for
+     *                              this map
+     *                              (<a href="Collection.html#optional-restrictions">optional</a>)
+     * @throws NullPointerException if the specified value is null and this
+     *                              map does not permit null values
+     *                              (<a href="Collection.html#optional-restrictions">optional</a>)
+     */
+    @Override
+    public boolean containsValue(Object value) {
+        return delegate.containsValue(value);
+    }
+
+    /**
+     * Returns the value to which the specified key is mapped,
+     * or {@code null} if this map contains no mapping for the key.
+     * <p/>
+     * <p>More formally, if this map contains a mapping from a key
+     * {@code k} to a value {@code v} such that {@code (key==null ? k==null :
+     * key.equals(k))}, then this method returns {@code v}; otherwise
+     * it returns {@code null}.  (There can be at most one such mapping.)
+     * <p/>
+     * <p>If this map permits null values, then a return value of
+     * {@code null} does not <i>necessarily</i> indicate that the map
+     * contains no mapping for the key; it's also possible that the map
+     * explicitly maps the key to {@code null}.  The {@link #containsKey
+     * containsKey} operation may be used to distinguish these two cases.
+     *
+     * @param key the key whose associated value is to be returned
+     * @return the value to which the specified key is mapped, or
+     *         {@code null} if this map contains no mapping for the key
+     * @throws ClassCastException   if the key is of an inappropriate type for
+     *                              this map
+     *                              (<a href="Collection.html#optional-restrictions">optional</a>)
+     * @throws NullPointerException if the specified key is null and this map
+     *                              does not permit null keys
+     *                              (<a href="Collection.html#optional-restrictions">optional</a>)
+     */
+    @Override
+    public V get(Object key) {
+        return delegate.get(new ElementWrapper((K)key));
+    }
+
+    /**
+     * Associates the specified value with the specified key in this map
+     * (optional operation).  If the map previously contained a mapping for
+     * the key, the old value is replaced by the specified value.  (A map
+     * <tt>m</tt> is said to contain a mapping for a key <tt>k</tt> if and only
+     * if {@link #containsKey(Object) m.containsKey(k)} would return
+     * <tt>true</tt>.)
+     *
+     * @param key   key with which the specified value is to be associated
+     * @param value value to be associated with the specified key
+     * @return the previous value associated with <tt>key</tt>, or
+     *         <tt>null</tt> if there was no mapping for <tt>key</tt>.
+     *         (A <tt>null</tt> return can also indicate that the map
+     *         previously associated <tt>null</tt> with <tt>key</tt>,
+     *         if the implementation supports <tt>null</tt> values.)
+     * @throws UnsupportedOperationException if the <tt>put</tt> operation
+     *                                       is not supported by this map
+     * @throws ClassCastException            if the class of the specified key or value
+     *                                       prevents it from being stored in this map
+     * @throws NullPointerException          if the specified key or value is null
+     *                                       and this map does not permit null keys or values
+     * @throws IllegalArgumentException      if some property of the specified key
+     *                                       or value prevents it from being stored in this map
+     */
+    @Override
+    public V put(K key, V value) {
+        return delegate.put(new ElementWrapper(key), value);
+    }
+
+    /**
+     * Removes the mapping for a key from this map if it is present
+     * (optional operation).   More formally, if this map contains a mapping
+     * from key <tt>k</tt> to value <tt>v</tt> such that
+     * <code>(key==null ?  k==null : key.equals(k))</code>, that mapping
+     * is removed.  (The map can contain at most one such mapping.)
+     * <p/>
+     * <p>Returns the value to which this map previously associated the key,
+     * or <tt>null</tt> if the map contained no mapping for the key.
+     * <p/>
+     * <p>If this map permits null values, then a return value of
+     * <tt>null</tt> does not <i>necessarily</i> indicate that the map
+     * contained no mapping for the key; it's also possible that the map
+     * explicitly mapped the key to <tt>null</tt>.
+     * <p/>
+     * <p>The map will not contain a mapping for the specified key once the
+     * call returns.
+     *
+     * @param key key whose mapping is to be removed from the map
+     * @return the previous value associated with <tt>key</tt>, or
+     *         <tt>null</tt> if there was no mapping for <tt>key</tt>.
+     * @throws UnsupportedOperationException if the <tt>remove</tt> operation
+     *                                       is not supported by this map
+     * @throws ClassCastException            if the key is of an inappropriate type for
+     *                                       this map
+     *                                       (<a href="Collection.html#optional-restrictions">optional</a>)
+     * @throws NullPointerException          if the specified key is null and this
+     *                                       map does not permit null keys
+     *                                       (<a href="Collection.html#optional-restrictions">optional</a>)
+     */
+    @Override
+    public V remove(Object key) {
+        return delegate.remove(new ElementWrapper((K)key));
+    }
+
+    /**
+     * Copies all of the mappings from the specified map to this map
+     * (optional operation).  The effect of this call is equivalent to that
+     * of calling {@link #put(Object, Object) put(k, v)} on this map once
+     * for each mapping from key <tt>k</tt> to value <tt>v</tt> in the
+     * specified map.  The behavior of this operation is undefined if the
+     * specified map is modified while the operation is in progress.
+     *
+     * @param m mappings to be stored in this map
+     * @throws UnsupportedOperationException if the <tt>putAll</tt> operation
+     *                                       is not supported by this map
+     * @throws ClassCastException            if the class of a key or value in the
+     *                                       specified map prevents it from being stored in this map
+     * @throws NullPointerException          if the specified map is null, or if
+     *                                       this map does not permit null keys or values, and the
+     *                                       specified map contains null keys or values
+     * @throws IllegalArgumentException      if some property of a key or value in
+     *                                       the specified map prevents it from being stored in this map
+     */
+    @Override
+    public void putAll(Map<? extends K, ? extends V> m) {
+        for(Entry entry : m.entrySet()) {
+            put((K)entry.getKey(),(V)entry.getValue());
+        }
+    }
+
+    /**
+     * Returns a {@link java.util.Set} view of the keys contained in this map.
+     * The set is backed by the map, so changes to the map are
+     * reflected in the set, and vice-versa.  If the map is modified
+     * while an iteration over the set is in progress (except through
+     * the iterator's own <tt>remove</tt> operation), the results of
+     * the iteration are undefined.  The set supports element removal,
+     * which removes the corresponding mapping from the map, via the
+     * <tt>Iterator.remove</tt>, <tt>Set.remove</tt>,
+     * <tt>removeAll</tt>, <tt>retainAll</tt>, and <tt>clear</tt>
+     * operations.  It does not support the <tt>add</tt> or <tt>addAll</tt>
+     * operations.
+     *
+     * @return a set view of the keys contained in this map
+     */
+    @Override
+    public Set<K> keySet() {
+        final Set<ElementWrapper> wrapped = delegate.keySet();
+
+        return new Set<K>() {
+            @Override
+            public int size() {
+                return wrapped.size();
+            }
+
+            @Override
+            public boolean isEmpty() {
+                return wrapped.isEmpty();
+            }
+
+            @Override
+            public boolean contains(Object o) {
+                return wrapped.contains(new ElementWrapper((K)o));
+            }
+
+            @Override
+            public Iterator<K> iterator() {
+                return Iterators.transform(wrapped.iterator(),unwrapper);
+            }
+
+            @Override
+            public Object[] toArray() {
+                return Iterators.toArray(this.iterator(), Object.class);
+            }
+
+            @Override
+            public <T> T[] toArray(T[] a) {
+                T[] result;
+                if(a.length < size()) {
+                    result = (T[]) Array.newInstance(a.getClass().getComponentType(), size());
+                } else {
+                    result = a;
+                }
+                int pos = 0;
+                for(ElementWrapper w : wrapped) {
+                    try {
+                    result[pos++] = (T) w.delegate;
+                    } catch (ClassCastException ex) {
+                        throw new ArrayStoreException("invalid type for array");
+                    }
+                }
+                if(pos < result.length) {
+                    result[pos] = null;
+                }
+                return result;
+            }
+
+            @Override
+            public boolean add(K k) {
+                return wrapped.add(new ElementWrapper(k));
+            }
+
+            @Override
+            public boolean remove(Object o) {
+                return wrapped.remove(new ElementWrapper((K)o));
+            }
+
+            @Override
+            public boolean containsAll(Collection<?> c) {
+                return wrapped.containsAll(Collections2.transform(c, wrapper));
+            }
+
+            @Override
+            public boolean addAll(Collection<? extends K> c) {
+                return wrapped.addAll(Collections2.transform(c, wrapper));
+            }
+
+            @Override
+            public boolean retainAll(Collection<?> c) {
+                return wrapped.retainAll(Collections2.transform(c, wrapper));
+            }
+
+            @Override
+            public boolean removeAll(Collection<?> c) {
+                return wrapped.removeAll(Collections2.transform(c, wrapper));
+            }
+
+            @Override
+            public void clear() {
+                wrapped.clear();
+            }
+        };
+    }
+
+    /**
+     * Returns a {@link java.util.Collection} view of the values contained in this map.
+     * The collection is backed by the map, so changes to the map are
+     * reflected in the collection, and vice-versa.  If the map is
+     * modified while an iteration over the collection is in progress
+     * (except through the iterator's own <tt>remove</tt> operation),
+     * the results of the iteration are undefined.  The collection
+     * supports element removal, which removes the corresponding
+     * mapping from the map, via the <tt>Iterator.remove</tt>,
+     * <tt>Collection.remove</tt>, <tt>removeAll</tt>,
+     * <tt>retainAll</tt> and <tt>clear</tt> operations.  It does not
+     * support the <tt>add</tt> or <tt>addAll</tt> operations.
+     *
+     * @return a collection view of the values contained in this map
+     */
+    @Override
+    public Collection<V> values() {
+        return delegate.values();
+    }
+
+    /**
+     * Returns a {@link java.util.Set} view of the mappings contained in this map.
+     * The set is backed by the map, so changes to the map are
+     * reflected in the set, and vice-versa.  If the map is modified
+     * while an iteration over the set is in progress (except through
+     * the iterator's own <tt>remove</tt> operation, or through the
+     * <tt>setValue</tt> operation on a map entry returned by the
+     * iterator) the results of the iteration are undefined.  The set
+     * supports element removal, which removes the corresponding
+     * mapping from the map, via the <tt>Iterator.remove</tt>,
+     * <tt>Set.remove</tt>, <tt>removeAll</tt>, <tt>retainAll</tt> and
+     * <tt>clear</tt> operations.  It does not support the
+     * <tt>add</tt> or <tt>addAll</tt> operations.
+     *
+     * @return a set view of the mappings contained in this map
+     */
+    @Override
+    public Set<Entry<K, V>> entrySet() {
+        final Set<Entry<ElementWrapper,V>> wrapped = delegate.entrySet();
+        final EntryUnwrapFunction entryUnwrapFunction = new EntryUnwrapFunction();
+        final EntryWrapFunction   entryWrapFunction   = new EntryWrapFunction();
+
+        return new Set<Entry<K, V>>() {
+            @Override
+            public int size() {
+                return wrapped.size();
+            }
+
+            @Override
+            public boolean isEmpty() {
+                return wrapped.isEmpty();
+            }
+
+            @Override
+            public boolean contains(Object o) {
+                return wrapped.contains(new ElementWrapper((K)o));
+            }
+
+            @Override
+            public Iterator<Entry<K, V>> iterator() {
+                return Iterators.transform(wrapped.iterator(), entryUnwrapFunction);
+            }
+
+            @Override
+            public Object[] toArray() {
+                return Iterators.toArray(this.iterator(), Object.class);
+            }
+
+            @Override
+            public <T> T[] toArray(T[] a) {
+                T[] result;
+                if(a.length < size()) {
+                    result = (T[]) Array.newInstance(a.getClass().getComponentType(), size());
+                } else {
+                    result = a;
+                }
+                int pos = 0;
+                for(Entry<ElementWrapper,V> w : wrapped) {
+                    try {
+                        result[pos++] = (T) entryUnwrapFunction.apply(w);
+                    } catch (ClassCastException ex) {
+                        throw new ArrayStoreException("invalid type for array");
+                    }
+                }
+                if(pos < result.length) {
+                    result[pos] = null;
+                }
+                return result;
+            }
+
+            @Override
+            public boolean add(Entry<K, V> k) {
+                return wrapped.add(entryWrapFunction.apply(k));
+            }
+
+            @Override
+            public boolean remove(Object o) {
+                return wrapped.remove(entryWrapFunction.apply((Entry<K, V>)o));
+            }
+
+            @Override
+            public boolean containsAll(Collection<?> c) {
+                return wrapped.containsAll(Collections2.transform(c, entryWrapFunction));
+            }
+
+            @Override
+            public boolean addAll(Collection<? extends Entry<K, V>> c) {
+                return wrapped.addAll(Collections2.transform(c, entryWrapFunction));
+            }
+
+            @Override
+            public boolean retainAll(Collection<?> c) {
+                return wrapped.retainAll(Collections2.transform(c, entryWrapFunction));
+            }
+
+            @Override
+            public boolean removeAll(Collection<?> c) {
+                return wrapped.removeAll(Collections2.transform(c, entryWrapFunction));
+            }
+
+            @Override
+            public void clear() {
+                wrapped.clear();
+            }
+        };
+    }
+
+    private class ElementWrapper {
+
+        private K delegate;
+
+        private ElementWrapper(K delegate) {
+            this.delegate = delegate;
+        }
+
+        @Override
+        public boolean equals(Object o) {
+            if(o instanceof EquivalenceHashMap<?,?>.ElementWrapper) {
+                return equivalence.equivalent(ElementWrapper.this.delegate, ((ElementWrapper)o).delegate);
+            } else {
+                return false;
+            }
+        }
+
+        @Override
+        public int hashCode() {
+            return equivalence.hash(delegate);
+        }
+    }
+
+    private class UnwrapFunction implements Function<ElementWrapper, K> {
+        @Override
+        public K apply(ElementWrapper input) {
+            return input.delegate;
+        }
+    }
+
+    private class WrapFunction implements Function<Object,ElementWrapper> {
+        @Override
+        public ElementWrapper apply(Object input) {
+            return new ElementWrapper((K)input);
+        }
+    }
+
+    private class EntryUnwrapFunction implements Function<Entry<ElementWrapper,V>, Entry<K, V>> {
+        @Override
+        public Entry<K, V> apply(final Entry<ElementWrapper, V> input) {
+            return new Entry<K, V>() {
+                @Override
+                public K getKey() {
+                    return input.getKey().delegate;
+                }
+
+                @Override
+                public V getValue() {
+                    return input.getValue();
+                }
+
+                @Override
+                public V setValue(V value) {
+                    return input.setValue(value);
+                }
+            };
+        }
+    }
+
+    private class EntryWrapFunction implements Function<Object,Entry<ElementWrapper,V>> {
+        @Override
+        public Entry<ElementWrapper, V> apply(Object o) {
+            final Entry<K, V> input = (Entry<K,V>)o;
+            return new Entry<ElementWrapper, V>() {
+                @Override
+                public ElementWrapper getKey() {
+                    return new ElementWrapper(input.getKey());
+                }
+
+                @Override
+                public V getValue() {
+                    return input.getValue();
+                }
+
+                @Override
+                public V setValue(V value) {
+                    return input.setValue(value);
+                }
+            };
+        }
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/marmotta-commons/src/main/java/org/apache/marmotta/commons/collections/EquivalenceHashSet.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-commons/src/main/java/org/apache/marmotta/commons/collections/EquivalenceHashSet.java b/commons/marmotta-commons/src/main/java/org/apache/marmotta/commons/collections/EquivalenceHashSet.java
new file mode 100644
index 0000000..9927efb
--- /dev/null
+++ b/commons/marmotta-commons/src/main/java/org/apache/marmotta/commons/collections/EquivalenceHashSet.java
@@ -0,0 +1,472 @@
+/*
+ * 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.commons.collections;
+
+import com.google.common.base.Equivalence;
+import com.google.common.base.Function;
+import com.google.common.collect.Collections2;
+import com.google.common.collect.Iterators;
+
+import java.util.*;
+
+/**
+ * A hashset implementation accepting different notions of equvialence (based on the Guava Equivalence class).
+ *
+ * @author Sebastian Schaffert (sschaffert@apache.org)
+ */
+public class EquivalenceHashSet<E> implements Set<E> {
+
+    private Equivalence equivalence;
+
+    private HashSet<ElementWrapper> delegate;
+
+
+    private UnwrapFunction unwrapper = new UnwrapFunction();
+    private WrapFunction   wrapper   = new WrapFunction();
+
+
+    public EquivalenceHashSet() {
+        this.equivalence = Equivalence.equals();
+        this.delegate    = new HashSet<>();
+    }
+
+    public EquivalenceHashSet(Equivalence equivalence) {
+        this.equivalence = equivalence;
+        this.delegate    = new HashSet<>();
+    }
+
+
+    /**
+     * Adds the specified element to this set if it is not already present
+     * (optional operation).  More formally, adds the specified element
+     * <tt>e</tt> to this set if the set contains no element <tt>e2</tt>
+     * such that
+     * <tt>(e==null&nbsp;?&nbsp;e2==null&nbsp;:&nbsp;e.equals(e2))</tt>.
+     * If this set already contains the element, the call leaves the set
+     * unchanged and returns <tt>false</tt>.  In combination with the
+     * restriction on constructors, this ensures that sets never contain
+     * duplicate elements.
+     * <p/>
+     * <p>The stipulation above does not imply that sets must accept all
+     * elements; sets may refuse to add any particular element, including
+     * <tt>null</tt>, and throw an exception, as described in the
+     * specification for {@link java.util.Collection#add Collection.add}.
+     * Individual set implementations should clearly document any
+     * restrictions on the elements that they may contain.
+     *
+     * @param e element to be added to this set
+     * @return <tt>true</tt> if this set did not already contain the specified
+     *         element
+     * @throws UnsupportedOperationException if the <tt>add</tt> operation
+     *                                       is not supported by this set
+     * @throws ClassCastException            if the class of the specified element
+     *                                       prevents it from being added to this set
+     * @throws NullPointerException          if the specified element is null and this
+     *                                       set does not permit null elements
+     * @throws IllegalArgumentException      if some property of the specified element
+     *                                       prevents it from being added to this set
+     */
+    @Override
+    public boolean add(E e) {
+        return delegate.add(new ElementWrapper(e));
+    }
+
+    /**
+     * Returns the number of elements in this set (its cardinality).  If this
+     * set contains more than <tt>Integer.MAX_VALUE</tt> elements, returns
+     * <tt>Integer.MAX_VALUE</tt>.
+     *
+     * @return the number of elements in this set (its cardinality)
+     */
+    @Override
+    public int size() {
+        return delegate.size();
+    }
+
+    /**
+     * Returns <tt>true</tt> if this set contains no elements.
+     *
+     * @return <tt>true</tt> if this set contains no elements
+     */
+    @Override
+    public boolean isEmpty() {
+        return delegate.isEmpty();
+    }
+
+    /**
+     * Returns <tt>true</tt> if this set contains the specified element.
+     * More formally, returns <tt>true</tt> if and only if this set
+     * contains an element <tt>e</tt> such that
+     * <tt>(o==null&nbsp;?&nbsp;e==null&nbsp;:&nbsp;o.equals(e))</tt>.
+     *
+     * @param o element whose presence in this set is to be tested
+     * @return <tt>true</tt> if this set contains the specified element
+     * @throws ClassCastException   if the type of the specified element
+     *                              is incompatible with this set
+     *                              (<a href="Collection.html#optional-restrictions">optional</a>)
+     * @throws NullPointerException if the specified element is null and this
+     *                              set does not permit null elements
+     *                              (<a href="Collection.html#optional-restrictions">optional</a>)
+     */
+    @Override
+    public boolean contains(Object o) {
+        return delegate.contains(new ElementWrapper((E)o));
+    }
+
+    /**
+     * Returns an iterator over the elements in this set.  The elements are
+     * returned in no particular order (unless this set is an instance of some
+     * class that provides a guarantee).
+     *
+     * @return an iterator over the elements in this set
+     */
+    @Override
+    public Iterator<E> iterator() {
+        return Iterators.transform(delegate.iterator(), unwrapper);
+    }
+
+    /**
+     * Returns an array containing all of the elements in this set.
+     * If this set makes any guarantees as to what order its elements
+     * are returned by its iterator, this method must return the
+     * elements in the same order.
+     * <p/>
+     * <p>The returned array will be "safe" in that no references to it
+     * are maintained by this set.  (In other words, this method must
+     * allocate a new array even if this set is backed by an array).
+     * The caller is thus free to modify the returned array.
+     * <p/>
+     * <p>This method acts as bridge between array-based and collection-based
+     * APIs.
+     *
+     * @return an array containing all the elements in this set
+     */
+    @Override
+    public Object[] toArray() {
+        return Iterators.toArray(this.iterator(), Object.class);
+    }
+
+    /**
+     * Returns an array containing all of the elements in this set; the
+     * runtime type of the returned array is that of the specified array.
+     * If the set fits in the specified array, it is returned therein.
+     * Otherwise, a new array is allocated with the runtime type of the
+     * specified array and the size of this set.
+     * <p/>
+     * <p>If this set fits in the specified array with room to spare
+     * (i.e., the array has more elements than this set), the element in
+     * the array immediately following the end of the set is set to
+     * <tt>null</tt>.  (This is useful in determining the length of this
+     * set <i>only</i> if the caller knows that this set does not contain
+     * any null elements.)
+     * <p/>
+     * <p>If this set makes any guarantees as to what order its elements
+     * are returned by its iterator, this method must return the elements
+     * in the same order.
+     * <p/>
+     * <p>Like the {@link #toArray()} method, this method acts as bridge between
+     * array-based and collection-based APIs.  Further, this method allows
+     * precise control over the runtime type of the output array, and may,
+     * under certain circumstances, be used to save allocation costs.
+     * <p/>
+     * <p>Suppose <tt>x</tt> is a set known to contain only strings.
+     * The following code can be used to dump the set into a newly allocated
+     * array of <tt>String</tt>:
+     * <p/>
+     * <pre>
+     *     String[] y = x.toArray(new String[0]);</pre>
+     *
+     * Note that <tt>toArray(new Object[0])</tt> is identical in function to
+     * <tt>toArray()</tt>.
+     *
+     * @param a the array into which the elements of this set are to be
+     *          stored, if it is big enough; otherwise, a new array of the same
+     *          runtime type is allocated for this purpose.
+     * @return an array containing all the elements in this set
+     * @throws ArrayStoreException  if the runtime type of the specified array
+     *                              is not a supertype of the runtime type of every element in this
+     *                              set
+     * @throws NullPointerException if the specified array is null
+     */
+    @Override
+    public <T> T[] toArray(T[] a) {
+        // stolen from AbstractCollection
+
+        // Estimate size of array; be prepared to see more or fewer elements
+        int size = size();
+        T[] r = a.length >= size ? a :
+                (T[])java.lang.reflect.Array
+                        .newInstance(a.getClass().getComponentType(), size);
+        Iterator<E> it = iterator();
+
+        for (int i = 0; i < r.length; i++) {
+            if (! it.hasNext()) { // fewer elements than expected
+                if (a != r)
+                    return Arrays.copyOf(r, i);
+                r[i] = null; // null-terminate
+                return r;
+            }
+            r[i] = (T)it.next();
+        }
+        return it.hasNext() ? finishToArray(r, it) : r;
+    }
+
+
+    /**
+     * The maximum size of array to allocate.
+     * Some VMs reserve some header words in an array.
+     * Attempts to allocate larger arrays may result in
+     * OutOfMemoryError: Requested array size exceeds VM limit
+     */
+    private static final int MAX_ARRAY_SIZE = Integer.MAX_VALUE - 8;
+
+    /**
+     * Reallocates the array being used within toArray when the iterator
+     * returned more elements than expected, and finishes filling it from
+     * the iterator.
+     *
+     * @param r the array, replete with previously stored elements
+     * @param it the in-progress iterator over this collection
+     * @return array containing the elements in the given array, plus any
+     *         further elements returned by the iterator, trimmed to size
+     */
+    private static <T> T[] finishToArray(T[] r, Iterator<?> it) {
+        int i = r.length;
+        while (it.hasNext()) {
+            int cap = r.length;
+            if (i == cap) {
+                int newCap = cap + (cap >> 1) + 1;
+                // overflow-conscious code
+                if (newCap - MAX_ARRAY_SIZE > 0)
+                    newCap = hugeCapacity(cap + 1);
+                r = Arrays.copyOf(r, newCap);
+            }
+            r[i++] = (T)it.next();
+        }
+        // trim if overallocated
+        return (i == r.length) ? r : Arrays.copyOf(r, i);
+    }
+
+
+    private static int hugeCapacity(int minCapacity) {
+        if (minCapacity < 0) // overflow
+            throw new OutOfMemoryError
+                    ("Required array size too large");
+        return (minCapacity > MAX_ARRAY_SIZE) ?
+                Integer.MAX_VALUE :
+                MAX_ARRAY_SIZE;
+    }
+
+
+    /**
+     * Removes the specified element from this set if it is present
+     * (optional operation).  More formally, removes an element <tt>e</tt>
+     * such that
+     * <tt>(o==null&nbsp;?&nbsp;e==null&nbsp;:&nbsp;o.equals(e))</tt>, if
+     * this set contains such an element.  Returns <tt>true</tt> if this set
+     * contained the element (or equivalently, if this set changed as a
+     * result of the call).  (This set will not contain the element once the
+     * call returns.)
+     *
+     * @param o object to be removed from this set, if present
+     * @return <tt>true</tt> if this set contained the specified element
+     * @throws ClassCastException            if the type of the specified element
+     *                                       is incompatible with this set
+     *                                       (<a href="Collection.html#optional-restrictions">optional</a>)
+     * @throws NullPointerException          if the specified element is null and this
+     *                                       set does not permit null elements
+     *                                       (<a href="Collection.html#optional-restrictions">optional</a>)
+     * @throws UnsupportedOperationException if the <tt>remove</tt> operation
+     *                                       is not supported by this set
+     */
+    @Override
+    public boolean remove(Object o) {
+        return delegate.remove(new ElementWrapper((E)o));
+    }
+
+    /**
+     * Returns <tt>true</tt> if this set contains all of the elements of the
+     * specified collection.  If the specified collection is also a set, this
+     * method returns <tt>true</tt> if it is a <i>subset</i> of this set.
+     *
+     * @param c collection to be checked for containment in this set
+     * @return <tt>true</tt> if this set contains all of the elements of the
+     *         specified collection
+     * @throws ClassCastException   if the types of one or more elements
+     *                              in the specified collection are incompatible with this
+     *                              set
+     *                              (<a href="Collection.html#optional-restrictions">optional</a>)
+     * @throws NullPointerException if the specified collection contains one
+     *                              or more null elements and this set does not permit null
+     *                              elements
+     *                              (<a href="Collection.html#optional-restrictions">optional</a>),
+     *                              or if the specified collection is null
+     * @see #contains(Object)
+     */
+    @Override
+    public boolean containsAll(Collection<?> c) {
+        return delegate.containsAll(Collections2.transform(c,wrapper));
+    }
+
+    /**
+     * Adds all of the elements in the specified collection to this set if
+     * they're not already present (optional operation).  If the specified
+     * collection is also a set, the <tt>addAll</tt> operation effectively
+     * modifies this set so that its value is the <i>union</i> of the two
+     * sets.  The behavior of this operation is undefined if the specified
+     * collection is modified while the operation is in progress.
+     *
+     * @param c collection containing elements to be added to this set
+     * @return <tt>true</tt> if this set changed as a result of the call
+     * @throws UnsupportedOperationException if the <tt>addAll</tt> operation
+     *                                       is not supported by this set
+     * @throws ClassCastException            if the class of an element of the
+     *                                       specified collection prevents it from being added to this set
+     * @throws NullPointerException          if the specified collection contains one
+     *                                       or more null elements and this set does not permit null
+     *                                       elements, or if the specified collection is null
+     * @throws IllegalArgumentException      if some property of an element of the
+     *                                       specified collection prevents it from being added to this set
+     * @see #add(Object)
+     */
+    @Override
+    public boolean addAll(Collection<? extends E> c) {
+        return delegate.addAll(Collections2.transform(c, wrapper));
+    }
+
+    /**
+     * Retains only the elements in this set that are contained in the
+     * specified collection (optional operation).  In other words, removes
+     * from this set all of its elements that are not contained in the
+     * specified collection.  If the specified collection is also a set, this
+     * operation effectively modifies this set so that its value is the
+     * <i>intersection</i> of the two sets.
+     *
+     * @param c collection containing elements to be retained in this set
+     * @return <tt>true</tt> if this set changed as a result of the call
+     * @throws UnsupportedOperationException if the <tt>retainAll</tt> operation
+     *                                       is not supported by this set
+     * @throws ClassCastException            if the class of an element of this set
+     *                                       is incompatible with the specified collection
+     *                                       (<a href="Collection.html#optional-restrictions">optional</a>)
+     * @throws NullPointerException          if this set contains a null element and the
+     *                                       specified collection does not permit null elements
+     *                                       (<a href="Collection.html#optional-restrictions">optional</a>),
+     *                                       or if the specified collection is null
+     * @see #remove(Object)
+     */
+    @Override
+    public boolean retainAll(Collection<?> c) {
+        return delegate.retainAll(Collections2.transform(c, wrapper));
+    }
+
+    /**
+     * Removes from this set all of its elements that are contained in the
+     * specified collection (optional operation).  If the specified
+     * collection is also a set, this operation effectively modifies this
+     * set so that its value is the <i>asymmetric set difference</i> of
+     * the two sets.
+     *
+     * @param c collection containing elements to be removed from this set
+     * @return <tt>true</tt> if this set changed as a result of the call
+     * @throws UnsupportedOperationException if the <tt>removeAll</tt> operation
+     *                                       is not supported by this set
+     * @throws ClassCastException            if the class of an element of this set
+     *                                       is incompatible with the specified collection
+     *                                       (<a href="Collection.html#optional-restrictions">optional</a>)
+     * @throws NullPointerException          if this set contains a null element and the
+     *                                       specified collection does not permit null elements
+     *                                       (<a href="Collection.html#optional-restrictions">optional</a>),
+     *                                       or if the specified collection is null
+     * @see #remove(Object)
+     * @see #contains(Object)
+     */
+    @Override
+    public boolean removeAll(Collection<?> c) {
+        return delegate.removeAll(Collections2.transform(c, wrapper));
+    }
+
+    /**
+     * Removes all of the elements from this set (optional operation).
+     * The set will be empty after this call returns.
+     *
+     * @throws UnsupportedOperationException if the <tt>clear</tt> method
+     *                                       is not supported by this set
+     */
+    @Override
+    public void clear() {
+        delegate.clear();
+    }
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) return true;
+        if (o == null || getClass() != o.getClass()) return false;
+
+        EquivalenceHashSet that = (EquivalenceHashSet) o;
+
+        if (!delegate.equals(that.delegate)) return false;
+        if (!equivalence.equals(that.equivalence)) return false;
+
+        return true;
+    }
+
+    @Override
+    public int hashCode() {
+        int result = equivalence.hashCode();
+        result = 31 * result + delegate.hashCode();
+        return result;
+    }
+
+    private class ElementWrapper {
+
+        private E delegate;
+
+        private ElementWrapper(E delegate) {
+            this.delegate = delegate;
+        }
+
+        @Override
+        public boolean equals(Object o) {
+            if(o instanceof EquivalenceHashSet<?>.ElementWrapper) {
+                return equivalence.equivalent(ElementWrapper.this.delegate, ((ElementWrapper)o).delegate);
+            } else {
+                return false;
+            }
+        }
+
+        @Override
+        public int hashCode() {
+            return equivalence.hash(delegate);
+        }
+    }
+
+    private class UnwrapFunction implements Function<ElementWrapper, E> {
+        @Override
+        public E apply(ElementWrapper input) {
+            return input.delegate;
+        }
+    }
+
+    private class WrapFunction implements Function<Object,ElementWrapper> {
+        @Override
+        public ElementWrapper apply(Object input) {
+            return new ElementWrapper((E)input);
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/marmotta-commons/src/main/java/org/apache/marmotta/commons/http/ETagGenerator.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-commons/src/main/java/org/apache/marmotta/commons/http/ETagGenerator.java b/commons/marmotta-commons/src/main/java/org/apache/marmotta/commons/http/ETagGenerator.java
index d54a510..4d93807 100644
--- a/commons/marmotta-commons/src/main/java/org/apache/marmotta/commons/http/ETagGenerator.java
+++ b/commons/marmotta-commons/src/main/java/org/apache/marmotta/commons/http/ETagGenerator.java
@@ -18,13 +18,14 @@
 package org.apache.marmotta.commons.http;
 
 import org.apache.marmotta.commons.sesame.repository.ResourceUtils;
+import org.openrdf.model.BNode;
+import org.openrdf.model.Resource;
 import org.openrdf.model.Statement;
 import org.openrdf.model.URI;
 import org.openrdf.repository.RepositoryConnection;
 import org.openrdf.repository.RepositoryException;
 import org.openrdf.repository.RepositoryResult;
 
-
 import com.google.common.hash.HashFunction;
 import com.google.common.hash.Hasher;
 import com.google.common.hash.Hashing;
@@ -73,12 +74,25 @@ public class ETagGenerator {
         return hasher.hash().toString();
     }
     
-    public static String getWeakETag(RepositoryConnection conn, String uri) throws RepositoryException {
-        URI resource = ResourceUtils.getUriResource(conn, uri);
-        return getWeakETag(conn, resource);
+    public static String getWeakETag(RepositoryConnection conn, String resource) throws RepositoryException {
+        if (resource.startsWith("http://")) {
+        	return getWeakETag(conn, ResourceUtils.getUriResource(conn, resource));
+        } else {
+        	return getWeakETag(conn, ResourceUtils.getAnonResource(conn, resource));
+        }
     }   
     
-    public static String getWeakETag(RepositoryConnection conn, URI resource) throws RepositoryException {
+//    public static String getWeakETag(RepositoryConnection conn, Resource resource) throws RepositoryException {
+//    	if (resource instanceof URI) {
+//    		return getWeakETag(conn, (URI)resource);
+//    	} else if (resource instanceof BNode) {
+//    		return getWeakETag(conn, (BNode)resource);
+//    	} else {
+//    		return null;
+//    	}
+//    }
+    
+    public static String getWeakETag(RepositoryConnection conn, Resource resource) throws RepositoryException {
     	if (resource == null) return "";
     	
         Hasher hasher = buildHasher();

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/marmotta-commons/src/main/java/org/apache/marmotta/commons/http/UriUtil.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-commons/src/main/java/org/apache/marmotta/commons/http/UriUtil.java b/commons/marmotta-commons/src/main/java/org/apache/marmotta/commons/http/UriUtil.java
index cc421bb..0fd360c 100644
--- a/commons/marmotta-commons/src/main/java/org/apache/marmotta/commons/http/UriUtil.java
+++ b/commons/marmotta-commons/src/main/java/org/apache/marmotta/commons/http/UriUtil.java
@@ -17,7 +17,7 @@
  */
 package org.apache.marmotta.commons.http;
 
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.validator.routines.UrlValidator;
 
 import java.net.URI;

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/marmotta-commons/src/main/java/org/apache/marmotta/commons/locking/ObjectLocks.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-commons/src/main/java/org/apache/marmotta/commons/locking/ObjectLocks.java b/commons/marmotta-commons/src/main/java/org/apache/marmotta/commons/locking/ObjectLocks.java
new file mode 100644
index 0000000..ebe4a1c
--- /dev/null
+++ b/commons/marmotta-commons/src/main/java/org/apache/marmotta/commons/locking/ObjectLocks.java
@@ -0,0 +1,75 @@
+/*
+ * 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.commons.locking;
+
+import com.google.common.cache.CacheBuilder;
+import com.google.common.cache.CacheLoader;
+import com.google.common.cache.LoadingCache;
+import com.google.common.util.concurrent.Monitor;
+
+import java.util.HashSet;
+
+/**
+ * An implementation of dynamic name-based locks that allows more fine-grained locking methods based on a string name.
+ *
+ * @author Sebastian Schaffert (sschaffert@apache.org)
+ */
+public class ObjectLocks {
+
+    private LoadingCache<Object,Monitor> stringLocks;
+
+    public ObjectLocks() {
+        stringLocks = CacheBuilder.newBuilder().build(new LockCacheLoader());
+    }
+
+
+    public void lock(Object name) {
+        Monitor lock;
+        synchronized (stringLocks) {
+            lock = stringLocks.getUnchecked(name);
+        }
+        lock.enter();
+    }
+
+    public void unlock(Object name) {
+        Monitor lock;
+        synchronized (stringLocks) {
+            lock = stringLocks.getUnchecked(name);
+        }
+        lock.leave();
+    }
+
+    public boolean tryLock(Object name) {
+        Monitor lock;
+        synchronized (stringLocks) {
+            lock = stringLocks.getUnchecked(name);
+        }
+        return lock.tryEnter();
+    }
+
+    /**
+     * A simple Guava cache loader implementation for generating object-based locks
+     */
+    private static class LockCacheLoader extends CacheLoader<Object,Monitor> {
+        @Override
+        public Monitor load(Object key) throws Exception {
+            return new Monitor();
+        }
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/marmotta-commons/src/main/java/org/apache/marmotta/commons/sesame/model/LiteralCommons.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-commons/src/main/java/org/apache/marmotta/commons/sesame/model/LiteralCommons.java b/commons/marmotta-commons/src/main/java/org/apache/marmotta/commons/sesame/model/LiteralCommons.java
index ce26c26..5749e37 100644
--- a/commons/marmotta-commons/src/main/java/org/apache/marmotta/commons/sesame/model/LiteralCommons.java
+++ b/commons/marmotta-commons/src/main/java/org/apache/marmotta/commons/sesame/model/LiteralCommons.java
@@ -170,7 +170,8 @@ public class LiteralCommons {
         } else if(Boolean.class.isAssignableFrom(javaClass) || boolean.class.isAssignableFrom(javaClass)) {
             return Namespaces.NS_XSD+"boolean";
         } else {
-            return Namespaces.NS_XSD+"string";
+            // FIXME: MARMOTTA-39 (no default datatype before RDF-1.1)
+            return null; //Namespaces.NS_XSD+"string";
         }
     }
     

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/marmotta-commons/src/main/java/org/apache/marmotta/commons/sesame/model/LiteralKey.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-commons/src/main/java/org/apache/marmotta/commons/sesame/model/LiteralKey.java b/commons/marmotta-commons/src/main/java/org/apache/marmotta/commons/sesame/model/LiteralKey.java
new file mode 100644
index 0000000..4a25b78
--- /dev/null
+++ b/commons/marmotta-commons/src/main/java/org/apache/marmotta/commons/sesame/model/LiteralKey.java
@@ -0,0 +1,60 @@
+/*
+ * 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.commons.sesame.model;
+
+/**
+ * Add file description here!
+ *
+ * @author Sebastian Schaffert (sschaffert@apache.org)
+ */
+public class LiteralKey {
+
+    private Object value;
+
+    private String type;
+
+    private String lang;
+
+    public LiteralKey(Object value, String type, String lang) {
+        this.value = value;
+        this.type = type;
+        this.lang = lang;
+    }
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) return true;
+        if (o == null || getClass() != o.getClass()) return false;
+
+        LiteralKey that = (LiteralKey) o;
+
+        if (lang != null ? !lang.equals(that.lang) : that.lang != null) return false;
+        if (type != null ? !type.equals(that.type) : that.type != null) return false;
+        if (!value.equals(that.value)) return false;
+
+        return true;
+    }
+
+    @Override
+    public int hashCode() {
+        int result = value.hashCode();
+        result = 31 * result + (type != null ? type.hashCode() : 0);
+        result = 31 * result + (lang != null ? lang.hashCode() : 0);
+        return result;
+    }
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/marmotta-commons/src/main/java/org/apache/marmotta/commons/sesame/model/StatementCommons.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-commons/src/main/java/org/apache/marmotta/commons/sesame/model/StatementCommons.java b/commons/marmotta-commons/src/main/java/org/apache/marmotta/commons/sesame/model/StatementCommons.java
new file mode 100644
index 0000000..c04e7be
--- /dev/null
+++ b/commons/marmotta-commons/src/main/java/org/apache/marmotta/commons/sesame/model/StatementCommons.java
@@ -0,0 +1,190 @@
+/*
+ * 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.commons.sesame.model;
+
+import com.google.common.base.Equivalence;
+import com.google.common.base.Objects;
+import javolution.util.FastMap;
+import javolution.util.FastSet;
+import javolution.util.function.Equality;
+import org.apache.marmotta.commons.collections.EquivalenceHashMap;
+import org.apache.marmotta.commons.collections.EquivalenceHashSet;
+import org.openrdf.model.Statement;
+
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * Provide some utility functions for managing statements (e.g. different forms of equivalence)
+ *
+ * @author Sebastian Schaffert (sschaffert@apache.org)
+ */
+public class StatementCommons {
+
+    private final static Equivalence<Statement> TRIPLE_EQUIVALENCE = new Equivalence<Statement>() {
+        @Override
+        protected boolean doEquivalent(Statement a, Statement b) {
+            if(a == b) return true;
+
+            if(!Objects.equal(a.getSubject(), b.getSubject())) return false;
+            if(!Objects.equal(a.getPredicate(), b.getPredicate())) return false;
+            if(!Objects.equal(a.getObject(), b.getObject())) return false;
+            return true;
+        }
+
+        @Override
+        protected int doHash(Statement statement) {
+            return Objects.hashCode(statement.getSubject(), statement.getPredicate(), statement.getObject());
+        }
+
+        @Override
+        public boolean equals(Object obj) {
+            return this.getClass().equals(obj.getClass());
+        }
+
+        @Override
+        public int hashCode() {
+            return this.getClass().hashCode();
+        }
+    };
+
+
+    private final static Equivalence<Statement> QUADRUPLE_EQUIVALENCE = new Equivalence<Statement>() {
+        @Override
+        protected boolean doEquivalent(Statement a, Statement b) {
+            if(a == b) return true;
+
+            if(!Objects.equal(a.getSubject(), b.getSubject())) return false;
+            if(!Objects.equal(a.getPredicate(), b.getPredicate())) return false;
+            if(!Objects.equal(a.getObject(), b.getObject())) return false;
+            if(!Objects.equal(a.getContext(), b.getContext())) return false;
+            return true;
+        }
+
+        @Override
+        protected int doHash(Statement statement) {
+            return Objects.hashCode(statement.getSubject(), statement.getPredicate(), statement.getObject(), statement.getContext());
+        }
+
+        @Override
+        public boolean equals(Object obj) {
+            return this.getClass().equals(obj.getClass());
+        }
+
+        @Override
+        public int hashCode() {
+            return this.getClass().hashCode();
+        }
+    };
+
+    /**
+     * Return triple equivalence, taking only into account subject, predicate and object
+     *
+     * @return
+     */
+    public static Equivalence<Statement> tripleEquivalence() {
+        return TRIPLE_EQUIVALENCE;
+    }
+
+    /**
+     * Return quadruple equivalence, taking into account subject, predicate, object, and context.
+     *
+     * @return
+     */
+    public static Equivalence<Statement> quadrupleEquivalence() {
+        return QUADRUPLE_EQUIVALENCE;
+
+    }
+
+    /**
+     * Create a new set for statements using the triple equivalence (based on subject, predicate, object only)
+     * @param <T>
+     * @return
+     */
+    public static <T extends Statement> Set<T> newTripleSet() {
+        //return new EquivalenceHashSet<>(tripleEquivalence());
+        return new FastSet<>(equivalenceEquality(tripleEquivalence()));
+    }
+
+    /**
+     * Create a new set for statements using the triple equivalence (based on subject, predicate, object and context)
+     * @param <T>
+     * @return
+     */
+    public static <T extends Statement> Set<T> newQuadrupleSet() {
+        //return new EquivalenceHashSet<>(quadrupleEquivalence());
+        return new FastSet<>(equivalenceEquality(quadrupleEquivalence()));
+    }
+
+    /**
+     * Create a new map where the keys are statements and the equivalence relation used for keys is triple
+     * equivalence (based on subject, predicate, object only)
+     *
+     * @param <K>
+     * @param <V>
+     * @return
+     */
+    public static <K extends Statement, V> Map<K,V> newTripleMap() {
+        //return new EquivalenceHashMap<>(tripleEquivalence());
+        return new FastMap<>(equivalenceEquality(tripleEquivalence()));
+    }
+
+    /**
+     * Create a new map where the keys are statements and the equivalence relation used for keys is triple
+     * equivalence (based on subject, predicate, object only)
+     *
+     * @param <K>
+     * @param <V>
+     * @return
+     */
+    public static <K extends Statement, V> Map<K,V> newQuadrupleMap() {
+        //return new EquivalenceHashMap<>(quadrupleEquivalence());
+        return new FastMap<>(equivalenceEquality(quadrupleEquivalence()));
+    }
+
+
+
+    private static <E> Equality<E> equivalenceEquality(final Equivalence<E> equivalence) {
+        return new Equality<E>() {
+            @Override
+            public int hashCodeOf(E object) {
+                return equivalence.hash(object);
+            }
+
+            @Override
+            public boolean areEqual(E left, E right) {
+                return equivalence.equivalent(left, right);
+            }
+
+            @Override
+            public int compare(E left, E right) {
+                return equivalence.hash(left) - equivalence.hash(right);
+            }
+
+            @Override
+            public int hashCode() {
+                return equivalence.hashCode();
+            }
+
+            @Override
+            public boolean equals(Object obj) {
+                return obj.hashCode() == hashCode();
+            }
+        };
+    }
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/marmotta-commons/src/main/java/org/apache/marmotta/commons/sesame/repository/ResourceUtils.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-commons/src/main/java/org/apache/marmotta/commons/sesame/repository/ResourceUtils.java b/commons/marmotta-commons/src/main/java/org/apache/marmotta/commons/sesame/repository/ResourceUtils.java
index 9e0cab5..1484df2 100644
--- a/commons/marmotta-commons/src/main/java/org/apache/marmotta/commons/sesame/repository/ResourceUtils.java
+++ b/commons/marmotta-commons/src/main/java/org/apache/marmotta/commons/sesame/repository/ResourceUtils.java
@@ -28,6 +28,8 @@ import org.openrdf.repository.RepositoryConnection;
 import org.openrdf.repository.RepositoryException;
 import org.openrdf.repository.RepositoryResult;
 import org.openrdf.repository.sail.SailRepositoryConnection;
+import org.openrdf.sail.SailConnection;
+import org.openrdf.sail.helpers.SailConnectionWrapper;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -37,8 +39,8 @@ import java.util.*;
  * Utility methods for simplifying certain common tasks. All methods are static and take as first argument a
  * RepositoryConnection that needs to be managed by the caller (i.e. requested from the repository and closed after use).
  *
- * <p/>
- * Author: Sebastian Schaffert
+ * @author Sebastian Schaffert (sschaffert@apache.org)
+ * @author Jakob Frank <ja...@apache.org>
  */
 public class ResourceUtils {
 
@@ -47,12 +49,12 @@ public class ResourceUtils {
     // *****************************************************************************************************
     // methods for retrieving resources
     // *****************************************************************************************************
-    
+
     /**
      * Check whenever the uri actually exists. 
      * Existence of a URI (Resource) is bound to the existence of a
      * Statement referencing the Resource, so this method simply delegates to {@link #isUsed(RepositoryConnection, String)}.
-     * 
+     *
      * @param conn connection with the repository
      * @param uri uri of the resource to check
      * @return resource exists or not
@@ -60,9 +62,9 @@ public class ResourceUtils {
      */
     @Deprecated
     public static boolean existsResource(RepositoryConnection conn, String uri) {
-    	return isUsed(conn, conn.getValueFactory().createURI(uri));
+        return isUsed(conn, conn.getValueFactory().createURI(uri));
     }
-    
+
     /**
      * Check whether the uri is ever used as subject. 
      * @param conn connection with the repository
@@ -70,7 +72,7 @@ public class ResourceUtils {
      * @return true if the uri is ever used as subject.
      */
     public static boolean isSubject(RepositoryConnection conn, String uri) {
-    	return isSubject(conn, conn.getValueFactory().createURI(uri));
+        return isSubject(conn, conn.getValueFactory().createURI(uri));
     }
 
     /**
@@ -79,9 +81,9 @@ public class ResourceUtils {
      * @param uri the {@link Resource} to check
      * @return true if the {@link Resource} is ever used as subject.
      */
-	public static boolean isSubject(RepositoryConnection conn, final Resource rsc) {
-		return existsStatement(conn, rsc, null, null, null);
-	}
+    public static boolean isSubject(RepositoryConnection conn, final Resource rsc) {
+        return existsStatement(conn, rsc, null, null);
+    }
 
     /**
      * Check whether the uri is ever used as predicate. 
@@ -89,41 +91,41 @@ public class ResourceUtils {
      * @param uri uri of the resource to check
      * @return true if the uri is ever used as predicate.
      */
-	public static boolean isPredicate(RepositoryConnection conn, final String uri) {
-		return isPredicate(conn, conn.getValueFactory().createURI(uri));
-	}
-	
+    public static boolean isPredicate(RepositoryConnection conn, final String uri) {
+        return isPredicate(conn, conn.getValueFactory().createURI(uri));
+    }
+
     /**
      * Check whether the {@link URI} is ever used as predicate. 
      * @param conn connection with the repository
      * @param uri the {@link URI} to check
      * @return true if the {@link URI} is ever used as predicate.
      */
-	public static boolean isPredicate(RepositoryConnection conn, final URI uri) {
-		return existsStatement(conn, null, uri, null, null);
-	}
+    public static boolean isPredicate(RepositoryConnection conn, final URI uri) {
+        return existsStatement(conn, null, uri, null);
+    }
 
-	   /**
+    /**
      * Check whether the uri is ever used as object. 
      * @param conn connection with the repository
      * @param uri uri of the resource to check
      * @return true if the uri is ever used as predicate.
      */
-	public static boolean isObject(RepositoryConnection conn, final String uri) {
-		return isObject(conn, conn.getValueFactory().createURI(uri));
-	}
-	
+    public static boolean isObject(RepositoryConnection conn, final String uri) {
+        return isObject(conn, conn.getValueFactory().createURI(uri));
+    }
+
     /**
      * Check whether the {@link Value} is ever used as object. 
      * @param conn connection with the repository
      * @param val {@link Value} to check
      * @return true if the {@link Value} is ever used as predicate.
      */
-	public static boolean isObject(RepositoryConnection conn, final Value val) {
-		return existsStatement(conn, null, null, val, null);
-	}
+    public static boolean isObject(RepositoryConnection conn, final Value val) {
+        return existsStatement(conn, null, null, val);
+    }
+
 
-	
     /**
      * Check whether the uri is ever used as context. 
      * @param conn connection with the repository
@@ -131,7 +133,7 @@ public class ResourceUtils {
      * @return true if the uri is ever used as context.
      */
     public static boolean isContext(RepositoryConnection conn, String uri) {
-    	return isContext(conn, conn.getValueFactory().createURI(uri));
+        return isContext(conn, conn.getValueFactory().createURI(uri));
     }
 
     /**
@@ -140,51 +142,46 @@ public class ResourceUtils {
      * @param rsc the {@link Resource} to check
      * @return true if the {@link Resource} is ever used as context.
      */
-	public static boolean isContext(RepositoryConnection conn, Resource rsc) {
-		return existsStatement(conn, null, null, null, rsc);
-	}
-	
-	/**
-	 * Check whether the {@link Resource} is used in any statement.
-	 * Checks if the provided {@link Resource} is used as
-	 * <ol>
-	 * <li>subject
-	 * <li>context
-	 * <li>object
-	 * <li>predicate (if the resource is a {@link URI})
-	 * </ol>
-	 * @param conn {@link ResourceConnection} to check on
-	 * @param rsc the {@link Resource} to check
-	 * @return true if the {@link Resource} is ever used in a {@link Statement}
-	 */
-	public static boolean isUsed(RepositoryConnection conn, Resource rsc) {
-		if (isSubject(conn, rsc) || isContext(conn, rsc) || isObject(conn, rsc)) return true;
-		if (rsc instanceof URI && isPredicate(conn, (URI) rsc)) return true;
-		return false;
-	}
-    
-	/**
-	 * Check for the existence of a {@link Statement} with the provided constraints. <code>null</code> is a wildcard.
-	 * <br>This is a convenience method and does not really fit whith <em>Resource</em>Utils. 
-	 * @param conn the {@link ResourceConnection} to check on
-	 * @param subj the subject of the {@link Statement} or <code>null</code> for a wildcard.
-	 * @param pred the predicate of the {@link Statement} or <code>null</code> for a wildcard.
-	 * @param object the object of the {@link Statement} or <code>null</code> for a wildcard.
-	 * @param ctx the context of the {@link Statement} or <code>null</code> for a wildcard.
-	 * @return true if a {@link Statement} with the provided constraints exists.
-	 */
-    public static boolean existsStatement(RepositoryConnection conn, Resource subj, URI pred, Value object, Resource ctx) {
-    	try {
-    		RepositoryResult<Statement> stmts = conn.getStatements(subj, pred, object, true, ctx);
-    		try {
-    			return stmts.hasNext();
-    		} finally {
-    			stmts.close();
-    		}
-    	} catch (RepositoryException e) {
-    		log.error(e.getMessage());
-    		return false;
-    	}
+    public static boolean isContext(RepositoryConnection conn, Resource rsc) {
+        return existsStatement(conn, null, null, null, rsc);
+    }
+
+    /**
+     * Check whether the {@link Resource} is used in any statement.
+     * Checks if the provided {@link Resource} is used as
+     * <ol>
+     * <li>subject
+     * <li>context
+     * <li>object
+     * <li>predicate (if the resource is a {@link URI})
+     * </ol>
+     * @param conn {@link ResourceConnection} to check on
+     * @param rsc the {@link Resource} to check
+     * @return true if the {@link Resource} is ever used in a {@link Statement}
+     */
+    public static boolean isUsed(RepositoryConnection conn, Resource rsc) {
+        if (isSubject(conn, rsc) || isContext(conn, rsc) || isObject(conn, rsc)) return true;
+        if (rsc instanceof URI && isPredicate(conn, (URI) rsc)) return true;
+        return false;
+    }
+
+    /**
+     * Check for the existence of a {@link Statement} with the provided constraints. <code>null</code> is a wildcard.
+     * <br>This is a convenience method and does not really fit whith <em>Resource</em>Utils.
+     *
+     * @param conn the {@link org.apache.marmotta.commons.sesame.repository.ResourceConnection} to check on
+     * @param subj the subject of the {@link org.openrdf.model.Statement} or <code>null</code> for a wildcard.
+     * @param pred the predicate of the {@link org.openrdf.model.Statement} or <code>null</code> for a wildcard.
+     * @param object the object of the {@link org.openrdf.model.Statement} or <code>null</code> for a wildcard.
+     * @return true if a {@link Statement} with the provided constraints exists.
+     */
+    public static boolean existsStatement(RepositoryConnection conn, Resource subj, URI pred, Value object, Resource ... context) {
+        try {
+            return conn.hasStatement(subj,pred,object,true,context);
+        } catch (RepositoryException e) {
+            log.error(e.getMessage());
+            return false;
+        }
     }
 
     /**
@@ -198,12 +195,12 @@ public class ResourceUtils {
      */
     @Deprecated
     public static URI getUriResource(RepositoryConnection con, String uri) {
-    	URI rsc = con.getValueFactory().createURI(uri);
-    	if (isUsed(con, rsc)) {
-    		return rsc;
-    	} else {
-    		return null;
-    	}
+        URI rsc = con.getValueFactory().createURI(uri);
+        if (isUsed(con, rsc)) {
+            return rsc;
+        } else {
+            return null;
+        }
     }
 
     /**
@@ -212,12 +209,12 @@ public class ResourceUtils {
      * @return
      */
     public static BNode getAnonResource(RepositoryConnection con, String id) {
-    	final BNode bNode = con.getValueFactory().createBNode(id);
-    	if (isUsed(con, bNode)) {
-    		return bNode;
-    	} else {
-    		return null;
-    	}
+        final BNode bNode = con.getValueFactory().createBNode(id);
+        if (isUsed(con, bNode)) {
+            return bNode;
+        } else {
+            return null;
+        }
     }
 
     /**
@@ -228,16 +225,12 @@ public class ResourceUtils {
      * @param resource
      */
     public static void removeResource(RepositoryConnection con, Resource resource) throws RepositoryException {
-        if(con instanceof SailRepositoryConnection && ((SailRepositoryConnection)con).getSailConnection() instanceof ResourceConnection) {
-            ((ResourceConnection) ((SailRepositoryConnection) con).getSailConnection()).removeResource(resource);
-        } else {
-            con.remove(resource,null,null);
-            if(resource instanceof URI) {
-                con.remove((Resource)null,(URI)resource,null);
-            }
-            con.remove((Resource)null,null,resource);
-            con.remove((Resource)null,null,null,resource);
+        con.remove(resource,null,null);
+        if(resource instanceof URI) {
+            con.remove((Resource)null,(URI)resource,null);
         }
+        con.remove((Resource)null,null,resource);
+        con.remove((Resource)null,null,null,resource);
     }
 
     /**
@@ -248,13 +241,15 @@ public class ResourceUtils {
      *
      * @return
      */
-    public static Iterable<Resource> listResources(final RepositoryConnection con) {
-        if(con instanceof SailRepositoryConnection && ((SailRepositoryConnection)con).getSailConnection() instanceof ResourceConnection) {
+    public static Iterable<Resource> listResources(RepositoryConnection con) {
+        final ResourceConnection rcon = getWrappedResourceConnection(con);
+
+        if(rcon != null) {
             return new Iterable<Resource>() {
                 @Override
                 public Iterator<Resource> iterator() {
                     try {
-                        return ResultUtils.unwrap(((ResourceConnection) ((SailRepositoryConnection) con).getSailConnection()).getResources());
+                        return ResultUtils.unwrap(rcon.getResources());
                     } catch (RepositoryException e) {
                         ExceptionUtils.handleRepositoryException(e,ResourceUtils.class);
                         return Iterators.emptyIterator();
@@ -262,11 +257,24 @@ public class ResourceUtils {
                 }
             };
         } else {
-            return listResourcesInternal(con,null,null,null);
+            return listSubjectsInternal(con, null, null, null);
         }
     }
 
     /**
+     * List all resources contained in the KiWi System, regardless of knowledge space or type. Since this
+     * operation works directly on the triple store, there is no guarantee the result is free of duplicates.
+     * In case the underlying connection does not directly support listing resources (i.e. is not an instance of
+     * ResourceConnection), the method will iterate over all triples and return their subjects
+     *
+     * @return
+     */
+    public static Iterable<Resource> listSubjects(RepositoryConnection con) {
+        return listSubjectsInternal(con, null, null, null);
+    }
+
+
+    /**
      * List all resources of a specific type in the KiWi system.
      *
      * @param type the type of the resources to list
@@ -286,37 +294,7 @@ public class ResourceUtils {
     public static Iterable<Resource> listResources(final RepositoryConnection con, final Resource type, final URI context) {
         URI rdf_type = con.getValueFactory().createURI(Namespaces.NS_RDF + "type");
 
-        return listResourcesInternal(con,rdf_type,type,context);
-    }
-
-    /**
-     * List all resources that have a specific property set to the given value
-     *
-     * @param propertyUri
-     * @param value  the literal value to query for
-     * @return
-     */
-    public static Iterable<Resource> listResourcesByProperty(final RepositoryConnection con, String propertyUri, String value) {
-        return listResourcesByProperty(con,propertyUri,value,null);
-    }
-
-    /**
-     * List all resources that have a specific property set to the given value and context
-     *
-     * @param propertyUri
-     * @param value  the literal value to query for
-     * @return
-     */
-    public static Iterable<Resource> listResourcesByProperty(final RepositoryConnection con, String propertyUri, String value, URI context) {
-        URI property = getUriResource(con,propertyUri);
-        Value object = con.getValueFactory().createLiteral(value);
-
-        if(property != null) {
-            return listResourcesInternal(con,property,object,context);
-        } else {
-            return Collections.emptySet();
-        }
-
+        return listSubjectsInternal(con, rdf_type, type, context);
     }
 
     /**
@@ -327,12 +305,14 @@ public class ResourceUtils {
      * @param limit
      */
     public static Iterable<URI> listResourcesByPrefix(final RepositoryConnection con, final String prefix, final int offset, final int limit) {
-        if(con instanceof SailRepositoryConnection && ((SailRepositoryConnection)con).getSailConnection() instanceof ResourceConnection) {
+        final ResourceConnection rcon = getWrappedResourceConnection(con);
+
+        if(rcon != null) {
             return new Iterable<URI>() {
                 @Override
                 public Iterator<URI> iterator() {
                     try {
-                        Iterator<URI> result = ResultUtils.unwrap(((ResourceConnection) ((SailRepositoryConnection) con).getSailConnection()).getResources(prefix));
+                        Iterator<URI> result = ResultUtils.unwrap(rcon.getResources(prefix));
 
                         Iterators.advance(result,offset);
 
@@ -362,14 +342,14 @@ public class ResourceUtils {
                                             return input instanceof URI && input.stringValue().startsWith(prefix);
                                         }
                                     }
-                                    ),
-                                    new Function<Resource, URI>() {
+                            ),
+                            new Function<Resource, URI>() {
                                 @Override
                                 public URI apply(Resource input) {
                                     return (URI)input;
                                 }
                             }
-                            );
+                    );
 
                     Iterators.advance(result,offset);
 
@@ -392,7 +372,7 @@ public class ResourceUtils {
         return listResourcesByPrefix(con,prefix,0,0);
     }
 
-    private static Iterable<Resource> listResourcesInternal(final RepositoryConnection con, final URI property, final Value value, final URI context) {
+    private static Iterable<Resource> listSubjectsInternal(final RepositoryConnection con, final URI property, final Value value, final URI context) {
         final Resource[] contexts;
         if(context != null) {
             contexts = new Resource[] { context };
@@ -413,7 +393,7 @@ public class ResourceUtils {
                                             return input.getSubject();
                                         }
                                     }),
-                                    new Predicate<Resource>() {
+                            new Predicate<Resource>() {
                                 // filter duplicates by remembering hash codes of visited resources
                                 private HashSet<Integer> visited = new HashSet<Integer>();
 
@@ -532,31 +512,6 @@ public class ResourceUtils {
 
     /**
      * Generic method to query for literal values related to this resource with the property
-     * identified by "propLabel" (SeRQL/SPARQL short or long notation) and the given locale. Just for the given space !!
-     *
-     * @param propLabel label of the property; either RDF short form (e.g. "foaf:mbox") or long form (e.g. <http://xmlns.com/foaf/0.1/mbox>)
-     * @return
-     *
-     */
-    public static Iterable<String> getProperties(RepositoryConnection con, Resource r, String propLabel, URI context) throws RepositoryException {
-        return getProperties(con, r, propLabel, null, context);
-    }
-
-    /**
-     * Generic method to query for literal values related to this resource with the property
-     * identified by "propLabel" (SeRQL/SPARQL short or long notation) and the given locale.
-     *
-     * @param propLabel label of the property; either RDF short form (e.g. "foaf:mbox") or long
-     *                  form (e.g. <http://xmlns.com/foaf/0.1/mbox>)
-     * @param loc
-     * @return
-     */
-    public static Iterable<String> getProperties(RepositoryConnection con, Resource r, String propLabel, Locale loc) throws RepositoryException {
-        return getProperties(con, r, propLabel, loc, null);
-    }
-
-    /**
-     * Generic method to query for literal values related to this resource with the property
      * identified by "propLabel" (SeRQL/SPARQL short or long notation) and the given locale.
      * Just for the given space !!
      *
@@ -592,7 +547,7 @@ public class ResourceUtils {
                                 input.getLanguage() != null && input.getLanguage().equals(loc.getLanguage().toLowerCase());
                     }
                 }
-                );
+        );
     }
 
     /**
@@ -862,7 +817,7 @@ public class ResourceUtils {
                         return input.getObject();
                     }
                 }
-                );
+        );
     }
 
 
@@ -1050,7 +1005,7 @@ public class ResourceUtils {
                         return input.getSubject();
                     }
                 }
-                );
+        );
     }
 
 
@@ -1106,8 +1061,8 @@ public class ResourceUtils {
      */
     public static String getLabel(RepositoryConnection con, Resource r, Locale loc, URI context) throws RepositoryException {
         String label = null;
-        // check kiwi:title, rdfs:label, dc:title in this order ...
-        String[] properties = { Namespaces.NS_RDFS+"label", Namespaces.NS_DC+"title", Namespaces.NS_DC_TERMS+"title", Namespaces.NS_SKOS+"prefLabel" };
+        // check rdfs:label, dct:title, dc:title, skos:prefLabel in this order ...
+        String[] properties = { Namespaces.NS_RDFS+"label", Namespaces.NS_DC_TERMS+"title", Namespaces.NS_DC+"title", Namespaces.NS_SKOS+"prefLabel" };
 
         for(String property : properties) {
             label = getProperty(con, r,property,loc,context);
@@ -1233,14 +1188,14 @@ public class ResourceUtils {
                                     return input.getObject() instanceof Resource;
                                 }
                             }
-                            ),
-                            new Function<Statement, Resource>() {
+                    ),
+                    new Function<Statement, Resource>() {
                         @Override
                         public Resource apply(Statement input) {
                             return (Resource)input.getObject();
                         }
                     }
-                    );
+            );
         } else {
             return Collections.emptyList();
         }
@@ -1278,7 +1233,11 @@ public class ResourceUtils {
             URI rdf_type = con.getValueFactory().createURI(Namespaces.NS_RDF + "type");
 
             if(rdf_type != null) {
-                return con.hasStatement(r,rdf_type,type,true,context);
+                if(context != null) {
+                    return con.hasStatement(r,rdf_type,type,true,context);
+                } else {
+                    return con.hasStatement(r,rdf_type,type,true);
+                }
             }
         }
         return false;
@@ -1292,7 +1251,7 @@ public class ResourceUtils {
      * in all provided contexts.
      * <p/>
      * If no context is provided, the type is added without context information.
-     * 
+     *
      * @param con the Connection to use
      * @param r the Resource
      * @param type the Type (the Object of the triple)
@@ -1341,7 +1300,7 @@ public class ResourceUtils {
      * Check whether the provided argument is a Resource (an URI or BNode).
      * <p/>
      * Equivalent to <code>(v instanceof Resource)</code>.
-     * 
+     *
      * @param v
      *            the Value to check.
      * @return <code>true</code> if it is a {@link Resource}
@@ -1354,7 +1313,7 @@ public class ResourceUtils {
      * Check whether the provided argument is an URI.
      * <p/>
      * Equivalent to <code>(v instanceof URI)</code>.
-     * 
+     *
      * @param v
      *            the Value to check.
      * @return <code>true</code> if it is a {@link URI}
@@ -1367,7 +1326,7 @@ public class ResourceUtils {
      * Check whether the provided argument is a BNode.
      * <p/>
      * Equivalent to <code>(v instanceof BNode)</code>.
-     * 
+     *
      * @param v
      *            the Value to check.
      * @return <code>true</code> if it is a {@link BNode}
@@ -1380,7 +1339,7 @@ public class ResourceUtils {
      * Check whether the provided argument is a Literal.
      * <p/>
      * Equivalent to <code>(v instanceof Literal)</code>.
-     * 
+     *
      * @param v
      *            the Value to check.
      * @return <code>true</code> if it is a {@link Literal}
@@ -1388,5 +1347,25 @@ public class ResourceUtils {
     public static boolean isLiteral(Value v) {
         return v instanceof Literal;
     }
-    
+
+
+    private static ResourceConnection getWrappedResourceConnection(SailConnection connection) {
+        if(connection instanceof ResourceConnection) {
+            return (ResourceConnection)connection;
+        } else if(connection instanceof SailConnectionWrapper) {
+            return getWrappedResourceConnection(((SailConnectionWrapper) connection).getWrappedConnection());
+        } else {
+            return null;
+        }
+
+    }
+
+    private static ResourceConnection getWrappedResourceConnection(RepositoryConnection connection) {
+        if(connection instanceof SailRepositoryConnection) {
+            return getWrappedResourceConnection(((SailRepositoryConnection) connection).getSailConnection());
+        } else {
+            return null;
+        }
+    }
+
 }


[015/100] [abbrv] [partial] Reverting the erroneous merge by Sebastian according to the instructions in INFRA-6876

Posted by wi...@apache.org.
http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/kiwi/kiwi-triplestore/src/test/java/org/apache/marmotta/kiwi/test/RepositoryTest.java
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-triplestore/src/test/java/org/apache/marmotta/kiwi/test/RepositoryTest.java b/libraries/kiwi/kiwi-triplestore/src/test/java/org/apache/marmotta/kiwi/test/RepositoryTest.java
index 67ec618..5627f1b 100644
--- a/libraries/kiwi/kiwi-triplestore/src/test/java/org/apache/marmotta/kiwi/test/RepositoryTest.java
+++ b/libraries/kiwi/kiwi-triplestore/src/test/java/org/apache/marmotta/kiwi/test/RepositoryTest.java
@@ -1,13 +1,12 @@
-/**
- * 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
+/*
+ * 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
+ *      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,
@@ -17,32 +16,41 @@
  */
 package org.apache.marmotta.kiwi.test;
 
+import static org.hamcrest.CoreMatchers.hasItems;
+import static org.hamcrest.CoreMatchers.not;
+import static org.hamcrest.CoreMatchers.notNullValue;
+import static org.hamcrest.Matchers.hasItem;
+import static org.hamcrest.Matchers.hasProperty;
+import static org.hamcrest.Matchers.is;
+import static org.hamcrest.Matchers.lessThan;
+import static org.junit.Assume.assumeThat;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.sql.SQLException;
+import java.util.ConcurrentModificationException;
+import java.util.List;
+
+import org.apache.commons.lang3.RandomStringUtils;
 import org.apache.marmotta.commons.sesame.repository.ResourceUtils;
-import com.google.common.base.Function;
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.Iterables;
-import org.apache.commons.lang.RandomStringUtils;
-import org.apache.marmotta.kiwi.persistence.KiWiDialect;
-import org.apache.marmotta.kiwi.persistence.h2.H2Dialect;
-import org.apache.marmotta.kiwi.persistence.mysql.MySQLDialect;
-import org.apache.marmotta.kiwi.persistence.pgsql.PostgreSQLDialect;
+import org.apache.marmotta.kiwi.config.KiWiConfiguration;
 import org.apache.marmotta.kiwi.sail.KiWiStore;
-import org.apache.marmotta.kiwi.test.helper.DBConnectionChecker;
+import org.apache.marmotta.kiwi.test.junit.KiWiDatabaseRunner;
 import org.hamcrest.CoreMatchers;
 import org.junit.After;
 import org.junit.Assert;
 import org.junit.Before;
-import org.junit.Rule;
 import org.junit.Test;
-import org.junit.rules.TestWatcher;
-import org.junit.runner.Description;
 import org.junit.runner.RunWith;
-import org.junit.runners.Parameterized;
 import org.openrdf.model.Literal;
 import org.openrdf.model.Namespace;
 import org.openrdf.model.Resource;
 import org.openrdf.model.Statement;
 import org.openrdf.model.URI;
+import org.openrdf.query.MalformedQueryException;
+import org.openrdf.query.QueryLanguage;
+import org.openrdf.query.Update;
+import org.openrdf.query.UpdateExecutionException;
 import org.openrdf.repository.Repository;
 import org.openrdf.repository.RepositoryConnection;
 import org.openrdf.repository.RepositoryException;
@@ -52,110 +60,35 @@ import org.openrdf.rio.RDFParseException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import java.io.IOException;
-import java.io.InputStream;
-import java.sql.SQLException;
-import java.util.ArrayList;
-import java.util.List;
-
-import static org.hamcrest.CoreMatchers.hasItems;
-import static org.hamcrest.CoreMatchers.not;
-import static org.hamcrest.CoreMatchers.notNullValue;
-import static org.hamcrest.Matchers.hasItem;
-import static org.hamcrest.Matchers.*;
-import static org.junit.Assume.assumeThat;
+import com.google.common.base.Function;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.Iterables;
 
 /**
- * Test the Sesame repository functionality backed by the KiWi triple store. It will try running over all
- * available databases. Except for in-memory databases like H2 or Derby, database URLs must be passed as
- * system property, or otherwise the test is skipped for this database. Available system properties:
- * <ul>
- *     <li>PostgreSQL:
- *     <ul>
- *         <li>postgresql.url, e.g. jdbc:postgresql://localhost:5433/kiwitest?prepareThreshold=3</li>
- *         <li>postgresql.user (default: lmf)</li>
- *         <li>postgresql.pass (default: lmf)</li>
- *     </ul>
- *     </li>
- *     <li>MySQL:
- *     <ul>
- *         <li>mysql.url, e.g. jdbc:mysql://localhost:3306/kiwitest?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull</li>
- *         <li>mysql.user (default: lmf)</li>
- *         <li>mysql.pass (default: lmf)</li>
- *     </ul>
- *     </li>
- *     <li>H2:
- *     <ul>
- *         <li>h2.url, e.g. jdbc:h2:mem;MVCC=true;DB_CLOSE_ON_EXIT=FALSE;DB_CLOSE_DELAY=10</li>
- *         <li>h2.user (default: lmf)</li>
- *         <li>h2.pass (default: lmf)</li>
- *     </ul>
- *     </li>
- * </ul>
- * <p/>
- * Author: Sebastian Schaffert
+ * Test the Sesame repository functionality backed by the KiWi triple store. 
+ *
+ * @author Sebastian Schaffert (sschaffert@apache.org)
  */
-@RunWith(Parameterized.class)
+@RunWith(KiWiDatabaseRunner.class)
 public class RepositoryTest {
 
     private static Logger log = LoggerFactory.getLogger(RepositoryTest.class);
 
-    /**
-     * Return database configurations if the appropriate parameters have been set.
-     *
-     * @return an array (database name, url, user, password)
-     */
-    @Parameterized.Parameters(name="Database Test {index}: {0} at {1}")
-    public static Iterable<Object[]> databases() {
-        String[] databases = {"H2", "PostgreSQL", "MySQL"};
-
-        List<Object[]> result = new ArrayList<Object[]>(databases.length);
-        for(String database : databases) {
-            if(System.getProperty(database.toLowerCase()+".url") != null) {
-                result.add(new Object[] {
-                        database,
-                        System.getProperty(database.toLowerCase()+".url"),
-                        System.getProperty(database.toLowerCase()+".user","lmf"),
-                        System.getProperty(database.toLowerCase()+".pass","lmf")
-                });
-            }
-        }
-        return result;
-    }
-
-
-    private KiWiDialect dialect;
-
-    private String jdbcUrl;
-
-    private String jdbcUser;
-
-    private String jdbcPass;
-
     private Repository repository;
 
-	private KiWiStore store;
+    private KiWiStore store;
 
-    public RepositoryTest(String database, String jdbcUrl, String jdbcUser, String jdbcPass) {
-        this.jdbcPass = jdbcPass;
-        this.jdbcUrl = jdbcUrl;
-        this.jdbcUser = jdbcUser;
+    private final KiWiConfiguration kiwiConfiguration;
+
+    public RepositoryTest(KiWiConfiguration kiwiConfiguration) {
+        this.kiwiConfiguration = kiwiConfiguration;
 
-        if("H2".equals(database)) {
-            this.dialect = new H2Dialect();
-        } else if("MySQL".equals(database)) {
-            this.dialect = new MySQLDialect();
-        } else if("PostgreSQL".equals(database)) {
-            this.dialect = new PostgreSQLDialect();
-        }
-        
-        DBConnectionChecker.checkDatabaseAvailability(jdbcUrl, jdbcUser, jdbcPass, this.dialect);
     }
 
-	@Before
+    @Before
     public void initDatabase() throws RepositoryException {
-        store = new KiWiStore("test",jdbcUrl,jdbcUser,jdbcPass,dialect, "http://localhost/context/default", "http://localhost/context/inferred" );
-		repository = new SailRepository(store);
+        store = new KiWiStore(kiwiConfiguration);
+        repository = new SailRepository(store);
         repository.initialize();
     }
 
@@ -166,19 +99,6 @@ public class RepositoryTest {
         repository.shutDown();
     }
 
-    final Logger logger =
-            LoggerFactory.getLogger(RepositoryTest.class);
-
-    @Rule
-    public TestWatcher watchman = new TestWatcher() {
-        /**
-         * Invoked when a test is about to start
-         */
-        @Override
-        protected void starting(Description description) {
-            logger.info("{} being run...", description.getMethodName());
-        }
-    };
 
     /**
      * Test importing data; the test will load a small sample RDF file and check whether the expected resources are
@@ -225,7 +145,8 @@ public class RepositoryTest {
         );
 
         // test if the result has the expected size
-        Assert.assertEquals(4, resources.size());
+        //FIXME: this test is no longer valid, because resource existance is not bound to use as subject
+        //Assert.assertEquals(4, resources.size());
 
         // test if the result contains all resources that have been used as subject
         Assert.assertThat(resources, hasItems(
@@ -329,7 +250,9 @@ public class RepositoryTest {
             );
 
             // test if the result has the expected size
-            Assert.assertEquals(4, resources.size());
+            // FIXME: MARMOTTA-39 (no xsd:string, so one resource is "missing")
+            // Assert.assertEquals(31, resources.size());
+            Assert.assertEquals(30, resources.size());
 
             // test if the result contains all resources that have been used as subject
             Assert.assertThat(resources, hasItems(
@@ -355,7 +278,7 @@ public class RepositoryTest {
             // the resource hans_meier should not be contained in the list of resources
             List<String> resources2 = ImmutableList.copyOf(
                     Iterables.transform(
-                            ResourceUtils.listResources(connection),
+                            ResourceUtils.listSubjects(connection),
                             new Function<Resource, String>() {
                                 @Override
                                 public String apply(Resource input) {
@@ -366,7 +289,7 @@ public class RepositoryTest {
             );
 
             // test if the result has the expected size
-            Assert.assertEquals(3, resources2.size());
+            //Assert.assertEquals(3, resources2.size());
 
             // test if the result does not contain the removed resource
             Assert.assertThat(resources2, not(hasItem(
@@ -545,7 +468,329 @@ public class RepositoryTest {
             connection4.close();
         }
 
+        // test repeated adding/removing inside the same transaction
+        Literal object5 = repository.getValueFactory().createLiteral(RandomStringUtils.randomAlphanumeric(8));
+        RepositoryConnection connection5 = repository.getConnection();
+        try {
+            Assert.assertFalse(connection5.hasStatement(subject, predicate, object5, true));
+
+            connection5.add(subject,predicate,object5);
+            Assert.assertTrue(connection5.hasStatement(subject,predicate,object5,true));
+
+            connection5.remove(subject,predicate,object5);
+            Assert.assertFalse(connection5.hasStatement(subject,predicate,object5,true));
+
+            connection5.add(subject,predicate,object5);
+            Assert.assertTrue(connection5.hasStatement(subject,predicate,object5,true));
+            connection5.commit();
+        } finally {
+            connection5.close();
+        }
+
+        RepositoryConnection connection6 = repository.getConnection();
+        try {
+            Assert.assertTrue(connection6.hasStatement(subject, predicate, object5, true));
+
+            connection6.commit();
+        } finally {
+            connection6.close();
+        }
+
+    }
+
+    @Test
+    public void testRepeatedAddRemoveCrossTransaction() throws RepositoryException {
+        String value = RandomStringUtils.randomAlphanumeric(8);
+
+        URI subject = repository.getValueFactory().createURI("http://localhost/resource/" + RandomStringUtils.randomAlphanumeric(8));
+        URI predicate = repository.getValueFactory().createURI("http://localhost/resource/" + RandomStringUtils.randomAlphanumeric(8));
+        Literal object1 = repository.getValueFactory().createLiteral(value);
+
+        RepositoryConnection connection1 = repository.getConnection();
+        try {
+            connection1.add(subject,predicate,object1);
+            connection1.commit();
+
+            Assert.assertTrue(connection1.hasStatement(subject,predicate,object1,true));
+
+            connection1.commit();
+        } finally {
+            connection1.close();
+        }
+
+        RepositoryConnection connection2 = repository.getConnection();
+        try {
+            connection2.remove(subject, predicate, object1);
+            Assert.assertFalse(connection2.hasStatement(subject, predicate, object1, true));
+
+            connection2.add(subject,predicate,object1);
+            Assert.assertTrue(connection2.hasStatement(subject, predicate, object1, true));
+
+            connection2.commit();
+        } finally {
+            connection2.close();
+        }
+
+        RepositoryConnection connection3 = repository.getConnection();
+        try {
+            Assert.assertTrue(connection3.hasStatement(subject, predicate, object1, true));
+            connection3.commit();
+        } finally {
+            connection3.close();
+        }
+    }
+
+    @Test
+    public void testRepeatedAddRemoveSPARQL() throws RepositoryException, MalformedQueryException, UpdateExecutionException {
+        String value = RandomStringUtils.randomAlphanumeric(8);
+
+        URI subject = repository.getValueFactory().createURI("http://localhost/resource/" + RandomStringUtils.randomAlphanumeric(8));
+        URI predicate = repository.getValueFactory().createURI("http://localhost/resource/" + RandomStringUtils.randomAlphanumeric(8));
+        Literal object1 = repository.getValueFactory().createLiteral(value);
+
+        RepositoryConnection connection1 = repository.getConnection();
+        try {
+            connection1.add(subject,predicate,object1);
+            connection1.commit();
+
+            Assert.assertTrue(connection1.hasStatement(subject,predicate,object1,true));
+
+            connection1.commit();
+        } finally {
+            connection1.close();
+        }
+
+        RepositoryConnection connection2 = repository.getConnection();
+        try {
+            String query = String.format("DELETE { <%s> <%s> ?v } INSERT { <%s> <%s> ?v . } WHERE { <%s> <%s> ?v }", subject.stringValue(), predicate.stringValue(), subject.stringValue(), predicate.stringValue(), subject.stringValue(), predicate.stringValue());
+
+            Update u = connection2.prepareUpdate(QueryLanguage.SPARQL, query);
+            u.execute();
 
+            connection2.commit();
+        } finally {
+            connection2.close();
+        }
+
+        RepositoryConnection connection3 = repository.getConnection();
+        try {
+            Assert.assertTrue(connection3.hasStatement(subject, predicate, object1, true));
+            connection3.commit();
+        } finally {
+            connection3.close();
+        }
     }
 
+
+    /**
+     * Test the rollback functionality of the triple store by adding a triple, rolling back, adding the triple again.
+     *
+     * @throws Exception
+     */
+    @Test
+    public void testRollback() throws Exception {
+        String value = RandomStringUtils.randomAlphanumeric(8);
+
+        URI subject = repository.getValueFactory().createURI("http://localhost/resource/" + RandomStringUtils.randomAlphanumeric(8));
+        URI predicate = repository.getValueFactory().createURI("http://localhost/resource/" + RandomStringUtils.randomAlphanumeric(8));
+        Literal object = repository.getValueFactory().createLiteral(value);
+
+        RepositoryConnection connection1 = repository.getConnection();
+        try {
+            connection1.begin();
+            connection1.add(subject,predicate,object);
+            connection1.rollback();
+
+        } finally {
+            connection1.close();
+        }
+
+        RepositoryConnection connection2 = repository.getConnection();
+        try {
+            connection2.begin();
+            Assert.assertFalse(connection2.hasStatement(subject,predicate,object,true));
+
+            connection2.add(subject,predicate,object);
+            connection2.commit();
+
+            Assert.assertTrue(connection2.hasStatement(subject,predicate,object,true));
+
+            connection2.commit();
+        } finally {
+            connection2.close();
+        }
+
+    }
+
+    /**
+     * This test is for a strange bug that happens when running SPARQL updates that delete and reinsert a triple in
+     * the same transaction. See https://issues.apache.org/jira/browse/MARMOTTA-283
+     */
+    @Test
+    public void testMARMOTTA283() throws RepositoryException, RDFParseException, IOException, MalformedQueryException, UpdateExecutionException {
+
+        InputStream rdfXML = this.getClass().getResourceAsStream("demo-data.foaf");
+        assumeThat("Could not load test-data: demo-data.foaf", rdfXML, notNullValue(InputStream.class));
+
+        RepositoryConnection connectionRDF = repository.getConnection();
+        try {
+            connectionRDF.add(rdfXML, "http://localhost/foaf/", RDFFormat.RDFXML);
+            connectionRDF.commit();
+        } finally {
+            connectionRDF.close();
+        }
+
+
+        String update = "DELETE { ?s ?p ?o } INSERT { <http://localhost:8080/LMF/resource/hans_meier> <http://xmlns.com/foaf/0.1/name> \"Hans Meier\" . <http://localhost:8080/LMF/resource/hans_meier> <http://xmlns.com/foaf/0.1/based_near> <http://dbpedia.org/resource/Traunstein> . <http://localhost:8080/LMF/resource/hans_meier> <http://xmlns.com/foaf/0.1/interest> <http://rdf.freebase.com/ns/en.linux> } WHERE { ?s ?p ?o . FILTER ( ?s = <http://localhost:8080/LMF/resource/hans_meier> ) }";
+
+        RepositoryConnection connectionUpdate = repository.getConnection();
+        try {
+            Update u = connectionUpdate.prepareUpdate(QueryLanguage.SPARQL, update);
+            u.execute();
+            connectionUpdate.commit();
+        } finally {
+            connectionUpdate.close();
+        }
+
+        // now there should be two triples
+        RepositoryConnection connectionVerify = repository.getConnection();
+        try {
+            URI hans_meier = repository.getValueFactory().createURI("http://localhost:8080/LMF/resource/hans_meier");
+            URI foaf_name  = repository.getValueFactory().createURI("http://xmlns.com/foaf/0.1/name");
+            URI foaf_based_near = repository.getValueFactory().createURI("http://xmlns.com/foaf/0.1/based_near");
+            URI foaf_interest = repository.getValueFactory().createURI("http://xmlns.com/foaf/0.1/interest");
+            URI freebase_linux = repository.getValueFactory().createURI("http://rdf.freebase.com/ns/en.linux");
+            URI traunstein = repository.getValueFactory().createURI("http://dbpedia.org/resource/Traunstein");
+
+            Assert.assertTrue(connectionVerify.hasStatement(hans_meier,foaf_name,null, true));
+            Assert.assertTrue(connectionVerify.hasStatement(hans_meier,foaf_based_near,traunstein, true));
+            Assert.assertTrue(connectionVerify.hasStatement(hans_meier,foaf_interest,freebase_linux, true));
+
+            connectionVerify.commit();
+        } finally {
+            connectionVerify.close();
+        }
+    }
+
+    /**
+     * This test is for a strange bug that happens when running SPARQL updates that delete and reinsert a triple in
+     * the same transaction. It is similar to #testMARMOTTA283, but simulates the issue in more detail.
+     * See https://issues.apache.org/jira/browse/MARMOTTA-283
+     */
+    @Test
+    public void testMARMOTTA283_2() throws RepositoryException, RDFParseException, IOException, MalformedQueryException, UpdateExecutionException {
+
+        //insert quadruples
+        String insert =
+                "WITH <http://resource.org/video>" +
+                "INSERT {" +
+                "   <http://resource.org/video> <http://ontology.org#hasFragment> <http://resource.org/fragment1>." +
+                "   <http://resource.org/annotation1> <http://ontology.org#hasTarget> <http://resource.org/fragment1>." +
+                "   <http://resource.org/annotation1> <http://ontology.org#hasBody> <http://resource.org/subject1>." +
+                "   <http://resource.org/fragment1> <http://ontology.org#shows> <http://resource.org/subject1>." +
+                "} WHERE {}";
+
+        RepositoryConnection connectionInsert = repository.getConnection();
+        try {
+            Update u = connectionInsert.prepareUpdate(QueryLanguage.SPARQL, insert);
+            u.execute();
+            connectionInsert.commit();
+        } finally {
+            connectionInsert.close();
+        }
+
+        //update quadruples
+        String update =
+                "WITH <http://resource.org/video>" +
+                "DELETE { " +
+                "   ?annotation ?p ?v." +
+                "   ?fragment ?r ?s." +
+                "   <http://resource.org/video> <http://ontology.org#hasFragment> ?fragment." +
+                "} INSERT {" +
+                "   <http://resource.org/video> <http://ontology.org#hasFragment> <http://resource.org/fragment1>." +
+                "   <http://resource.org/annotation1> <http://ontology.org#hasTarget> <http://resource.org/fragment1>." +
+                "   <http://resource.org/annotation1> <http://ontology.org#hasBody> <http://resource.org/subject1>." +
+                "   <http://resource.org/fragment1> <http://ontology.org#shows> <http://resource.org/subject1>." +
+                "} WHERE {" +
+                "   ?annotation <http://ontology.org#hasTarget> ?fragment." +
+                "   ?annotation ?p ?v." +
+                "   OPTIONAL {" +
+                "       ?fragment ?r ?s" +
+                "   }" +
+                "   FILTER (?fragment = <http://resource.org/fragment1>)" +
+                "} ";
+
+        RepositoryConnection connectionUpdate = repository.getConnection();
+        try {
+            Update u = connectionUpdate.prepareUpdate(QueryLanguage.SPARQL, update);
+            u.execute();
+            connectionUpdate.commit();
+        } finally {
+            connectionUpdate.close();
+        }
+
+        //check quadruples
+        RepositoryConnection connectionVerify = repository.getConnection();
+        try {
+            URI video = repository.getValueFactory().createURI("http://resource.org/video");
+            URI hasFragment  = repository.getValueFactory().createURI("http://ontology.org#hasFragment");
+            URI fragment = repository.getValueFactory().createURI("http://resource.org/fragment1");
+            URI annotation = repository.getValueFactory().createURI("http://resource.org/annotation1");
+            URI hasTarget = repository.getValueFactory().createURI("http://ontology.org#hasTarget");
+            URI hasBody = repository.getValueFactory().createURI("http://ontology.org#hasBody");
+            URI subject = repository.getValueFactory().createURI("http://resource.org/subject1");
+            URI shows = repository.getValueFactory().createURI("http://ontology.org#shows");
+
+            Assert.assertTrue(connectionVerify.hasStatement(video,hasFragment,fragment,true,video));
+            Assert.assertTrue(connectionVerify.hasStatement(annotation,hasTarget,fragment,true,video));
+            Assert.assertTrue(connectionVerify.hasStatement(annotation,hasBody,subject,true,video));
+            Assert.assertTrue(connectionVerify.hasStatement(fragment,shows,subject,true,video));
+
+            connectionVerify.commit();
+        } finally {
+            connectionVerify.close();
+        }
+    }
+
+    /**
+     * Test the concurrent connection problem reported in MARMOTTA-236 for facading:
+     * - get two parallel connections
+     * - add triple in connection 1; should be available in connection 1 and not in connection 2
+     * - add same triple in connection 2; should be available in both, connection 1 and connection 2 or
+     *   fail-fast by throwing a ConcurrentModificationException
+     * @throws Exception
+     */
+    @Test
+    public void testMARMOTTA236() throws Exception {
+        RepositoryConnection con1 = repository.getConnection();
+        RepositoryConnection con2 = repository.getConnection();
+
+        try {
+            URI r1 = repository.getValueFactory().createURI("http://localhost/"+ RandomStringUtils.randomAlphanumeric(8));
+            URI r2 = repository.getValueFactory().createURI("http://localhost/"+ RandomStringUtils.randomAlphanumeric(8));
+            URI r3 = repository.getValueFactory().createURI("http://localhost/"+ RandomStringUtils.randomAlphanumeric(8));
+
+            con1.begin();
+            con1.add(r1,r2,r3);
+
+            Assert.assertTrue(con1.hasStatement(r1,r2,r3,true));
+
+            con2.begin();
+            Assert.assertFalse(con2.hasStatement(r1,r2,r3,true));
+
+            con2.add(r1,r2,r3);
+
+            Assert.assertTrue(con2.hasStatement(r1,r2,r3,true));
+
+            con2.rollback();
+            con1.commit();
+        } catch (ConcurrentModificationException ex) {
+
+        } finally {
+            con1.close();
+            con2.close();
+        }
+
+
+    }
 }

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/kiwi/kiwi-triplestore/src/test/java/org/apache/marmotta/kiwi/test/helper/DBConnectionChecker.java
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-triplestore/src/test/java/org/apache/marmotta/kiwi/test/helper/DBConnectionChecker.java b/libraries/kiwi/kiwi-triplestore/src/test/java/org/apache/marmotta/kiwi/test/helper/DBConnectionChecker.java
index 6b429f4..bce19b6 100644
--- a/libraries/kiwi/kiwi-triplestore/src/test/java/org/apache/marmotta/kiwi/test/helper/DBConnectionChecker.java
+++ b/libraries/kiwi/kiwi-triplestore/src/test/java/org/apache/marmotta/kiwi/test/helper/DBConnectionChecker.java
@@ -1,13 +1,12 @@
-/**
- * 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
+/*
+ * 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
+ *      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,
@@ -17,33 +16,84 @@
  */
 package org.apache.marmotta.kiwi.test.helper;
 
-import org.apache.marmotta.kiwi.persistence.KiWiDialect;
-import org.junit.Assume;
-
 import java.sql.Connection;
 import java.sql.DriverManager;
 import java.sql.SQLException;
 
+import org.apache.marmotta.kiwi.config.KiWiConfiguration;
+import org.apache.marmotta.kiwi.persistence.KiWiDialect;
+import org.junit.Assume;
+import org.junit.internal.AssumptionViolatedException;
+
 public class DBConnectionChecker {
 
-	private DBConnectionChecker() {
-		// static only
-	}
-	
-	public static void checkDatabaseAvailability(String jdbcUrl, String jdbcUser,
-			String jdbcPass, KiWiDialect dialect) {
-		try {
-	    	Class.forName(dialect.getDriverClass());
-			Connection conn = DriverManager.getConnection(jdbcUrl, jdbcUser, jdbcPass);
+    private DBConnectionChecker() {
+        // static only
+    }
+
+    /**
+     * Check availability of the Database.
+     * @param jdbcUrl - the jdbcURL
+     * @param jdbcUser - the user
+     * @param jdbcPass - the password
+     * @param dialect - the {@link KiWiDialect}
+     * @throws AssumptionViolatedException if the database is not available.
+     */
+    public static void checkDatabaseAvailability(String jdbcUrl, String jdbcUser,
+            String jdbcPass, KiWiDialect dialect) throws AssumptionViolatedException {
+        try {
+            Class.forName(dialect.getDriverClass());
+            Connection conn = DriverManager.getConnection(jdbcUrl, jdbcUser, jdbcPass);
             conn.setAutoCommit(false);
-			Assume.assumeTrue("Database not available", conn.isValid(1000));
-			conn.commit();
-			conn.close();
-		} catch (SQLException e) {
-			Assume.assumeNoException("Database not available", e);
-		} catch (ClassNotFoundException e) {
-			Assume.assumeNoException("Missing DB driver", e);
-		}
-	}
+            Assume.assumeTrue("Database not available", conn.isValid(1000));
+            conn.commit();
+            conn.close();
+        } catch (SQLException e) {
+            Assume.assumeNoException("Database not available", e);
+        } catch (ClassNotFoundException e) {
+            Assume.assumeNoException("Missing DB driver", e);
+        }
+    }
+
+    /**
+     * Check availability of the Database.
+     * @param config the {@link KiWiConfiguration} to test
+     * @throws AssumptionViolatedException if the database is not available.
+     */
+    public static void checkDatabaseAvailability(KiWiConfiguration config) throws AssumptionViolatedException {
+        checkDatabaseAvailability(config.getJdbcUrl(), config.getDbUser(), config.getDbPassword(), config.getDialect());
+    }
+
+    /**
+     * Check the availability of the Database.
+     * @param jdbcUrl - the jdbcURL
+     * @param jdbcUser - the user
+     * @param jdbcPass - the password
+     * @param dialect - the {@link KiWiDialect}
+     * @return {@code true} if the database is available, {@code false} if not
+     */
+    public static boolean isDatabaseAvailable(String jdbcUrl, String jdbcUser,
+            String jdbcPass, KiWiDialect dialect) {
+        try {
+            checkDatabaseAvailability(jdbcUrl, jdbcUser, jdbcPass, dialect);
+            return true;
+        } catch (AssumptionViolatedException ave) {
+            return false;
+        }
+    }
+
+    /**
+     * Check availability of the Database.
+     * @param config the {@link KiWiConfiguration} to test
+     * @return {@code true} if the database is available, {@code false} if not
+     */
+    public static boolean isDatabaseAvailable(KiWiConfiguration config) {
+        try {
+            checkDatabaseAvailability(config);
+            return true;
+        } catch (AssumptionViolatedException ave) {
+            return false;
+        }
+    }
 
 }

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/kiwi/kiwi-triplestore/src/test/java/org/apache/marmotta/kiwi/test/junit/DatabaseRunnerTest1.java
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-triplestore/src/test/java/org/apache/marmotta/kiwi/test/junit/DatabaseRunnerTest1.java b/libraries/kiwi/kiwi-triplestore/src/test/java/org/apache/marmotta/kiwi/test/junit/DatabaseRunnerTest1.java
new file mode 100644
index 0000000..cee043e
--- /dev/null
+++ b/libraries/kiwi/kiwi-triplestore/src/test/java/org/apache/marmotta/kiwi/test/junit/DatabaseRunnerTest1.java
@@ -0,0 +1,82 @@
+/*
+ * 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.kiwi.test.junit;
+
+import static org.hamcrest.CoreMatchers.instanceOf;
+import static org.hamcrest.CoreMatchers.not;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertThat;
+
+import org.apache.marmotta.kiwi.config.KiWiConfiguration;
+import org.apache.marmotta.kiwi.persistence.h2.H2Dialect;
+import org.apache.marmotta.kiwi.persistence.mysql.MySQLDialect;
+import org.apache.marmotta.kiwi.persistence.pgsql.PostgreSQLDialect;
+import org.apache.marmotta.kiwi.test.junit.KiWiDatabaseRunner.ForDialects;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+@RunWith(KiWiDatabaseRunner.class)
+public class DatabaseRunnerTest1 {
+
+    private final KiWiConfiguration dbConfig;
+
+    public DatabaseRunnerTest1(KiWiConfiguration dbConfig) {
+        this.dbConfig = dbConfig;
+    }
+    
+    @Test
+    public void testDatabase() {
+        assertNotNull(dbConfig);
+    }
+
+    @Test
+    @ForDialects(H2Dialect.class)
+    public void testOnlyH2() {
+        assertThat(dbConfig.getDialect(), instanceOf(H2Dialect.class));
+    }
+    
+    @Test
+    @ForDialects(PostgreSQLDialect.class)
+    public void testOnlyPostgreSQL() {
+        assertThat(dbConfig.getDialect(), instanceOf(PostgreSQLDialect.class));
+    }
+
+    @Test
+    @ForDialects(MySQLDialect.class)
+    public void testOnlyMySQL() {
+        assertThat(dbConfig.getDialect(), instanceOf(MySQLDialect.class));
+    }
+
+    @Test
+    @ForDialects({PostgreSQLDialect.class, MySQLDialect.class})
+    public void testNotH2() {
+        assertThat(dbConfig.getDialect(), not(instanceOf(H2Dialect.class)));
+    }
+    
+    @Test
+    @ForDialects({H2Dialect.class, MySQLDialect.class})
+    public void testNotPostgreSQL() {
+        assertThat(dbConfig.getDialect(), not(instanceOf(PostgreSQLDialect.class)));
+    }
+
+    @Test
+    @ForDialects({PostgreSQLDialect.class, H2Dialect.class})
+    public void testNotMySQL() {
+        assertThat(dbConfig.getDialect(), not(instanceOf(MySQLDialect.class)));
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/kiwi/kiwi-triplestore/src/test/java/org/apache/marmotta/kiwi/test/junit/DatabaseRunnerTest2.java
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-triplestore/src/test/java/org/apache/marmotta/kiwi/test/junit/DatabaseRunnerTest2.java b/libraries/kiwi/kiwi-triplestore/src/test/java/org/apache/marmotta/kiwi/test/junit/DatabaseRunnerTest2.java
new file mode 100644
index 0000000..d903698
--- /dev/null
+++ b/libraries/kiwi/kiwi-triplestore/src/test/java/org/apache/marmotta/kiwi/test/junit/DatabaseRunnerTest2.java
@@ -0,0 +1,79 @@
+/*
+ * 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.kiwi.test.junit;
+
+import static org.hamcrest.CoreMatchers.instanceOf;
+import static org.hamcrest.CoreMatchers.not;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertThat;
+
+import org.apache.marmotta.kiwi.config.KiWiConfiguration;
+import org.apache.marmotta.kiwi.persistence.h2.H2Dialect;
+import org.apache.marmotta.kiwi.persistence.mysql.MySQLDialect;
+import org.apache.marmotta.kiwi.persistence.pgsql.PostgreSQLDialect;
+import org.apache.marmotta.kiwi.test.junit.KiWiDatabaseRunner.ForDialects;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+@RunWith(KiWiDatabaseRunner.class)
+public class DatabaseRunnerTest2 {
+
+    @KiWiDatabaseRunner.KiWiConfig
+    public KiWiConfiguration dbConfig;
+    
+    @Test
+    public void testDatabase() {
+        assertNotNull(dbConfig);
+    }
+
+    @Test
+    @ForDialects(H2Dialect.class)
+    public void testOnlyH2() {
+        assertThat(dbConfig.getDialect(), instanceOf(H2Dialect.class));
+    }
+    
+    @Test
+    @ForDialects(PostgreSQLDialect.class)
+    public void testOnlyPostgreSQL() {
+        assertThat(dbConfig.getDialect(), instanceOf(PostgreSQLDialect.class));
+    }
+
+    @Test
+    @ForDialects(MySQLDialect.class)
+    public void testOnlyMySQL() {
+        assertThat(dbConfig.getDialect(), instanceOf(MySQLDialect.class));
+    }
+
+    @Test
+    @ForDialects({PostgreSQLDialect.class, MySQLDialect.class})
+    public void testNotH2() {
+        assertThat(dbConfig.getDialect(), not(instanceOf(H2Dialect.class)));
+    }
+    
+    @Test
+    @ForDialects({H2Dialect.class, MySQLDialect.class})
+    public void testNotPostgreSQL() {
+        assertThat(dbConfig.getDialect(), not(instanceOf(PostgreSQLDialect.class)));
+    }
+
+    @Test
+    @ForDialects({PostgreSQLDialect.class, H2Dialect.class})
+    public void testNotMySQL() {
+        assertThat(dbConfig.getDialect(), not(instanceOf(MySQLDialect.class)));
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/kiwi/kiwi-triplestore/src/test/java/org/apache/marmotta/kiwi/test/junit/KiWiDatabaseRunner.java
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-triplestore/src/test/java/org/apache/marmotta/kiwi/test/junit/KiWiDatabaseRunner.java b/libraries/kiwi/kiwi-triplestore/src/test/java/org/apache/marmotta/kiwi/test/junit/KiWiDatabaseRunner.java
new file mode 100644
index 0000000..170fdba
--- /dev/null
+++ b/libraries/kiwi/kiwi-triplestore/src/test/java/org/apache/marmotta/kiwi/test/junit/KiWiDatabaseRunner.java
@@ -0,0 +1,340 @@
+/*
+ * 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.kiwi.test.junit;
+
+import java.lang.annotation.Annotation;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.LinkedList;
+import java.util.List;
+
+import org.apache.commons.lang3.ArrayUtils;
+import org.apache.marmotta.kiwi.config.KiWiConfiguration;
+import org.apache.marmotta.kiwi.persistence.KiWiDialect;
+import org.apache.marmotta.kiwi.persistence.h2.H2Dialect;
+import org.apache.marmotta.kiwi.persistence.mysql.MySQLDialect;
+import org.apache.marmotta.kiwi.persistence.pgsql.PostgreSQLDialect;
+import org.apache.marmotta.kiwi.test.helper.DBConnectionChecker;
+import org.junit.internal.AssumptionViolatedException;
+import org.junit.rules.MethodRule;
+import org.junit.rules.TestWatcher;
+import org.junit.runner.Runner;
+import org.junit.runner.notification.RunNotifier;
+import org.junit.runners.BlockJUnit4ClassRunner;
+import org.junit.runners.Parameterized;
+import org.junit.runners.Suite;
+import org.junit.runners.model.FrameworkField;
+import org.junit.runners.model.FrameworkMethod;
+import org.junit.runners.model.InitializationError;
+import org.junit.runners.model.Statement;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Specialized {@link Parameterized} runner for UnitTests that injects the database config for KiWi.
+ * <p>
+ * Except for in-memory databases like H2 or Derby, database URLs must be passed as
+ * system property, or otherwise the test is skipped for this database. Available system properties:
+ * <ul>
+ *     <li>PostgreSQL:
+ *     <ul>
+ *         <li>postgresql.url, e.g. jdbc:postgresql://localhost:5433/kiwitest?prepareThreshold=3</li>
+ *         <li>postgresql.user (default: kiwi)</li>
+ *         <li>postgresql.pass (default: kiwi)</li>
+ *     </ul>
+ *     </li>
+ *     <li>MySQL:
+ *     <ul>
+ *         <li>mysql.url, e.g. jdbc:mysql://localhost:3306/kiwitest?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull</li>
+ *         <li>mysql.user (default: kiwi)</li>
+ *         <li>mysql.pass (default: kiwi)</li>
+ *     </ul>
+ *     </li>
+ *     <li>H2:
+ *     <ul>
+ *         <li>h2.url, e.g. jdbc:h2:mem:kiwitest;MVCC=true;DB_CLOSE_ON_EXIT=TRUE</li>
+ *         <li>h2.user (default: kiwi)</li>
+ *         <li>h2.pass (default: kiwi)</li>
+ *     </ul>
+ *     </li>
+ * </ul>
+ * @author Jakob Frank <ja...@apache.org>
+ *
+ */
+public class KiWiDatabaseRunner extends Suite {
+
+    /**
+     * Assign the {@link KiWiConfiguration} to all member fields with {@link KiWiConfig}-Annotation.
+     * If this annotation is used, the class must only have the default constructor.
+     */
+    @Retention(RetentionPolicy.RUNTIME)
+    @Target(ElementType.FIELD)
+    public static @interface KiWiConfig {     
+    }
+    
+    /**
+     * Only execute with {@link KiWiConfiguration}s for these {@link KiWiDialect}s.
+     */
+    @Retention(RetentionPolicy.RUNTIME)
+    @Target({ElementType.TYPE, ElementType.METHOD})
+    public static @interface ForDialects {
+        Class<? extends KiWiDialect>[] value();
+    }
+    
+    private final ArrayList<Runner> runners = new ArrayList<Runner>();
+    
+    private final List<Class<? extends KiWiDialect>> forDialects;
+    
+    public KiWiDatabaseRunner(Class<?> klass) throws Throwable {
+        super(klass, Collections.<Runner>emptyList());
+        
+        ForDialects d = klass.getAnnotation(ForDialects.class);
+        if (d != null) {
+            ArrayList<Class<? extends KiWiDialect>> forDialects = new ArrayList<>();
+            for (Class<? extends KiWiDialect> dialect : d.value()) {
+                forDialects.add(dialect);
+            }
+            this.forDialects = Collections.unmodifiableList(forDialects);
+        } else {
+            forDialects = null;
+        }
+        
+        createRunners();
+    }
+
+    private void createRunners() throws InitializationError {
+        List<KiWiConfiguration> configs = new ArrayList<>();
+        createKiWiConfig("H2", new H2Dialect(), configs);
+        createKiWiConfig("PostgreSQL", new PostgreSQLDialect(), configs);
+        createKiWiConfig("MySQL", new MySQLDialect(), configs);
+
+        for (KiWiConfiguration config : configs) {
+            final DatabaseTestClassRunner runner = new DatabaseTestClassRunner(getTestClass().getJavaClass(), config);
+            runners.add(runner);
+        }
+    }
+
+    private void createKiWiConfig(String database, KiWiDialect dialect, List<KiWiConfiguration> configs) {
+        if (forDialects != null && !forDialects.contains(dialect.getClass())) {
+            return;
+        }
+        KiWiConfiguration c = createKiWiConfig(database, dialect);
+        if (c!=null) configs.add(c);
+    }
+    
+    public static KiWiConfiguration createKiWiConfig(String database, KiWiDialect dialect) {
+        final KiWiConfiguration config;
+        if(!(dialect instanceof H2Dialect) && System.getProperty(database.toLowerCase()+".url") != null) {
+            config = new KiWiConfiguration(
+                    database,
+                    System.getProperty(database.toLowerCase()+".url"),
+                    System.getProperty(database.toLowerCase()+".user","kiwi"),
+                    System.getProperty(database.toLowerCase()+".pass","kiwi"),
+                    dialect);
+        } else if (dialect instanceof H2Dialect) {
+            config = new KiWiConfiguration(
+                    "default-H2", 
+                    "jdbc:h2:mem:kiwitest;MVCC=true;DB_CLOSE_ON_EXIT=TRUE;DB_CLOSE_DELAY=-1",
+                    "kiwi", "kiwi", 
+                    dialect);
+        } else {
+            return null;
+        }
+        config.setDefaultContext("http://localhost/context/default");
+        config.setInferredContext("http://localhost/context/inferred");
+        return config;
+    }
+
+    @Override
+    protected List<Runner> getChildren() {
+        return runners;
+    }
+    
+    private class DatabaseTestClassRunner extends BlockJUnit4ClassRunner {
+
+        private final KiWiConfiguration config;
+        
+        private final Logger logger;
+
+        private final CheckDBRule checkDB;
+        private final ExecutionLogger loggerRule;
+
+        public DatabaseTestClassRunner(Class<?> klass, KiWiConfiguration config)
+                throws InitializationError {
+            super(klass);
+            logger = LoggerFactory.getLogger(klass);
+            this.config = config;
+            
+            checkDB = new CheckDBRule(config);
+            loggerRule = new ExecutionLogger();
+        }
+        
+        @Override
+        protected void runChild(FrameworkMethod method, RunNotifier notifier) {
+            final ForDialects forD = method.getAnnotation(ForDialects.class);
+            if (forD != null) {
+                if (ArrayUtils.contains(forD.value(), config.getDialect().getClass())) {
+                    super.runChild(method, notifier);
+                } else {
+                    notifier.fireTestIgnored(describeChild(method));
+                }
+            } else {
+                super.runChild(method, notifier);
+            }
+
+        }
+        
+        @Override
+        protected Object createTest() throws Exception {
+            if (fieldAnnotated()) {
+                Object testInstance = getTestClass().getOnlyConstructor().newInstance();
+                List<FrameworkField> configFields = getFieldsAnnotatedByKiWiConfig();
+                for (FrameworkField field : configFields) {
+                    try {
+                        field.getField().set(testInstance, config);
+                    } catch (IllegalArgumentException iae) {
+                        throw new Exception(getTestClass().getName() + ": Trying to set " + field.getName() + " that has a wrong type.");
+                    }
+                }
+                return testInstance;
+            }
+            return getTestClass().getOnlyConstructor().newInstance(config);
+        }
+        
+        @Override
+        protected List<MethodRule> rules(Object target) {
+            LinkedList<MethodRule> rules = new LinkedList<>();
+            rules.add(loggerRule);
+            rules.addAll(super.rules(target));
+            rules.add(checkDB);
+            return rules;
+        }
+        
+        @Override
+        protected String getName() {
+            return "KiWi-Triplestore - " + config.getName();
+        }
+        
+        @Override
+        protected String testName(FrameworkMethod method) {
+            return method.getName() + "(" + config.getName() + ")";
+        }
+        
+        @Override
+        protected void validateConstructor(List<Throwable> errors) {
+            validateOnlyOneConstructor(errors);
+            if (fieldAnnotated()) {
+                validateZeroArgConstructor(errors);
+            }
+        }
+        
+        @Override
+        protected void validateFields(List<Throwable> errors) {
+            super.validateFields(errors);
+            if (fieldAnnotated()) {
+                List<FrameworkField> configFields = getFieldsAnnotatedByKiWiConfig();
+                for (FrameworkField field : configFields) {
+                    if (!field.getType().isAssignableFrom(KiWiConfiguration.class)) {
+                        errors.add(new Exception(String.format("Invalid type %s for field %s, must be %s", field.getType().getName(), field.getName(), KiWiConfiguration.class.getSimpleName())));
+                    }
+                }
+            }
+        }
+        
+        @Override
+        protected Statement classBlock(RunNotifier notifier) {
+            return childrenInvoker(notifier);
+        }
+
+        @Override
+        protected Annotation[] getRunnerAnnotations() {
+            return new Annotation[0];
+        }
+        
+        private class CheckDBRule implements MethodRule {
+
+            private final AssumptionViolatedException assume;
+
+            public CheckDBRule(KiWiConfiguration dbConfig) {
+                AssumptionViolatedException ex = null;
+                try {
+                    DBConnectionChecker.checkDatabaseAvailability(dbConfig);
+                } catch (AssumptionViolatedException ave) {
+                    ex = ave;
+                }
+                this.assume = ex;
+            }
+            
+            @Override
+            public Statement apply(final Statement base, final FrameworkMethod method,
+                    Object target) {
+                return new Statement() {
+                    @Override
+                    public void evaluate() throws Throwable {
+                        if (assume != null) {
+                            logger.info("{} skipped because database is not available", testName(method));
+                            throw assume;
+                        }
+                        base.evaluate();
+                    }
+                };
+            }
+            
+        }
+        
+        private class ExecutionLogger extends TestWatcher implements MethodRule {
+
+
+            @Override
+            public Statement apply(final Statement base, final FrameworkMethod method,
+                    Object target) {
+                return new Statement() {
+                    @Override
+                    public void evaluate() throws Throwable {
+                        logger.info("{} starting...", testName(method));
+                        try {
+                            base.evaluate();
+                            logger.debug("{} SUCCESS", testName(method));
+                        } catch (AssumptionViolatedException e) {
+                            logger.info("{} Ignored: {}", testName(method), e.getMessage());
+                            throw e;
+                        } catch (Throwable t) {
+                            logger.warn("{} FAILED: {}", testName(method), t.getMessage());
+                            throw t;
+                        }
+                    }
+                };
+            }
+            
+        }
+        
+    }
+    
+    private boolean fieldAnnotated() {
+        return !getFieldsAnnotatedByKiWiConfig().isEmpty();
+    }
+
+    private List<FrameworkField> getFieldsAnnotatedByKiWiConfig() {
+        return getTestClass().getAnnotatedFields(KiWiConfig.class);
+    }
+    
+    
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/kiwi/kiwi-triplestore/src/test/java/org/apache/marmotta/kiwi/test/sesame/KiWiLocaleTest.java
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-triplestore/src/test/java/org/apache/marmotta/kiwi/test/sesame/KiWiLocaleTest.java b/libraries/kiwi/kiwi-triplestore/src/test/java/org/apache/marmotta/kiwi/test/sesame/KiWiLocaleTest.java
new file mode 100644
index 0000000..7815127
--- /dev/null
+++ b/libraries/kiwi/kiwi-triplestore/src/test/java/org/apache/marmotta/kiwi/test/sesame/KiWiLocaleTest.java
@@ -0,0 +1,113 @@
+/*
+ * 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.kiwi.test.sesame;
+
+import org.apache.marmotta.kiwi.config.KiWiConfiguration;
+import org.apache.marmotta.kiwi.sail.KiWiStore;
+import org.apache.marmotta.kiwi.sail.KiWiValueFactory;
+import org.apache.marmotta.kiwi.test.junit.KiWiDatabaseRunner;
+import org.junit.After;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.openrdf.model.Literal;
+import org.openrdf.sail.SailConnection;
+import org.openrdf.sail.SailException;
+
+import java.sql.SQLException;
+
+/**
+ * Tests for testing locales against the KiWi Triple store 
+ * (and its implementation of the ValueFactory)
+ * 
+ * @author Sergio Fernández <wi...@apache.org>
+ */
+@RunWith(KiWiDatabaseRunner.class)
+public class KiWiLocaleTest  {
+
+    private final KiWiConfiguration kiwiConfig;
+    private KiWiStore store;
+    private KiWiValueFactory vf;
+    
+    public KiWiLocaleTest(KiWiConfiguration kiwiConfig) {
+        this.kiwiConfig = kiwiConfig;
+    }
+    
+    @Before
+    public void initialize() throws SailException {
+    	store = new KiWiStore(kiwiConfig);
+    	store.initialize();
+    	vf = new KiWiValueFactory(store, "http://example.org");
+    }
+    
+    @After
+    public void shutdown() throws SailException, SQLException {
+        store.getPersistence().dropDatabase();
+    	store.shutDown();
+    	store = null;
+    	vf = null;
+    }
+    
+    /** 
+     * Tests creating BCP47 literals (see MARMOTTA-115 for further details)
+     */
+    @Test
+    public void createBCP47LiteralsTests() {
+    	Literal enLiteral = vf.createLiteral("Hungary", "en");
+    	Assert.assertEquals("Hungary", enLiteral.getLabel());
+    	Assert.assertEquals("en", enLiteral.getLanguage());
+    	Literal warLiteral = vf.createLiteral("Hungary", "war");
+    	Assert.assertEquals("Hungary", warLiteral.getLabel());
+    	Assert.assertEquals("war", warLiteral.getLanguage());
+    }
+
+    /** 
+     * Tests creating invalid BCP47 literals (see MARMOTTA-115 for further details)
+     */
+    @Test
+    public void createBCP47LiteralsInvalidTests() {
+    	Literal invalidLangLiteral = vf.createLiteral("Hungary", "invalid-bcp47-languagetag");
+    	Assert.assertEquals("Hungary", invalidLangLiteral.getLabel());
+    	Assert.assertNull(invalidLangLiteral.getLanguage());
+    }
+
+//    /** 
+//     * Tests adding BCP47 literals (see MARMOTTA-115 for further details)
+//     */
+//    @Test
+//    public void addBCP47LiteralsTests() throws SailException {
+//    	SailConnection conn = store.getConnection();
+//        try {
+//        	conn.begin();
+//            conn.commit();
+//        } finally {
+//            conn.close();
+//        }
+//    	
+//    }
+//    
+//    /** 
+//     * Tests importing BCP47 literals (see MARMOTTA-115 for further details)
+//     */
+//    @Test
+//    public void importBCP47LiteralsTests() throws SailException {
+//    	SailConnection connection = store.getConnection();
+//    	
+//    }
+
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/kiwi/kiwi-triplestore/src/test/java/org/apache/marmotta/kiwi/test/sesame/KiWiSailConcurrencyTest.java
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-triplestore/src/test/java/org/apache/marmotta/kiwi/test/sesame/KiWiSailConcurrencyTest.java b/libraries/kiwi/kiwi-triplestore/src/test/java/org/apache/marmotta/kiwi/test/sesame/KiWiSailConcurrencyTest.java
new file mode 100644
index 0000000..c5661c7
--- /dev/null
+++ b/libraries/kiwi/kiwi-triplestore/src/test/java/org/apache/marmotta/kiwi/test/sesame/KiWiSailConcurrencyTest.java
@@ -0,0 +1,83 @@
+/*
+ * 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.kiwi.test.sesame;
+
+import org.apache.marmotta.kiwi.config.KiWiConfiguration;
+import org.apache.marmotta.kiwi.sail.KiWiStore;
+import org.apache.marmotta.kiwi.test.junit.KiWiDatabaseRunner;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.openrdf.sail.Sail;
+import org.openrdf.sail.SailConcurrencyTest;
+import org.openrdf.sail.SailException;
+import org.openrdf.sail.helpers.SailWrapper;
+
+import java.sql.SQLException;
+
+import static org.junit.Assert.fail;
+
+/**
+ * Run the Sesame {@link SailConcurrencyTest} suite.
+ * @author Jakob Frank <ja...@apache.org>
+ */
+@RunWith(KiWiDatabaseRunner.class)
+public class KiWiSailConcurrencyTest extends SailConcurrencyTest {
+
+    private final KiWiConfiguration kiwiConfig;
+
+    public KiWiSailConcurrencyTest(KiWiConfiguration kiwiConfig) {
+        super(String.format("%s (%S)", KiWiSailConcurrencyTest.class.getSimpleName(), kiwiConfig.getName()));
+        this.kiwiConfig = kiwiConfig;
+    }
+    
+    @Override
+    protected Sail createSail() throws SailException {
+        Sail store = new SailWrapper(new KiWiStore(kiwiConfig)) {
+            @Override
+            public void shutDown() throws SailException {
+                try {
+                    ((KiWiStore)getBaseSail()).getPersistence().dropDatabase();
+                } catch (SQLException e) {
+                    fail("SQL exception while deleting database");
+                }
+
+                super.shutDown();
+            }
+        };
+        return store;
+    }
+
+    @Override
+    @Before
+    public void setUp() throws Exception {
+        super.setUp();
+    }
+    
+    @Override
+    @After
+    public void tearDown() throws Exception {
+        super.tearDown();
+    }
+    
+    @Override
+    @Test
+    public void testGetContextIDs() throws Exception {
+        super.testGetContextIDs();
+    }
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/kiwi/kiwi-triplestore/src/test/java/org/apache/marmotta/kiwi/test/sesame/KiWiSailInterruptTest.java
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-triplestore/src/test/java/org/apache/marmotta/kiwi/test/sesame/KiWiSailInterruptTest.java b/libraries/kiwi/kiwi-triplestore/src/test/java/org/apache/marmotta/kiwi/test/sesame/KiWiSailInterruptTest.java
new file mode 100644
index 0000000..710f128
--- /dev/null
+++ b/libraries/kiwi/kiwi-triplestore/src/test/java/org/apache/marmotta/kiwi/test/sesame/KiWiSailInterruptTest.java
@@ -0,0 +1,71 @@
+/*
+ * 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.kiwi.test.sesame;
+
+import org.apache.marmotta.kiwi.config.KiWiConfiguration;
+import org.apache.marmotta.kiwi.sail.KiWiStore;
+import org.apache.marmotta.kiwi.test.junit.KiWiDatabaseRunner;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.openrdf.sail.Sail;
+import org.openrdf.sail.SailException;
+import org.openrdf.sail.SailInterruptTest;
+
+/**
+ * Run the Sesame {@link SailInterruptTest} suite.
+ * @author Jakob Frank <ja...@apache.org>
+ *
+ */
+@RunWith(KiWiDatabaseRunner.class)
+public class KiWiSailInterruptTest extends SailInterruptTest {
+
+    private final KiWiConfiguration kiwiConfig;
+
+    public KiWiSailInterruptTest(KiWiConfiguration kiwiConfig) {
+        super(String.format("%s (%S)", KiWiSailInterruptTest.class.getSimpleName(), kiwiConfig.getName()));
+        this.kiwiConfig = kiwiConfig;
+        
+    }
+    
+    
+    
+    @Override
+    protected Sail createSail() throws SailException {
+        KiWiStore store = new KiWiStore(kiwiConfig);
+        return store;
+    }
+    
+    @Override
+    @Before
+    public void setUp() throws Exception {
+        super.setUp();
+    }
+    
+    @Override
+    @After
+    public void tearDown() throws Exception {
+        super.tearDown();
+    }
+    
+    @Override
+    @Test
+    public void testQueryInterrupt() throws Exception {
+        super.testQueryInterrupt();
+    }
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/kiwi/kiwi-triplestore/src/test/java/org/apache/marmotta/kiwi/test/sesame/KiWiStoreTest.java
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-triplestore/src/test/java/org/apache/marmotta/kiwi/test/sesame/KiWiStoreTest.java b/libraries/kiwi/kiwi-triplestore/src/test/java/org/apache/marmotta/kiwi/test/sesame/KiWiStoreTest.java
new file mode 100644
index 0000000..081dae4
--- /dev/null
+++ b/libraries/kiwi/kiwi-triplestore/src/test/java/org/apache/marmotta/kiwi/test/sesame/KiWiStoreTest.java
@@ -0,0 +1,66 @@
+/*
+ * 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.kiwi.test.sesame;
+
+import org.apache.marmotta.kiwi.config.KiWiConfiguration;
+import org.apache.marmotta.kiwi.sail.KiWiStore;
+import org.apache.marmotta.kiwi.test.junit.KiWiDatabaseRunner;
+import org.junit.runner.RunWith;
+import org.openrdf.sail.RDFStoreTest;
+import org.openrdf.sail.Sail;
+import org.openrdf.sail.SailException;
+import org.openrdf.sail.helpers.SailWrapper;
+
+import java.sql.SQLException;
+
+import static org.junit.Assert.fail;
+
+/**
+ * Run the Sesame {@link RDFStoreTest} suite.
+ * @author Jakob Frank <ja...@apache.org>
+ */
+@RunWith(KiWiDatabaseRunner.class)
+public class KiWiStoreTest extends RDFStoreTest {
+
+    private final KiWiConfiguration kiwiConfig;
+    
+    public KiWiStoreTest(KiWiConfiguration kiwiConfig) {
+        this.kiwiConfig = kiwiConfig;
+    }
+    
+    @Override
+    protected Sail createSail() throws SailException {
+        Sail store = new SailWrapper(new KiWiStore(kiwiConfig)) {
+            @Override
+            public void shutDown() throws SailException {
+                try {
+                    ((KiWiStore)getBaseSail()).getPersistence().dropDatabase();
+                } catch (SQLException e) {
+                    fail("SQL exception while deleting database");
+                }
+
+                super.shutDown();
+            }
+        };
+        store.initialize();
+        return store;
+    }
+
+
+
+
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/kiwi/kiwi-triplestore/src/test/java/org/apache/marmotta/kiwi/test/sesame/repository/KiWiRepositoryConnectionTest.java
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-triplestore/src/test/java/org/apache/marmotta/kiwi/test/sesame/repository/KiWiRepositoryConnectionTest.java b/libraries/kiwi/kiwi-triplestore/src/test/java/org/apache/marmotta/kiwi/test/sesame/repository/KiWiRepositoryConnectionTest.java
new file mode 100644
index 0000000..f71f964
--- /dev/null
+++ b/libraries/kiwi/kiwi-triplestore/src/test/java/org/apache/marmotta/kiwi/test/sesame/repository/KiWiRepositoryConnectionTest.java
@@ -0,0 +1,70 @@
+/*
+ * 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.kiwi.test.sesame.repository;
+
+import org.apache.marmotta.kiwi.config.KiWiConfiguration;
+import org.apache.marmotta.kiwi.persistence.h2.H2Dialect;
+import org.apache.marmotta.kiwi.sail.KiWiStore;
+import org.apache.marmotta.kiwi.test.junit.KiWiDatabaseRunner;
+import org.junit.runner.RunWith;
+import org.openrdf.repository.Repository;
+import org.openrdf.repository.RepositoryConnectionTest;
+import org.openrdf.repository.sail.SailRepository;
+import org.openrdf.sail.Sail;
+import org.openrdf.sail.SailException;
+import org.openrdf.sail.helpers.SailWrapper;
+
+import java.sql.SQLException;
+
+import static org.junit.Assert.fail;
+
+/**
+ * Run the {@link RepositoryConnectionTest}s.
+ * @author Jakob Frank <ja...@apache.org>
+ *
+ */
+@RunWith(KiWiDatabaseRunner.class)
+public class KiWiRepositoryConnectionTest extends RepositoryConnectionTest {
+
+    private final KiWiConfiguration config;
+
+    public KiWiRepositoryConnectionTest(KiWiConfiguration config) {
+        this.config = config;
+    }
+    
+    /* (non-Javadoc)
+     * @see org.openrdf.repository.RepositoryConnectionTest#createRepository()
+     */
+    @Override
+    protected Repository createRepository() throws Exception {
+        config.setDefaultContext(null);
+        Sail store = new SailWrapper(new KiWiStore(config)) {
+            @Override
+            public void shutDown() throws SailException {
+                try {
+                    ((KiWiStore)getBaseSail()).getPersistence().dropDatabase();
+                } catch (SQLException e) {
+                    fail("SQL exception while deleting database");
+                }
+
+                super.shutDown();
+            }
+        };
+        return new SailRepository(store);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/kiwi/kiwi-triplestore/src/test/java/org/apache/marmotta/kiwi/test/sesame/repository/KiWiRepositoryTest.java
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-triplestore/src/test/java/org/apache/marmotta/kiwi/test/sesame/repository/KiWiRepositoryTest.java b/libraries/kiwi/kiwi-triplestore/src/test/java/org/apache/marmotta/kiwi/test/sesame/repository/KiWiRepositoryTest.java
new file mode 100644
index 0000000..7291859
--- /dev/null
+++ b/libraries/kiwi/kiwi-triplestore/src/test/java/org/apache/marmotta/kiwi/test/sesame/repository/KiWiRepositoryTest.java
@@ -0,0 +1,66 @@
+/*
+ * 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.kiwi.test.sesame.repository;
+
+import org.apache.marmotta.kiwi.config.KiWiConfiguration;
+import org.apache.marmotta.kiwi.sail.KiWiStore;
+import org.apache.marmotta.kiwi.test.junit.KiWiDatabaseRunner;
+import org.junit.Ignore;
+import org.junit.runner.RunWith;
+import org.openrdf.repository.Repository;
+import org.openrdf.repository.RepositoryTest;
+import org.openrdf.repository.sail.SailRepository;
+import org.openrdf.sail.Sail;
+import org.openrdf.sail.SailException;
+import org.openrdf.sail.helpers.SailWrapper;
+
+import java.sql.SQLException;
+
+import static org.junit.Assert.fail;
+
+/**
+ * Run the {@link RepositoryTest}s.
+ * @author Jakob Frank <ja...@apache.org>
+ *
+ */
+@RunWith(KiWiDatabaseRunner.class)
+public class KiWiRepositoryTest extends RepositoryTest {
+
+    private final KiWiConfiguration config;
+
+    private KiWiStore store;
+
+    public KiWiRepositoryTest(KiWiConfiguration config) {
+        this.config = config;
+    }
+
+    /* (non-Javadoc)
+     * @see org.openrdf.repository.RepositoryTest#createRepository()
+     */
+    @Override
+    protected Repository createRepository() throws Exception {
+        store = new KiWiStore(config);
+        return new SailRepository(store);
+    }
+
+    @Override
+    public void tearDown() throws Exception {
+        store.getPersistence().dropDatabase();
+        super.tearDown();
+    }
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/kiwi/kiwi-tripletable/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-tripletable/pom.xml b/libraries/kiwi/kiwi-tripletable/pom.xml
index 3aa74e9..2c8a49d 100644
--- a/libraries/kiwi/kiwi-tripletable/pom.xml
+++ b/libraries/kiwi/kiwi-tripletable/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>kiwi-parent</artifactId>
-        <version>3.1.0-incubating-SNAPSHOT</version>
+        <version>3.1.0-incubating</version>
     </parent>
 
     <artifactId>kiwi-tripletable</artifactId>
@@ -46,6 +46,42 @@
             <groupId>com.google.guava</groupId>
             <artifactId>guava</artifactId>
         </dependency>
+        <dependency>
+            <groupId>org.apache.marmotta</groupId>
+            <artifactId>marmotta-commons</artifactId>
+        </dependency>
+
+        <dependency>
+            <artifactId>junit</artifactId>
+            <groupId>junit</groupId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <artifactId>hamcrest-core</artifactId>
+            <groupId>org.hamcrest</groupId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <artifactId>hamcrest-library</artifactId>
+            <groupId>org.hamcrest</groupId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>ch.qos.logback</groupId>
+            <artifactId>logback-core</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>ch.qos.logback</groupId>
+            <artifactId>logback-classic</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.commons</groupId>
+            <artifactId>commons-lang3</artifactId>
+            <scope>test</scope>
+        </dependency>
+
 
     </dependencies>
 </project>

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/kiwi/kiwi-tripletable/src/main/java/org/apache/marmotta/kiwi/model/caching/IntArray.java
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-tripletable/src/main/java/org/apache/marmotta/kiwi/model/caching/IntArray.java b/libraries/kiwi/kiwi-tripletable/src/main/java/org/apache/marmotta/kiwi/model/caching/IntArray.java
index f870611..549bddf 100644
--- a/libraries/kiwi/kiwi-tripletable/src/main/java/org/apache/marmotta/kiwi/model/caching/IntArray.java
+++ b/libraries/kiwi/kiwi-tripletable/src/main/java/org/apache/marmotta/kiwi/model/caching/IntArray.java
@@ -44,12 +44,16 @@ public final class IntArray implements Comparable<IntArray> {
 
     public IntArray(int[] data) {
         this.data = data;
+    }
 
-        Hasher hasher = hashFunction.newHasher();
-        for(int i : data) {
-            hasher.putInt(i);
+    private void ensureHashCode() {
+        if(goodHashCode == null) {
+            Hasher hasher = hashFunction.newHasher();
+            for(int i : data) {
+                hasher.putInt(i);
+            }
+            goodHashCode = hasher.hash();
         }
-        goodHashCode = hasher.hash();
     }
 
     public static final IntArray createSPOCKey(Resource subject, URI property, Value object, Resource context){
@@ -72,7 +76,7 @@ public final class IntArray implements Comparable<IntArray> {
 
     }
 
-    public static final IntArray createSPOCMaxKey(Resource subject, URI property, Value object, URI context){
+    public static final IntArray createSPOCMaxKey(Resource subject, URI property, Value object, Resource context){
 
         // the cache key is generated by appending the bytes of the hashcodes of subject, property, object, context and inferred and
         // storing them as a BigInteger; generating the cache key should thus be very efficient
@@ -112,7 +116,7 @@ public final class IntArray implements Comparable<IntArray> {
 
     }
 
-    public static final IntArray createCSPOMaxKey(Resource subject, URI property, Value object, URI context){
+    public static final IntArray createCSPOMaxKey(Resource subject, URI property, Value object, Resource context){
 
         // the cache key is generated by appending the bytes of the hashcodes of subject, property, object, context and inferred and
         // storing them as a BigInteger; generating the cache key should thus be very efficient
@@ -165,6 +169,7 @@ public final class IntArray implements Comparable<IntArray> {
 
     @Override
     public int hashCode() {
+        ensureHashCode();
         return goodHashCode.hashCode();
     }
 }

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/kiwi/kiwi-tripletable/src/main/java/org/apache/marmotta/kiwi/model/caching/TripleTable.java
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-tripletable/src/main/java/org/apache/marmotta/kiwi/model/caching/TripleTable.java b/libraries/kiwi/kiwi-tripletable/src/main/java/org/apache/marmotta/kiwi/model/caching/TripleTable.java
index 8b40ca5..d05b644 100644
--- a/libraries/kiwi/kiwi-tripletable/src/main/java/org/apache/marmotta/kiwi/model/caching/TripleTable.java
+++ b/libraries/kiwi/kiwi-tripletable/src/main/java/org/apache/marmotta/kiwi/model/caching/TripleTable.java
@@ -18,21 +18,16 @@
 package org.apache.marmotta.kiwi.model.caching;
 
 import com.google.common.base.Predicate;
-import com.google.common.collect.Sets;
+import com.google.common.collect.Collections2;
+import org.apache.marmotta.commons.collections.EquivalenceHashSet;
+import org.apache.marmotta.commons.sesame.model.StatementCommons;
 import org.openrdf.model.Resource;
 import org.openrdf.model.Statement;
 import org.openrdf.model.URI;
 import org.openrdf.model.Value;
 
 import java.io.Serializable;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.NavigableMap;
-import java.util.Set;
-import java.util.TreeMap;
+import java.util.*;
 
 /**
  * A triple table that allows efficient in-memory operations over large collections of triples. This can be used as
@@ -61,14 +56,14 @@ public class TripleTable<Triple extends Statement> implements Set<Triple>, Seria
     private NavigableMap<IntArray,Triple> indexCSPO;
 
     public TripleTable() {
-        data = new HashSet<Triple>();
+        data = StatementCommons.newQuadrupleSet();
         indexSPOC = new TreeMap<IntArray, Triple>();
         indexCSPO = new TreeMap<IntArray, Triple>();
     }
 
 
     public TripleTable(Collection<Triple> triples) {
-        data = new HashSet<Triple>(triples.size());
+        data = StatementCommons.newQuadrupleSet();
         indexSPOC = new TreeMap<IntArray, Triple>();
         indexCSPO = new TreeMap<IntArray, Triple>();
         addAll(triples);
@@ -83,7 +78,7 @@ public class TripleTable<Triple extends Statement> implements Set<Triple>, Seria
      * @return the number of elements in this set (its cardinality)
      */
     @Override
-    public int size() {
+    public synchronized int size() {
         return data.size();
     }
 
@@ -93,7 +88,7 @@ public class TripleTable<Triple extends Statement> implements Set<Triple>, Seria
      * @return <tt>true</tt> if this set contains no elements
      */
     @Override
-    public boolean isEmpty() {
+    public synchronized boolean isEmpty() {
         return data.isEmpty();
     }
 
@@ -111,7 +106,7 @@ public class TripleTable<Triple extends Statement> implements Set<Triple>, Seria
      *         set does not permit null elements (optional)
      */
     @Override
-    public boolean contains(Object o) {
+    public synchronized boolean contains(Object o) {
         return data.contains(o);
     }
 
@@ -144,7 +139,7 @@ public class TripleTable<Triple extends Statement> implements Set<Triple>, Seria
      * @return an array containing all the elements in this set
      */
     @Override
-    public Object[] toArray() {
+    public synchronized Object[] toArray() {
         return data.toArray();
     }
 
@@ -191,7 +186,7 @@ public class TripleTable<Triple extends Statement> implements Set<Triple>, Seria
      * @throws NullPointerException if the specified array is null
      */
     @Override
-    public <T> T[] toArray(T[] a) {
+    public synchronized <T> T[] toArray(T[] a) {
         return data.toArray(a);
     }
 
@@ -226,7 +221,7 @@ public class TripleTable<Triple extends Statement> implements Set<Triple>, Seria
      *         prevents it from being added to this set
      */
     @Override
-    public boolean add(Triple triple) {
+    public synchronized boolean add(Triple triple) {
         indexSPOC.put(IntArray.createSPOCKey(triple.getSubject(), triple.getPredicate(), triple.getObject(), triple.getContext()),triple);
         indexCSPO.put(IntArray.createCSPOKey(triple.getSubject(), triple.getPredicate(), triple.getObject(), triple.getContext()),triple);
         return data.add(triple);
@@ -252,7 +247,7 @@ public class TripleTable<Triple extends Statement> implements Set<Triple>, Seria
      *         is not supported by this set
      */
     @Override
-    public boolean remove(Object o) {
+    public synchronized boolean remove(Object o) {
         if(o instanceof Statement) {
             Statement triple = (Statement)o;
             indexSPOC.remove(IntArray.createSPOCKey(triple.getSubject(), triple.getPredicate(), triple.getObject(), triple.getContext()));
@@ -278,7 +273,7 @@ public class TripleTable<Triple extends Statement> implements Set<Triple>, Seria
      * @see    #contains(Object)
      */
     @Override
-    public boolean containsAll(Collection<?> c) {
+    public synchronized boolean containsAll(Collection<?> c) {
         return data.containsAll(c);
     }
 
@@ -305,7 +300,7 @@ public class TripleTable<Triple extends Statement> implements Set<Triple>, Seria
      * @see #add(Object)
      */
     @Override
-    public boolean addAll(Collection<? extends Triple> c) {
+    public synchronized boolean addAll(Collection<? extends Triple> c) {
         boolean modified = false;
         for(Triple t : c) {
             modified = add(t) || modified;
@@ -333,7 +328,7 @@ public class TripleTable<Triple extends Statement> implements Set<Triple>, Seria
      * @see #remove(Object)
      */
     @Override
-    public boolean retainAll(Collection<?> c) {
+    public synchronized boolean retainAll(Collection<?> c) {
         Iterator<Map.Entry<IntArray,Triple>> it = indexSPOC.entrySet().iterator();
         while(it.hasNext()) {
             if(!c.contains(it.next().getValue())) {
@@ -369,7 +364,7 @@ public class TripleTable<Triple extends Statement> implements Set<Triple>, Seria
      * @see #contains(Object)
      */
     @Override
-    public boolean removeAll(Collection<?> c) {
+    public synchronized boolean removeAll(Collection<?> c) {
         boolean modified = false;
         for(Object o : c) {
             modified = remove(o) || modified;
@@ -385,7 +380,7 @@ public class TripleTable<Triple extends Statement> implements Set<Triple>, Seria
      *         is not supported by this set
      */
     @Override
-    public void clear() {
+    public synchronized void clear() {
         data.clear();
         indexSPOC.clear();
         indexCSPO.clear();
@@ -394,13 +389,15 @@ public class TripleTable<Triple extends Statement> implements Set<Triple>, Seria
     /**
      * Return a subset of the triples matching the filter criteria. Arguments with null value are treated as wildcards.
      *
+     *
      * @param subject
      * @param property
      * @param object
      * @param context
+     * @param wildcardContext
      * @return
      */
-    public Collection<Triple> listTriples(final Resource subject, final URI property, final Value object, final URI context) {
+    public synchronized Collection<Triple> listTriples(final Resource subject, final URI property, final Value object, final Resource context, boolean wildcardContext) {
         // in special cases we can make use of the index
         if(subject != null && property != null && object != null && context != null) {
             IntArray key = IntArray.createSPOCKey(subject, property, object, context);
@@ -410,9 +407,10 @@ public class TripleTable<Triple extends Statement> implements Set<Triple>, Seria
             } else {
                 return Collections.emptyList();
             }
-        } else if(  (subject != null && property != null && object != null)
+        } else if(wildcardContext &&
+                (  (subject != null && property != null && object != null)
                  || (subject != null && property != null)
-                 || subject != null) {
+                 || subject != null)) {
             IntArray fromKey = IntArray.createSPOCKey(subject, property, object, context);
             IntArray toKey   = IntArray.createSPOCMaxKey(subject, property, object, context);
 
@@ -446,13 +444,20 @@ public class TripleTable<Triple extends Statement> implements Set<Triple>, Seria
                 }
             };
 
-            return Sets.filter(data, p);
+            return Collections2.filter(data, p);
         }
     }
 
+    public synchronized Collection<Resource> listContextIDs() {
+        Set<Resource> result = new HashSet<>();
+        for(Triple t : data) {
+            result.add(t.getContext());
+        }
+        return result;
+    }
 
     @Override
-    public boolean equals(Object o) {
+    public synchronized boolean equals(Object o) {
         if (this == o) return true;
         if (o == null || getClass() != o.getClass()) return false;
 
@@ -465,7 +470,9 @@ public class TripleTable<Triple extends Statement> implements Set<Triple>, Seria
     }
 
     @Override
-    public int hashCode() {
+    public synchronized int hashCode() {
         return data.hashCode();
     }
+
+
 }


[026/100] [abbrv] [partial] Reverting the erroneous merge by Sebastian according to the instructions in INFRA-6876

Posted by wi...@apache.org.
http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/extras/webjars/snorql/src/main/resources/scriptaculous/effects.js
----------------------------------------------------------------------
diff --git a/extras/webjars/snorql/src/main/resources/scriptaculous/effects.js b/extras/webjars/snorql/src/main/resources/scriptaculous/effects.js
new file mode 100755
index 0000000..113aff6
--- /dev/null
+++ b/extras/webjars/snorql/src/main/resources/scriptaculous/effects.js
@@ -0,0 +1,1130 @@
+/*
+ * 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.
+ */
+// script.aculo.us effects.js v1.8.1, Thu Jan 03 22:07:12 -0500 2008
+
+// converts rgb() and #xxx to #xxxxxx format,
+// returns self (or first argument) if not convertable  
+String.prototype.parseColor = function() {  
+  var color = '#';
+  if (this.slice(0,4) == 'rgb(') {  
+    var cols = this.slice(4,this.length-1).split(',');  
+    var i=0; do { color += parseInt(cols[i]).toColorPart() } while (++i<3);  
+  } else {  
+    if (this.slice(0,1) == '#') {  
+      if (this.length==4) for(var i=1;i<4;i++) color += (this.charAt(i) + this.charAt(i)).toLowerCase();  
+      if (this.length==7) color = this.toLowerCase();  
+    }  
+  }  
+  return (color.length==7 ? color : (arguments[0] || this));  
+};
+
+/*--------------------------------------------------------------------------*/
+
+Element.collectTextNodes = function(element) {  
+  return $A($(element).childNodes).collect( function(node) {
+    return (node.nodeType==3 ? node.nodeValue : 
+      (node.hasChildNodes() ? Element.collectTextNodes(node) : ''));
+  }).flatten().join('');
+};
+
+Element.collectTextNodesIgnoreClass = function(element, className) {  
+  return $A($(element).childNodes).collect( function(node) {
+    return (node.nodeType==3 ? node.nodeValue : 
+      ((node.hasChildNodes() && !Element.hasClassName(node,className)) ? 
+        Element.collectTextNodesIgnoreClass(node, className) : ''));
+  }).flatten().join('');
+};
+
+Element.setContentZoom = function(element, percent) {
+  element = $(element);  
+  element.setStyle({fontSize: (percent/100) + 'em'});   
+  if (Prototype.Browser.WebKit) window.scrollBy(0,0);
+  return element;
+};
+
+Element.getInlineOpacity = function(element){
+  return $(element).style.opacity || '';
+};
+
+Element.forceRerendering = function(element) {
+  try {
+    element = $(element);
+    var n = document.createTextNode(' ');
+    element.appendChild(n);
+    element.removeChild(n);
+  } catch(e) { }
+};
+
+/*--------------------------------------------------------------------------*/
+
+var Effect = {
+  _elementDoesNotExistError: {
+    name: 'ElementDoesNotExistError',
+    message: 'The specified DOM element does not exist, but is required for this effect to operate'
+  },
+  Transitions: {
+    linear: Prototype.K,
+    sinoidal: function(pos) {
+      return (-Math.cos(pos*Math.PI)/2) + 0.5;
+    },
+    reverse: function(pos) {
+      return 1-pos;
+    },
+    flicker: function(pos) {
+      var pos = ((-Math.cos(pos*Math.PI)/4) + 0.75) + Math.random()/4;
+      return pos > 1 ? 1 : pos;
+    },
+    wobble: function(pos) {
+      return (-Math.cos(pos*Math.PI*(9*pos))/2) + 0.5;
+    },
+    pulse: function(pos, pulses) { 
+      pulses = pulses || 5; 
+      return (
+        ((pos % (1/pulses)) * pulses).round() == 0 ? 
+              ((pos * pulses * 2) - (pos * pulses * 2).floor()) : 
+          1 - ((pos * pulses * 2) - (pos * pulses * 2).floor())
+        );
+    },
+    spring: function(pos) { 
+      return 1 - (Math.cos(pos * 4.5 * Math.PI) * Math.exp(-pos * 6)); 
+    },
+    none: function(pos) {
+      return 0;
+    },
+    full: function(pos) {
+      return 1;
+    }
+  },
+  DefaultOptions: {
+    duration:   1.0,   // seconds
+    fps:        100,   // 100= assume 66fps max.
+    sync:       false, // true for combining
+    from:       0.0,
+    to:         1.0,
+    delay:      0.0,
+    queue:      'parallel'
+  },
+  tagifyText: function(element) {
+    var tagifyStyle = 'position:relative';
+    if (Prototype.Browser.IE) tagifyStyle += ';zoom:1';
+    
+    element = $(element);
+    $A(element.childNodes).each( function(child) {
+      if (child.nodeType==3) {
+        child.nodeValue.toArray().each( function(character) {
+          element.insertBefore(
+            new Element('span', {style: tagifyStyle}).update(
+              character == ' ' ? String.fromCharCode(160) : character), 
+              child);
+        });
+        Element.remove(child);
+      }
+    });
+  },
+  multiple: function(element, effect) {
+    var elements;
+    if (((typeof element == 'object') || 
+        Object.isFunction(element)) && 
+       (element.length))
+      elements = element;
+    else
+      elements = $(element).childNodes;
+      
+    var options = Object.extend({
+      speed: 0.1,
+      delay: 0.0
+    }, arguments[2] || { });
+    var masterDelay = options.delay;
+
+    $A(elements).each( function(element, index) {
+      new effect(element, Object.extend(options, { delay: index * options.speed + masterDelay }));
+    });
+  },
+  PAIRS: {
+    'slide':  ['SlideDown','SlideUp'],
+    'blind':  ['BlindDown','BlindUp'],
+    'appear': ['Appear','Fade']
+  },
+  toggle: function(element, effect) {
+    element = $(element);
+    effect = (effect || 'appear').toLowerCase();
+    var options = Object.extend({
+      queue: { position:'end', scope:(element.id || 'global'), limit: 1 }
+    }, arguments[2] || { });
+    Effect[element.visible() ? 
+      Effect.PAIRS[effect][1] : Effect.PAIRS[effect][0]](element, options);
+  }
+};
+
+Effect.DefaultOptions.transition = Effect.Transitions.sinoidal;
+
+/* ------------- core effects ------------- */
+
+Effect.ScopedQueue = Class.create(Enumerable, {
+  initialize: function() {
+    this.effects  = [];
+    this.interval = null;    
+  },
+  _each: function(iterator) {
+    this.effects._each(iterator);
+  },
+  add: function(effect) {
+    var timestamp = new Date().getTime();
+    
+    var position = Object.isString(effect.options.queue) ? 
+      effect.options.queue : effect.options.queue.position;
+    
+    switch(position) {
+      case 'front':
+        // move unstarted effects after this effect  
+        this.effects.findAll(function(e){ return e.state=='idle' }).each( function(e) {
+            e.startOn  += effect.finishOn;
+            e.finishOn += effect.finishOn;
+          });
+        break;
+      case 'with-last':
+        timestamp = this.effects.pluck('startOn').max() || timestamp;
+        break;
+      case 'end':
+        // start effect after last queued effect has finished
+        timestamp = this.effects.pluck('finishOn').max() || timestamp;
+        break;
+    }
+    
+    effect.startOn  += timestamp;
+    effect.finishOn += timestamp;
+
+    if (!effect.options.queue.limit || (this.effects.length < effect.options.queue.limit))
+      this.effects.push(effect);
+    
+    if (!this.interval)
+      this.interval = setInterval(this.loop.bind(this), 15);
+  },
+  remove: function(effect) {
+    this.effects = this.effects.reject(function(e) { return e==effect });
+    if (this.effects.length == 0) {
+      clearInterval(this.interval);
+      this.interval = null;
+    }
+  },
+  loop: function() {
+    var timePos = new Date().getTime();
+    for(var i=0, len=this.effects.length;i<len;i++) 
+      this.effects[i] && this.effects[i].loop(timePos);
+  }
+});
+
+Effect.Queues = {
+  instances: $H(),
+  get: function(queueName) {
+    if (!Object.isString(queueName)) return queueName;
+    
+    return this.instances.get(queueName) ||
+      this.instances.set(queueName, new Effect.ScopedQueue());
+  }
+};
+Effect.Queue = Effect.Queues.get('global');
+
+Effect.Base = Class.create({
+  position: null,
+  start: function(options) {
+    function codeForEvent(options,eventName){
+      return (
+        (options[eventName+'Internal'] ? 'this.options.'+eventName+'Internal(this);' : '') +
+        (options[eventName] ? 'this.options.'+eventName+'(this);' : '')
+      );
+    }
+    if (options && options.transition === false) options.transition = Effect.Transitions.linear;
+    this.options      = Object.extend(Object.extend({ },Effect.DefaultOptions), options || { });
+    this.currentFrame = 0;
+    this.state        = 'idle';
+    this.startOn      = this.options.delay*1000;
+    this.finishOn     = this.startOn+(this.options.duration*1000);
+    this.fromToDelta  = this.options.to-this.options.from;
+    this.totalTime    = this.finishOn-this.startOn;
+    this.totalFrames  = this.options.fps*this.options.duration;
+    
+    eval('this.render = function(pos){ '+
+      'if (this.state=="idle"){this.state="running";'+
+      codeForEvent(this.options,'beforeSetup')+
+      (this.setup ? 'this.setup();':'')+ 
+      codeForEvent(this.options,'afterSetup')+
+      '};if (this.state=="running"){'+
+      'pos=this.options.transition(pos)*'+this.fromToDelta+'+'+this.options.from+';'+
+      'this.position=pos;'+
+      codeForEvent(this.options,'beforeUpdate')+
+      (this.update ? 'this.update(pos);':'')+
+      codeForEvent(this.options,'afterUpdate')+
+      '}}');
+    
+    this.event('beforeStart');
+    if (!this.options.sync)
+      Effect.Queues.get(Object.isString(this.options.queue) ? 
+        'global' : this.options.queue.scope).add(this);
+  },
+  loop: function(timePos) {
+    if (timePos >= this.startOn) {
+      if (timePos >= this.finishOn) {
+        this.render(1.0);
+        this.cancel();
+        this.event('beforeFinish');
+        if (this.finish) this.finish(); 
+        this.event('afterFinish');
+        return;  
+      }
+      var pos   = (timePos - this.startOn) / this.totalTime,
+          frame = (pos * this.totalFrames).round();
+      if (frame > this.currentFrame) {
+        this.render(pos);
+        this.currentFrame = frame;
+      }
+    }
+  },
+  cancel: function() {
+    if (!this.options.sync)
+      Effect.Queues.get(Object.isString(this.options.queue) ? 
+        'global' : this.options.queue.scope).remove(this);
+    this.state = 'finished';
+  },
+  event: function(eventName) {
+    if (this.options[eventName + 'Internal']) this.options[eventName + 'Internal'](this);
+    if (this.options[eventName]) this.options[eventName](this);
+  },
+  inspect: function() {
+    var data = $H();
+    for(property in this)
+      if (!Object.isFunction(this[property])) data.set(property, this[property]);
+    return '#<Effect:' + data.inspect() + ',options:' + $H(this.options).inspect() + '>';
+  }
+});
+
+Effect.Parallel = Class.create(Effect.Base, {
+  initialize: function(effects) {
+    this.effects = effects || [];
+    this.start(arguments[1]);
+  },
+  update: function(position) {
+    this.effects.invoke('render', position);
+  },
+  finish: function(position) {
+    this.effects.each( function(effect) {
+      effect.render(1.0);
+      effect.cancel();
+      effect.event('beforeFinish');
+      if (effect.finish) effect.finish(position);
+      effect.event('afterFinish');
+    });
+  }
+});
+
+Effect.Tween = Class.create(Effect.Base, {
+  initialize: function(object, from, to) {
+    object = Object.isString(object) ? $(object) : object;
+    var args = $A(arguments), method = args.last(), 
+      options = args.length == 5 ? args[3] : null;
+    this.method = Object.isFunction(method) ? method.bind(object) :
+      Object.isFunction(object[method]) ? object[method].bind(object) : 
+      function(value) { object[method] = value };
+    this.start(Object.extend({ from: from, to: to }, options || { }));
+  },
+  update: function(position) {
+    this.method(position);
+  }
+});
+
+Effect.Event = Class.create(Effect.Base, {
+  initialize: function() {
+    this.start(Object.extend({ duration: 0 }, arguments[0] || { }));
+  },
+  update: Prototype.emptyFunction
+});
+
+Effect.Opacity = Class.create(Effect.Base, {
+  initialize: function(element) {
+    this.element = $(element);
+    if (!this.element) throw(Effect._elementDoesNotExistError);
+    // make this work on IE on elements without 'layout'
+    if (Prototype.Browser.IE && (!this.element.currentStyle.hasLayout))
+      this.element.setStyle({zoom: 1});
+    var options = Object.extend({
+      from: this.element.getOpacity() || 0.0,
+      to:   1.0
+    }, arguments[1] || { });
+    this.start(options);
+  },
+  update: function(position) {
+    this.element.setOpacity(position);
+  }
+});
+
+Effect.Move = Class.create(Effect.Base, {
+  initialize: function(element) {
+    this.element = $(element);
+    if (!this.element) throw(Effect._elementDoesNotExistError);
+    var options = Object.extend({
+      x:    0,
+      y:    0,
+      mode: 'relative'
+    }, arguments[1] || { });
+    this.start(options);
+  },
+  setup: function() {
+    this.element.makePositioned();
+    this.originalLeft = parseFloat(this.element.getStyle('left') || '0');
+    this.originalTop  = parseFloat(this.element.getStyle('top')  || '0');
+    if (this.options.mode == 'absolute') {
+      this.options.x = this.options.x - this.originalLeft;
+      this.options.y = this.options.y - this.originalTop;
+    }
+  },
+  update: function(position) {
+    this.element.setStyle({
+      left: (this.options.x  * position + this.originalLeft).round() + 'px',
+      top:  (this.options.y  * position + this.originalTop).round()  + 'px'
+    });
+  }
+});
+
+// for backwards compatibility
+Effect.MoveBy = function(element, toTop, toLeft) {
+  return new Effect.Move(element, 
+    Object.extend({ x: toLeft, y: toTop }, arguments[3] || { }));
+};
+
+Effect.Scale = Class.create(Effect.Base, {
+  initialize: function(element, percent) {
+    this.element = $(element);
+    if (!this.element) throw(Effect._elementDoesNotExistError);
+    var options = Object.extend({
+      scaleX: true,
+      scaleY: true,
+      scaleContent: true,
+      scaleFromCenter: false,
+      scaleMode: 'box',        // 'box' or 'contents' or { } with provided values
+      scaleFrom: 100.0,
+      scaleTo:   percent
+    }, arguments[2] || { });
+    this.start(options);
+  },
+  setup: function() {
+    this.restoreAfterFinish = this.options.restoreAfterFinish || false;
+    this.elementPositioning = this.element.getStyle('position');
+    
+    this.originalStyle = { };
+    ['top','left','width','height','fontSize'].each( function(k) {
+      this.originalStyle[k] = this.element.style[k];
+    }.bind(this));
+      
+    this.originalTop  = this.element.offsetTop;
+    this.originalLeft = this.element.offsetLeft;
+    
+    var fontSize = this.element.getStyle('font-size') || '100%';
+    ['em','px','%','pt'].each( function(fontSizeType) {
+      if (fontSize.indexOf(fontSizeType)>0) {
+        this.fontSize     = parseFloat(fontSize);
+        this.fontSizeType = fontSizeType;
+      }
+    }.bind(this));
+    
+    this.factor = (this.options.scaleTo - this.options.scaleFrom)/100;
+    
+    this.dims = null;
+    if (this.options.scaleMode=='box')
+      this.dims = [this.element.offsetHeight, this.element.offsetWidth];
+    if (/^content/.test(this.options.scaleMode))
+      this.dims = [this.element.scrollHeight, this.element.scrollWidth];
+    if (!this.dims)
+      this.dims = [this.options.scaleMode.originalHeight,
+                   this.options.scaleMode.originalWidth];
+  },
+  update: function(position) {
+    var currentScale = (this.options.scaleFrom/100.0) + (this.factor * position);
+    if (this.options.scaleContent && this.fontSize)
+      this.element.setStyle({fontSize: this.fontSize * currentScale + this.fontSizeType });
+    this.setDimensions(this.dims[0] * currentScale, this.dims[1] * currentScale);
+  },
+  finish: function(position) {
+    if (this.restoreAfterFinish) this.element.setStyle(this.originalStyle);
+  },
+  setDimensions: function(height, width) {
+    var d = { };
+    if (this.options.scaleX) d.width = width.round() + 'px';
+    if (this.options.scaleY) d.height = height.round() + 'px';
+    if (this.options.scaleFromCenter) {
+      var topd  = (height - this.dims[0])/2;
+      var leftd = (width  - this.dims[1])/2;
+      if (this.elementPositioning == 'absolute') {
+        if (this.options.scaleY) d.top = this.originalTop-topd + 'px';
+        if (this.options.scaleX) d.left = this.originalLeft-leftd + 'px';
+      } else {
+        if (this.options.scaleY) d.top = -topd + 'px';
+        if (this.options.scaleX) d.left = -leftd + 'px';
+      }
+    }
+    this.element.setStyle(d);
+  }
+});
+
+Effect.Highlight = Class.create(Effect.Base, {
+  initialize: function(element) {
+    this.element = $(element);
+    if (!this.element) throw(Effect._elementDoesNotExistError);
+    var options = Object.extend({ startcolor: '#ffff99' }, arguments[1] || { });
+    this.start(options);
+  },
+  setup: function() {
+    // Prevent executing on elements not in the layout flow
+    if (this.element.getStyle('display')=='none') { this.cancel(); return; }
+    // Disable background image during the effect
+    this.oldStyle = { };
+    if (!this.options.keepBackgroundImage) {
+      this.oldStyle.backgroundImage = this.element.getStyle('background-image');
+      this.element.setStyle({backgroundImage: 'none'});
+    }
+    if (!this.options.endcolor)
+      this.options.endcolor = this.element.getStyle('background-color').parseColor('#ffffff');
+    if (!this.options.restorecolor)
+      this.options.restorecolor = this.element.getStyle('background-color');
+    // init color calculations
+    this._base  = $R(0,2).map(function(i){ return parseInt(this.options.startcolor.slice(i*2+1,i*2+3),16) }.bind(this));
+    this._delta = $R(0,2).map(function(i){ return parseInt(this.options.endcolor.slice(i*2+1,i*2+3),16)-this._base[i] }.bind(this));
+  },
+  update: function(position) {
+    this.element.setStyle({backgroundColor: $R(0,2).inject('#',function(m,v,i){
+      return m+((this._base[i]+(this._delta[i]*position)).round().toColorPart()); }.bind(this)) });
+  },
+  finish: function() {
+    this.element.setStyle(Object.extend(this.oldStyle, {
+      backgroundColor: this.options.restorecolor
+    }));
+  }
+});
+
+Effect.ScrollTo = function(element) {
+  var options = arguments[1] || { },
+    scrollOffsets = document.viewport.getScrollOffsets(),
+    elementOffsets = $(element).cumulativeOffset(),
+    max = (window.height || document.body.scrollHeight) - document.viewport.getHeight();  
+
+  if (options.offset) elementOffsets[1] += options.offset;
+
+  return new Effect.Tween(null,
+    scrollOffsets.top,
+    elementOffsets[1] > max ? max : elementOffsets[1],
+    options,
+    function(p){ scrollTo(scrollOffsets.left, p.round()) }
+  );
+};
+
+/* ------------- combination effects ------------- */
+
+Effect.Fade = function(element) {
+  element = $(element);
+  var oldOpacity = element.getInlineOpacity();
+  var options = Object.extend({
+    from: element.getOpacity() || 1.0,
+    to:   0.0,
+    afterFinishInternal: function(effect) { 
+      if (effect.options.to!=0) return;
+      effect.element.hide().setStyle({opacity: oldOpacity}); 
+    }
+  }, arguments[1] || { });
+  return new Effect.Opacity(element,options);
+};
+
+Effect.Appear = function(element) {
+  element = $(element);
+  var options = Object.extend({
+  from: (element.getStyle('display') == 'none' ? 0.0 : element.getOpacity() || 0.0),
+  to:   1.0,
+  // force Safari to render floated elements properly
+  afterFinishInternal: function(effect) {
+    effect.element.forceRerendering();
+  },
+  beforeSetup: function(effect) {
+    effect.element.setOpacity(effect.options.from).show(); 
+  }}, arguments[1] || { });
+  return new Effect.Opacity(element,options);
+};
+
+Effect.Puff = function(element) {
+  element = $(element);
+  var oldStyle = { 
+    opacity: element.getInlineOpacity(), 
+    position: element.getStyle('position'),
+    top:  element.style.top,
+    left: element.style.left,
+    width: element.style.width,
+    height: element.style.height
+  };
+  return new Effect.Parallel(
+   [ new Effect.Scale(element, 200, 
+      { sync: true, scaleFromCenter: true, scaleContent: true, restoreAfterFinish: true }), 
+     new Effect.Opacity(element, { sync: true, to: 0.0 } ) ], 
+     Object.extend({ duration: 1.0, 
+      beforeSetupInternal: function(effect) {
+        Position.absolutize(effect.effects[0].element)
+      },
+      afterFinishInternal: function(effect) {
+         effect.effects[0].element.hide().setStyle(oldStyle); }
+     }, arguments[1] || { })
+   );
+};
+
+Effect.BlindUp = function(element) {
+  element = $(element);
+  element.makeClipping();
+  return new Effect.Scale(element, 0,
+    Object.extend({ scaleContent: false, 
+      scaleX: false, 
+      restoreAfterFinish: true,
+      afterFinishInternal: function(effect) {
+        effect.element.hide().undoClipping();
+      } 
+    }, arguments[1] || { })
+  );
+};
+
+Effect.BlindDown = function(element) {
+  element = $(element);
+  var elementDimensions = element.getDimensions();
+  return new Effect.Scale(element, 100, Object.extend({ 
+    scaleContent: false, 
+    scaleX: false,
+    scaleFrom: 0,
+    scaleMode: {originalHeight: elementDimensions.height, originalWidth: elementDimensions.width},
+    restoreAfterFinish: true,
+    afterSetup: function(effect) {
+      effect.element.makeClipping().setStyle({height: '0px'}).show(); 
+    },  
+    afterFinishInternal: function(effect) {
+      effect.element.undoClipping();
+    }
+  }, arguments[1] || { }));
+};
+
+Effect.SwitchOff = function(element) {
+  element = $(element);
+  var oldOpacity = element.getInlineOpacity();
+  return new Effect.Appear(element, Object.extend({
+    duration: 0.4,
+    from: 0,
+    transition: Effect.Transitions.flicker,
+    afterFinishInternal: function(effect) {
+      new Effect.Scale(effect.element, 1, { 
+        duration: 0.3, scaleFromCenter: true,
+        scaleX: false, scaleContent: false, restoreAfterFinish: true,
+        beforeSetup: function(effect) { 
+          effect.element.makePositioned().makeClipping();
+        },
+        afterFinishInternal: function(effect) {
+          effect.element.hide().undoClipping().undoPositioned().setStyle({opacity: oldOpacity});
+        }
+      })
+    }
+  }, arguments[1] || { }));
+};
+
+Effect.DropOut = function(element) {
+  element = $(element);
+  var oldStyle = {
+    top: element.getStyle('top'),
+    left: element.getStyle('left'),
+    opacity: element.getInlineOpacity() };
+  return new Effect.Parallel(
+    [ new Effect.Move(element, {x: 0, y: 100, sync: true }), 
+      new Effect.Opacity(element, { sync: true, to: 0.0 }) ],
+    Object.extend(
+      { duration: 0.5,
+        beforeSetup: function(effect) {
+          effect.effects[0].element.makePositioned(); 
+        },
+        afterFinishInternal: function(effect) {
+          effect.effects[0].element.hide().undoPositioned().setStyle(oldStyle);
+        } 
+      }, arguments[1] || { }));
+};
+
+Effect.Shake = function(element) {
+  element = $(element);
+  var options = Object.extend({
+    distance: 20,
+    duration: 0.5
+  }, arguments[1] || {});
+  var distance = parseFloat(options.distance);
+  var split = parseFloat(options.duration) / 10.0;
+  var oldStyle = {
+    top: element.getStyle('top'),
+    left: element.getStyle('left') };
+    return new Effect.Move(element,
+      { x:  distance, y: 0, duration: split, afterFinishInternal: function(effect) {
+    new Effect.Move(effect.element,
+      { x: -distance*2, y: 0, duration: split*2,  afterFinishInternal: function(effect) {
+    new Effect.Move(effect.element,
+      { x:  distance*2, y: 0, duration: split*2,  afterFinishInternal: function(effect) {
+    new Effect.Move(effect.element,
+      { x: -distance*2, y: 0, duration: split*2,  afterFinishInternal: function(effect) {
+    new Effect.Move(effect.element,
+      { x:  distance*2, y: 0, duration: split*2,  afterFinishInternal: function(effect) {
+    new Effect.Move(effect.element,
+      { x: -distance, y: 0, duration: split, afterFinishInternal: function(effect) {
+        effect.element.undoPositioned().setStyle(oldStyle);
+  }}) }}) }}) }}) }}) }});
+};
+
+Effect.SlideDown = function(element) {
+  element = $(element).cleanWhitespace();
+  // SlideDown need to have the content of the element wrapped in a container element with fixed height!
+  var oldInnerBottom = element.down().getStyle('bottom');
+  var elementDimensions = element.getDimensions();
+  return new Effect.Scale(element, 100, Object.extend({ 
+    scaleContent: false, 
+    scaleX: false, 
+    scaleFrom: window.opera ? 0 : 1,
+    scaleMode: {originalHeight: elementDimensions.height, originalWidth: elementDimensions.width},
+    restoreAfterFinish: true,
+    afterSetup: function(effect) {
+      effect.element.makePositioned();
+      effect.element.down().makePositioned();
+      if (window.opera) effect.element.setStyle({top: ''});
+      effect.element.makeClipping().setStyle({height: '0px'}).show(); 
+    },
+    afterUpdateInternal: function(effect) {
+      effect.element.down().setStyle({bottom:
+        (effect.dims[0] - effect.element.clientHeight) + 'px' }); 
+    },
+    afterFinishInternal: function(effect) {
+      effect.element.undoClipping().undoPositioned();
+      effect.element.down().undoPositioned().setStyle({bottom: oldInnerBottom}); }
+    }, arguments[1] || { })
+  );
+};
+
+Effect.SlideUp = function(element) {
+  element = $(element).cleanWhitespace();
+  var oldInnerBottom = element.down().getStyle('bottom');
+  var elementDimensions = element.getDimensions();
+  return new Effect.Scale(element, window.opera ? 0 : 1,
+   Object.extend({ scaleContent: false, 
+    scaleX: false, 
+    scaleMode: 'box',
+    scaleFrom: 100,
+    scaleMode: {originalHeight: elementDimensions.height, originalWidth: elementDimensions.width},
+    restoreAfterFinish: true,
+    afterSetup: function(effect) {
+      effect.element.makePositioned();
+      effect.element.down().makePositioned();
+      if (window.opera) effect.element.setStyle({top: ''});
+      effect.element.makeClipping().show();
+    },  
+    afterUpdateInternal: function(effect) {
+      effect.element.down().setStyle({bottom:
+        (effect.dims[0] - effect.element.clientHeight) + 'px' });
+    },
+    afterFinishInternal: function(effect) {
+      effect.element.hide().undoClipping().undoPositioned();
+      effect.element.down().undoPositioned().setStyle({bottom: oldInnerBottom});
+    }
+   }, arguments[1] || { })
+  );
+};
+
+// Bug in opera makes the TD containing this element expand for a instance after finish 
+Effect.Squish = function(element) {
+  return new Effect.Scale(element, window.opera ? 1 : 0, { 
+    restoreAfterFinish: true,
+    beforeSetup: function(effect) {
+      effect.element.makeClipping(); 
+    },  
+    afterFinishInternal: function(effect) {
+      effect.element.hide().undoClipping(); 
+    }
+  });
+};
+
+Effect.Grow = function(element) {
+  element = $(element);
+  var options = Object.extend({
+    direction: 'center',
+    moveTransition: Effect.Transitions.sinoidal,
+    scaleTransition: Effect.Transitions.sinoidal,
+    opacityTransition: Effect.Transitions.full
+  }, arguments[1] || { });
+  var oldStyle = {
+    top: element.style.top,
+    left: element.style.left,
+    height: element.style.height,
+    width: element.style.width,
+    opacity: element.getInlineOpacity() };
+
+  var dims = element.getDimensions();    
+  var initialMoveX, initialMoveY;
+  var moveX, moveY;
+  
+  switch (options.direction) {
+    case 'top-left':
+      initialMoveX = initialMoveY = moveX = moveY = 0; 
+      break;
+    case 'top-right':
+      initialMoveX = dims.width;
+      initialMoveY = moveY = 0;
+      moveX = -dims.width;
+      break;
+    case 'bottom-left':
+      initialMoveX = moveX = 0;
+      initialMoveY = dims.height;
+      moveY = -dims.height;
+      break;
+    case 'bottom-right':
+      initialMoveX = dims.width;
+      initialMoveY = dims.height;
+      moveX = -dims.width;
+      moveY = -dims.height;
+      break;
+    case 'center':
+      initialMoveX = dims.width / 2;
+      initialMoveY = dims.height / 2;
+      moveX = -dims.width / 2;
+      moveY = -dims.height / 2;
+      break;
+  }
+  
+  return new Effect.Move(element, {
+    x: initialMoveX,
+    y: initialMoveY,
+    duration: 0.01, 
+    beforeSetup: function(effect) {
+      effect.element.hide().makeClipping().makePositioned();
+    },
+    afterFinishInternal: function(effect) {
+      new Effect.Parallel(
+        [ new Effect.Opacity(effect.element, { sync: true, to: 1.0, from: 0.0, transition: options.opacityTransition }),
+          new Effect.Move(effect.element, { x: moveX, y: moveY, sync: true, transition: options.moveTransition }),
+          new Effect.Scale(effect.element, 100, {
+            scaleMode: { originalHeight: dims.height, originalWidth: dims.width }, 
+            sync: true, scaleFrom: window.opera ? 1 : 0, transition: options.scaleTransition, restoreAfterFinish: true})
+        ], Object.extend({
+             beforeSetup: function(effect) {
+               effect.effects[0].element.setStyle({height: '0px'}).show(); 
+             },
+             afterFinishInternal: function(effect) {
+               effect.effects[0].element.undoClipping().undoPositioned().setStyle(oldStyle); 
+             }
+           }, options)
+      )
+    }
+  });
+};
+
+Effect.Shrink = function(element) {
+  element = $(element);
+  var options = Object.extend({
+    direction: 'center',
+    moveTransition: Effect.Transitions.sinoidal,
+    scaleTransition: Effect.Transitions.sinoidal,
+    opacityTransition: Effect.Transitions.none
+  }, arguments[1] || { });
+  var oldStyle = {
+    top: element.style.top,
+    left: element.style.left,
+    height: element.style.height,
+    width: element.style.width,
+    opacity: element.getInlineOpacity() };
+
+  var dims = element.getDimensions();
+  var moveX, moveY;
+  
+  switch (options.direction) {
+    case 'top-left':
+      moveX = moveY = 0;
+      break;
+    case 'top-right':
+      moveX = dims.width;
+      moveY = 0;
+      break;
+    case 'bottom-left':
+      moveX = 0;
+      moveY = dims.height;
+      break;
+    case 'bottom-right':
+      moveX = dims.width;
+      moveY = dims.height;
+      break;
+    case 'center':  
+      moveX = dims.width / 2;
+      moveY = dims.height / 2;
+      break;
+  }
+  
+  return new Effect.Parallel(
+    [ new Effect.Opacity(element, { sync: true, to: 0.0, from: 1.0, transition: options.opacityTransition }),
+      new Effect.Scale(element, window.opera ? 1 : 0, { sync: true, transition: options.scaleTransition, restoreAfterFinish: true}),
+      new Effect.Move(element, { x: moveX, y: moveY, sync: true, transition: options.moveTransition })
+    ], Object.extend({            
+         beforeStartInternal: function(effect) {
+           effect.effects[0].element.makePositioned().makeClipping(); 
+         },
+         afterFinishInternal: function(effect) {
+           effect.effects[0].element.hide().undoClipping().undoPositioned().setStyle(oldStyle); }
+       }, options)
+  );
+};
+
+Effect.Pulsate = function(element) {
+  element = $(element);
+  var options    = arguments[1] || { };
+  var oldOpacity = element.getInlineOpacity();
+  var transition = options.transition || Effect.Transitions.sinoidal;
+  var reverser   = function(pos){ return transition(1-Effect.Transitions.pulse(pos, options.pulses)) };
+  reverser.bind(transition);
+  return new Effect.Opacity(element, 
+    Object.extend(Object.extend({  duration: 2.0, from: 0,
+      afterFinishInternal: function(effect) { effect.element.setStyle({opacity: oldOpacity}); }
+    }, options), {transition: reverser}));
+};
+
+Effect.Fold = function(element) {
+  element = $(element);
+  var oldStyle = {
+    top: element.style.top,
+    left: element.style.left,
+    width: element.style.width,
+    height: element.style.height };
+  element.makeClipping();
+  return new Effect.Scale(element, 5, Object.extend({   
+    scaleContent: false,
+    scaleX: false,
+    afterFinishInternal: function(effect) {
+    new Effect.Scale(element, 1, { 
+      scaleContent: false, 
+      scaleY: false,
+      afterFinishInternal: function(effect) {
+        effect.element.hide().undoClipping().setStyle(oldStyle);
+      } });
+  }}, arguments[1] || { }));
+};
+
+Effect.Morph = Class.create(Effect.Base, {
+  initialize: function(element) {
+    this.element = $(element);
+    if (!this.element) throw(Effect._elementDoesNotExistError);
+    var options = Object.extend({
+      style: { }
+    }, arguments[1] || { });
+    
+    if (!Object.isString(options.style)) this.style = $H(options.style);
+    else {
+      if (options.style.include(':'))
+        this.style = options.style.parseStyle();
+      else {
+        this.element.addClassName(options.style);
+        this.style = $H(this.element.getStyles());
+        this.element.removeClassName(options.style);
+        var css = this.element.getStyles();
+        this.style = this.style.reject(function(style) {
+          return style.value == css[style.key];
+        });
+        options.afterFinishInternal = function(effect) {
+          effect.element.addClassName(effect.options.style);
+          effect.transforms.each(function(transform) {
+            effect.element.style[transform.style] = '';
+          });
+        }
+      }
+    }
+    this.start(options);
+  },
+  
+  setup: function(){
+    function parseColor(color){
+      if (!color || ['rgba(0, 0, 0, 0)','transparent'].include(color)) color = '#ffffff';
+      color = color.parseColor();
+      return $R(0,2).map(function(i){
+        return parseInt( color.slice(i*2+1,i*2+3), 16 ) 
+      });
+    }
+    this.transforms = this.style.map(function(pair){
+      var property = pair[0], value = pair[1], unit = null;
+
+      if (value.parseColor('#zzzzzz') != '#zzzzzz') {
+        value = value.parseColor();
+        unit  = 'color';
+      } else if (property == 'opacity') {
+        value = parseFloat(value);
+        if (Prototype.Browser.IE && (!this.element.currentStyle.hasLayout))
+          this.element.setStyle({zoom: 1});
+      } else if (Element.CSS_LENGTH.test(value)) {
+          var components = value.match(/^([\+\-]?[0-9\.]+)(.*)$/);
+          value = parseFloat(components[1]);
+          unit = (components.length == 3) ? components[2] : null;
+      }
+
+      var originalValue = this.element.getStyle(property);
+      return { 
+        style: property.camelize(), 
+        originalValue: unit=='color' ? parseColor(originalValue) : parseFloat(originalValue || 0), 
+        targetValue: unit=='color' ? parseColor(value) : value,
+        unit: unit
+      };
+    }.bind(this)).reject(function(transform){
+      return (
+        (transform.originalValue == transform.targetValue) ||
+        (
+          transform.unit != 'color' &&
+          (isNaN(transform.originalValue) || isNaN(transform.targetValue))
+        )
+      )
+    });
+  },
+  update: function(position) {
+    var style = { }, transform, i = this.transforms.length;
+    while(i--)
+      style[(transform = this.transforms[i]).style] = 
+        transform.unit=='color' ? '#'+
+          (Math.round(transform.originalValue[0]+
+            (transform.targetValue[0]-transform.originalValue[0])*position)).toColorPart() +
+          (Math.round(transform.originalValue[1]+
+            (transform.targetValue[1]-transform.originalValue[1])*position)).toColorPart() +
+          (Math.round(transform.originalValue[2]+
+            (transform.targetValue[2]-transform.originalValue[2])*position)).toColorPart() :
+        (transform.originalValue +
+          (transform.targetValue - transform.originalValue) * position).toFixed(3) + 
+            (transform.unit === null ? '' : transform.unit);
+    this.element.setStyle(style, true);
+  }
+});
+
+Effect.Transform = Class.create({
+  initialize: function(tracks){
+    this.tracks  = [];
+    this.options = arguments[1] || { };
+    this.addTracks(tracks);
+  },
+  addTracks: function(tracks){
+    tracks.each(function(track){
+      track = $H(track);
+      var data = track.values().first();
+      this.tracks.push($H({
+        ids:     track.keys().first(),
+        effect:  Effect.Morph,
+        options: { style: data }
+      }));
+    }.bind(this));
+    return this;
+  },
+  play: function(){
+    return new Effect.Parallel(
+      this.tracks.map(function(track){
+        var ids = track.get('ids'), effect = track.get('effect'), options = track.get('options');
+        var elements = [$(ids) || $$(ids)].flatten();
+        return elements.map(function(e){ return new effect(e, Object.extend({ sync:true }, options)) });
+      }).flatten(),
+      this.options
+    );
+  }
+});
+
+Element.CSS_PROPERTIES = $w(
+  'backgroundColor backgroundPosition borderBottomColor borderBottomStyle ' + 
+  'borderBottomWidth borderLeftColor borderLeftStyle borderLeftWidth ' +
+  'borderRightColor borderRightStyle borderRightWidth borderSpacing ' +
+  'borderTopColor borderTopStyle borderTopWidth bottom clip color ' +
+  'fontSize fontWeight height left letterSpacing lineHeight ' +
+  'marginBottom marginLeft marginRight marginTop markerOffset maxHeight '+
+  'maxWidth minHeight minWidth opacity outlineColor outlineOffset ' +
+  'outlineWidth paddingBottom paddingLeft paddingRight paddingTop ' +
+  'right textIndent top width wordSpacing zIndex');
+  
+Element.CSS_LENGTH = /^(([\+\-]?[0-9\.]+)(em|ex|px|in|cm|mm|pt|pc|\%))|0$/;
+
+String.__parseStyleElement = document.createElement('div');
+String.prototype.parseStyle = function(){
+  var style, styleRules = $H();
+  if (Prototype.Browser.WebKit)
+    style = new Element('div',{style:this}).style;
+  else {
+    String.__parseStyleElement.innerHTML = '<div style="' + this + '"></div>';
+    style = String.__parseStyleElement.childNodes[0].style;
+  }
+  
+  Element.CSS_PROPERTIES.each(function(property){
+    if (style[property]) styleRules.set(property, style[property]); 
+  });
+  
+  if (Prototype.Browser.IE && this.include('opacity'))
+    styleRules.set('opacity', this.match(/opacity:\s*((?:0|1)?(?:\.\d*)?)/)[1]);
+
+  return styleRules;
+};
+
+if (document.defaultView && document.defaultView.getComputedStyle) {
+  Element.getStyles = function(element) {
+    var css = document.defaultView.getComputedStyle($(element), null);
+    return Element.CSS_PROPERTIES.inject({ }, function(styles, property) {
+      styles[property] = css[property];
+      return styles;
+    });
+  };
+} else {
+  Element.getStyles = function(element) {
+    element = $(element);
+    var css = element.currentStyle, styles;
+    styles = Element.CSS_PROPERTIES.inject({ }, function(results, property) {
+      results[property] = css[property];
+      return results;
+    });
+    if (!styles.opacity) styles.opacity = element.getOpacity();
+    return styles;
+  };
+};
+
+Effect.Methods = {
+  morph: function(element, style) {
+    element = $(element);
+    new Effect.Morph(element, Object.extend({ style: style }, arguments[2] || { }));
+    return element;
+  },
+  visualEffect: function(element, effect, options) {
+    element = $(element)
+    var s = effect.dasherize().camelize(), klass = s.charAt(0).toUpperCase() + s.substring(1);
+    new Effect[klass](element, options);
+    return element;
+  },
+  highlight: function(element, options) {
+    element = $(element);
+    new Effect.Highlight(element, options);
+    return element;
+  }
+};
+
+$w('fade appear grow shrink fold blindUp blindDown slideUp slideDown '+
+  'pulsate shake puff squish switchOff dropOut').each(
+  function(effect) { 
+    Effect.Methods[effect] = function(element, options){
+      element = $(element);
+      Effect[effect.charAt(0).toUpperCase() + effect.substring(1)](element, options);
+      return element;
+    }
+  }
+);
+
+$w('getInlineOpacity forceRerendering setContentZoom collectTextNodes collectTextNodesIgnoreClass getStyles').each( 
+  function(f) { Effect.Methods[f] = Element[f]; }
+);
+
+Element.addMethods(Effect.Methods);

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/extras/webjars/snorql/src/main/resources/scriptaculous/scriptaculous.js
----------------------------------------------------------------------
diff --git a/extras/webjars/snorql/src/main/resources/scriptaculous/scriptaculous.js b/extras/webjars/snorql/src/main/resources/scriptaculous/scriptaculous.js
new file mode 100755
index 0000000..b60bfd3
--- /dev/null
+++ b/extras/webjars/snorql/src/main/resources/scriptaculous/scriptaculous.js
@@ -0,0 +1,40 @@
+/*
+ * 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.
+ */
+// script.aculo.us scriptaculous.js v1.8.1, Thu Jan 03 22:07:12 -0500 2008
+
+var Scriptaculous = {
+  Version: '1.8.1',
+  REQUIRED_PROTOTYPE: '1.6.0',
+  load: function() {
+    function convertVersionString(versionString){
+      var r = versionString.split('.');
+      return parseInt(r[0])*100000 + parseInt(r[1])*1000 + parseInt(r[2]);
+    }
+ 
+    if((typeof Prototype=='undefined') || 
+       (typeof Element == 'undefined') || 
+       (typeof Element.Methods=='undefined') ||
+       (convertVersionString(Prototype.Version) < 
+        convertVersionString(Scriptaculous.REQUIRED_PROTOTYPE)))
+       throw("script.aculo.us requires the Prototype JavaScript framework >= " +
+        Scriptaculous.REQUIRED_PROTOTYPE);
+    
+  }
+}
+
+Scriptaculous.load();
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/extras/webjars/snorql/src/main/resources/scriptaculous/slider.js
----------------------------------------------------------------------
diff --git a/extras/webjars/snorql/src/main/resources/scriptaculous/slider.js b/extras/webjars/snorql/src/main/resources/scriptaculous/slider.js
new file mode 100755
index 0000000..1279f94
--- /dev/null
+++ b/extras/webjars/snorql/src/main/resources/scriptaculous/slider.js
@@ -0,0 +1,287 @@
+/*
+ * 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.
+ */
+// script.aculo.us slider.js v1.8.1, Thu Jan 03 22:07:12 -0500 2008
+
+if (!Control) var Control = { };
+
+// options:
+//  axis: 'vertical', or 'horizontal' (default)
+//
+// callbacks:
+//  onChange(value)
+//  onSlide(value)
+Control.Slider = Class.create({
+  initialize: function(handle, track, options) {
+    var slider = this;
+    
+    if (Object.isArray(handle)) {
+      this.handles = handle.collect( function(e) { return $(e) });
+    } else {
+      this.handles = [$(handle)];
+    }
+    
+    this.track   = $(track);
+    this.options = options || { };
+
+    this.axis      = this.options.axis || 'horizontal';
+    this.increment = this.options.increment || 1;
+    this.step      = parseInt(this.options.step || '1');
+    this.range     = this.options.range || $R(0,1);
+    
+    this.value     = 0; // assure backwards compat
+    this.values    = this.handles.map( function() { return 0 });
+    this.spans     = this.options.spans ? this.options.spans.map(function(s){ return $(s) }) : false;
+    this.options.startSpan = $(this.options.startSpan || null);
+    this.options.endSpan   = $(this.options.endSpan || null);
+
+    this.restricted = this.options.restricted || false;
+
+    this.maximum   = this.options.maximum || this.range.end;
+    this.minimum   = this.options.minimum || this.range.start;
+
+    // Will be used to align the handle onto the track, if necessary
+    this.alignX = parseInt(this.options.alignX || '0');
+    this.alignY = parseInt(this.options.alignY || '0');
+    
+    this.trackLength = this.maximumOffset() - this.minimumOffset();
+
+    this.handleLength = this.isVertical() ? 
+      (this.handles[0].offsetHeight != 0 ? 
+        this.handles[0].offsetHeight : this.handles[0].style.height.replace(/px$/,"")) : 
+      (this.handles[0].offsetWidth != 0 ? this.handles[0].offsetWidth : 
+        this.handles[0].style.width.replace(/px$/,""));
+
+    this.active   = false;
+    this.dragging = false;
+    this.disabled = false;
+
+    if (this.options.disabled) this.setDisabled();
+
+    // Allowed values array
+    this.allowedValues = this.options.values ? this.options.values.sortBy(Prototype.K) : false;
+    if (this.allowedValues) {
+      this.minimum = this.allowedValues.min();
+      this.maximum = this.allowedValues.max();
+    }
+
+    this.eventMouseDown = this.startDrag.bindAsEventListener(this);
+    this.eventMouseUp   = this.endDrag.bindAsEventListener(this);
+    this.eventMouseMove = this.update.bindAsEventListener(this);
+
+    // Initialize handles in reverse (make sure first handle is active)
+    this.handles.each( function(h,i) {
+      i = slider.handles.length-1-i;
+      slider.setValue(parseFloat(
+        (Object.isArray(slider.options.sliderValue) ? 
+          slider.options.sliderValue[i] : slider.options.sliderValue) || 
+         slider.range.start), i);
+      h.makePositioned().observe("mousedown", slider.eventMouseDown);
+    });
+    
+    this.track.observe("mousedown", this.eventMouseDown);
+    document.observe("mouseup", this.eventMouseUp);
+    document.observe("mousemove", this.eventMouseMove);
+    
+    this.initialized = true;
+  },
+  dispose: function() {
+    var slider = this;    
+    Event.stopObserving(this.track, "mousedown", this.eventMouseDown);
+    Event.stopObserving(document, "mouseup", this.eventMouseUp);
+    Event.stopObserving(document, "mousemove", this.eventMouseMove);
+    this.handles.each( function(h) {
+      Event.stopObserving(h, "mousedown", slider.eventMouseDown);
+    });
+  },
+  setDisabled: function(){
+    this.disabled = true;
+  },
+  setEnabled: function(){
+    this.disabled = false;
+  },  
+  getNearestValue: function(value){
+    if (this.allowedValues){
+      if (value >= this.allowedValues.max()) return(this.allowedValues.max());
+      if (value <= this.allowedValues.min()) return(this.allowedValues.min());
+      
+      var offset = Math.abs(this.allowedValues[0] - value);
+      var newValue = this.allowedValues[0];
+      this.allowedValues.each( function(v) {
+        var currentOffset = Math.abs(v - value);
+        if (currentOffset <= offset){
+          newValue = v;
+          offset = currentOffset;
+        } 
+      });
+      return newValue;
+    }
+    if (value > this.range.end) return this.range.end;
+    if (value < this.range.start) return this.range.start;
+    return value;
+  },
+  setValue: function(sliderValue, handleIdx){
+    if (!this.active) {
+      this.activeHandleIdx = handleIdx || 0;
+      this.activeHandle    = this.handles[this.activeHandleIdx];
+      this.updateStyles();
+    }
+    handleIdx = handleIdx || this.activeHandleIdx || 0;
+    if (this.initialized && this.restricted) {
+      if ((handleIdx>0) && (sliderValue<this.values[handleIdx-1]))
+        sliderValue = this.values[handleIdx-1];
+      if ((handleIdx < (this.handles.length-1)) && (sliderValue>this.values[handleIdx+1]))
+        sliderValue = this.values[handleIdx+1];
+    }
+    sliderValue = this.getNearestValue(sliderValue);
+    this.values[handleIdx] = sliderValue;
+    this.value = this.values[0]; // assure backwards compat
+    
+    this.handles[handleIdx].style[this.isVertical() ? 'top' : 'left'] = 
+      this.translateToPx(sliderValue);
+    
+    this.drawSpans();
+    if (!this.dragging || !this.event) this.updateFinished();
+  },
+  setValueBy: function(delta, handleIdx) {
+    this.setValue(this.values[handleIdx || this.activeHandleIdx || 0] + delta, 
+      handleIdx || this.activeHandleIdx || 0);
+  },
+  translateToPx: function(value) {
+    return Math.round(
+      ((this.trackLength-this.handleLength)/(this.range.end-this.range.start)) * 
+      (value - this.range.start)) + "px";
+  },
+  translateToValue: function(offset) {
+    return ((offset/(this.trackLength-this.handleLength) * 
+      (this.range.end-this.range.start)) + this.range.start);
+  },
+  getRange: function(range) {
+    var v = this.values.sortBy(Prototype.K); 
+    range = range || 0;
+    return $R(v[range],v[range+1]);
+  },
+  minimumOffset: function(){
+    return(this.isVertical() ? this.alignY : this.alignX);
+  },
+  maximumOffset: function(){
+    return(this.isVertical() ? 
+      (this.track.offsetHeight != 0 ? this.track.offsetHeight :
+        this.track.style.height.replace(/px$/,"")) - this.alignY : 
+      (this.track.offsetWidth != 0 ? this.track.offsetWidth : 
+        this.track.style.width.replace(/px$/,"")) - this.alignX);
+  },  
+  isVertical:  function(){
+    return (this.axis == 'vertical');
+  },
+  drawSpans: function() {
+    var slider = this;
+    if (this.spans)
+      $R(0, this.spans.length-1).each(function(r) { slider.setSpan(slider.spans[r], slider.getRange(r)) });
+    if (this.options.startSpan)
+      this.setSpan(this.options.startSpan,
+        $R(0, this.values.length>1 ? this.getRange(0).min() : this.value ));
+    if (this.options.endSpan)
+      this.setSpan(this.options.endSpan, 
+        $R(this.values.length>1 ? this.getRange(this.spans.length-1).max() : this.value, this.maximum));
+  },
+  setSpan: function(span, range) {
+    if (this.isVertical()) {
+      span.style.top = this.translateToPx(range.start);
+      span.style.height = this.translateToPx(range.end - range.start + this.range.start);
+    } else {
+      span.style.left = this.translateToPx(range.start);
+      span.style.width = this.translateToPx(range.end - range.start + this.range.start);
+    }
+  },
+  updateStyles: function() {
+    this.handles.each( function(h){ Element.removeClassName(h, 'selected') });
+    Element.addClassName(this.activeHandle, 'selected');
+  },
+  startDrag: function(event) {
+    if (Event.isLeftClick(event)) {
+      if (!this.disabled){
+        this.active = true;
+        
+        var handle = Event.element(event);
+        var pointer  = [Event.pointerX(event), Event.pointerY(event)];
+        var track = handle;
+        if (track==this.track) {
+          var offsets  = Position.cumulativeOffset(this.track); 
+          this.event = event;
+          this.setValue(this.translateToValue( 
+           (this.isVertical() ? pointer[1]-offsets[1] : pointer[0]-offsets[0])-(this.handleLength/2)
+          ));
+          var offsets  = Position.cumulativeOffset(this.activeHandle);
+          this.offsetX = (pointer[0] - offsets[0]);
+          this.offsetY = (pointer[1] - offsets[1]);
+        } else {
+          // find the handle (prevents issues with Safari)
+          while((this.handles.indexOf(handle) == -1) && handle.parentNode) 
+            handle = handle.parentNode;
+            
+          if (this.handles.indexOf(handle)!=-1) {
+            this.activeHandle    = handle;
+            this.activeHandleIdx = this.handles.indexOf(this.activeHandle);
+            this.updateStyles();
+            
+            var offsets  = Position.cumulativeOffset(this.activeHandle);
+            this.offsetX = (pointer[0] - offsets[0]);
+            this.offsetY = (pointer[1] - offsets[1]);
+          }
+        }
+      }
+      Event.stop(event);
+    }
+  },
+  update: function(event) {
+   if (this.active) {
+      if (!this.dragging) this.dragging = true;
+      this.draw(event);
+      if (Prototype.Browser.WebKit) window.scrollBy(0,0);
+      Event.stop(event);
+   }
+  },
+  draw: function(event) {
+    var pointer = [Event.pointerX(event), Event.pointerY(event)];
+    var offsets = Position.cumulativeOffset(this.track);
+    pointer[0] -= this.offsetX + offsets[0];
+    pointer[1] -= this.offsetY + offsets[1];
+    this.event = event;
+    this.setValue(this.translateToValue( this.isVertical() ? pointer[1] : pointer[0] ));
+    if (this.initialized && this.options.onSlide)
+      this.options.onSlide(this.values.length>1 ? this.values : this.value, this);
+  },
+  endDrag: function(event) {
+    if (this.active && this.dragging) {
+      this.finishDrag(event, true);
+      Event.stop(event);
+    }
+    this.active = false;
+    this.dragging = false;
+  },  
+  finishDrag: function(event, success) {
+    this.active = false;
+    this.dragging = false;
+    this.updateFinished();
+  },
+  updateFinished: function() {
+    if (this.initialized && this.options.onChange) 
+      this.options.onChange(this.values.length>1 ? this.values : this.value, this);
+    this.event = null;
+  }
+});

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/extras/webjars/snorql/src/main/resources/scriptaculous/sound.js
----------------------------------------------------------------------
diff --git a/extras/webjars/snorql/src/main/resources/scriptaculous/sound.js b/extras/webjars/snorql/src/main/resources/scriptaculous/sound.js
new file mode 100755
index 0000000..4d1b027
--- /dev/null
+++ b/extras/webjars/snorql/src/main/resources/scriptaculous/sound.js
@@ -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.
+ */
+// script.aculo.us sound.js v1.8.1, Thu Jan 03 22:07:12 -0500 2008
+
+Sound = {
+  tracks: {},
+  _enabled: true,
+  template:
+    new Template('<embed style="height:0" id="sound_#{track}_#{id}" src="#{url}" loop="false" autostart="true" hidden="true"/>'),
+  enable: function(){
+    Sound._enabled = true;
+  },
+  disable: function(){
+    Sound._enabled = false;
+  },
+  play: function(url){
+    if(!Sound._enabled) return;
+    var options = Object.extend({
+      track: 'global', url: url, replace: false
+    }, arguments[1] || {});
+    
+    if(options.replace && this.tracks[options.track]) {
+      $R(0, this.tracks[options.track].id).each(function(id){
+        var sound = $('sound_'+options.track+'_'+id);
+        sound.Stop && sound.Stop();
+        sound.remove();
+      })
+      this.tracks[options.track] = null;
+    }
+      
+    if(!this.tracks[options.track])
+      this.tracks[options.track] = { id: 0 }
+    else
+      this.tracks[options.track].id++;
+      
+    options.id = this.tracks[options.track].id;
+    $$('body')[0].insert( 
+      Prototype.Browser.IE ? new Element('bgsound',{
+        id: 'sound_'+options.track+'_'+options.id,
+        src: options.url, loop: 1, autostart: true
+      }) : Sound.template.evaluate(options));
+  }
+};
+
+if(Prototype.Browser.Gecko && navigator.userAgent.indexOf("Win") > 0){
+  if(navigator.plugins && $A(navigator.plugins).detect(function(p){ return p.name.indexOf('QuickTime') != -1 }))
+    Sound.template = new Template('<object id="sound_#{track}_#{id}" width="0" height="0" type="audio/mpeg" data="#{url}"/>')
+  else
+    Sound.play = function(){}
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/extras/webjars/snorql/src/main/resources/scriptaculous/unittest.js
----------------------------------------------------------------------
diff --git a/extras/webjars/snorql/src/main/resources/scriptaculous/unittest.js b/extras/webjars/snorql/src/main/resources/scriptaculous/unittest.js
new file mode 100755
index 0000000..e40149c
--- /dev/null
+++ b/extras/webjars/snorql/src/main/resources/scriptaculous/unittest.js
@@ -0,0 +1,578 @@
+/*
+ * 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.
+ */
+// script.aculo.us unittest.js v1.8.1, Thu Jan 03 22:07:12 -0500 2008
+
+// experimental, Firefox-only
+Event.simulateMouse = function(element, eventName) {
+  var options = Object.extend({
+    pointerX: 0,
+    pointerY: 0,
+    buttons:  0,
+    ctrlKey:  false,
+    altKey:   false,
+    shiftKey: false,
+    metaKey:  false
+  }, arguments[2] || {});
+  var oEvent = document.createEvent("MouseEvents");
+  oEvent.initMouseEvent(eventName, true, true, document.defaultView, 
+    options.buttons, options.pointerX, options.pointerY, options.pointerX, options.pointerY, 
+    options.ctrlKey, options.altKey, options.shiftKey, options.metaKey, 0, $(element));
+  
+  if(this.mark) Element.remove(this.mark);
+  this.mark = document.createElement('div');
+  this.mark.appendChild(document.createTextNode(" "));
+  document.body.appendChild(this.mark);
+  this.mark.style.position = 'absolute';
+  this.mark.style.top = options.pointerY + "px";
+  this.mark.style.left = options.pointerX + "px";
+  this.mark.style.width = "5px";
+  this.mark.style.height = "5px;";
+  this.mark.style.borderTop = "1px solid red;"
+  this.mark.style.borderLeft = "1px solid red;"
+  
+  if(this.step)
+    alert('['+new Date().getTime().toString()+'] '+eventName+'/'+Test.Unit.inspect(options));
+  
+  $(element).dispatchEvent(oEvent);
+};
+
+// Note: Due to a fix in Firefox 1.0.5/6 that probably fixed "too much", this doesn't work in 1.0.6 or DP2.
+// You need to downgrade to 1.0.4 for now to get this working
+// See https://bugzilla.mozilla.org/show_bug.cgi?id=289940 for the fix that fixed too much
+Event.simulateKey = function(element, eventName) {
+  var options = Object.extend({
+    ctrlKey: false,
+    altKey: false,
+    shiftKey: false,
+    metaKey: false,
+    keyCode: 0,
+    charCode: 0
+  }, arguments[2] || {});
+
+  var oEvent = document.createEvent("KeyEvents");
+  oEvent.initKeyEvent(eventName, true, true, window, 
+    options.ctrlKey, options.altKey, options.shiftKey, options.metaKey,
+    options.keyCode, options.charCode );
+  $(element).dispatchEvent(oEvent);
+};
+
+Event.simulateKeys = function(element, command) {
+  for(var i=0; i<command.length; i++) {
+    Event.simulateKey(element,'keypress',{charCode:command.charCodeAt(i)});
+  }
+};
+
+var Test = {}
+Test.Unit = {};
+
+// security exception workaround
+Test.Unit.inspect = Object.inspect;
+
+Test.Unit.Logger = Class.create();
+Test.Unit.Logger.prototype = {
+  initialize: function(log) {
+    this.log = $(log);
+    if (this.log) {
+      this._createLogTable();
+    }
+  },
+  start: function(testName) {
+    if (!this.log) return;
+    this.testName = testName;
+    this.lastLogLine = document.createElement('tr');
+    this.statusCell = document.createElement('td');
+    this.nameCell = document.createElement('td');
+    this.nameCell.className = "nameCell";
+    this.nameCell.appendChild(document.createTextNode(testName));
+    this.messageCell = document.createElement('td');
+    this.lastLogLine.appendChild(this.statusCell);
+    this.lastLogLine.appendChild(this.nameCell);
+    this.lastLogLine.appendChild(this.messageCell);
+    this.loglines.appendChild(this.lastLogLine);
+  },
+  finish: function(status, summary) {
+    if (!this.log) return;
+    this.lastLogLine.className = status;
+    this.statusCell.innerHTML = status;
+    this.messageCell.innerHTML = this._toHTML(summary);
+    this.addLinksToResults();
+  },
+  message: function(message) {
+    if (!this.log) return;
+    this.messageCell.innerHTML = this._toHTML(message);
+  },
+  summary: function(summary) {
+    if (!this.log) return;
+    this.logsummary.innerHTML = this._toHTML(summary);
+  },
+  _createLogTable: function() {
+    this.log.innerHTML =
+    '<div id="logsummary"></div>' +
+    '<table id="logtable">' +
+    '<thead><tr><th>Status</th><th>Test</th><th>Message</th></tr></thead>' +
+    '<tbody id="loglines"></tbody>' +
+    '</table>';
+    this.logsummary = $('logsummary')
+    this.loglines = $('loglines');
+  },
+  _toHTML: function(txt) {
+    return txt.escapeHTML().replace(/\n/g,"<br/>");
+  },
+  addLinksToResults: function(){ 
+    $$("tr.failed .nameCell").each( function(td){ // todo: limit to children of this.log
+      td.title = "Run only this test"
+      Event.observe(td, 'click', function(){ window.location.search = "?tests=" + td.innerHTML;});
+    });
+    $$("tr.passed .nameCell").each( function(td){ // todo: limit to children of this.log
+      td.title = "Run all tests"
+      Event.observe(td, 'click', function(){ window.location.search = "";});
+    });
+  }
+}
+
+Test.Unit.Runner = Class.create();
+Test.Unit.Runner.prototype = {
+  initialize: function(testcases) {
+    this.options = Object.extend({
+      testLog: 'testlog'
+    }, arguments[1] || {});
+    this.options.resultsURL = this.parseResultsURLQueryParameter();
+    this.options.tests      = this.parseTestsQueryParameter();
+    if (this.options.testLog) {
+      this.options.testLog = $(this.options.testLog) || null;
+    }
+    if(this.options.tests) {
+      this.tests = [];
+      for(var i = 0; i < this.options.tests.length; i++) {
+        if(/^test/.test(this.options.tests[i])) {
+          this.tests.push(new Test.Unit.Testcase(this.options.tests[i], testcases[this.options.tests[i]], testcases["setup"], testcases["teardown"]));
+        }
+      }
+    } else {
+      if (this.options.test) {
+        this.tests = [new Test.Unit.Testcase(this.options.test, testcases[this.options.test], testcases["setup"], testcases["teardown"])];
+      } else {
+        this.tests = [];
+        for(var testcase in testcases) {
+          if(/^test/.test(testcase)) {
+            this.tests.push(
+               new Test.Unit.Testcase(
+                 this.options.context ? ' -> ' + this.options.titles[testcase] : testcase, 
+                 testcases[testcase], testcases["setup"], testcases["teardown"]
+               ));
+          }
+        }
+      }
+    }
+    this.currentTest = 0;
+    this.logger = new Test.Unit.Logger(this.options.testLog);
+    setTimeout(this.runTests.bind(this), 1000);
+  },
+  parseResultsURLQueryParameter: function() {
+    return window.location.search.parseQuery()["resultsURL"];
+  },
+  parseTestsQueryParameter: function(){
+    if (window.location.search.parseQuery()["tests"]){
+        return window.location.search.parseQuery()["tests"].split(',');
+    };
+  },
+  // Returns:
+  //  "ERROR" if there was an error,
+  //  "FAILURE" if there was a failure, or
+  //  "SUCCESS" if there was neither
+  getResult: function() {
+    var hasFailure = false;
+    for(var i=0;i<this.tests.length;i++) {
+      if (this.tests[i].errors > 0) {
+        return "ERROR";
+      }
+      if (this.tests[i].failures > 0) {
+        hasFailure = true;
+      }
+    }
+    if (hasFailure) {
+      return "FAILURE";
+    } else {
+      return "SUCCESS";
+    }
+  },
+  postResults: function() {
+    if (this.options.resultsURL) {
+      new Ajax.Request(this.options.resultsURL, 
+        { method: 'get', parameters: 'result=' + this.getResult(), asynchronous: false });
+    }
+  },
+  runTests: function() {
+    var test = this.tests[this.currentTest];
+    if (!test) {
+      // finished!
+      this.postResults();
+      this.logger.summary(this.summary());
+      return;
+    }
+    if(!test.isWaiting) {
+      this.logger.start(test.name);
+    }
+    test.run();
+    if(test.isWaiting) {
+      this.logger.message("Waiting for " + test.timeToWait + "ms");
+      setTimeout(this.runTests.bind(this), test.timeToWait || 1000);
+    } else {
+      this.logger.finish(test.status(), test.summary());
+      this.currentTest++;
+      // tail recursive, hopefully the browser will skip the stackframe
+      this.runTests();
+    }
+  },
+  summary: function() {
+    var assertions = 0;
+    var failures = 0;
+    var errors = 0;
+    var messages = [];
+    for(var i=0;i<this.tests.length;i++) {
+      assertions +=   this.tests[i].assertions;
+      failures   +=   this.tests[i].failures;
+      errors     +=   this.tests[i].errors;
+    }
+    return (
+      (this.options.context ? this.options.context + ': ': '') + 
+      this.tests.length + " tests, " + 
+      assertions + " assertions, " + 
+      failures   + " failures, " +
+      errors     + " errors");
+  }
+}
+
+Test.Unit.Assertions = Class.create();
+Test.Unit.Assertions.prototype = {
+  initialize: function() {
+    this.assertions = 0;
+    this.failures   = 0;
+    this.errors     = 0;
+    this.messages   = [];
+  },
+  summary: function() {
+    return (
+      this.assertions + " assertions, " + 
+      this.failures   + " failures, " +
+      this.errors     + " errors" + "\n" +
+      this.messages.join("\n"));
+  },
+  pass: function() {
+    this.assertions++;
+  },
+  fail: function(message) {
+    this.failures++;
+    this.messages.push("Failure: " + message);
+  },
+  info: function(message) {
+    this.messages.push("Info: " + message);
+  },
+  error: function(error) {
+    this.errors++;
+    this.messages.push(error.name + ": "+ error.message + "(" + Test.Unit.inspect(error) +")");
+  },
+  status: function() {
+    if (this.failures > 0) return 'failed';
+    if (this.errors > 0) return 'error';
+    return 'passed';
+  },
+  assert: function(expression) {
+    var message = arguments[1] || 'assert: got "' + Test.Unit.inspect(expression) + '"';
+    try { expression ? this.pass() : 
+      this.fail(message); }
+    catch(e) { this.error(e); }
+  },
+  assertEqual: function(expected, actual) {
+    var message = arguments[2] || "assertEqual";
+    try { (expected == actual) ? this.pass() :
+      this.fail(message + ': expected "' + Test.Unit.inspect(expected) + 
+        '", actual "' + Test.Unit.inspect(actual) + '"'); }
+    catch(e) { this.error(e); }
+  },
+  assertInspect: function(expected, actual) {
+    var message = arguments[2] || "assertInspect";
+    try { (expected == actual.inspect()) ? this.pass() :
+      this.fail(message + ': expected "' + Test.Unit.inspect(expected) + 
+        '", actual "' + Test.Unit.inspect(actual) + '"'); }
+    catch(e) { this.error(e); }
+  },
+  assertEnumEqual: function(expected, actual) {
+    var message = arguments[2] || "assertEnumEqual";
+    try { $A(expected).length == $A(actual).length && 
+      expected.zip(actual).all(function(pair) { return pair[0] == pair[1] }) ?
+        this.pass() : this.fail(message + ': expected ' + Test.Unit.inspect(expected) + 
+          ', actual ' + Test.Unit.inspect(actual)); }
+    catch(e) { this.error(e); }
+  },
+  assertNotEqual: function(expected, actual) {
+    var message = arguments[2] || "assertNotEqual";
+    try { (expected != actual) ? this.pass() : 
+      this.fail(message + ': got "' + Test.Unit.inspect(actual) + '"'); }
+    catch(e) { this.error(e); }
+  },
+  assertIdentical: function(expected, actual) { 
+    var message = arguments[2] || "assertIdentical"; 
+    try { (expected === actual) ? this.pass() : 
+      this.fail(message + ': expected "' + Test.Unit.inspect(expected) +  
+        '", actual "' + Test.Unit.inspect(actual) + '"'); } 
+    catch(e) { this.error(e); } 
+  },
+  assertNotIdentical: function(expected, actual) { 
+    var message = arguments[2] || "assertNotIdentical"; 
+    try { !(expected === actual) ? this.pass() : 
+      this.fail(message + ': expected "' + Test.Unit.inspect(expected) +  
+        '", actual "' + Test.Unit.inspect(actual) + '"'); } 
+    catch(e) { this.error(e); } 
+  },
+  assertNull: function(obj) {
+    var message = arguments[1] || 'assertNull'
+    try { (obj==null) ? this.pass() : 
+      this.fail(message + ': got "' + Test.Unit.inspect(obj) + '"'); }
+    catch(e) { this.error(e); }
+  },
+  assertMatch: function(expected, actual) {
+    var message = arguments[2] || 'assertMatch';
+    var regex = new RegExp(expected);
+    try { (regex.exec(actual)) ? this.pass() :
+      this.fail(message + ' : regex: "' +  Test.Unit.inspect(expected) + ' did not match: ' + Test.Unit.inspect(actual) + '"'); }
+    catch(e) { this.error(e); }
+  },
+  assertHidden: function(element) {
+    var message = arguments[1] || 'assertHidden';
+    this.assertEqual("none", element.style.display, message);
+  },
+  assertNotNull: function(object) {
+    var message = arguments[1] || 'assertNotNull';
+    this.assert(object != null, message);
+  },
+  assertType: function(expected, actual) {
+    var message = arguments[2] || 'assertType';
+    try { 
+      (actual.constructor == expected) ? this.pass() : 
+      this.fail(message + ': expected "' + Test.Unit.inspect(expected) +  
+        '", actual "' + (actual.constructor) + '"'); }
+    catch(e) { this.error(e); }
+  },
+  assertNotOfType: function(expected, actual) {
+    var message = arguments[2] || 'assertNotOfType';
+    try { 
+      (actual.constructor != expected) ? this.pass() : 
+      this.fail(message + ': expected "' + Test.Unit.inspect(expected) +  
+        '", actual "' + (actual.constructor) + '"'); }
+    catch(e) { this.error(e); }
+  },
+  assertInstanceOf: function(expected, actual) {
+    var message = arguments[2] || 'assertInstanceOf';
+    try { 
+      (actual instanceof expected) ? this.pass() : 
+      this.fail(message + ": object was not an instance of the expected type"); }
+    catch(e) { this.error(e); } 
+  },
+  assertNotInstanceOf: function(expected, actual) {
+    var message = arguments[2] || 'assertNotInstanceOf';
+    try { 
+      !(actual instanceof expected) ? this.pass() : 
+      this.fail(message + ": object was an instance of the not expected type"); }
+    catch(e) { this.error(e); } 
+  },
+  assertRespondsTo: function(method, obj) {
+    var message = arguments[2] || 'assertRespondsTo';
+    try {
+      (obj[method] && typeof obj[method] == 'function') ? this.pass() : 
+      this.fail(message + ": object doesn't respond to [" + method + "]"); }
+    catch(e) { this.error(e); }
+  },
+  assertReturnsTrue: function(method, obj) {
+    var message = arguments[2] || 'assertReturnsTrue';
+    try {
+      var m = obj[method];
+      if(!m) m = obj['is'+method.charAt(0).toUpperCase()+method.slice(1)];
+      m() ? this.pass() : 
+      this.fail(message + ": method returned false"); }
+    catch(e) { this.error(e); }
+  },
+  assertReturnsFalse: function(method, obj) {
+    var message = arguments[2] || 'assertReturnsFalse';
+    try {
+      var m = obj[method];
+      if(!m) m = obj['is'+method.charAt(0).toUpperCase()+method.slice(1)];
+      !m() ? this.pass() : 
+      this.fail(message + ": method returned true"); }
+    catch(e) { this.error(e); }
+  },
+  assertRaise: function(exceptionName, method) {
+    var message = arguments[2] || 'assertRaise';
+    try { 
+      method();
+      this.fail(message + ": exception expected but none was raised"); }
+    catch(e) {
+      ((exceptionName == null) || (e.name==exceptionName)) ? this.pass() : this.error(e); 
+    }
+  },
+  assertElementsMatch: function() {
+    var expressions = $A(arguments), elements = $A(expressions.shift());
+    if (elements.length != expressions.length) {
+      this.fail('assertElementsMatch: size mismatch: ' + elements.length + ' elements, ' + expressions.length + ' expressions');
+      return false;
+    }
+    elements.zip(expressions).all(function(pair, index) {
+      var element = $(pair.first()), expression = pair.last();
+      if (element.match(expression)) return true;
+      this.fail('assertElementsMatch: (in index ' + index + ') expected ' + expression.inspect() + ' but got ' + element.inspect());
+    }.bind(this)) && this.pass();
+  },
+  assertElementMatches: function(element, expression) {
+    this.assertElementsMatch([element], expression);
+  },
+  benchmark: function(operation, iterations) {
+    var startAt = new Date();
+    (iterations || 1).times(operation);
+    var timeTaken = ((new Date())-startAt);
+    this.info((arguments[2] || 'Operation') + ' finished ' + 
+       iterations + ' iterations in ' + (timeTaken/1000)+'s' );
+    return timeTaken;
+  },
+  _isVisible: function(element) {
+    element = $(element);
+    if(!element.parentNode) return true;
+    this.assertNotNull(element);
+    if(element.style && Element.getStyle(element, 'display') == 'none')
+      return false;
+    
+    return this._isVisible(element.parentNode);
+  },
+  assertNotVisible: function(element) {
+    this.assert(!this._isVisible(element), Test.Unit.inspect(element) + " was not hidden and didn't have a hidden parent either. " + ("" || arguments[1]));
+  },
+  assertVisible: function(element) {
+    this.assert(this._isVisible(element), Test.Unit.inspect(element) + " was not visible. " + ("" || arguments[1]));
+  },
+  benchmark: function(operation, iterations) {
+    var startAt = new Date();
+    (iterations || 1).times(operation);
+    var timeTaken = ((new Date())-startAt);
+    this.info((arguments[2] || 'Operation') + ' finished ' + 
+       iterations + ' iterations in ' + (timeTaken/1000)+'s' );
+    return timeTaken;
+  }
+}
+
+Test.Unit.Testcase = Class.create();
+Object.extend(Object.extend(Test.Unit.Testcase.prototype, Test.Unit.Assertions.prototype), {
+  initialize: function(name, test, setup, teardown) {
+    Test.Unit.Assertions.prototype.initialize.bind(this)();
+    this.name           = name;
+    
+    if(typeof test == 'string') {
+      test = test.gsub(/(\.should[^\(]+\()/,'#{0}this,');
+      test = test.gsub(/(\.should[^\(]+)\(this,\)/,'#{1}(this)');
+      this.test = function() {
+        eval('with(this){'+test+'}');
+      }
+    } else {
+      this.test = test || function() {};
+    }
+    
+    this.setup          = setup || function() {};
+    this.teardown       = teardown || function() {};
+    this.isWaiting      = false;
+    this.timeToWait     = 1000;
+  },
+  wait: function(time, nextPart) {
+    this.isWaiting = true;
+    this.test = nextPart;
+    this.timeToWait = time;
+  },
+  run: function() {
+    try {
+      try {
+        if (!this.isWaiting) this.setup.bind(this)();
+        this.isWaiting = false;
+        this.test.bind(this)();
+      } finally {
+        if(!this.isWaiting) {
+          this.teardown.bind(this)();
+        }
+      }
+    }
+    catch(e) { this.error(e); }
+  }
+});
+
+// *EXPERIMENTAL* BDD-style testing to please non-technical folk
+// This draws many ideas from RSpec http://rspec.rubyforge.org/
+
+Test.setupBDDExtensionMethods = function(){
+  var METHODMAP = {
+    shouldEqual:     'assertEqual',
+    shouldNotEqual:  'assertNotEqual',
+    shouldEqualEnum: 'assertEnumEqual',
+    shouldBeA:       'assertType',
+    shouldNotBeA:    'assertNotOfType',
+    shouldBeAn:      'assertType',
+    shouldNotBeAn:   'assertNotOfType',
+    shouldBeNull:    'assertNull',
+    shouldNotBeNull: 'assertNotNull',
+    
+    shouldBe:        'assertReturnsTrue',
+    shouldNotBe:     'assertReturnsFalse',
+    shouldRespondTo: 'assertRespondsTo'
+  };
+  var makeAssertion = function(assertion, args, object) { 
+   	this[assertion].apply(this,(args || []).concat([object]));
+  }
+  
+  Test.BDDMethods = {};   
+  $H(METHODMAP).each(function(pair) { 
+    Test.BDDMethods[pair.key] = function() { 
+       var args = $A(arguments); 
+       var scope = args.shift(); 
+       makeAssertion.apply(scope, [pair.value, args, this]); }; 
+  });
+  
+  [Array.prototype, String.prototype, Number.prototype, Boolean.prototype].each(
+    function(p){ Object.extend(p, Test.BDDMethods) }
+  );
+}
+
+Test.context = function(name, spec, log){
+  Test.setupBDDExtensionMethods();
+  
+  var compiledSpec = {};
+  var titles = {};
+  for(specName in spec) {
+    switch(specName){
+      case "setup":
+      case "teardown":
+        compiledSpec[specName] = spec[specName];
+        break;
+      default:
+        var testName = 'test'+specName.gsub(/\s+/,'-').camelize();
+        var body = spec[specName].toString().split('\n').slice(1);
+        if(/^\{/.test(body[0])) body = body.slice(1);
+        body.pop();
+        body = body.map(function(statement){ 
+          return statement.strip()
+        });
+        compiledSpec[testName] = body.join('\n');
+        titles[testName] = specName;
+    }
+  }
+  new Test.Unit.Runner(compiledSpec, { titles: titles, testLog: log || 'testlog', context: name });
+};
\ No newline at end of file


[074/100] [abbrv] git commit: [maven-release-plugin] prepare release 3.2.0

Posted by wi...@apache.org.
[maven-release-plugin] prepare release 3.2.0


Project: http://git-wip-us.apache.org/repos/asf/marmotta/repo
Commit: http://git-wip-us.apache.org/repos/asf/marmotta/commit/f5b5cf0c
Tree: http://git-wip-us.apache.org/repos/asf/marmotta/tree/f5b5cf0c
Diff: http://git-wip-us.apache.org/repos/asf/marmotta/diff/f5b5cf0c

Branch: refs/heads/ldp
Commit: f5b5cf0c21ab3ce0aaea1e816658e0aa2d59bb86
Parents: 1c58043
Author: Jakob Frank <ja...@salzburgresearch.at>
Authored: Wed Apr 9 10:03:14 2014 +0200
Committer: Jakob Frank <ja...@salzburgresearch.at>
Committed: Wed Apr 9 10:03:14 2014 +0200

----------------------------------------------------------------------
 build/archetypes/marmotta-archetype-module/pom.xml             | 2 +-
 build/archetypes/marmotta-archetype-webapp/pom.xml             | 2 +-
 build/archetypes/pom.xml                                       | 2 +-
 build/checkstyle-resources/pom.xml                             | 2 +-
 build/dependency-resource-supplement/pom.xml                   | 2 +-
 build/plugins/buildinfo-maven-plugin/pom.xml                   | 2 +-
 build/plugins/marmotta-maven-plugin/pom.xml                    | 2 +-
 build/plugins/pom.xml                                          | 2 +-
 build/plugins/refpack-maven-plugin/pom.xml                     | 2 +-
 build/plugins/repocheck-maven-plugin/pom.xml                   | 2 +-
 build/pom.xml                                                  | 2 +-
 client/marmotta-client-java/pom.xml                            | 2 +-
 client/marmotta-client-js/pom.xml                              | 2 +-
 client/pom.xml                                                 | 2 +-
 commons/marmotta-commons/pom.xml                               | 2 +-
 commons/marmotta-sesame-tools/marmotta-model-vocabs/pom.xml    | 2 +-
 commons/marmotta-sesame-tools/marmotta-rio-api/pom.xml         | 2 +-
 commons/marmotta-sesame-tools/marmotta-rio-ical/pom.xml        | 2 +-
 commons/marmotta-sesame-tools/marmotta-rio-rss/pom.xml         | 2 +-
 commons/marmotta-sesame-tools/marmotta-rio-vcard/pom.xml       | 2 +-
 .../marmotta-sesame-tools/marmotta-sail-contextaware/pom.xml   | 2 +-
 .../marmotta-sesame-tools/marmotta-sail-transactions/pom.xml   | 2 +-
 commons/marmotta-sesame-tools/marmotta-sesame-matchers/pom.xml | 2 +-
 commons/marmotta-sesame-tools/marmotta-util-facading/pom.xml   | 2 +-
 commons/marmotta-sesame-tools/marmotta-util-filter/pom.xml     | 2 +-
 commons/marmotta-sesame-tools/marmotta-util-rdfpatch/pom.xml   | 2 +-
 .../marmotta-sesame-tools/marmotta-util-tripletable/pom.xml    | 2 +-
 commons/marmotta-sesame-tools/pom.xml                          | 2 +-
 commons/pom.xml                                                | 2 +-
 extras/pom.xml                                                 | 2 +-
 extras/webjars/codemirror/pom.xml                              | 2 +-
 extras/webjars/pom.xml                                         | 2 +-
 extras/webjars/strftime/pom.xml                                | 2 +-
 launchers/marmotta-installer/pom.xml                           | 2 +-
 launchers/marmotta-splash/pom.xml                              | 2 +-
 launchers/marmotta-webapp/pom.xml                              | 2 +-
 launchers/pom.xml                                              | 2 +-
 libraries/kiwi/kiwi-caching-ehcache/pom.xml                    | 6 ++----
 libraries/kiwi/kiwi-caching-hazelcast/pom.xml                  | 6 ++----
 libraries/kiwi/kiwi-caching-infinispan/pom.xml                 | 6 ++----
 libraries/kiwi/kiwi-loader/pom.xml                             | 5 ++---
 libraries/kiwi/kiwi-reasoner/pom.xml                           | 2 +-
 libraries/kiwi/kiwi-sparql/pom.xml                             | 2 +-
 libraries/kiwi/kiwi-triplestore/pom.xml                        | 2 +-
 libraries/kiwi/kiwi-versioning/pom.xml                         | 2 +-
 libraries/kiwi/pom.xml                                         | 2 +-
 libraries/ldcache/ldcache-api/pom.xml                          | 2 +-
 libraries/ldcache/ldcache-backend-file/pom.xml                 | 2 +-
 libraries/ldcache/ldcache-backend-infinispan/pom.xml           | 6 ++----
 libraries/ldcache/ldcache-backend-kiwi/pom.xml                 | 2 +-
 libraries/ldcache/ldcache-core/pom.xml                         | 2 +-
 libraries/ldcache/ldcache-sail-generic/pom.xml                 | 2 +-
 libraries/ldcache/ldcache-sail-kiwi/pom.xml                    | 2 +-
 libraries/ldcache/pom.xml                                      | 2 +-
 libraries/ldclient/ldclient-api/pom.xml                        | 2 +-
 libraries/ldclient/ldclient-core/pom.xml                       | 2 +-
 libraries/ldclient/ldclient-provider-facebook/pom.xml          | 2 +-
 libraries/ldclient/ldclient-provider-freebase/pom.xml          | 2 +-
 libraries/ldclient/ldclient-provider-html/pom.xml              | 2 +-
 libraries/ldclient/ldclient-provider-ldap/pom.xml              | 2 +-
 libraries/ldclient/ldclient-provider-mediawiki/pom.xml         | 2 +-
 libraries/ldclient/ldclient-provider-phpbb/pom.xml             | 2 +-
 libraries/ldclient/ldclient-provider-rdf/pom.xml               | 2 +-
 libraries/ldclient/ldclient-provider-rdfa/pom.xml              | 2 +-
 libraries/ldclient/ldclient-provider-vimeo/pom.xml             | 2 +-
 libraries/ldclient/ldclient-provider-xml/pom.xml               | 2 +-
 libraries/ldclient/ldclient-provider-youtube/pom.xml           | 2 +-
 libraries/ldclient/pom.xml                                     | 2 +-
 libraries/ldpath/ldpath-api/pom.xml                            | 2 +-
 libraries/ldpath/ldpath-backend-file/pom.xml                   | 2 +-
 libraries/ldpath/ldpath-backend-jena/pom.xml                   | 2 +-
 libraries/ldpath/ldpath-backend-linkeddata/pom.xml             | 2 +-
 libraries/ldpath/ldpath-backend-sesame/pom.xml                 | 2 +-
 libraries/ldpath/ldpath-core-bundle/pom.xml                    | 2 +-
 libraries/ldpath/ldpath-core/pom.xml                           | 2 +-
 libraries/ldpath/ldpath-functions-collections/pom.xml          | 2 +-
 libraries/ldpath/ldpath-functions-date/pom.xml                 | 2 +-
 libraries/ldpath/ldpath-functions-html/pom.xml                 | 2 +-
 libraries/ldpath/ldpath-functions-math/pom.xml                 | 2 +-
 libraries/ldpath/ldpath-functions-text/pom.xml                 | 2 +-
 libraries/ldpath/ldpath-functions-xml/pom.xml                  | 2 +-
 libraries/ldpath/ldpath-template-linkeddata/pom.xml            | 2 +-
 libraries/ldpath/ldpath-template/pom.xml                       | 2 +-
 libraries/ldpath/pom.xml                                       | 2 +-
 libraries/pom.xml                                              | 2 +-
 loader/marmotta-loader-berkeley/pom.xml                        | 6 +++---
 loader/marmotta-loader-core/pom.xml                            | 2 +-
 loader/marmotta-loader-hbase/pom.xml                           | 6 +++---
 loader/marmotta-loader-kiwi/pom.xml                            | 6 +++---
 loader/marmotta-loader-titan/pom.xml                           | 2 +-
 loader/pom.xml                                                 | 2 +-
 parent/pom.xml                                                 | 6 +++++-
 platform/backends/marmotta-backend-kiwi/pom.xml                | 6 ++----
 platform/backends/marmotta-backend-memory/pom.xml              | 6 ++----
 platform/backends/marmotta-backend-native/pom.xml              | 6 ++----
 platform/backends/marmotta-backend-titan/pom.xml               | 6 ++----
 platform/backends/pom.xml                                      | 2 +-
 platform/ldcache/marmotta-ldcache-common/pom.xml               | 6 ++----
 platform/ldcache/marmotta-ldcache-file/pom.xml                 | 2 +-
 platform/ldcache/marmotta-ldcache-kiwi/pom.xml                 | 2 +-
 platform/ldcache/pom.xml                                       | 2 +-
 platform/marmotta-core/pom.xml                                 | 2 +-
 platform/marmotta-ldp/pom.xml                                  | 2 +-
 platform/marmotta-ldpath/pom.xml                               | 2 +-
 platform/marmotta-reasoner-kiwi/pom.xml                        | 2 +-
 platform/marmotta-security/pom.xml                             | 2 +-
 platform/marmotta-sparql/pom.xml                               | 2 +-
 platform/marmotta-user/pom.xml                                 | 2 +-
 platform/marmotta-versioning-common/pom.xml                    | 6 ++----
 platform/marmotta-versioning-kiwi/pom.xml                      | 2 +-
 platform/marmotta-zookeeper/pom.xml                            | 6 ++----
 platform/pom.xml                                               | 2 +-
 pom.xml                                                        | 4 ++--
 113 files changed, 136 insertions(+), 155 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/marmotta/blob/f5b5cf0c/build/archetypes/marmotta-archetype-module/pom.xml
----------------------------------------------------------------------
diff --git a/build/archetypes/marmotta-archetype-module/pom.xml b/build/archetypes/marmotta-archetype-module/pom.xml
index 94c15d1..7b0e110 100644
--- a/build/archetypes/marmotta-archetype-module/pom.xml
+++ b/build/archetypes/marmotta-archetype-module/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0-SNAPSHOT</version>
+        <version>3.2.0</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/f5b5cf0c/build/archetypes/marmotta-archetype-webapp/pom.xml
----------------------------------------------------------------------
diff --git a/build/archetypes/marmotta-archetype-webapp/pom.xml b/build/archetypes/marmotta-archetype-webapp/pom.xml
index 3a971a2..88dd566 100644
--- a/build/archetypes/marmotta-archetype-webapp/pom.xml
+++ b/build/archetypes/marmotta-archetype-webapp/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0-SNAPSHOT</version>
+        <version>3.2.0</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/f5b5cf0c/build/archetypes/pom.xml
----------------------------------------------------------------------
diff --git a/build/archetypes/pom.xml b/build/archetypes/pom.xml
index b30564f..3bbb7b5 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.2.0-SNAPSHOT</version>
+        <version>3.2.0</version>
         <relativePath>../../parent</relativePath>
     </parent>
     <artifactId>archetypes-reactor</artifactId>

http://git-wip-us.apache.org/repos/asf/marmotta/blob/f5b5cf0c/build/checkstyle-resources/pom.xml
----------------------------------------------------------------------
diff --git a/build/checkstyle-resources/pom.xml b/build/checkstyle-resources/pom.xml
index 39c4d43..6bcf91f 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.2.0-SNAPSHOT</version>
+        <version>3.2.0</version>
         <relativePath>../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/f5b5cf0c/build/dependency-resource-supplement/pom.xml
----------------------------------------------------------------------
diff --git a/build/dependency-resource-supplement/pom.xml b/build/dependency-resource-supplement/pom.xml
index 4c0eaf4..70be603 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.2.0-SNAPSHOT</version>
+        <version>3.2.0</version>
         <relativePath>../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/f5b5cf0c/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 a929c66..757a77d 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.2.0-SNAPSHOT</version>
+        <version>3.2.0</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/f5b5cf0c/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 1407e62..3e3437f 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.2.0-SNAPSHOT</version>
+        <version>3.2.0</version>
         <relativePath>../</relativePath>
         <artifactId>plugins-reactor</artifactId>
     </parent>

http://git-wip-us.apache.org/repos/asf/marmotta/blob/f5b5cf0c/build/plugins/pom.xml
----------------------------------------------------------------------
diff --git a/build/plugins/pom.xml b/build/plugins/pom.xml
index 681c5a8..4a9bdf6 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.2.0-SNAPSHOT</version>
+        <version>3.2.0</version>
         <relativePath>../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/f5b5cf0c/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 7ec5763..67f99ae 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.2.0-SNAPSHOT</version>
+        <version>3.2.0</version>
         <artifactId>plugins-reactor</artifactId>
         <relativePath>../</relativePath>
     </parent>

http://git-wip-us.apache.org/repos/asf/marmotta/blob/f5b5cf0c/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 11ed9f8..b0bfa46 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.2.0-SNAPSHOT</version>
+        <version>3.2.0</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/marmotta/blob/f5b5cf0c/build/pom.xml
----------------------------------------------------------------------
diff --git a/build/pom.xml b/build/pom.xml
index ca6b672..d6615c4 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.2.0-SNAPSHOT</version>
+        <version>3.2.0</version>
         <relativePath>../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/f5b5cf0c/client/marmotta-client-java/pom.xml
----------------------------------------------------------------------
diff --git a/client/marmotta-client-java/pom.xml b/client/marmotta-client-java/pom.xml
index 4a35c78..e35de4b 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.2.0-SNAPSHOT</version>
+        <version>3.2.0</version>
         <relativePath>../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/f5b5cf0c/client/marmotta-client-js/pom.xml
----------------------------------------------------------------------
diff --git a/client/marmotta-client-js/pom.xml b/client/marmotta-client-js/pom.xml
index 6632c09..5319778 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.2.0-SNAPSHOT</version>
+        <version>3.2.0</version>
         <relativePath>../../parent/pom.xml</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/f5b5cf0c/client/pom.xml
----------------------------------------------------------------------
diff --git a/client/pom.xml b/client/pom.xml
index c64a940..a5e655b 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.2.0-SNAPSHOT</version>
+        <version>3.2.0</version>
         <relativePath>../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/f5b5cf0c/commons/marmotta-commons/pom.xml
----------------------------------------------------------------------
diff --git a/commons/marmotta-commons/pom.xml b/commons/marmotta-commons/pom.xml
index e505ceb..237e4a5 100644
--- a/commons/marmotta-commons/pom.xml
+++ b/commons/marmotta-commons/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0-SNAPSHOT</version>
+        <version>3.2.0</version>
         <relativePath>../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/f5b5cf0c/commons/marmotta-sesame-tools/marmotta-model-vocabs/pom.xml
----------------------------------------------------------------------
diff --git a/commons/marmotta-sesame-tools/marmotta-model-vocabs/pom.xml b/commons/marmotta-sesame-tools/marmotta-model-vocabs/pom.xml
index 8fb8e45..6d29685 100644
--- a/commons/marmotta-sesame-tools/marmotta-model-vocabs/pom.xml
+++ b/commons/marmotta-sesame-tools/marmotta-model-vocabs/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0-SNAPSHOT</version>
+        <version>3.2.0</version>
         <relativePath>../../../parent/</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/f5b5cf0c/commons/marmotta-sesame-tools/marmotta-rio-api/pom.xml
----------------------------------------------------------------------
diff --git a/commons/marmotta-sesame-tools/marmotta-rio-api/pom.xml b/commons/marmotta-sesame-tools/marmotta-rio-api/pom.xml
index 843665b..0b7b2a0 100644
--- a/commons/marmotta-sesame-tools/marmotta-rio-api/pom.xml
+++ b/commons/marmotta-sesame-tools/marmotta-rio-api/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0-SNAPSHOT</version>
+        <version>3.2.0</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/f5b5cf0c/commons/marmotta-sesame-tools/marmotta-rio-ical/pom.xml
----------------------------------------------------------------------
diff --git a/commons/marmotta-sesame-tools/marmotta-rio-ical/pom.xml b/commons/marmotta-sesame-tools/marmotta-rio-ical/pom.xml
index 5fe23e8..28608f1 100644
--- a/commons/marmotta-sesame-tools/marmotta-rio-ical/pom.xml
+++ b/commons/marmotta-sesame-tools/marmotta-rio-ical/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0-SNAPSHOT</version>
+        <version>3.2.0</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/f5b5cf0c/commons/marmotta-sesame-tools/marmotta-rio-rss/pom.xml
----------------------------------------------------------------------
diff --git a/commons/marmotta-sesame-tools/marmotta-rio-rss/pom.xml b/commons/marmotta-sesame-tools/marmotta-rio-rss/pom.xml
index 2e8b2f3..9d1539b 100644
--- a/commons/marmotta-sesame-tools/marmotta-rio-rss/pom.xml
+++ b/commons/marmotta-sesame-tools/marmotta-rio-rss/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0-SNAPSHOT</version>
+        <version>3.2.0</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/f5b5cf0c/commons/marmotta-sesame-tools/marmotta-rio-vcard/pom.xml
----------------------------------------------------------------------
diff --git a/commons/marmotta-sesame-tools/marmotta-rio-vcard/pom.xml b/commons/marmotta-sesame-tools/marmotta-rio-vcard/pom.xml
index 9b82335..698037e 100644
--- a/commons/marmotta-sesame-tools/marmotta-rio-vcard/pom.xml
+++ b/commons/marmotta-sesame-tools/marmotta-rio-vcard/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0-SNAPSHOT</version>
+        <version>3.2.0</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/f5b5cf0c/commons/marmotta-sesame-tools/marmotta-sail-contextaware/pom.xml
----------------------------------------------------------------------
diff --git a/commons/marmotta-sesame-tools/marmotta-sail-contextaware/pom.xml b/commons/marmotta-sesame-tools/marmotta-sail-contextaware/pom.xml
index fde8240..42128aa 100644
--- a/commons/marmotta-sesame-tools/marmotta-sail-contextaware/pom.xml
+++ b/commons/marmotta-sesame-tools/marmotta-sail-contextaware/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0-SNAPSHOT</version>
+        <version>3.2.0</version>
         <relativePath>../../../parent/</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/f5b5cf0c/commons/marmotta-sesame-tools/marmotta-sail-transactions/pom.xml
----------------------------------------------------------------------
diff --git a/commons/marmotta-sesame-tools/marmotta-sail-transactions/pom.xml b/commons/marmotta-sesame-tools/marmotta-sail-transactions/pom.xml
index bcb713a..4a24f91 100644
--- a/commons/marmotta-sesame-tools/marmotta-sail-transactions/pom.xml
+++ b/commons/marmotta-sesame-tools/marmotta-sail-transactions/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0-SNAPSHOT</version>
+        <version>3.2.0</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/f5b5cf0c/commons/marmotta-sesame-tools/marmotta-sesame-matchers/pom.xml
----------------------------------------------------------------------
diff --git a/commons/marmotta-sesame-tools/marmotta-sesame-matchers/pom.xml b/commons/marmotta-sesame-tools/marmotta-sesame-matchers/pom.xml
index 709ee01..f5a9e7a 100644
--- a/commons/marmotta-sesame-tools/marmotta-sesame-matchers/pom.xml
+++ b/commons/marmotta-sesame-tools/marmotta-sesame-matchers/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0-SNAPSHOT</version>
+        <version>3.2.0</version>
         <relativePath>../../../parent/</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/f5b5cf0c/commons/marmotta-sesame-tools/marmotta-util-facading/pom.xml
----------------------------------------------------------------------
diff --git a/commons/marmotta-sesame-tools/marmotta-util-facading/pom.xml b/commons/marmotta-sesame-tools/marmotta-util-facading/pom.xml
index 2bd4823..7babadb 100644
--- a/commons/marmotta-sesame-tools/marmotta-util-facading/pom.xml
+++ b/commons/marmotta-sesame-tools/marmotta-util-facading/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0-SNAPSHOT</version>
+        <version>3.2.0</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/f5b5cf0c/commons/marmotta-sesame-tools/marmotta-util-filter/pom.xml
----------------------------------------------------------------------
diff --git a/commons/marmotta-sesame-tools/marmotta-util-filter/pom.xml b/commons/marmotta-sesame-tools/marmotta-util-filter/pom.xml
index 8890d9a..8f585eb 100644
--- a/commons/marmotta-sesame-tools/marmotta-util-filter/pom.xml
+++ b/commons/marmotta-sesame-tools/marmotta-util-filter/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0-SNAPSHOT</version>
+        <version>3.2.0</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/f5b5cf0c/commons/marmotta-sesame-tools/marmotta-util-rdfpatch/pom.xml
----------------------------------------------------------------------
diff --git a/commons/marmotta-sesame-tools/marmotta-util-rdfpatch/pom.xml b/commons/marmotta-sesame-tools/marmotta-util-rdfpatch/pom.xml
index ce35792..6ed1b35 100644
--- a/commons/marmotta-sesame-tools/marmotta-util-rdfpatch/pom.xml
+++ b/commons/marmotta-sesame-tools/marmotta-util-rdfpatch/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0-SNAPSHOT</version>
+        <version>3.2.0</version>
         <relativePath>../../../parent/</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/f5b5cf0c/commons/marmotta-sesame-tools/marmotta-util-tripletable/pom.xml
----------------------------------------------------------------------
diff --git a/commons/marmotta-sesame-tools/marmotta-util-tripletable/pom.xml b/commons/marmotta-sesame-tools/marmotta-util-tripletable/pom.xml
index ad21202..cdde08a 100644
--- a/commons/marmotta-sesame-tools/marmotta-util-tripletable/pom.xml
+++ b/commons/marmotta-sesame-tools/marmotta-util-tripletable/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0-SNAPSHOT</version>
+        <version>3.2.0</version>
         <relativePath>../../../parent/</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/f5b5cf0c/commons/marmotta-sesame-tools/pom.xml
----------------------------------------------------------------------
diff --git a/commons/marmotta-sesame-tools/pom.xml b/commons/marmotta-sesame-tools/pom.xml
index 15aa51d..edce64c 100644
--- a/commons/marmotta-sesame-tools/pom.xml
+++ b/commons/marmotta-sesame-tools/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0-SNAPSHOT</version>
+        <version>3.2.0</version>
         <relativePath>../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/f5b5cf0c/commons/pom.xml
----------------------------------------------------------------------
diff --git a/commons/pom.xml b/commons/pom.xml
index c4f83c4..3d9355f 100644
--- a/commons/pom.xml
+++ b/commons/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0-SNAPSHOT</version>
+        <version>3.2.0</version>
         <relativePath>../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/f5b5cf0c/extras/pom.xml
----------------------------------------------------------------------
diff --git a/extras/pom.xml b/extras/pom.xml
index 164109e..e3b34af 100644
--- a/extras/pom.xml
+++ b/extras/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0-SNAPSHOT</version>
+        <version>3.2.0</version>
         <relativePath>../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/f5b5cf0c/extras/webjars/codemirror/pom.xml
----------------------------------------------------------------------
diff --git a/extras/webjars/codemirror/pom.xml b/extras/webjars/codemirror/pom.xml
index 0b1edec..0046a6e 100644
--- a/extras/webjars/codemirror/pom.xml
+++ b/extras/webjars/codemirror/pom.xml
@@ -22,7 +22,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0-SNAPSHOT</version>
+        <version>3.2.0</version>
         <relativePath>../../../parent/</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/f5b5cf0c/extras/webjars/pom.xml
----------------------------------------------------------------------
diff --git a/extras/webjars/pom.xml b/extras/webjars/pom.xml
index e428f3f..fde39f4 100644
--- a/extras/webjars/pom.xml
+++ b/extras/webjars/pom.xml
@@ -22,7 +22,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0-SNAPSHOT</version>
+        <version>3.2.0</version>
         <relativePath>../../parent/</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/f5b5cf0c/extras/webjars/strftime/pom.xml
----------------------------------------------------------------------
diff --git a/extras/webjars/strftime/pom.xml b/extras/webjars/strftime/pom.xml
index 68a50cf..fcf0455 100644
--- a/extras/webjars/strftime/pom.xml
+++ b/extras/webjars/strftime/pom.xml
@@ -22,7 +22,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0-SNAPSHOT</version>
+        <version>3.2.0</version>
         <relativePath>../../../parent/</relativePath> 
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/f5b5cf0c/launchers/marmotta-installer/pom.xml
----------------------------------------------------------------------
diff --git a/launchers/marmotta-installer/pom.xml b/launchers/marmotta-installer/pom.xml
index ef8cdea..35ca306 100644
--- a/launchers/marmotta-installer/pom.xml
+++ b/launchers/marmotta-installer/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0-SNAPSHOT</version>
+        <version>3.2.0</version>
         <relativePath>../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/f5b5cf0c/launchers/marmotta-splash/pom.xml
----------------------------------------------------------------------
diff --git a/launchers/marmotta-splash/pom.xml b/launchers/marmotta-splash/pom.xml
index 736b096..9dbb127 100644
--- a/launchers/marmotta-splash/pom.xml
+++ b/launchers/marmotta-splash/pom.xml
@@ -22,7 +22,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0-SNAPSHOT</version>
+        <version>3.2.0</version>
         <relativePath>../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/f5b5cf0c/launchers/marmotta-webapp/pom.xml
----------------------------------------------------------------------
diff --git a/launchers/marmotta-webapp/pom.xml b/launchers/marmotta-webapp/pom.xml
index 4f90733..5f1ed2e 100644
--- a/launchers/marmotta-webapp/pom.xml
+++ b/launchers/marmotta-webapp/pom.xml
@@ -22,7 +22,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0-SNAPSHOT</version>
+        <version>3.2.0</version>
         <relativePath>../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/f5b5cf0c/launchers/pom.xml
----------------------------------------------------------------------
diff --git a/launchers/pom.xml b/launchers/pom.xml
index 542a291..e0bbb1b 100644
--- a/launchers/pom.xml
+++ b/launchers/pom.xml
@@ -22,7 +22,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0-SNAPSHOT</version>
+        <version>3.2.0</version>
         <relativePath>../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/f5b5cf0c/libraries/kiwi/kiwi-caching-ehcache/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-caching-ehcache/pom.xml b/libraries/kiwi/kiwi-caching-ehcache/pom.xml
index a1e6afd..4cb3dfa 100644
--- a/libraries/kiwi/kiwi-caching-ehcache/pom.xml
+++ b/libraries/kiwi/kiwi-caching-ehcache/pom.xml
@@ -16,15 +16,13 @@
   ~ limitations under the License.
   -->
 
-<project xmlns="http://maven.apache.org/POM/4.0.0"
-         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>kiwi-parent</artifactId>
-        <version>3.2.0-SNAPSHOT</version>
+        <version>3.2.0</version>
     </parent>
 
     <artifactId>kiwi-caching-ehcache</artifactId>

http://git-wip-us.apache.org/repos/asf/marmotta/blob/f5b5cf0c/libraries/kiwi/kiwi-caching-hazelcast/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-caching-hazelcast/pom.xml b/libraries/kiwi/kiwi-caching-hazelcast/pom.xml
index 5f9a648..b07b6c9 100644
--- a/libraries/kiwi/kiwi-caching-hazelcast/pom.xml
+++ b/libraries/kiwi/kiwi-caching-hazelcast/pom.xml
@@ -16,15 +16,13 @@
   ~ limitations under the License.
   -->
 
-<project xmlns="http://maven.apache.org/POM/4.0.0"
-         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>kiwi-parent</artifactId>
-        <version>3.2.0-SNAPSHOT</version>
+        <version>3.2.0</version>
     </parent>
 
     <artifactId>kiwi-caching-hazelcast</artifactId>

http://git-wip-us.apache.org/repos/asf/marmotta/blob/f5b5cf0c/libraries/kiwi/kiwi-caching-infinispan/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-caching-infinispan/pom.xml b/libraries/kiwi/kiwi-caching-infinispan/pom.xml
index c57b260..61e649a 100644
--- a/libraries/kiwi/kiwi-caching-infinispan/pom.xml
+++ b/libraries/kiwi/kiwi-caching-infinispan/pom.xml
@@ -16,15 +16,13 @@
   ~ limitations under the License.
   -->
 
-<project xmlns="http://maven.apache.org/POM/4.0.0"
-         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>kiwi-parent</artifactId>
-        <version>3.2.0-SNAPSHOT</version>
+        <version>3.2.0</version>
         <relativePath>../</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/f5b5cf0c/libraries/kiwi/kiwi-loader/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-loader/pom.xml b/libraries/kiwi/kiwi-loader/pom.xml
index 3913a72..d07fe52 100644
--- a/libraries/kiwi/kiwi-loader/pom.xml
+++ b/libraries/kiwi/kiwi-loader/pom.xml
@@ -9,13 +9,12 @@
     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. -->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>kiwi-parent</artifactId>
-        <version>3.2.0-SNAPSHOT</version>
+        <version>3.2.0</version>
     </parent>
 
     <artifactId>kiwi-loader</artifactId>

http://git-wip-us.apache.org/repos/asf/marmotta/blob/f5b5cf0c/libraries/kiwi/kiwi-reasoner/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-reasoner/pom.xml b/libraries/kiwi/kiwi-reasoner/pom.xml
index ff3a97a..ddbed48 100644
--- a/libraries/kiwi/kiwi-reasoner/pom.xml
+++ b/libraries/kiwi/kiwi-reasoner/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>kiwi-parent</artifactId>
-        <version>3.2.0-SNAPSHOT</version>
+        <version>3.2.0</version>
         <relativePath>../</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/f5b5cf0c/libraries/kiwi/kiwi-sparql/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-sparql/pom.xml b/libraries/kiwi/kiwi-sparql/pom.xml
index c7a1c46..0768ceb 100644
--- a/libraries/kiwi/kiwi-sparql/pom.xml
+++ b/libraries/kiwi/kiwi-sparql/pom.xml
@@ -22,7 +22,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>kiwi-parent</artifactId>
-        <version>3.2.0-SNAPSHOT</version>
+        <version>3.2.0</version>
         <relativePath>../</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/f5b5cf0c/libraries/kiwi/kiwi-triplestore/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-triplestore/pom.xml b/libraries/kiwi/kiwi-triplestore/pom.xml
index 96a6f13..8be0f8f 100644
--- a/libraries/kiwi/kiwi-triplestore/pom.xml
+++ b/libraries/kiwi/kiwi-triplestore/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>kiwi-parent</artifactId>
-        <version>3.2.0-SNAPSHOT</version>
+        <version>3.2.0</version>
         <relativePath>../</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/f5b5cf0c/libraries/kiwi/kiwi-versioning/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-versioning/pom.xml b/libraries/kiwi/kiwi-versioning/pom.xml
index 20eba74..cf30946 100644
--- a/libraries/kiwi/kiwi-versioning/pom.xml
+++ b/libraries/kiwi/kiwi-versioning/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>kiwi-parent</artifactId>
-        <version>3.2.0-SNAPSHOT</version>
+        <version>3.2.0</version>
         <relativePath>../</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/f5b5cf0c/libraries/kiwi/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/kiwi/pom.xml b/libraries/kiwi/pom.xml
index 0b77792..694f270 100644
--- a/libraries/kiwi/pom.xml
+++ b/libraries/kiwi/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0-SNAPSHOT</version>
+        <version>3.2.0</version>
         <relativePath>../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/f5b5cf0c/libraries/ldcache/ldcache-api/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldcache/ldcache-api/pom.xml b/libraries/ldcache/ldcache-api/pom.xml
index 59454ef..fa5bcea 100644
--- a/libraries/ldcache/ldcache-api/pom.xml
+++ b/libraries/ldcache/ldcache-api/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0-SNAPSHOT</version>
+        <version>3.2.0</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/f5b5cf0c/libraries/ldcache/ldcache-backend-file/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldcache/ldcache-backend-file/pom.xml b/libraries/ldcache/ldcache-backend-file/pom.xml
index 9ab2bd3..e9abeef 100644
--- a/libraries/ldcache/ldcache-backend-file/pom.xml
+++ b/libraries/ldcache/ldcache-backend-file/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0-SNAPSHOT</version>
+        <version>3.2.0</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/f5b5cf0c/libraries/ldcache/ldcache-backend-infinispan/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldcache/ldcache-backend-infinispan/pom.xml b/libraries/ldcache/ldcache-backend-infinispan/pom.xml
index a4bd526..873511e 100644
--- a/libraries/ldcache/ldcache-backend-infinispan/pom.xml
+++ b/libraries/ldcache/ldcache-backend-infinispan/pom.xml
@@ -16,15 +16,13 @@
   ~ limitations under the License.
   -->
 
-<project xmlns="http://maven.apache.org/POM/4.0.0"
-         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0-SNAPSHOT</version>
+        <version>3.2.0</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/f5b5cf0c/libraries/ldcache/ldcache-backend-kiwi/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldcache/ldcache-backend-kiwi/pom.xml b/libraries/ldcache/ldcache-backend-kiwi/pom.xml
index 070e294..ca78593 100644
--- a/libraries/ldcache/ldcache-backend-kiwi/pom.xml
+++ b/libraries/ldcache/ldcache-backend-kiwi/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0-SNAPSHOT</version>
+        <version>3.2.0</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/f5b5cf0c/libraries/ldcache/ldcache-core/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldcache/ldcache-core/pom.xml b/libraries/ldcache/ldcache-core/pom.xml
index c823f69..f6c5e27 100644
--- a/libraries/ldcache/ldcache-core/pom.xml
+++ b/libraries/ldcache/ldcache-core/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0-SNAPSHOT</version>
+        <version>3.2.0</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/f5b5cf0c/libraries/ldcache/ldcache-sail-generic/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldcache/ldcache-sail-generic/pom.xml b/libraries/ldcache/ldcache-sail-generic/pom.xml
index b2c6eaf..78ad47f 100644
--- a/libraries/ldcache/ldcache-sail-generic/pom.xml
+++ b/libraries/ldcache/ldcache-sail-generic/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0-SNAPSHOT</version>
+        <version>3.2.0</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/f5b5cf0c/libraries/ldcache/ldcache-sail-kiwi/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldcache/ldcache-sail-kiwi/pom.xml b/libraries/ldcache/ldcache-sail-kiwi/pom.xml
index fab4797..34fa855 100644
--- a/libraries/ldcache/ldcache-sail-kiwi/pom.xml
+++ b/libraries/ldcache/ldcache-sail-kiwi/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0-SNAPSHOT</version>
+        <version>3.2.0</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/f5b5cf0c/libraries/ldcache/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldcache/pom.xml b/libraries/ldcache/pom.xml
index 4d66112..f184f63 100644
--- a/libraries/ldcache/pom.xml
+++ b/libraries/ldcache/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0-SNAPSHOT</version>
+        <version>3.2.0</version>
         <relativePath>../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/f5b5cf0c/libraries/ldclient/ldclient-api/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldclient/ldclient-api/pom.xml b/libraries/ldclient/ldclient-api/pom.xml
index c309e3e..c672943 100644
--- a/libraries/ldclient/ldclient-api/pom.xml
+++ b/libraries/ldclient/ldclient-api/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0-SNAPSHOT</version>
+        <version>3.2.0</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/f5b5cf0c/libraries/ldclient/ldclient-core/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldclient/ldclient-core/pom.xml b/libraries/ldclient/ldclient-core/pom.xml
index dba4d13..ac24d0b 100644
--- a/libraries/ldclient/ldclient-core/pom.xml
+++ b/libraries/ldclient/ldclient-core/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0-SNAPSHOT</version>
+        <version>3.2.0</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/f5b5cf0c/libraries/ldclient/ldclient-provider-facebook/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldclient/ldclient-provider-facebook/pom.xml b/libraries/ldclient/ldclient-provider-facebook/pom.xml
index 2dcbb85..e249a0a 100644
--- a/libraries/ldclient/ldclient-provider-facebook/pom.xml
+++ b/libraries/ldclient/ldclient-provider-facebook/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0-SNAPSHOT</version>
+        <version>3.2.0</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/f5b5cf0c/libraries/ldclient/ldclient-provider-freebase/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldclient/ldclient-provider-freebase/pom.xml b/libraries/ldclient/ldclient-provider-freebase/pom.xml
index c233928..59b33ed 100644
--- a/libraries/ldclient/ldclient-provider-freebase/pom.xml
+++ b/libraries/ldclient/ldclient-provider-freebase/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0-SNAPSHOT</version>
+        <version>3.2.0</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/f5b5cf0c/libraries/ldclient/ldclient-provider-html/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldclient/ldclient-provider-html/pom.xml b/libraries/ldclient/ldclient-provider-html/pom.xml
index cd31921..3040455 100644
--- a/libraries/ldclient/ldclient-provider-html/pom.xml
+++ b/libraries/ldclient/ldclient-provider-html/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0-SNAPSHOT</version>
+        <version>3.2.0</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/f5b5cf0c/libraries/ldclient/ldclient-provider-ldap/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldclient/ldclient-provider-ldap/pom.xml b/libraries/ldclient/ldclient-provider-ldap/pom.xml
index 07a819d..45651fa 100644
--- a/libraries/ldclient/ldclient-provider-ldap/pom.xml
+++ b/libraries/ldclient/ldclient-provider-ldap/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0-SNAPSHOT</version>
+        <version>3.2.0</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/f5b5cf0c/libraries/ldclient/ldclient-provider-mediawiki/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldclient/ldclient-provider-mediawiki/pom.xml b/libraries/ldclient/ldclient-provider-mediawiki/pom.xml
index cd1d09e..a1aca3d 100644
--- a/libraries/ldclient/ldclient-provider-mediawiki/pom.xml
+++ b/libraries/ldclient/ldclient-provider-mediawiki/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0-SNAPSHOT</version>
+        <version>3.2.0</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/f5b5cf0c/libraries/ldclient/ldclient-provider-phpbb/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldclient/ldclient-provider-phpbb/pom.xml b/libraries/ldclient/ldclient-provider-phpbb/pom.xml
index 8d1dbf7..7239d64 100644
--- a/libraries/ldclient/ldclient-provider-phpbb/pom.xml
+++ b/libraries/ldclient/ldclient-provider-phpbb/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0-SNAPSHOT</version>
+        <version>3.2.0</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/f5b5cf0c/libraries/ldclient/ldclient-provider-rdf/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldclient/ldclient-provider-rdf/pom.xml b/libraries/ldclient/ldclient-provider-rdf/pom.xml
index 76d60d9..ad1166f 100644
--- a/libraries/ldclient/ldclient-provider-rdf/pom.xml
+++ b/libraries/ldclient/ldclient-provider-rdf/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0-SNAPSHOT</version>
+        <version>3.2.0</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/f5b5cf0c/libraries/ldclient/ldclient-provider-rdfa/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldclient/ldclient-provider-rdfa/pom.xml b/libraries/ldclient/ldclient-provider-rdfa/pom.xml
index d86fc94..f0bdddf 100644
--- a/libraries/ldclient/ldclient-provider-rdfa/pom.xml
+++ b/libraries/ldclient/ldclient-provider-rdfa/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0-SNAPSHOT</version>
+        <version>3.2.0</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/f5b5cf0c/libraries/ldclient/ldclient-provider-vimeo/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldclient/ldclient-provider-vimeo/pom.xml b/libraries/ldclient/ldclient-provider-vimeo/pom.xml
index 7a32238..e1b12cf 100644
--- a/libraries/ldclient/ldclient-provider-vimeo/pom.xml
+++ b/libraries/ldclient/ldclient-provider-vimeo/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0-SNAPSHOT</version>
+        <version>3.2.0</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/f5b5cf0c/libraries/ldclient/ldclient-provider-xml/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldclient/ldclient-provider-xml/pom.xml b/libraries/ldclient/ldclient-provider-xml/pom.xml
index 68c747a..8e63562 100644
--- a/libraries/ldclient/ldclient-provider-xml/pom.xml
+++ b/libraries/ldclient/ldclient-provider-xml/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0-SNAPSHOT</version>
+        <version>3.2.0</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/f5b5cf0c/libraries/ldclient/ldclient-provider-youtube/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldclient/ldclient-provider-youtube/pom.xml b/libraries/ldclient/ldclient-provider-youtube/pom.xml
index 36e95c9..95727eb 100644
--- a/libraries/ldclient/ldclient-provider-youtube/pom.xml
+++ b/libraries/ldclient/ldclient-provider-youtube/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0-SNAPSHOT</version>
+        <version>3.2.0</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/f5b5cf0c/libraries/ldclient/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldclient/pom.xml b/libraries/ldclient/pom.xml
index 43cc045..0d9a53f 100644
--- a/libraries/ldclient/pom.xml
+++ b/libraries/ldclient/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0-SNAPSHOT</version>
+        <version>3.2.0</version>
         <relativePath>../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/f5b5cf0c/libraries/ldpath/ldpath-api/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-api/pom.xml b/libraries/ldpath/ldpath-api/pom.xml
index 4a6c1f8..2c5b5cb 100644
--- a/libraries/ldpath/ldpath-api/pom.xml
+++ b/libraries/ldpath/ldpath-api/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0-SNAPSHOT</version>
+        <version>3.2.0</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/f5b5cf0c/libraries/ldpath/ldpath-backend-file/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-backend-file/pom.xml b/libraries/ldpath/ldpath-backend-file/pom.xml
index 14612f2..6ba19ca 100644
--- a/libraries/ldpath/ldpath-backend-file/pom.xml
+++ b/libraries/ldpath/ldpath-backend-file/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0-SNAPSHOT</version>
+        <version>3.2.0</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/f5b5cf0c/libraries/ldpath/ldpath-backend-jena/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-backend-jena/pom.xml b/libraries/ldpath/ldpath-backend-jena/pom.xml
index a51355f..a5e91d6 100644
--- a/libraries/ldpath/ldpath-backend-jena/pom.xml
+++ b/libraries/ldpath/ldpath-backend-jena/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0-SNAPSHOT</version>
+        <version>3.2.0</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/f5b5cf0c/libraries/ldpath/ldpath-backend-linkeddata/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-backend-linkeddata/pom.xml b/libraries/ldpath/ldpath-backend-linkeddata/pom.xml
index 81abf13..5848b48 100644
--- a/libraries/ldpath/ldpath-backend-linkeddata/pom.xml
+++ b/libraries/ldpath/ldpath-backend-linkeddata/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0-SNAPSHOT</version>
+        <version>3.2.0</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/f5b5cf0c/libraries/ldpath/ldpath-backend-sesame/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-backend-sesame/pom.xml b/libraries/ldpath/ldpath-backend-sesame/pom.xml
index 2047d44..3262375 100644
--- a/libraries/ldpath/ldpath-backend-sesame/pom.xml
+++ b/libraries/ldpath/ldpath-backend-sesame/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0-SNAPSHOT</version>
+        <version>3.2.0</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/f5b5cf0c/libraries/ldpath/ldpath-core-bundle/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-core-bundle/pom.xml b/libraries/ldpath/ldpath-core-bundle/pom.xml
index d35ebde..fb57445 100644
--- a/libraries/ldpath/ldpath-core-bundle/pom.xml
+++ b/libraries/ldpath/ldpath-core-bundle/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0-SNAPSHOT</version>
+        <version>3.2.0</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/f5b5cf0c/libraries/ldpath/ldpath-core/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-core/pom.xml b/libraries/ldpath/ldpath-core/pom.xml
index 387ff8b..c963b0a 100644
--- a/libraries/ldpath/ldpath-core/pom.xml
+++ b/libraries/ldpath/ldpath-core/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0-SNAPSHOT</version>
+        <version>3.2.0</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/f5b5cf0c/libraries/ldpath/ldpath-functions-collections/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-functions-collections/pom.xml b/libraries/ldpath/ldpath-functions-collections/pom.xml
index 078188b..dfa590b 100644
--- a/libraries/ldpath/ldpath-functions-collections/pom.xml
+++ b/libraries/ldpath/ldpath-functions-collections/pom.xml
@@ -20,7 +20,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0-SNAPSHOT</version>
+        <version>3.2.0</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/f5b5cf0c/libraries/ldpath/ldpath-functions-date/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-functions-date/pom.xml b/libraries/ldpath/ldpath-functions-date/pom.xml
index af12d19..98f1121 100644
--- a/libraries/ldpath/ldpath-functions-date/pom.xml
+++ b/libraries/ldpath/ldpath-functions-date/pom.xml
@@ -20,7 +20,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0-SNAPSHOT</version>
+        <version>3.2.0</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/f5b5cf0c/libraries/ldpath/ldpath-functions-html/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-functions-html/pom.xml b/libraries/ldpath/ldpath-functions-html/pom.xml
index 4d7e127..991f0b3 100644
--- a/libraries/ldpath/ldpath-functions-html/pom.xml
+++ b/libraries/ldpath/ldpath-functions-html/pom.xml
@@ -19,7 +19,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0-SNAPSHOT</version>
+        <version>3.2.0</version>
         <relativePath>../../../parent</relativePath>
     </parent>
     <modelVersion>4.0.0</modelVersion>

http://git-wip-us.apache.org/repos/asf/marmotta/blob/f5b5cf0c/libraries/ldpath/ldpath-functions-math/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-functions-math/pom.xml b/libraries/ldpath/ldpath-functions-math/pom.xml
index 51c0fe5..3231efb 100644
--- a/libraries/ldpath/ldpath-functions-math/pom.xml
+++ b/libraries/ldpath/ldpath-functions-math/pom.xml
@@ -20,7 +20,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0-SNAPSHOT</version>
+        <version>3.2.0</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/f5b5cf0c/libraries/ldpath/ldpath-functions-text/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-functions-text/pom.xml b/libraries/ldpath/ldpath-functions-text/pom.xml
index 05f8c45..e7d08a0 100644
--- a/libraries/ldpath/ldpath-functions-text/pom.xml
+++ b/libraries/ldpath/ldpath-functions-text/pom.xml
@@ -20,7 +20,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0-SNAPSHOT</version>
+        <version>3.2.0</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/f5b5cf0c/libraries/ldpath/ldpath-functions-xml/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-functions-xml/pom.xml b/libraries/ldpath/ldpath-functions-xml/pom.xml
index 5a58678..7cc029c 100644
--- a/libraries/ldpath/ldpath-functions-xml/pom.xml
+++ b/libraries/ldpath/ldpath-functions-xml/pom.xml
@@ -19,7 +19,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0-SNAPSHOT</version>
+        <version>3.2.0</version>
         <relativePath>../../../parent</relativePath>
     </parent>
     <modelVersion>4.0.0</modelVersion>

http://git-wip-us.apache.org/repos/asf/marmotta/blob/f5b5cf0c/libraries/ldpath/ldpath-template-linkeddata/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-template-linkeddata/pom.xml b/libraries/ldpath/ldpath-template-linkeddata/pom.xml
index bcf4626..1bce32c 100644
--- a/libraries/ldpath/ldpath-template-linkeddata/pom.xml
+++ b/libraries/ldpath/ldpath-template-linkeddata/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0-SNAPSHOT</version>
+        <version>3.2.0</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/f5b5cf0c/libraries/ldpath/ldpath-template/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-template/pom.xml b/libraries/ldpath/ldpath-template/pom.xml
index 96c25fe..d1917ad 100644
--- a/libraries/ldpath/ldpath-template/pom.xml
+++ b/libraries/ldpath/ldpath-template/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0-SNAPSHOT</version>
+        <version>3.2.0</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/f5b5cf0c/libraries/ldpath/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldpath/pom.xml b/libraries/ldpath/pom.xml
index f47872e..fab550e 100644
--- a/libraries/ldpath/pom.xml
+++ b/libraries/ldpath/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0-SNAPSHOT</version>
+        <version>3.2.0</version>
         <relativePath>../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/f5b5cf0c/libraries/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/pom.xml b/libraries/pom.xml
index 54dfc65..6ed6798 100644
--- a/libraries/pom.xml
+++ b/libraries/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0-SNAPSHOT</version>
+        <version>3.2.0</version>
         <relativePath>../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/f5b5cf0c/loader/marmotta-loader-berkeley/pom.xml
----------------------------------------------------------------------
diff --git a/loader/marmotta-loader-berkeley/pom.xml b/loader/marmotta-loader-berkeley/pom.xml
index c68a409..5cb346a 100644
--- a/loader/marmotta-loader-berkeley/pom.xml
+++ b/loader/marmotta-loader-berkeley/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0-SNAPSHOT</version>
+        <version>3.2.0</version>
         <relativePath>../../parent</relativePath>
     </parent>
 
@@ -47,11 +47,11 @@
                         <configuration>
                             <createDependencyReducedPom>false</createDependencyReducedPom>
                             <transformers>
-                                <transformer implementation="org.apache.maven.plugins.shade.resource.ApacheLicenseResourceTransformer"/>
+                                <transformer implementation="org.apache.maven.plugins.shade.resource.ApacheLicenseResourceTransformer" />
                                 <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
                                     <mainClass>org.apache.marmotta.loader.core.MarmottaLoader</mainClass>
                                 </transformer>
-                                <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
+                                <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
                                 <transformer implementation="org.apache.maven.plugins.shade.resource.ApacheNoticeResourceTransformer">
                                     <addHeader>false</addHeader>
                                 </transformer>

http://git-wip-us.apache.org/repos/asf/marmotta/blob/f5b5cf0c/loader/marmotta-loader-core/pom.xml
----------------------------------------------------------------------
diff --git a/loader/marmotta-loader-core/pom.xml b/loader/marmotta-loader-core/pom.xml
index 6ffc422..83cebb4 100644
--- a/loader/marmotta-loader-core/pom.xml
+++ b/loader/marmotta-loader-core/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0-SNAPSHOT</version>
+        <version>3.2.0</version>
         <relativePath>../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/f5b5cf0c/loader/marmotta-loader-hbase/pom.xml
----------------------------------------------------------------------
diff --git a/loader/marmotta-loader-hbase/pom.xml b/loader/marmotta-loader-hbase/pom.xml
index f82d8f6..27872d3 100644
--- a/loader/marmotta-loader-hbase/pom.xml
+++ b/loader/marmotta-loader-hbase/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0-SNAPSHOT</version>
+        <version>3.2.0</version>
         <relativePath>../../parent</relativePath>
     </parent>
 
@@ -47,11 +47,11 @@
                         <configuration>
                             <createDependencyReducedPom>false</createDependencyReducedPom>
                             <transformers>
-                                <transformer implementation="org.apache.maven.plugins.shade.resource.ApacheLicenseResourceTransformer"/>
+                                <transformer implementation="org.apache.maven.plugins.shade.resource.ApacheLicenseResourceTransformer" />
                                 <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
                                     <mainClass>org.apache.marmotta.loader.core.MarmottaLoader</mainClass>
                                 </transformer>
-                                <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
+                                <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
                                 <transformer implementation="org.apache.maven.plugins.shade.resource.ApacheNoticeResourceTransformer">
                                     <addHeader>false</addHeader>
                                 </transformer>

http://git-wip-us.apache.org/repos/asf/marmotta/blob/f5b5cf0c/loader/marmotta-loader-kiwi/pom.xml
----------------------------------------------------------------------
diff --git a/loader/marmotta-loader-kiwi/pom.xml b/loader/marmotta-loader-kiwi/pom.xml
index 2997dba..94d8d92 100644
--- a/loader/marmotta-loader-kiwi/pom.xml
+++ b/loader/marmotta-loader-kiwi/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0-SNAPSHOT</version>
+        <version>3.2.0</version>
         <relativePath>../../parent</relativePath>
     </parent>
 
@@ -47,11 +47,11 @@
                         <configuration>
                             <createDependencyReducedPom>false</createDependencyReducedPom>
                             <transformers>
-                                <transformer implementation="org.apache.maven.plugins.shade.resource.ApacheLicenseResourceTransformer"/>
+                                <transformer implementation="org.apache.maven.plugins.shade.resource.ApacheLicenseResourceTransformer" />
                                 <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
                                     <mainClass>org.apache.marmotta.loader.core.MarmottaLoader</mainClass>
                                 </transformer>
-                                <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
+                                <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
                                 <transformer implementation="org.apache.maven.plugins.shade.resource.ApacheNoticeResourceTransformer">
                                     <addHeader>false</addHeader>
                                 </transformer>

http://git-wip-us.apache.org/repos/asf/marmotta/blob/f5b5cf0c/loader/marmotta-loader-titan/pom.xml
----------------------------------------------------------------------
diff --git a/loader/marmotta-loader-titan/pom.xml b/loader/marmotta-loader-titan/pom.xml
index 7d41a77..02358b9 100644
--- a/loader/marmotta-loader-titan/pom.xml
+++ b/loader/marmotta-loader-titan/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0-SNAPSHOT</version>
+        <version>3.2.0</version>
         <relativePath>../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/f5b5cf0c/loader/pom.xml
----------------------------------------------------------------------
diff --git a/loader/pom.xml b/loader/pom.xml
index 72d6649..b1044db 100644
--- a/loader/pom.xml
+++ b/loader/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0-SNAPSHOT</version>
+        <version>3.2.0</version>
         <relativePath>../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/f5b5cf0c/parent/pom.xml
----------------------------------------------------------------------
diff --git a/parent/pom.xml b/parent/pom.xml
index 5a03106..3c2f128 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -29,7 +29,7 @@
     <groupId>org.apache.marmotta</groupId>
     <artifactId>marmotta-parent</artifactId>
     <packaging>pom</packaging>
-    <version>3.2.0-SNAPSHOT</version>
+    <version>3.2.0</version>
 
     <name>Apache Marmotta Parent</name>
     <description>Parent POM for the Apache Marmotta project</description>
@@ -1781,4 +1781,8 @@
         <tag>3.1.0</tag>
     </scm>
 -->
+
+  <scm>
+    <tag>3.2.0</tag>
+  </scm>
 </project>

http://git-wip-us.apache.org/repos/asf/marmotta/blob/f5b5cf0c/platform/backends/marmotta-backend-kiwi/pom.xml
----------------------------------------------------------------------
diff --git a/platform/backends/marmotta-backend-kiwi/pom.xml b/platform/backends/marmotta-backend-kiwi/pom.xml
index 606e223..faea6ff 100644
--- a/platform/backends/marmotta-backend-kiwi/pom.xml
+++ b/platform/backends/marmotta-backend-kiwi/pom.xml
@@ -16,15 +16,13 @@
   ~ limitations under the License.
   -->
 
-<project xmlns="http://maven.apache.org/POM/4.0.0"
-         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0-SNAPSHOT</version>
+        <version>3.2.0</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/f5b5cf0c/platform/backends/marmotta-backend-memory/pom.xml
----------------------------------------------------------------------
diff --git a/platform/backends/marmotta-backend-memory/pom.xml b/platform/backends/marmotta-backend-memory/pom.xml
index 8cc3396..94a4979 100644
--- a/platform/backends/marmotta-backend-memory/pom.xml
+++ b/platform/backends/marmotta-backend-memory/pom.xml
@@ -15,15 +15,13 @@
    See the License for the specific language governing permissions and
    limitations under the License.
 -->
-<project xmlns="http://maven.apache.org/POM/4.0.0"
-         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0-SNAPSHOT</version>
+        <version>3.2.0</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/f5b5cf0c/platform/backends/marmotta-backend-native/pom.xml
----------------------------------------------------------------------
diff --git a/platform/backends/marmotta-backend-native/pom.xml b/platform/backends/marmotta-backend-native/pom.xml
index 7f4851c..09f80fb 100644
--- a/platform/backends/marmotta-backend-native/pom.xml
+++ b/platform/backends/marmotta-backend-native/pom.xml
@@ -16,15 +16,13 @@
   ~ limitations under the License.
   -->
 
-<project xmlns="http://maven.apache.org/POM/4.0.0"
-         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0-SNAPSHOT</version>
+        <version>3.2.0</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/f5b5cf0c/platform/backends/marmotta-backend-titan/pom.xml
----------------------------------------------------------------------
diff --git a/platform/backends/marmotta-backend-titan/pom.xml b/platform/backends/marmotta-backend-titan/pom.xml
index 10c0afe..b3fb632 100644
--- a/platform/backends/marmotta-backend-titan/pom.xml
+++ b/platform/backends/marmotta-backend-titan/pom.xml
@@ -16,15 +16,13 @@
 ~ limitations under the License.
 -->
 
-<project xmlns="http://maven.apache.org/POM/4.0.0"
-         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0-SNAPSHOT</version>
+        <version>3.2.0</version>
         <relativePath>../../../parent/pom.xml</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/f5b5cf0c/platform/backends/pom.xml
----------------------------------------------------------------------
diff --git a/platform/backends/pom.xml b/platform/backends/pom.xml
index 6a88063..3f40a2b 100644
--- a/platform/backends/pom.xml
+++ b/platform/backends/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0-SNAPSHOT</version>
+        <version>3.2.0</version>
         <relativePath>../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/f5b5cf0c/platform/ldcache/marmotta-ldcache-common/pom.xml
----------------------------------------------------------------------
diff --git a/platform/ldcache/marmotta-ldcache-common/pom.xml b/platform/ldcache/marmotta-ldcache-common/pom.xml
index 93b5c21..7fe23a3 100644
--- a/platform/ldcache/marmotta-ldcache-common/pom.xml
+++ b/platform/ldcache/marmotta-ldcache-common/pom.xml
@@ -16,15 +16,13 @@
   ~ limitations under the License.
   -->
 
-<project xmlns="http://maven.apache.org/POM/4.0.0"
-         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0-SNAPSHOT</version>
+        <version>3.2.0</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/f5b5cf0c/platform/ldcache/marmotta-ldcache-file/pom.xml
----------------------------------------------------------------------
diff --git a/platform/ldcache/marmotta-ldcache-file/pom.xml b/platform/ldcache/marmotta-ldcache-file/pom.xml
index 851ce27..a7044d9 100644
--- a/platform/ldcache/marmotta-ldcache-file/pom.xml
+++ b/platform/ldcache/marmotta-ldcache-file/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0-SNAPSHOT</version>
+        <version>3.2.0</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/f5b5cf0c/platform/ldcache/marmotta-ldcache-kiwi/pom.xml
----------------------------------------------------------------------
diff --git a/platform/ldcache/marmotta-ldcache-kiwi/pom.xml b/platform/ldcache/marmotta-ldcache-kiwi/pom.xml
index ae5041d..7c7bd68 100644
--- a/platform/ldcache/marmotta-ldcache-kiwi/pom.xml
+++ b/platform/ldcache/marmotta-ldcache-kiwi/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0-SNAPSHOT</version>
+        <version>3.2.0</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/f5b5cf0c/platform/ldcache/pom.xml
----------------------------------------------------------------------
diff --git a/platform/ldcache/pom.xml b/platform/ldcache/pom.xml
index e14de92..1b0cbf0 100644
--- a/platform/ldcache/pom.xml
+++ b/platform/ldcache/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0-SNAPSHOT</version>
+        <version>3.2.0</version>
         <relativePath>../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/f5b5cf0c/platform/marmotta-core/pom.xml
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/pom.xml b/platform/marmotta-core/pom.xml
index 55366a6..2f24a13 100644
--- a/platform/marmotta-core/pom.xml
+++ b/platform/marmotta-core/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0-SNAPSHOT</version>
+        <version>3.2.0</version>
         <relativePath>../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/f5b5cf0c/platform/marmotta-ldp/pom.xml
----------------------------------------------------------------------
diff --git a/platform/marmotta-ldp/pom.xml b/platform/marmotta-ldp/pom.xml
index a5bcdfe..a7a6b88 100644
--- a/platform/marmotta-ldp/pom.xml
+++ b/platform/marmotta-ldp/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0-SNAPSHOT</version>
+        <version>3.2.0</version>
         <relativePath>../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/f5b5cf0c/platform/marmotta-ldpath/pom.xml
----------------------------------------------------------------------
diff --git a/platform/marmotta-ldpath/pom.xml b/platform/marmotta-ldpath/pom.xml
index 60bc43f..95f9eb6 100644
--- a/platform/marmotta-ldpath/pom.xml
+++ b/platform/marmotta-ldpath/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0-SNAPSHOT</version>
+        <version>3.2.0</version>
         <relativePath>../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/f5b5cf0c/platform/marmotta-reasoner-kiwi/pom.xml
----------------------------------------------------------------------
diff --git a/platform/marmotta-reasoner-kiwi/pom.xml b/platform/marmotta-reasoner-kiwi/pom.xml
index 4e3b5d7..5905919 100644
--- a/platform/marmotta-reasoner-kiwi/pom.xml
+++ b/platform/marmotta-reasoner-kiwi/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0-SNAPSHOT</version>
+        <version>3.2.0</version>
         <relativePath>../../parent</relativePath>
     </parent>
 


[085/100] [abbrv] git commit: enabled testing by default in the embedded marmotta

Posted by wi...@apache.org.
enabled testing by default in the embedded marmotta


Project: http://git-wip-us.apache.org/repos/asf/marmotta/repo
Commit: http://git-wip-us.apache.org/repos/asf/marmotta/commit/c5f0d767
Tree: http://git-wip-us.apache.org/repos/asf/marmotta/tree/c5f0d767
Diff: http://git-wip-us.apache.org/repos/asf/marmotta/diff/c5f0d767

Branch: refs/heads/ldp
Commit: c5f0d7675240bd378f8c7986d5dee0fac06cf956
Parents: db70ff7
Author: Sergio Fernández <wi...@apache.org>
Authored: Wed Apr 16 12:25:50 2014 +0200
Committer: Sergio Fernández <wi...@apache.org>
Committed: Wed Apr 16 12:25:50 2014 +0200

----------------------------------------------------------------------
 .../core/services/logging/LoggingServiceImpl.java    | 11 +++++++----
 .../platform/core/test/base/AbstractMarmotta.java    | 15 +++++++--------
 .../platform/core/test/base/EmbeddedMarmotta.java    |  9 +++++----
 .../platform/core/test/base/JettyMarmotta.java       |  6 ++----
 4 files changed, 21 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/marmotta/blob/c5f0d767/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/logging/LoggingServiceImpl.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/logging/LoggingServiceImpl.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/logging/LoggingServiceImpl.java
index dc53656..3bd7ecc 100644
--- a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/logging/LoggingServiceImpl.java
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/logging/LoggingServiceImpl.java
@@ -143,23 +143,26 @@ public class LoggingServiceImpl implements LoggingService {
     }
 
     public void startEventHandler(@Observes LoggingStartEvent event) {
-        if(!configurationService.getBooleanConfiguration("testing.enabled")) {
+        if(!isTestEnvironment()) {
             log.warn("LOGGING: Switching to Apache Marmotta logging configuration; further output will be found in {}{}log{}*.log", configurationService.getHome(), File.separator, File.separator);
-
             configureLoggers();
         }
     }
 
     public void configurationEventHandler(@Observes ConfigurationChangedEvent event) {
-        if(!configurationService.getBooleanConfiguration("testing.enabled")) {
+        if(!isTestEnvironment()) {
             if (event.containsChangedKeyWithPrefix("logging.")) {
                 log.warn("LOGGING: Reloading logging configuration");
-
                 configureLoggers();
             }
         }
     }
 
+    private boolean isTestEnvironment() {
+        //TODO: Thread.currentThread().getContextClassLoader().getResource("/logback-test.xml") != null
+        //                                                    .getResource("/logback-testing.xml") != null
+        return configurationService.getBooleanConfiguration("testing.enabled", false);
+    }
 
     /**
      * Configure all loggers according to their configuration and set some reasonable fallback for the root level

http://git-wip-us.apache.org/repos/asf/marmotta/blob/c5f0d767/platform/marmotta-core/src/test/java/org/apache/marmotta/platform/core/test/base/AbstractMarmotta.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/test/java/org/apache/marmotta/platform/core/test/base/AbstractMarmotta.java b/platform/marmotta-core/src/test/java/org/apache/marmotta/platform/core/test/base/AbstractMarmotta.java
index b4fb48b..51ca188 100644
--- a/platform/marmotta-core/src/test/java/org/apache/marmotta/platform/core/test/base/AbstractMarmotta.java
+++ b/platform/marmotta-core/src/test/java/org/apache/marmotta/platform/core/test/base/AbstractMarmotta.java
@@ -36,9 +36,9 @@ import java.io.IOException;
 import java.util.HashMap;
 
 /**
- * Add file description here!
- * <p/>
- * Author: Sebastian Schaffert
+ * Abstract Marmotta
+ *
+ * @author Sebastian Schaffert
  */
 public abstract class AbstractMarmotta {
 
@@ -52,7 +52,7 @@ public abstract class AbstractMarmotta {
     protected File home;
 
     protected AbstractMarmotta() {
-    	
+
         // initialise JNDI environment
         try {
             NamingManager.setInitialContextFactoryBuilder(new MarmottaInitialContextFactoryBuilder());
@@ -75,25 +75,23 @@ public abstract class AbstractMarmotta {
             log.error("error adding bean manager to JNDI",e);
         }
 
-
         // create temporary LMF home directory
         home = Files.createTempDir();
 
-        // create a temporary configuration with an in-memory database URL for h2
+        // create a temporary configuration with an in-memory database URL for H2
         override = new MapConfiguration(new HashMap<String,Object>());
         override.setProperty("database.h2.url","jdbc:h2:mem;MVCC=true;DB_CLOSE_ON_EXIT=FALSE;DB_CLOSE_DELAY=10");
         override.setProperty("logging.template", "/logback-testing.xml");
+        override.setProperty("testing.enabled", true);
 
         // initialise LMF using a temporary directory
         startupService = getService(MarmottaStartupService.class);
     }
 
-
     public <T> T getService(Class<T> serviceClass) {
         return container.instance().select(serviceClass).get();
     }
 
-
     public void shutdown() {
         // remove bean manager from JNDI
         cleanJNDI();
@@ -124,4 +122,5 @@ public abstract class AbstractMarmotta {
         }
 
     }
+
 }

http://git-wip-us.apache.org/repos/asf/marmotta/blob/c5f0d767/platform/marmotta-core/src/test/java/org/apache/marmotta/platform/core/test/base/EmbeddedMarmotta.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/test/java/org/apache/marmotta/platform/core/test/base/EmbeddedMarmotta.java b/platform/marmotta-core/src/test/java/org/apache/marmotta/platform/core/test/base/EmbeddedMarmotta.java
index a804bad..8d92592 100644
--- a/platform/marmotta-core/src/test/java/org/apache/marmotta/platform/core/test/base/EmbeddedMarmotta.java
+++ b/platform/marmotta-core/src/test/java/org/apache/marmotta/platform/core/test/base/EmbeddedMarmotta.java
@@ -21,10 +21,11 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /**
- * An embedded version of the LMF. Provides support to startup and shutdown the CDI container and the LMF for test cases.
- * After the embedded LMF has been used, it should always be shutdown before being reused.
- * <p/>
- * Author: Sebastian Schaffert
+ * An embedded version of the Marmotta. Provides support to startup and shutdown the CDI container
+ * and the Marmotta for test cases. After the embedded Marmotta has been used, it should always be
+ * shutdown before being reused.
+ *
+ * @author Sebastian Schaffert
  */
 public class EmbeddedMarmotta extends AbstractMarmotta {
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/c5f0d767/platform/marmotta-core/src/test/java/org/apache/marmotta/platform/core/test/base/JettyMarmotta.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/test/java/org/apache/marmotta/platform/core/test/base/JettyMarmotta.java b/platform/marmotta-core/src/test/java/org/apache/marmotta/platform/core/test/base/JettyMarmotta.java
index 5004848..97a7ef1 100644
--- a/platform/marmotta-core/src/test/java/org/apache/marmotta/platform/core/test/base/JettyMarmotta.java
+++ b/platform/marmotta-core/src/test/java/org/apache/marmotta/platform/core/test/base/JettyMarmotta.java
@@ -56,8 +56,8 @@ public class JettyMarmotta extends AbstractMarmotta {
     
     private int port;
 
-	private String context;
-	
+    private String context;
+
     public JettyMarmotta(String context) {
         this(context, getRandomPort());
     }
@@ -86,7 +86,6 @@ public class JettyMarmotta extends AbstractMarmotta {
         this(override, context, getRandomPort(), webservices);
     }
 
-
     public JettyMarmotta(String context, Set<Class<?>> webservices) {
     	this(context, getRandomPort(), webservices);
     }
@@ -110,7 +109,6 @@ public class JettyMarmotta extends AbstractMarmotta {
         // create a new jetty & run it on port 8080
         jetty = new Server(this.port);
 
-
         TestInjectorFactory.setManager(container.getBeanManager());
 
         ServletContextHandler ctx = new ServletContextHandler(jetty, this.context);


[033/100] [abbrv] [partial] Reverting the erroneous merge by Sebastian according to the instructions in INFRA-6876

Posted by wi...@apache.org.
http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/extras/webjars/sgvizler/src/main/java/META-INF/resources/webjars/sgvizler/0.5.1/lib/d3.v2.min.js
----------------------------------------------------------------------
diff --git a/extras/webjars/sgvizler/src/main/java/META-INF/resources/webjars/sgvizler/0.5.1/lib/d3.v2.min.js b/extras/webjars/sgvizler/src/main/java/META-INF/resources/webjars/sgvizler/0.5.1/lib/d3.v2.min.js
new file mode 100644
index 0000000..8f53330
--- /dev/null
+++ b/extras/webjars/sgvizler/src/main/java/META-INF/resources/webjars/sgvizler/0.5.1/lib/d3.v2.min.js
@@ -0,0 +1 @@
+(function(){function h4(b,a){try{for(var e in a){Object.defineProperty(b.prototype,e,{value:a[e],enumerable:!1})}}catch(c){b.prototype=a}}function js(b){var a=-1,e=b.length,c=[];while(++a<e){c.push(b[a])}return c}function i4(a){return Array.prototype.slice.call(a)}function gW(){}function gz(a){return a}function iE(){return this}function kk(){return !0}function ke(a){return typeof a=="function"?a:function(){return a}}function j4(b,a,c){return function(){var e=c.apply(a,arguments);return arguments.length?b:e}}function jW(a){return a!=null&&!isNaN(a)}function iq(a){return a.length}function hC(a){return a==null}function hl(a){return a.replace(/(^\s+)|(\s+$)/g,"").replace(/\s+/g," ")}function jN(b){var a=1;while(b*a%1){a*=10}return a}function i8(){}function iV(b){function c(){var g=a,f=-1,i=g.length,h;while(++f<i){(h=g[f].on)&&h.apply(this,arguments)}return b}var a=[],e=new gW;return c.on=function(g,f){var i=e.get(g),h;return arguments.length<2?i&&i.on:(i&&(i.on=null,a=a.slice(0,h=a.inde
 xOf(i)).concat(a.slice(h+1)),e.remove(g)),f&&a.push(e.set(g,{on:f})),b)},c}function hI(b,a){return a-(b?1+Math.floor(Math.log(b+Math.pow(10,1+Math.floor(Math.log(b)/Math.LN10)-a))/Math.LN10):1)}function hy(a){return a+""}function hs(b){var a=b.lastIndexOf("."),e=a>=0?b.substring(a):(a=b.length,""),c=[];while(a>0){c.push(b.substring(a-=3,a+3))}return c.reverse().join(",")+e}function jJ(b,a){return{scale:Math.pow(10,(8-a)*3),symbol:b}}function ki(a){return function(b){return b<=0?0:b>=1?1:a(b)}}function kf(a){return function(b){return 1-a(1-b)}}function j5(a){return function(b){return 0.5*(b<0.5?a(2*b):2-a(2-2*b))}}function iC(a){return a}function h7(a){return function(b){return Math.pow(b,a)}}function hO(a){return 1-Math.cos(a*Math.PI/2)}function hx(a){return Math.pow(2,10*(a-1))}function jR(a){return 1-Math.sqrt(1-a*a)}function jB(b,a){var c;return arguments.length<2&&(a=0.45),arguments.length<1?(b=1,c=a/4):c=a/(2*Math.PI)*Math.asin(1/b),function(e){return 1+b*Math.pow(2,10*-e)*Math
 .sin((e-c)*2*Math.PI/a)}}function jf(a){return a||(a=1.70158),function(b){return b*b*((a+1)*b-a)}}function iX(a){return a<1/2.75?7.5625*a*a:a<2/2.75?7.5625*(a-=1.5/2.75)*a+0.75:a<2.5/2.75?7.5625*(a-=2.25/2.75)*a+0.9375:7.5625*(a-=2.625/2.75)*a+0.984375}function ai(){d3.event.stopPropagation(),d3.event.preventDefault()}function j6(){var b=d3.event,a;while(a=b.sourceEvent){b=a}return b}function jQ(b){var a=new i8,e=0,c=arguments.length;while(++e<c){a[arguments[e]]=iV(a)}return a.of=function(g,f){return function(i){try{var h=i.sourceEvent=d3.event;i.target=b,d3.event=i,a[i.type].apply(g,f)}finally{d3.event=h}}},a}function h0(a){return a=="transform"?d3.interpolateTransform:d3.interpolate}function hN(b,a){return a=a-(b=+b)?1/(a-b):0,function(c){return(c-b)*a}}function hE(b,a){return a=a-(b=+b)?1/(a-b):0,function(c){return Math.max(0,Math.min(1,(c-b)*a))}}function hv(b,a,c){return new hm(b,a,c)}function hm(b,a,c){this.r=b,this.g=a,this.b=c}function jP(a){return a<16?"0"+Math.max(0,a).toS
 tring(16):Math.min(255,a).toString(16)}function jH(a,j,i){var h=0,g=0,f=0,e,c,b;e=/([a-z]+)\((.*)\)/i.exec(a);if(e){c=e[2].split(",");switch(e[1]){case"hsl":return i(parseFloat(c[0]),parseFloat(c[1])/100,parseFloat(c[2])/100);case"rgb":return j(jg(c[0]),jg(c[1]),jg(c[2]))}}return(b=iM.get(a))?j(b.r,b.g,b.b):(a!=null&&a.charAt(0)==="#"&&(a.length===4?(h=a.charAt(1),h+=h,g=a.charAt(2),g+=g,f=a.charAt(3),f+=f):a.length===7&&(h=a.substring(1,3),g=a.substring(3,5),f=a.substring(5,7)),h=parseInt(h,16),g=parseInt(g,16),f=parseInt(f,16)),j(h,g,f))}function jx(a,j,i){var h=Math.min(a/=255,j/=255,i/=255),g=Math.max(a,j,i),f=g-h,e,c,b=(g+h)/2;return f?(c=b<0.5?f/(g+h):f/(2-g-h),a==g?e=(j-i)/f+(j<i?6:0):j==g?e=(i-a)/f+2:e=(a-j)/f+4,e*=60):c=e=0,g9(e,c,b)}function jg(b){var a=parseFloat(b);return b.charAt(b.length-1)==="%"?Math.round(a*2.55):a}function g9(b,a,c){return new gV(b,a,c)}function gV(b,a,c){this.h=b,this.s=a,this.l=c}function kg(c,b,a){function f(i){return i>360?i-=360:i<0&&(i+=360),i
 <60?h+(g-h)*i/60:i<180?g:i<240?h+(g-h)*(240-i)/60:h}function e(i){return Math.round(f(i)*255)}var h,g;return c%=360,c<0&&(c+=360),b=b<0?0:b>1?1:b,a=a<0?0:a>1?1:a,g=a<=0.5?a*(1+b):a+b-a*b,h=2*a-g,hv(e(c+120),e(c),e(c-120))}function j8(a){return g3(a,jL),a}function jo(a){return function(){return jY(a,this)}}function i9(a){return function(){return ik(a,this)}}function ag(f,e){function i(){if(j=this.classList){return j.add(f)}var j=this.className,l=j.baseVal!=null,k=l?j.baseVal:j;c.lastIndex=0,c.test(k)||(k=hl(k+" "+f),l?j.baseVal=k:this.className=k)}function h(){if(j=this.classList){return j.remove(f)}var j=this.className,l=j.baseVal!=null,k=l?j.baseVal:j;k=hl(k.replace(c," ")),l?j.baseVal=k:this.className=k}function g(){(e.apply(this,arguments)?i:h).call(this)}var c=new RegExp("(^|\\s+)"+d3.requote(f)+"(\\s+|$)","g");if(arguments.length<2){var b=this.node();if(a=b.classList){return a.contains(f)}var a=b.className;return c.lastIndex=0,c.test(a.baseVal!=null?a.baseVal:a)}return this.eac
 h(typeof e=="function"?g:e?i:h)}function ab(a){return{__data__:a}}function ka(a){return function(){return hr(this,a)}}function j7(a){return arguments.length||(a=d3.ascending),function(c,b){return a(c&&c.__data__,b&&b.__data__)}}function jV(a){return g3(a,iz),a}function im(b,a,g){g3(b,i0);var f=new gW,e=d3.dispatch("start","end"),c=ac;return b.id=a,b.time=g,b.tween=function(i,h){return arguments.length<2?f.get(i):(h==null?f.remove(i):f.set(i,h),b)},b.ease=function(h){return arguments.length?(c=typeof h=="function"?h:d3.ease.apply(d3,arguments),b):c},b.each=function(i,h){return arguments.length<2?aa.call(b,i):(e.on(i,h),b)},d3.timer(function(h){return b.each(function(p,n,m){function r(t){return s.active>a?o():(s.active=a,f.forEach(function(v,u){(u=u.call(k,p,n))&&l.push(u)}),e.start.call(k,p,n),q(t)||d3.timer(q,0,g),1)}function q(t){if(s.active!==a){return o()}var w=(t-j)/i,v=c(w),u=l.length;while(u>0){l[--u].call(k,v)}if(w>=1){return o(),iP=a,e.end.call(k,p,n),iP=0,1}}function o(){re
 turn --s.count||delete k.__transition__,1}var l=[],k=this,j=b[m][n].delay,i=b[m][n].duration,s=k.__transition__||(k.__transition__={active:0,count:0});++s.count,j<=h?r(h):d3.timer(r,j,g)}),1},0,g),b}function jc(b,a,c){return c!=""&&ji}function i6(b,a){function e(j,i,h){var g=a.call(this,j,i);return g==null?h!=""&&ji:h!=g&&f(h,g)}function c(i,h,g){return g!=a&&f(g,a)}var f=h0(b);return typeof a=="function"?e:a==null?jc:(a+="",c)}function aa(f){var e=iP,c=ac,b=af,a=ad;iP=this.id,ac=this.ease();for(var l=0,k=this.length;l<k;l++){for(var j=this[l],i=0,h=j.length;i<h;i++){var g=j[i];g&&(af=this[l][i].delay,ad=this[l][i].duration,f.call(g=g.node,g.__data__,i,l))}}return iP=e,ac=c,af=b,ad=a,this}function jz(){var b,a=Date.now(),e=jO;while(e){b=a-e.then,b>=e.delay&&(e.flush=e.callback(b)),e=e.next}var c=jt()-a;c>24?(isFinite(c)&&(clearTimeout(jC),jC=setTimeout(jz,c)),jI=0):(jI=1,jk(jz))}function jt(){var b=null,a=jO,c=Infinity;while(a){a.flush?a=b?b.next=a.next:jO=a.next:(c=Math.min(c,a.the
 n+a.delay),a=(b=a).next)}return c}function jh(b){var a=[b.a,b.b],g=[b.c,b.d],f=jd(a),e=kd(a,g),c=jd(jp(g,a,-e))||0;a[0]*g[1]<g[0]*a[1]&&(a[0]*=-1,a[1]*=-1,f*=-1,e*=-1),this.rotate=(f?Math.atan2(a[1],a[0]):Math.atan2(-g[0],g[1]))*i5,this.translate=[b.e,b.f],this.scale=[f,c],this.skew=c?Math.atan2(e,c)*i5:0}function kd(b,a){return b[0]*a[0]+b[1]*a[1]}function jd(b){var a=Math.sqrt(kd(b,b));return a&&(b[0]/=a,b[1]/=a),a}function jp(b,a,c){return b[0]+=c*a[0],b[1]+=c*a[1],b}function id(b,a){var g=b.ownerSVGElement||b;if(g.createSVGPoint){var f=g.createSVGPoint();if(io<0&&(window.scrollX||window.scrollY)){g=d3.select(document.body).append("svg").style("position","absolute").style("top",0).style("left",0);var e=g[0][0].getScreenCTM();io=!e.f&&!e.e,g.remove()}return io?(f.x=a.pageX,f.y=a.pageY):(f.x=a.clientX,f.y=a.clientY),f=f.matrixTransform(b.getScreenCTM().inverse()),[f.x,f.y]}var c=b.getBoundingClientRect();return[a.clientX-c.left-b.clientLeft,a.clientY-c.top-b.clientTop]}function hS(
 ){}function hD(b){var a=b[0],c=b[b.length-1];return a<c?[a,c]:[c,a]}function jq(a){return a.rangeExtent?a.rangeExtent():hD(a.range())}function i1(c,b){var a=0,h=c.length-1,g=c[a],f=c[h],e;f<g&&(e=a,a=h,h=e,e=g,g=f,f=e);if(e=f-g){b=b(e),c[a]=b.floor(g),c[h]=b.ceil(f)}return c}function he(){return Math}function g0(f,e,c,b){function h(){var j=Math.min(f.length,e.length)>2?kb:kj,k=b?hE:hN;return a=j(f,e,k,c),i=j(e,f,k,d3.interpolate),g}function g(j){return a(j)}var a,i;return g.invert=function(j){return i(j)},g.domain=function(j){return arguments.length?(f=j.map(Number),h()):f},g.range=function(j){return arguments.length?(e=j,h()):e},g.rangeRound=function(j){return g.range(j).interpolate(d3.interpolateRound)},g.clamp=function(j){return arguments.length?(b=j,h()):b},g.interpolate=function(j){return arguments.length?(c=j,h()):c},g.ticks=function(j){return gy(f,j)},g.tickFormat=function(j){return iB(f,j)},g.nice=function(){return i1(f,gJ),h()},g.copy=function(){return g0(f,e,c,b)},h()}func
 tion gP(b,a){return d3.rebind(b,a,"range","rangeRound","interpolate","clamp")}function gJ(a){return a=Math.pow(10,Math.round(Math.log(a)/Math.LN10)-1),{floor:function(b){return Math.floor(b/a)*a},ceil:function(b){return Math.ceil(b/a)*a}}}function gD(b,a){var g=hD(b),f=g[1]-g[0],e=Math.pow(10,Math.floor(Math.log(f/a)/Math.LN10)),c=a/f*e;return c<=0.15?e*=10:c<=0.35?e*=5:c<=0.75&&(e*=2),g[0]=Math.ceil(g[0]/e)*e,g[1]=Math.floor(g[1]/e)*e+e*0.5,g[2]=e,g}function gy(b,a){return d3.range.apply(d3,gD(b,a))}function iB(b,a){return d3.format(",."+Math.max(0,-Math.floor(Math.log(gD(b,a)[2])/Math.LN10+0.01))+"f")}function kj(b,a,g,f){var e=g(b[0],b[1]),c=f(a[0],a[1]);return function(h){return c(e(h))}}function kb(f,e,c,b){var a=[],i=[],h=0,g=Math.min(f.length,e.length)-1;f[g]<f[0]&&(f=f.slice().reverse(),e=e.slice().reverse());while(++h<=g){a.push(c(f[h-1],f[h])),i.push(b(e[h-1],e[h]))}return function(j){var k=d3.bisect(f,j,1,g)-1;return i[k](a[k](j))}}function j2(b,a){function c(f){return b(
 a(f))}var e=a.pow;return c.invert=function(f){return e(b.invert(f))},c.domain=function(f){return arguments.length?(a=f[0]<0?hR:h9,e=a.pow,b.domain(f.map(a)),c):b.domain().map(e)},c.nice=function(){return b.domain(i1(b.domain(),he)),c},c.ticks=function(){var k=hD(b.domain()),i=[];if(k.every(isFinite)){var g=Math.floor(k[0]),f=Math.ceil(k[1]),l=e(k[0]),j=e(k[1]);if(a===hR){i.push(e(g));for(;g++<f;){for(var h=9;h>0;h--){i.push(e(g)*h)}}}else{for(;g<f;g++){for(var h=1;h<10;h++){i.push(e(g)*h)}}i.push(e(g))}for(g=0;i[g]<l;g++){}for(f=i.length;i[f-1]>j;f--){}i=i.slice(g,f)}return i},c.tickFormat=function(j,i){arguments.length<2&&(i=iw);if(arguments.length<1){return i}var h=j/c.ticks().length,g=a===hR?(f=-1e-12,Math.floor):(f=1e-12,Math.ceil),f;return function(k){return k/e(g(a(k)+f))<h?i(k):""}},c.copy=function(){return j2(b.copy(),a)},gP(c,b)}function h9(a){return Math.log(a<0?0:a)/Math.LN10}function hR(a){return -Math.log(a>0?0:-a)/Math.LN10}function hz(b,a){function c(g){return b(f(g))
 }var f=jT(a),e=jT(1/a);return c.invert=function(g){return e(b.invert(g))},c.domain=function(g){return arguments.length?(b.domain(g.map(f)),c):b.domain().map(e)},c.ticks=function(g){return gy(c.domain(),g)},c.tickFormat=function(g){return iB(c.domain(),g)},c.nice=function(){return c.domain(i1(c.domain(),gJ))},c.exponent=function(h){if(!arguments.length){return a}var g=c.domain();return f=jT(a=h),e=jT(1/a),c.domain(g)},c.copy=function(){return hz(b.copy(),a)},gP(c,b)}function jT(a){return function(b){return b<0?-Math.pow(-b,a):Math.pow(b,a)}}function d9(c,b){function f(i){return h[((a.get(i)||a.set(i,c.push(i)))-1)%h.length]}function e(j,i){return d3.range(c.length).map(function(k){return j+i*k})}var a,h,g;return f.domain=function(l){if(!arguments.length){return c}c=[],a=new gW;var k=-1,j=l.length,i;while(++k<j){a.has(i=l[k])||a.set(i,c.push(i))}return f[b.t](b.x,b.p)},f.range=function(i){return arguments.length?(h=i,g=0,b={t:"range",x:i},f):h},f.rangePoints=function(m,l){arguments.le
 ngth<2&&(l=0);var k=m[0],j=m[1],i=(j-k)/(c.length-1+l);return h=e(c.length<2?(k+j)/2:k+i*l/2,i),g=0,b={t:"rangePoints",x:m,p:l},f},f.rangeBands=function(k,n){arguments.length<2&&(n=0);var m=k[1]<k[0],l=k[m-0],j=k[1-m],i=(j-l)/(c.length+n);return h=e(l+i*n,i),m&&h.reverse(),g=i*(1-n),b={t:"rangeBands",x:k,p:n},f},f.rangeRoundBands=function(l,k){arguments.length<2&&(k=0);var o=l[1]<l[0],n=l[o-0],m=l[1-o],j=Math.floor((m-n)/(c.length+k)),i=m-n-(c.length-k)*j;return h=e(n+Math.round(i/2),j),o&&h.reverse(),g=Math.round(j*(1-k)),b={t:"rangeRoundBands",x:l,p:k},f},f.rangeBand=function(){return g},f.rangeExtent=function(){return hD(b.x)},f.copy=function(){return d9(c,b)},f.domain(c)}function hW(b,a){function e(){var g=0,i=b.length,h=a.length;f=[];while(++g<h){f[g-1]=d3.quantile(b,g/h)}return c}function c(g){return isNaN(g=+g)?NaN:a[d3.bisect(f,g)]}var f;return c.domain=function(g){return arguments.length?(b=g.filter(function(h){return !isNaN(h)}).sort(d3.ascending),e()):b},c.range=function(
 g){return arguments.length?(a=g,e()):a},c.quantiles=function(){return f},c.copy=function(){return hW(b,a)},e()}function hK(c,b,a){function f(i){return a[Math.max(0,Math.min(g,Math.floor(h*(i-c))))]}function e(){return h=a.length/(b-c),g=a.length-1,f}var h,g;return f.domain=function(i){return arguments.length?(c=+i[0],b=+i[i.length-1],e()):[c,b]},f.range=function(i){return arguments.length?(a=i,e()):a},f.copy=function(){return hK(c,b,a)},e()}function hB(b){function a(c){return +c}return a.invert=a,a.domain=a.range=function(c){return arguments.length?(b=c.map(a),a):b},a.ticks=function(c){return gy(b,c)},a.tickFormat=function(c){return iB(b,c)},a.copy=function(){return hB(b)},a}function jM(a){return a.innerRadius}function jD(a){return a.outerRadius}function jv(a){return a.startAngle}function i7(a){return a.endAngle}function iH(f){function g(k){function l(){j.push("M",i(f(r),h))}var j=[],r=[],q=-1,p=k.length,o,n=ke(e),m=ke(c);while(++q<p){b.call(this,o=k[q],q)?r.push([+n.call(this,o,q),
 +m.call(this,o,q)]):r.length&&(l(),r=[])}return r.length&&l(),j.length?j.join(""):null}var e=g5,c=iF,b=kk,a=kc,i=jX,h=0.7;return g.x=function(j){return arguments.length?(e=j,g):e},g.y=function(j){return arguments.length?(c=j,g):c},g.defined=function(j){return arguments.length?(b=j,g):b},g.interpolate=function(j){return arguments.length?(j3.has(j+="")||(j=kc),i=j3.get(a=j),g):a},g.tension=function(j){return arguments.length?(h=j,g):h},g}function g5(a){return a[0]}function iF(a){return a[1]}function jX(b){var a=0,f=b.length,e=b[0],c=[e[0],",",e[1]];while(++a<f){c.push("L",(e=b[a])[0],",",e[1])}return c.join("")}function ic(b){var a=0,f=b.length,e=b[0],c=[e[0],",",e[1]];while(++a<f){c.push("V",(e=b[a])[1],"H",e[0])}return c.join("")}function hX(b){var a=0,f=b.length,e=b[0],c=[e[0],",",e[1]];while(++a<f){c.push("H",(e=b[a])[0],"V",e[1])}return c.join("")}function hG(b,a){return b.length<4?jX(b):b[1]+jl(b.slice(1,b.length-1),i3(b,a))}function ho(b,a){return b.length<3?jX(b):b[0]+jl((b.pu
 sh(b[0]),b),i3([b[b.length-2]].concat(b,[b[1]]),a))}function jF(b,a,c){return b.length<3?jX(b):b[0]+jl(b,i3(b,a))}function jl(f,e){if(e.length<1||f.length!=e.length&&f.length!=e.length+2){return jX(f)}var c=f.length!=e.length,b="",a=f[0],l=f[1],k=e[0],j=k,i=1;c&&(b+="Q"+(l[0]-k[0]*2/3)+","+(l[1]-k[1]*2/3)+","+l[0]+","+l[1],a=f[1],i=2);if(e.length>1){j=e[1],l=f[i],i++,b+="C"+(a[0]+k[0])+","+(a[1]+k[1])+","+(l[0]-j[0])+","+(l[1]-j[1])+","+l[0]+","+l[1];for(var h=2;h<e.length;h++,i++){l=f[i],j=e[h],b+="S"+(l[0]-j[0])+","+(l[1]-j[1])+","+l[0]+","+l[1]}}if(c){var g=f[i];b+="Q"+(l[0]+j[0]*2/3)+","+(l[1]+j[1]*2/3)+","+g[0]+","+g[1]}return b}function i3(a,j){var i=[],h=(1-j)/2,g,f=a[0],e=a[1],c=1,b=a.length;while(++c<b){g=f,f=e,e=a[c],i.push([h*(e[0]-g[0]),h*(e[1]-g[1])])}return i}function iI(a){if(a.length<3){return jX(a)}var j=1,i=a.length,h=a[0],g=h[0],f=h[1],e=[g,g,g,(h=a[1])[0]],c=[f,f,f,h[1]],b=[g,",",f];hF(b,e,c);while(++j<i){h=a[j],e.shift(),e.push(h[0]),c.shift(),c.push(h[1]),hF(b,
 e,c)}j=-1;while(++j<2){e.shift(),e.push(h[0]),c.shift(),c.push(h[1]),hF(b,e,c)}return b.join("")}function ae(c){if(c.length<4){return jX(c)}var b=[],a=-1,h=c.length,g,f=[0],e=[0];while(++a<3){g=c[a],f.push(g[0]),e.push(g[1])}b.push(iy(hT,f)+","+iy(hT,e)),--a;while(++a<h){g=c[a],f.shift(),f.push(g[0]),e.shift(),e.push(g[1]),hF(b,f,e)}return b.join("")}function jZ(f){var e,c=-1,b=f.length,a=b+4,i,h=[],g=[];while(++c<4){i=f[c%b],h.push(i[0]),g.push(i[1])}e=[iy(hT,h),",",iy(hT,g)],--c;while(++c<a){i=f[c%b],h.shift(),h.push(i[0]),g.shift(),g.push(i[1]),hF(e,h,g)}return e.join("")}function jK(c,b){var a=c.length-1,k=c[0][0],j=c[0][1],i=c[a][0]-k,h=c[a][1]-j,g=-1,f,e;while(++g<=a){f=c[g],e=g/a,f[0]=b*f[0]+(1-b)*(k+e*i),f[1]=b*f[1]+(1-b)*(j+e*h)}return iI(c)}function iy(b,a){return b[0]*a[0]+b[1]*a[1]+b[2]*a[2]+b[3]*a[3]}function hF(b,a,c){b.push("C",iy(ih,a),",",iy(ih,c),",",iy(h5,a),",",iy(h5,c),",",iy(hT,a),",",iy(hT,c))}function hu(b,a){return(a[1]-b[1])/(a[0]-b[0])}function hn(c){var b
 =0,a=c.length-1,h=[],g=c[0],f=c[1],e=h[0]=hu(g,f);while(++b<a){h[b]=e+(e=hu(g=f,f=c[b+1]))}return h[b]=e,h}function gs(a){var j=[],i,h,g,f,e=hn(a),c=-1,b=a.length-1;while(++c<b){i=hu(a[c],a[c+1]),Math.abs(i)<0.000001?e[c]=e[c+1]=0:(h=e[c]/i,g=e[c+1]/i,f=h*h+g*g,f>9&&(f=i*3/Math.sqrt(f),e[c]=f*h,e[c+1]=f*g))}c=-1;while(++c<=b){f=(a[Math.min(b,c+1)][0]-a[Math.max(0,c-1)][0])/(6*(1+e[c]*e[c])),j.push([f||0,e[c]*f||0])}return j}function f8(a){return a.length<3?jX(a):a[0]+jl(a,gs(a))}function f3(b){var a,g=-1,f=b.length,e,c;while(++g<f){a=b[g],e=a[0],c=a[1]+hp,a[0]=e*Math.cos(c),a[1]=e*Math.sin(c)}return b}function f0(h){function i(r){function s(){q.push("M",m(h(o),j),k,l(h(p.reverse()),j),"Z")}var q=[],p=[],o=[],A=-1,z=r.length,w,y=ke(g),x=ke(e),v=g===f?function(){return n}:ke(f),u=e===c?function(){return t}:ke(c),n,t;while(++A<z){b.call(this,w=r[A],A)?(p.push([n=+y.call(this,w,A),t=+x.call(this,w,A)]),o.push([+v.call(this,w,A),+u.call(this,w,A)])):p.length&&(s(),p=[],o=[])}return p.len
 gth&&s(),q.length?q.join(""):null}var g=g5,f=g5,e=0,c=iF,b=kk,a=kc,m=jX,l=jX,k="L",j=0.7;return i.x=function(n){return arguments.length?(g=f=n,i):f},i.x0=function(n){return arguments.length?(g=n,i):g},i.x1=function(n){return arguments.length?(f=n,i):f},i.y=function(n){return arguments.length?(e=c=n,i):c},i.y0=function(n){return arguments.length?(e=n,i):e},i.y1=function(n){return arguments.length?(c=n,i):c},i.defined=function(n){return arguments.length?(b=n,i):b},i.interpolate=function(n){return arguments.length?(j3.has(n+="")||(n=kc),m=j3.get(a=n),l=m.reverse||m,k=/-closed$/.test(n)?"M":"L",i):a},i.tension=function(n){return arguments.length?(j=n,i):j},i}function e5(a){return a.source}function e1(a){return a.target}function jy(a){return a.radius}function ja(a){return a.startAngle}function iQ(a){return a.endAngle}function iJ(a){return[a.x,a.y]}function b8(a){return function(){var e=a.apply(this,arguments),c=e[0],b=e[1]+hp;return[c*Math.cos(b),c*Math.sin(b)]}}function b4(){return 64}f
 unction hk(){return"circle"}function hh(b){var a=Math.sqrt(b/Math.PI);return"M0,"+a+"A"+a+","+a+" 0 1,1 0,"+-a+"A"+a+","+a+" 0 1,1 0,"+a+"Z"}function g2(b,a){b.attr("transform",function(c){return"translate("+a(c)+",0)"})}function jE(b,a){b.attr("transform",function(c){return"translate(0,"+a(c)+")"})}function jm(c,b,a){j=[];if(a&&b.length>1){var k=hD(c.domain()),j,i=-1,h=b.length,g=(b[1]-b[0])/++a,f,e;while(++i<h){for(f=a;--f>0;){(e=+b[i]-f*g)>=k[0]&&j.push(e)}}for(--i,f=0;++f<a&&(e=+b[i]+f*g)<k[1];){j.push(e)}}return j}function hw(){hZ||(hZ=d3.select("body").append("div").style("visibility","hidden").style("top",0).style("height",0).style("width",0).style("overflow-y","scroll").append("div").style("height","2000px").node().parentNode);var b=d3.event,a;try{hZ.scrollTop=1000,hZ.dispatchEvent(b),a=1000-hZ.scrollTop}catch(c){a=b.wheelDelta||-b.detail*5}return a}function jj(b){var a=b.source,g=b.target,f=ha(a,g),e=[a];while(a!==f){a=a.parent,e.push(a)}var c=e.length;while(g!==f){e.splice
 (c,0,g),g=g.parent}return e}function iS(b){var a=[],c=b.parent;while(c!=null){a.push(b),b=c,c=c.parent}return a.push(b),a}function ha(c,b){if(c===b){return c}var a=iS(c),h=iS(b),g=a.pop(),f=h.pop(),e=null;while(g===f){e=g,g=a.pop(),f=h.pop()}return e}function gH(a){a.fixed|=2}function gC(a){a!==gL&&(a.fixed&=1)}function gw(){gL.fixed&=1,gS=gL=null}function iG(){gL.px=d3.event.x,gL.py=d3.event.y,gS.resume()}function kh(c,b,a){var k=0,j=0;c.charge=0;if(!c.leaf){var i=c.nodes,h=i.length,g=-1,f;while(++g<h){f=i[g];if(f==null){continue}kh(f,b,a),c.charge+=f.charge,k+=f.charge*f.cx,j+=f.charge*f.cy}}if(c.point){c.leaf||(c.point.x+=Math.random()-0.5,c.point.y+=Math.random()-0.5);var e=b*a[c.point.index];c.charge+=c.pointCharge=e,k+=e*c.point.x,j+=e*c.point.y}c.cx=k/c.charge,c.cy=j/c.charge}function j9(a){return 20}function j0(a){return 1}function h3(a){return a.x}function hL(a){return a.y}function ht(b,a,c){b.y0=a,b.y=c}function d0(a){return d3.range(a.length)}function hU(b){var a=-1,e=b[0
 ].length,c=[];while(++a<e){c[a]=0}return c}function c4(b){var a=1,g=0,f=b[0][1],e,c=b.length;for(;a<c;++a){(e=b[a][1])>f&&(g=a,f=e)}return g}function gX(a){return a.reduce(gR,0)}function gR(b,a){return b+a[1]}function gQ(b,a){return gK(b,Math.ceil(Math.log(a.length)/Math.LN2+1))}function gK(b,a){var g=-1,f=+b[0],e=(b[1]-f)/a,c=[];while(++g<=a){c[g]=e*g+f}return c}function gI(a){return[d3.min(a),d3.max(a)]}function gE(b,a){return d3.rebind(b,a,"sort","children","value"),b.links=aO,b.nodes=function(c){return aL=!0,(b.nodes=b)(c)},b}function gA(a){return a.children}function aV(a){return a.value}function aS(b,a){return a.value-b.value}function aO(a){return d3.merge(a.map(function(b){return(b.children||[]).map(function(c){return{source:b,target:c}})}))}function e6(b,a){return b.value-a.value}function d6(b,a){var c=b._pack_next;b._pack_next=a,a._pack_prev=b,a._pack_next=c,c._pack_prev=a}function c8(b,a){b._pack_next=a,a._pack_prev=b}function c0(b,a){var f=a.x-b.x,e=a.y-b.y,c=b.r+a.r;retur
 n c*c-f*f-e*e>0.001}function aC(u){function c(v){t=Math.min(v.x-v.r,t),s=Math.max(v.x+v.r,s),r=Math.min(v.y-v.r,r),p=Math.max(v.y+v.r,p)}var t=Infinity,s=-Infinity,r=Infinity,p=-Infinity,n=u.length,k,i,g,f,e;u.forEach(iD),k=u[0],k.x=-k.r,k.y=0,c(k);if(n>1){i=u[1],i.x=i.r,i.y=0,c(i);if(n>2){g=u[2],h8(k,i,g),c(g),d6(k,g),k._pack_prev=g,d6(g,i),i=k._pack_next;for(var b=3;b<n;b++){h8(k,i,g=u[b]);var a=0,q=1,o=1;for(f=i._pack_next;f!==i;f=f._pack_next,q++){if(c0(f,g)){a=1;break}}if(a==1){for(e=k._pack_prev;e!==f._pack_prev;e=e._pack_prev,o++){if(c0(e,g)){break}}}a?(q<o||q==o&&i.r<k.r?c8(k,i=f):c8(k=e,i),b--):(d6(k,g),i=g,c(g))}}}var m=(t+s)/2,l=(r+p)/2,j=0;for(var b=0;b<n;b++){var h=u[b];h.x-=m,h.y-=l,j=Math.max(j,h.r+Math.sqrt(h.x*h.x+h.y*h.y))}return u.forEach(ix),j}function iD(a){a._pack_next=a._pack_prev=a}function ix(a){delete a._pack_next,delete a._pack_prev}function il(b){var a=b.children;a&&a.length?(a.forEach(il),b.r=aC(a)):b.r=Math.sqrt(b.value)}function ij(c,b,a,h){var g=c.chi
 ldren;c.x=b+=h*c.x,c.y=a+=h*c.y,c.r*=h;if(g){var f=-1,e=g.length;while(++f<e){ij(g[f],b,a,h)}}}function h8(h,g,f){var e=h.r+f.r,c=g.x-h.x,b=g.y-h.y;if(e&&(c||b)){var a=g.r+f.r,m=Math.sqrt(c*c+b*b),l=Math.max(-1,Math.min(1,(e*e+m*m-a*a)/(2*e*m))),k=Math.acos(l),j=l*(e/=m),i=Math.sin(k)*e;f.x=h.x+j*c+i*b,f.y=h.y+j*b-i*c}else{f.x=h.x+e,f.y=h.y}}function h6(a){return 1+d3.max(a,function(b){return b.y})}function e3(a){return a.reduce(function(c,b){return c+b.x},0)/a.length}function e2(b){var a=b.children;return a&&a.length?e2(a[0]):b}function c6(b){var a=b.children,c;return a&&(c=a.length)?c6(a[c-1]):b}function c5(b,a){return b.parent==a.parent?1:2}function c2(b){var a=b.children;return a&&a.length?a[0]:b._tree.thread}function c1(b){var a=b.children,c;return a&&(c=a.length)?a[c-1]:b._tree.thread}function iu(b,a){var g=b.children;if(g&&(e=g.length)){var f,e,c=-1;while(++c<e){a(f=iu(g[c],a),b)>0&&(b=f)}}return b}function ia(b,a){return b.x-a.x}function hY(b,a){return a.x-b.x}function hP(b,
 a){return b.depth-a.depth}function hA(b,a){function c(i,k){var j=i.children;if(j&&(e=j.length)){var h,g=null,f=-1,e;while(++f<e){h=j[f],c(h,g),g=h}}a(i,k)}c(b,null)}function hq(b){var a=0,g=0,f=b.children,e=f.length,c;while(--e>=0){c=f[e]._tree,c.prelim+=a,c.mod+=a,a+=c.shift+(g+=c.change)}}function gu(b,a,e){b=b._tree,a=a._tree;var c=e/(a.number-b.number);b.change+=c,a.change-=c,a.shift+=e,a.prelim+=e,a.mod+=e}function gq(b,a,c){return b._tree.ancestor.parent==a.parent?b._tree.ancestor:c}function f6(a){return{x:a.x,y:a.y,dx:a.dx,dy:a.dy}}function f1(b,a){var g=b.x+a[3],f=b.y+a[0],e=b.dx-a[1]-a[3],c=b.dy-a[0]-a[2];return e<0&&(g+=e/2,e=0),c<0&&(f+=c/2,c=0),{x:g,y:f,dx:e,dy:c}}function e7(a){return a.map(e4).join(",")}function e4(a){return/[",\n]/.test(a)?'"'+a.replace(/\"/g,'""')+'"':a}function jn(b,a){return function(c){return c&&b.hasOwnProperty(c.type)?b[c.type](c):a}}function je(a){return"m0,"+a+"a"+a+","+a+" 0 1,1 0,"+-2*a+"a"+a+","+a+" 0 1,1 0,"+2*a+"z"}function iY(b,a){hg.has
 OwnProperty(b.type)&&hg[b.type](b,a)}function g6(b,a){iY(b.geometry,a)}function b6(b,a){for(var f=b.features,e=0,c=f.length;e<c;e++){iY(f[e].geometry,a)}}function b3(b,a){for(var f=b.geometries,e=0,c=f.length;e<c;e++){iY(f[e],a)}}function hi(b,a){for(var f=b.coordinates,e=0,c=f.length;e<c;e++){a.apply(null,f[e])}}function hf(f,e){for(var c=f.coordinates,b=0,a=c.length;b<a;b++){for(var i=c[b],h=0,g=i.length;h<g;h++){e.apply(null,i[h])}}}function hb(f,e){for(var c=f.coordinates,b=0,a=c.length;b<a;b++){for(var i=c[b][0],h=0,g=i.length;h<g;h++){e.apply(null,i[h])}}}function g7(b,a){a.apply(null,b.coordinates)}function i2(b,a){for(var f=b.coordinates[0],e=0,c=f.length;e<c;e++){a.apply(null,f[e])}}function g1(a){return a.source}function b7(a){return a.target}function aB(i,g){function r(w){var u=Math.sin(f-(w*=f))/c,t=Math.sin(w)/c,s=u*p*b+t*j*m,x=u*p*a+t*j*l,v=u*o+t*h;return[Math.atan2(x,s)/ju,Math.atan2(v,Math.sqrt(s*s+x*x))/ju]}var e=i[0]*ju,b=Math.cos(e),a=Math.sin(e),q=i[1]*ju,p=Math.
 cos(q),o=Math.sin(q),n=g[0]*ju,m=Math.cos(n),l=Math.sin(n),k=g[1]*ju,j=Math.cos(k),h=Math.sin(k),f=r.d=Math.acos(Math.max(-1,Math.min(1,o*h+p*j*Math.cos(n-e)))),c=Math.sin(f);return r}function ax(b){var a=0,c=0;for(;;){if(b(a,c)){return[a,c]}a===0?(a=c+1,c=0):(a-=1,c+=1)}}function aw(f,e,c,b){var a,l,k,j,i,h,g;return a=b[f],l=a[0],k=a[1],a=b[e],j=a[0],i=a[1],a=b[c],h=a[0],g=a[1],(g-k)*(j-l)-(i-k)*(h-l)>0}function av(b,a,c){return(c[0]-a[0])*(b[1]-a[1])<(c[1]-a[1])*(b[0]-a[0])}function au(t,s,q,o){var m=t[0],k=s[0],h=q[0],f=o[0],e=t[1],c=s[1],b=q[1],a=o[1],r=m-h,p=k-m,n=f-h,l=e-b,j=c-e,i=a-b,g=(n*l-i*r)/(i*p-n*j);return[m+g*p,e+g*j]}function ar(u,t){var s={list:u.map(function(w,v){return{index:v,x:w[0],y:w[1]}}).sort(function(w,v){return w.y<v.y?-1:w.y>v.y?1:w.x<v.x?-1:w.x>v.x?1:0}),bottomSite:null},r={list:[],leftEnd:null,rightEnd:null,init:function(){r.leftEnd=r.createHalfEdge(null,"l"),r.rightEnd=r.createHalfEdge(null,"l"),r.leftEnd.r=r.rightEnd,r.rightEnd.l=r.leftEnd,r.list.unshi
 ft(r.leftEnd,r.rightEnd)},createHalfEdge:function(w,v){return{edge:w,side:v,vertex:null,l:null,r:null}},insert:function(w,v){v.l=w,v.r=w.r,w.r.l=v,w.r=v},leftBound:function(w){var v=r.leftEnd;do{v=v.r}while(v!=r.rightEnd&&p.rightOf(v,w));return v=v.l,v},del:function(v){v.l.r=v.r,v.r.l=v.l,v.edge=null},right:function(v){return v.r},left:function(v){return v.l},leftRegion:function(v){return v.edge==null?s.bottomSite:v.edge.region[v.side]},rightRegion:function(v){return v.edge==null?s.bottomSite:v.edge.region[at[v.side]]}},p={bisect:function(v,z){var x={region:{l:v,r:z},ep:{l:null,r:null}},B=z.x-v.x,A=z.y-v.y,y=B>0?B:-B,w=A>0?A:-A;return x.c=v.x*B+v.y*A+(B*B+A*A)*0.5,y>w?(x.a=1,x.b=A/B,x.c/=B):(x.b=1,x.a=B/A,x.c/=A),x},intersect:function(D,C){var B=D.edge,A=C.edge;if(!B||!A||B.region.r==A.region.r){return null}var z=B.a*A.b-B.b*A.a;if(Math.abs(z)<1e-10){return null}var y=(B.c*A.b-A.c*B.b)/z,x=(A.c*B.a-B.c*A.a)/z,w=B.region.r,v=A.region.r,G,F;w.y<v.y||w.y==v.y&&w.x<v.x?(G=D,F=B):(G=C,F=
 A);var E=y>=F.region.r.x;return E&&G.side==="l"||!E&&G.side==="r"?null:{x:y,y:x}},rightOf:function(H,G){var F=H.edge,E=F.region.r,D=G.x>E.x;if(D&&H.side==="l"){return 1}if(!D&&H.side==="r"){return 0}if(F.a===1){var C=G.y-E.y,B=G.x-E.x,A=0,z=0;!D&&F.b<0||D&&F.b>=0?z=A=C>=F.b*B:(z=G.x+G.y*F.b>F.c,F.b<0&&(z=!z),z||(A=1));if(!A){var x=E.x-F.region.l.x;z=F.b*(B*B-C*C)<x*C*(1+2*B/x+F.b*F.b),F.b<0&&(z=!z)}}else{var y=F.c-F.a*G.x,w=G.y-y,v=G.x-E.x,I=y-E.y;z=w*w>v*v+I*I}return H.side==="l"?z:!z},endPoint:function(x,w,v){x.ep[w]=v;if(!x.ep[at[w]]){return}t(x)},distance:function(w,v){var y=w.x-v.x,x=w.y-v.y;return Math.sqrt(y*y+x*x)}},n={list:[],insert:function(v,z,x){v.vertex=z,v.ystar=z.y+x;for(var B=0,A=n.list,y=A.length;B<y;B++){var w=A[B];if(v.ystar>w.ystar||v.ystar==w.ystar&&z.x>w.vertex.x){continue}break}A.splice(B,0,v)},del:function(w){for(var v=0,y=n.list,x=y.length;v<x&&y[v]!=w;++v){}y.splice(v,1)},empty:function(){return n.list.length===0},nextEvent:function(w){for(var v=0,y=n.list,
 x=y.length;v<x;++v){if(y[v]==w){return y[v+1]}}return null},min:function(){var v=n.list[0];return{x:v.vertex.x,y:v.ystar}},extractMin:function(){return n.list.shift()}};r.init(),s.bottomSite=s.list.shift();var k=s.list.shift(),i,g,f,e,c,b,a,q,o,m,l,j,h;for(;;){n.empty()||(i=n.min());if(k&&(n.empty()||k.y<i.y||k.y==i.y&&k.x<i.x)){g=r.leftBound(k),f=r.right(g),a=r.rightRegion(g),j=p.bisect(a,k),b=r.createHalfEdge(j,"l"),r.insert(g,b),m=p.intersect(g,b),m&&(n.del(g),n.insert(g,m,p.distance(m,k))),g=b,b=r.createHalfEdge(j,"r"),r.insert(g,b),m=p.intersect(b,f),m&&n.insert(b,m,p.distance(m,k)),k=s.list.shift()}else{if(!n.empty()){g=n.extractMin(),e=r.left(g),f=r.right(g),c=r.right(f),a=r.leftRegion(g),q=r.rightRegion(f),l=g.vertex,p.endPoint(g.edge,g.side,l),p.endPoint(f.edge,f.side,l),r.del(g),n.del(f),r.del(f),h="l",a.y>q.y&&(o=a,a=q,q=o,h="r"),j=p.bisect(a,q),b=r.createHalfEdge(j,h),r.insert(e,b),p.endPoint(j,at[h],l),m=p.intersect(e,b),m&&(n.del(e),n.insert(e,m,p.distance(m,a))),m=p.i
 ntersect(b,c),m&&n.insert(b,m,p.distance(m,a))}else{break}}}for(g=r.right(r.leftEnd);g!=r.rightEnd;g=r.right(g)){t(g.edge)}}function aq(){return{leaf:!0,nodes:[],point:null}}function ap(a,j,i,h,g,f){if(!a(j,i,h,g,f)){var e=(i+g)*0.5,c=(h+f)*0.5,b=j.nodes;b[0]&&ap(a,b[0],i,h,e,c),b[1]&&ap(a,b[1],e,h,g,c),b[2]&&ap(a,b[2],i,c,e,f),b[3]&&ap(a,b[3],e,c,g,f)}}function ao(a){return{x:a[0],y:a[1]}}function am(){this._=new Date(arguments.length>1?Date.UTC.apply(this,arguments):arguments[0])}function ak(a,j,i,h){var g,f,e=0,c=j.length,b=i.length;while(e<c){if(h>=b){return -1}g=j.charCodeAt(e++);if(g==37){f=aW[j.charAt(e++)];if(!f||(h=f(a,i,h))<0){return -1}}else{if(g!=i.charCodeAt(h++)){return -1}}}return h}function aU(b,a,c){return aP.test(a.substring(c,c+=3))?c:-1}function aR(b,a,e){gY.lastIndex=0;var c=gY.exec(a.substring(e,e+10));return c?e+=c[0].length:-1}function gT(b,a,e){var c=gN.get(a.substring(e,e+=3).toLowerCase());return c==null?-1:(b.m=c,e)}function gM(b,a,e){gF.lastIndex=0;var c
 =gF.exec(a.substring(e,e+12));return c?(b.m=gB.get(c[0].toLowerCase()),e+=c[0].length):-1}function aX(b,a,c){return ak(b,aY.c.toString(),a,c)}function aT(b,a,c){return ak(b,aY.x.toString(),a,c)}function aQ(b,a,c){return ak(b,aY.X.toString(),a,c)}function aN(b,a,e){ie.lastIndex=0;var c=ie.exec(a.substring(e,e+4));return c?(b.y=+c[0],e+=c[0].length):-1}function aJ(b,a,e){ie.lastIndex=0;var c=ie.exec(a.substring(e,e+2));return c?(b.y=e0()+ +c[0],e+=c[0].length):-1}function e0(){return ~~((new Date).getFullYear()/1000)*1000}function d2(b,a,e){ie.lastIndex=0;var c=ie.exec(a.substring(e,e+2));return c?(b.m=c[0]-1,e+=c[0].length):-1}function c3(b,a,e){ie.lastIndex=0;var c=ie.exec(a.substring(e,e+2));return c?(b.d=+c[0],e+=c[0].length):-1}function b5(b,a,e){ie.lastIndex=0;var c=ie.exec(a.substring(e,e+2));return c?(b.H=+c[0],e+=c[0].length):-1}function az(b,a,e){ie.lastIndex=0;var c=ie.exec(a.substring(e,e+2));return c?(b.M=+c[0],e+=c[0].length):-1}function iA(b,a,e){ie.lastIndex=0;var c=ie
 .exec(a.substring(e,e+2));return c?(b.S=+c[0],e+=c[0].length):-1}function ip(b,a,e){ie.lastIndex=0;var c=ie.exec(a.substring(e,e+3));return c?(b.L=+c[0],e+=c[0].length):-1}function ib(b,a,e){var c=e9.get(a.substring(e,e+=2).toLowerCase());return c==null?-1:(b.p=c,e)}function e8(b){var a=b.getTimezoneOffset(),f=a>0?"-":"+",e=~~(Math.abs(a)/60),c=Math.abs(a)%60;return f+gx(e)+gx(c)}function d1(a){return a.toISOString()}function iv(a,j,i){function h(m){var l=a(m),k=f(l,1);return m-l<k-m?l:k}function g(k){return j(k=a(new an(k-1)),1),k}function f(l,k){return j(l=new an(+l),k),l}function e(o,m,n){var l=g(o),k=[];if(n>1){while(l<m){i(l)%n||k.push(new Date(+l)),j(l,1)}}else{while(l<m){k.push(new Date(+l)),j(l,1)}}return k}function c(l,k,n){try{an=am;var m=new am;return m._=l,e(m,k,n)}finally{an=Date}}a.floor=a,a.round=h,a.ceil=g,a.offset=f,a.range=e;var b=a.utc=b9(a);return b.floor=b,b.round=b9(h),b.ceil=b9(g),b.offset=b9(f),b.range=c,a}function b9(a){return function(e,c){try{an=am;var b=n
 ew am;return b._=e,a(b,c)._}finally{an=Date}}}function aM(b,a,e){function c(f){return b(f)}return c.invert=function(f){return aI(b.invert(f))},c.domain=function(f){return arguments.length?(b.domain(f),c):b.domain().map(aI)},c.nice=function(g){var f=aK(c.domain());return c.domain([g.floor(f[0]),g.ceil(f[1])])},c.ticks=function(i,g){var f=aK(c.domain());if(typeof i!="function"){var k=f[1]-f[0],j=k/i,h=d3.bisect(aE,j);if(h==aE.length){return a.year(f,i)}if(!h){return b.ticks(i).map(aI)}Math.log(j/aE[h-1])<Math.log(aE[h]/j)&&--h,i=a[h],g=i[1],i=i[0].range}return i(f[0],new Date(+f[1]+1),g)},c.tickFormat=function(){return e},c.copy=function(){return aM(b.copy(),a,e)},d3.rebind(c,b,"range","rangeRound","interpolate","clamp")}function aK(b){var a=b[0],c=b[b.length-1];return a<c?[a,c]:[c,a]}function aI(a){return new Date(a)}function aH(a){return function(e){var c=a.length-1,b=a[c];while(!b[1](e)){b=a[--c]}return b[0](e)}}function aG(b){var a=new Date(b,0,1);return a.setFullYear(b),a}functio
 n aF(b){var a=b.getFullYear(),e=aG(a),c=aG(a+1);return a+(b-e)/(c-e)}function f4(b){var a=new Date(Date.UTC(b,0,1));return a.setUTCFullYear(b),a}function f2(b){var a=b.getUTCFullYear(),e=f4(a),c=f4(a+1);return a+(b-e)/(c-e)}Date.now||(Date.now=function(){return +(new Date)});try{document.createElement("div").style.setProperty("opacity",0,"")}catch(jw){var jb=CSSStyleDeclaration.prototype,iT=jb.setProperty;jb.setProperty=function(b,a,c){iT.call(this,b,a+"",c)}}d3={version:"2.9.1"};var hM=i4;try{hM(document.documentElement.childNodes)[0].nodeType}catch(hj){hM=js}var g3=[].__proto__?function(b,a){b.__proto__=a}:function(b,a){for(var c in a){b[c]=a[c]}};d3.map=function(b){var a=new gW;for(var c in b){a.set(c,b[c])}return a},h4(gW,{has:function(a){return gO+a in this},get:function(a){return this[gO+a]},set:function(b,a){return this[gO+b]=a},remove:function(a){return a=gO+a,a in this&&delete this[a]},keys:function(){var a=[];return this.forEach(function(b){a.push(b)}),a},values:function()
 {var a=[];return this.forEach(function(c,b){a.push(b)}),a},entries:function(){var a=[];return this.forEach(function(c,b){a.push({key:c,value:b})}),a},forEach:function(b){for(var a in this){a.charCodeAt(0)===gG&&b.call(this,a.substring(1),this[a])}}});var gO="\0",gG=gO.charCodeAt(0);d3.functor=ke,d3.rebind=function(b,a){var f=1,e=arguments.length,c;while(++f<e){b[c=arguments[f]]=j4(b,a,a[c])}return b},d3.ascending=function(b,a){return b<a?-1:b>a?1:b>=a?0:NaN},d3.descending=function(b,a){return a<b?-1:a>b?1:a>=b?0:NaN},d3.mean=function(c,b){var a=c.length,h,g=0,f=-1,e=0;if(arguments.length===1){while(++f<a){jW(h=c[f])&&(g+=(h-g)/++e)}}else{while(++f<a){jW(h=b.call(c,c[f],f))&&(g+=(h-g)/++e)}}return e?g:undefined},d3.median=function(b,a){return arguments.length>1&&(b=b.map(a)),b=b.filter(jW),b.length?d3.quantile(b.sort(d3.ascending),0.5):undefined},d3.min=function(b,a){var g=-1,f=b.length,e,c;if(arguments.length===1){while(++g<f&&((e=b[g])==null||e!=e)){e=undefined}while(++g<f){(c=b[g]
 )!=null&&e>c&&(e=c)}}else{while(++g<f&&((e=a.call(b,b[g],g))==null||e!=e)){e=undefined}while(++g<f){(c=a.call(b,b[g],g))!=null&&e>c&&(e=c)}}return e},d3.max=function(b,a){var g=-1,f=b.length,e,c;if(arguments.length===1){while(++g<f&&((e=b[g])==null||e!=e)){e=undefined}while(++g<f){(c=b[g])!=null&&c>e&&(e=c)}}else{while(++g<f&&((e=a.call(b,b[g],g))==null||e!=e)){e=undefined}while(++g<f){(c=a.call(b,b[g],g))!=null&&c>e&&(e=c)}}return e},d3.extent=function(c,b){var a=-1,h=c.length,g,f,e;if(arguments.length===1){while(++a<h&&((g=e=c[a])==null||g!=g)){g=e=undefined}while(++a<h){(f=c[a])!=null&&(g>f&&(g=f),e<f&&(e=f))}}else{while(++a<h&&((g=e=b.call(c,c[a],a))==null||g!=g)){g=undefined}while(++a<h){(f=b.call(c,c[a],a))!=null&&(g>f&&(g=f),e<f&&(e=f))}}return[g,e]},d3.random={normal:function(b,a){return arguments.length<2&&(a=1),arguments.length<1&&(b=0),function(){var c,f,e;do{c=Math.random()*2-1,f=Math.random()*2-1,e=c*c+f*f}while(!e||e>1);return b+a*c*Math.sqrt(-2*Math.log(e)/e)}}},d3.su
 m=function(b,a){var g=0,f=b.length,e,c=-1;if(arguments.length===1){while(++c<f){isNaN(e=+b[c])||(g+=e)}}else{while(++c<f){isNaN(e=+a.call(b,b[c],c))||(g+=e)}}return g},d3.quantile=function(b,a){var g=(b.length-1)*a+1,f=Math.floor(g),e=b[f-1],c=g-f;return c?e+c*(b[f]-e):e},d3.transpose=function(a){return d3.zip.apply(d3,a)},d3.zip=function(){if(!(e=arguments.length)){return[]}for(var b=-1,a=d3.min(arguments,iq),g=new Array(a);++b<a;){for(var f=-1,e,c=g[b]=new Array(e);++f<e;){c[f]=arguments[f][b]}}return g},d3.bisector=function(a){return{left:function(g,f,e,c){arguments.length<3&&(e=0),arguments.length<4&&(c=g.length);while(e<c){var b=e+c>>1;a.call(g,g[b],b)<f?e=b+1:c=b}return e},right:function(g,f,e,c){arguments.length<3&&(e=0),arguments.length<4&&(c=g.length);while(e<c){var b=e+c>>1;f<a.call(g,g[b],b)?c=b:e=b+1}return e}}};var hV=d3.bisector(function(a){return a});d3.bisectLeft=hV.left,d3.bisect=d3.bisectRight=hV.right,d3.first=function(b,a){var g=0,f=b.length,e=b[0],c;arguments.le
 ngth===1&&(a=d3.ascending);while(++g<f){a.call(b,e,c=b[g])>0&&(e=c)}return e},d3.last=function(b,a){var g=0,f=b.length,e=b[0],c;arguments.length===1&&(a=d3.ascending);while(++g<f){a.call(b,e,c=b[g])<=0&&(e=c)}return e},d3.nest=function(){function f(l,k){if(k>=b.length){return g?g.call(c,l):h?l.sort(h):l}var j=-1,i=l.length,r=b[k++],q,p,o=new gW,n,m={};while(++j<i){(n=o.get(q=r(p=l[j])))?n.push(p):o.set(q,[p])}return o.forEach(function(s){m[s]=f(o.get(s),k)}),m}function e(j,m){if(m>=b.length){return j}var l=[],i=a[m++],k;for(k in j){l.push({key:k,values:e(j[k],m)})}return i&&l.sort(function(o,n){return i(o.key,n.key)}),l}var c={},b=[],a=[],h,g;return c.map=function(i){return f(i,0)},c.entries=function(i){return e(f(i,0),0)},c.key=function(i){return b.push(i),c},c.sortKeys=function(i){return a[b.length-1]=i,c},c.sortValues=function(i){return h=i,c},c.rollup=function(i){return g=i,c},c},d3.keys=function(b){var a=[];for(var c in b){a.push(c)}return a},d3.values=function(b){var a=[];for(
 var c in b){a.push(b[c])}return a},d3.entries=function(b){var a=[];for(var c in b){a.push({key:c,value:b[c]})}return a},d3.permute=function(b,a){var f=[],e=-1,c=a.length;while(++e<c){f[e]=b[a[e]]}return f},d3.merge=function(a){return Array.prototype.concat.apply([],a)},d3.split=function(c,b){var a=[],h=[],g,f=-1,e=c.length;arguments.length<2&&(b=hC);while(++f<e){b.call(h,g=c[f],f)?h=[]:(h.length||a.push(h),h.push(g))}return a},d3.range=function(c,b,a){arguments.length<3&&(a=1,arguments.length<2&&(b=c,c=0));if((b-c)/a===Infinity){throw new Error("infinite range")}var h=[],g=jN(Math.abs(a)),f=-1,e;c*=g,b*=g,a*=g;if(a<0){while((e=c+a*++f)>b){h.push(e/g)}}else{while((e=c+a*++f)<b){h.push(e/g)}}return h},d3.requote=function(a){return a.replace(d8,"\\$&")};var d8=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g;d3.round=function(b,a){return a?Math.round(b*(a=Math.pow(10,a)))/a:Math.round(b)},d3.xhr=function(b,a,e){var c=new XMLHttpRequest;arguments.length<3?(e=a,a=null):a&&c.overrideMimeType&&c.override
 MimeType(a),c.open("GET",b,!0),a&&c.setRequestHeader("Accept",a),c.onreadystatechange=function(){if(c.readyState===4){var f=c.status;e(f>=200&&f<300||f===304?c:null)}},c.send(null)},d3.text=function(b,a,e){function c(f){e(f&&f.responseText)}arguments.length<3&&(e=a,a=null),d3.xhr(b,a,c)},d3.json=function(b,a){d3.text(b,"application/json",function(c){a(c?JSON.parse(c):null)})},d3.html=function(b,a){d3.text(b,"text/html",function(e){if(e!=null){var c=document.createRange();c.selectNode(document.body),e=c.createContextualFragment(e)}a(e)})},d3.xml=function(b,a,e){function c(f){e(f&&f.responseXML)}arguments.length<3&&(e=a,a=null),d3.xhr(b,a,c)};var c9={svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};d3.ns={prefix:c9,qualify:function(b){var a=b.indexOf(":"),c=b;return a>=0&&(c=b.substring(0,a),b=b.substring(a+1)),c9.hasOwnProperty(c)?{space:c9[c],lo
 cal:b}:b}},d3.dispatch=function(){var b=new i8,a=-1,c=arguments.length;while(++a<c){b[arguments[a]]=iV(b)}return b},i8.prototype.on=function(b,a){var e=b.indexOf("."),c="";return e>0&&(c=b.substring(e+1),b=b.substring(0,e)),arguments.length<2?this[b].on(c):this[b].on(c,a)},d3.format=function(h){var g=h2.exec(h),f=g[1]||" ",e=g[3]||"",c=g[5],b=+g[6],a=g[7],m=g[8],l=g[9],k=1,j="",i=!1;m&&(m=+m.substring(1)),c&&(f="0",a&&(b-=Math.floor((b-1)/4)));switch(l){case"n":a=!0,l="g";break;case"%":k=100,j="%",l="f";break;case"p":k=100,j="%",l="r";break;case"d":i=!0,m=0;break;case"s":k=-1,l="r"}return l=="r"&&!m&&(l="g"),l=hQ.get(l)||hy,function(p){if(i&&p%1){return""}var o=p<0&&(p=-p)?"−":e;if(k<0){var n=d3.formatPrefix(p,m);p*=n.scale,j=n.symbol}else{p*=k}p=l(p,m);if(c){var q=p.length+o.length;q<b&&(p=(new Array(b-q+1)).join(f)+p),a&&(p=hs(p)),p=o+p}else{a&&(p=hs(p)),p=o+p;var q=p.length;q<b&&(p=(new Array(b-q+1)).join(f)+p)}return p+j}};var h2=/(?:([^{])?([<>=^]))?([+\- ])?(#)?(0)?([0-9]+)?
 (,)?(\.[0-9]+)?([a-zA-Z%])?/,hQ=d3.map({g:function(b,a){return b.toPrecision(a)},e:function(b,a){return b.toExponential(a)},f:function(b,a){return b.toFixed(a)},r:function(b,a){return d3.round(b,a=hI(b,a)).toFixed(Math.max(0,Math.min(20,a)))}}),jU=["y","z","a","f","p","n","μ","m","","k","M","G","T","P","E","Z","Y"].map(jJ);d3.formatPrefix=function(b,a){var c=0;return b&&(b<0&&(b*=-1),a&&(b=d3.round(b,hI(b,a))),c=1+Math.floor(1e-12+Math.log(b)/Math.LN10),c=Math.max(-24,Math.min(24,Math.floor((c<=0?c+1:c-1)/3)*3))),jU[8+c/3]};var jA=h7(2),jr=h7(3),iW=function(){return iC},hd=d3.map({linear:iW,poly:h7,quad:function(){return jA},cubic:function(){return jr},sin:function(){return hO},exp:function(){return hx},circle:function(){return jR},elastic:jB,back:jf,bounce:function(){return iX}}),gZ=d3.map({"in":iC,out:kf,"in-out":j5,"out-in":function(a){return j5(kf(a))}});d3.ease=function(b){var a=b.indexOf("-"),e=a>=0?b.substring(0,a):b,c=a>=0?b.substring(a+1):"in";return e=hd.get(e)||iW,c=gZ.g
 et(c)||iC,ki(c(e.apply(null,Array.prototype.slice.call(arguments,1))))},d3.event=null,d3.interpolate=function(b,a){var e=d3.interpolators.length,c;while(--e>=0&&!(c=d3.interpolators[e](b,a))){}return c},d3.interpolateNumber=function(b,a){return a-=b,function(c){return b+a*c}},d3.interpolateRound=function(b,a){return a-=b,function(c){return Math.round(b+a*c)}},d3.interpolateString=function(f,e){var c,b,a,l=0,k=0,j=[],i=[],h,g;iK.lastIndex=0;for(b=0;c=iK.exec(e);++b){c.index&&j.push(e.substring(l,k=c.index)),i.push({i:j.length,x:c[0]}),j.push(null),l=iK.lastIndex}l<e.length&&j.push(e.substring(l));for(b=0,h=i.length;(c=iK.exec(f))&&b<h;++b){g=i[b];if(g.x==c[0]){if(g.i){if(j[g.i+1]==null){j[g.i-1]+=g.x,j.splice(g.i,1);for(a=b+1;a<h;++a){i[a].i--}}else{j[g.i-1]+=g.x+j[g.i+1],j.splice(g.i,2);for(a=b+1;a<h;++a){i[a].i-=2}}}else{if(j[g.i+1]==null){j[g.i]=g.x}else{j[g.i]=g.x+j[g.i+1],j.splice(g.i+1,1);for(a=b+1;a<h;++a){i[a].i--}}}i.splice(b,1),h--,b--}else{g.x=d3.interpolateNumber(parseFlo
 at(c[0]),parseFloat(g.x))}}while(b<h){g=i.pop(),j[g.i+1]==null?j[g.i]=g.x:(j[g.i]=g.x+j[g.i+1],j.splice(g.i+1,1)),h--}return j.length===1?j[0]==null?i[0].x:function(){return e}:function(m){for(b=0;b<h;++b){j[(g=i[b]).i]=g.x(m)}return j.join("")}},d3.interpolateTransform=function(p,n){var l=[],k=[],j,i=d3.transform(p),h=d3.transform(n),g=i.translate,f=h.translate,e=i.rotate,c=h.rotate,b=i.skew,a=h.skew,o=i.scale,m=h.scale;return g[0]!=f[0]||g[1]!=f[1]?(l.push("translate(",null,",",null,")"),k.push({i:1,x:d3.interpolateNumber(g[0],f[0])},{i:3,x:d3.interpolateNumber(g[1],f[1])})):f[0]||f[1]?l.push("translate("+f+")"):l.push(""),e!=c?k.push({i:l.push(l.pop()+"rotate(",null,")")-2,x:d3.interpolateNumber(e,c)}):c&&l.push(l.pop()+"rotate("+c+")"),b!=a?k.push({i:l.push(l.pop()+"skewX(",null,")")-2,x:d3.interpolateNumber(b,a)}):a&&l.push(l.pop()+"skewX("+a+")"),o[0]!=m[0]||o[1]!=m[1]?(j=l.push(l.pop()+"scale(",null,",",null,")"),k.push({i:j-4,x:d3.interpolateNumber(o[0],m[0])},{i:j-2,x:d3.in
 terpolateNumber(o[1],m[1])})):(m[0]!=1||m[1]!=1)&&l.push(l.pop()+"scale("+m+")"),j=k.length,function(r){var q=-1,s;while(++q<j){l[(s=k[q]).i]=s.x(r)}return l.join("")}},d3.interpolateRgb=function(f,e){f=d3.rgb(f),e=d3.rgb(e);var c=f.r,b=f.g,a=f.b,i=e.r-c,h=e.g-b,g=e.b-a;return function(j){return"#"+jP(Math.round(c+i*j))+jP(Math.round(b+h*j))+jP(Math.round(a+g*j))}},d3.interpolateHsl=function(f,e){f=d3.hsl(f),e=d3.hsl(e);var c=f.h,b=f.s,a=f.l,i=e.h-c,h=e.s-b,g=e.l-a;return function(j){return kg(c+i*j,b+h*j,a+g*j).toString()}},d3.interpolateArray=function(f,e){var c=[],b=[],a=f.length,i=e.length,h=Math.min(f.length,e.length),g;for(g=0;g<h;++g){c.push(d3.interpolate(f[g],e[g]))}for(;g<a;++g){b[g]=f[g]}for(;g<i;++g){b[g]=e[g]}return function(j){for(g=0;g<h;++g){b[g]=c[g](j)}return b}},d3.interpolateObject=function(b,a){var f={},e={},c;for(c in b){c in a?f[c]=h0(c)(b[c],a[c]):e[c]=b[c]}for(c in a){c in b||(e[c]=a[c])}return function(g){for(c in f){e[c]=f[c](g)}return e}};var iK=/[-+]?(?:
 \d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g;d3.interpolators=[d3.interpolateObject,function(b,a){return a instanceof Array&&d3.interpolateArray(b,a)},function(b,a){return(typeof b=="string"||typeof a=="string")&&d3.interpolateString(b+"",a+"")},function(b,a){return(typeof a=="string"?iM.has(a)||/^(#|rgb\(|hsl\()/.test(a):a instanceof hm||a instanceof gV)&&d3.interpolateRgb(b,a)},function(b,a){return !isNaN(b=+b)&&!isNaN(a=+a)&&d3.interpolateNumber(b,a)}],d3.rgb=function(b,a,c){return arguments.length===1?b instanceof hm?hv(b.r,b.g,b.b):jH(""+b,hv,kg):hv(~~b,~~a,~~c)},hm.prototype.brighter=function(b){b=Math.pow(0.7,arguments.length?b:1);var a=this.r,f=this.g,e=this.b,c=30;return !a&&!f&&!e?hv(c,c,c):(a&&a<c&&(a=c),f&&f<c&&(f=c),e&&e<c&&(e=c),hv(Math.min(255,Math.floor(a/b)),Math.min(255,Math.floor(f/b)),Math.min(255,Math.floor(e/b))))},hm.prototype.darker=function(a){return a=Math.pow(0.7,arguments.length?a:1),hv(Math.floor(a*this.r),Math.floor(a*this.g),Math.floor(a*this.b))},hm.prototype
 .hsl=function(){return jx(this.r,this.g,this.b)},hm.prototype.toString=function(){return"#"+jP(this.r)+jP(this.g)+jP(this.b)};var iM=d3.map({aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#69
 6969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:
 "#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",
 white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"});iM.forEach(function(b,a){iM.set(b,jH(a,hv,kg))}),d3.hsl=function(b,a,c){return arguments.length===1?b instanceof gV?g9(b.h,b.s,b.l):jH(""+b,jx,g9):g9(+b,+a,+c)},gV.prototype.brighter=function(a){return a=Math.pow(0.7,arguments.length?a:1),g9(this.h,this.s,this.l/a)},gV.prototype.darker=function(a){return a=Math.pow(0.7,arguments.length?a:1),g9(this.h,this.s,a*this.l)},gV.prototype.rgb=function(){return kg(this.h,this.s,this.l)},gV.prototype.toString=function(){return this.rgb().toString()};var jY=function(b,a){return a.querySelector(b)},ik=function(b,a){return a.querySelectorAll(b)},h1=document.documentElement,hJ=h1.matchesSelector||h1.webkitMatchesSelector||h1.mozMatchesSelector||h1.msMatchesSelector||h1.oMatchesSelector,hr=function(b,a){return hJ.call(b,a)};typeof Sizzle=="function"&&(jY=function(b,a){return Sizzle(b,a)[0]},ik=function(b,a){return Sizzle.uniqueSort(Sizzle(b,a))},hr=Sizzle.matchesSelector
 );var jL=[];d3.selection=function(){return j1},d3.selection.prototype=jL,jL.select=function(c){var b=[],a,k,j,i;typeof c!="function"&&(c=jo(c));for(var h=-1,g=this.length;++h<g;){b.push(a=[]),a.parentNode=(j=this[h]).parentNode;for(var f=-1,e=j.length;++f<e;){(i=j[f])?(a.push(k=c.call(i,i.__data__,f)),k&&"__data__" in i&&(k.__data__=i.__data__)):a.push(null)}}return j8(b)},jL.selectAll=function(a){var j=[],i,h;typeof a!="function"&&(a=i9(a));for(var g=-1,f=this.length;++g<f;){for(var e=this[g],c=-1,b=e.length;++c<b;){if(h=e[c]){j.push(i=hM(a.call(h,h.__data__,c))),i.parentNode=h}}}return j8(j)},jL.attr=function(a,j){function h(){this.removeAttribute(a)}function g(){this.removeAttributeNS(a.space,a.local)}function f(){this.setAttribute(a,j)}function e(){this.setAttributeNS(a.space,a.local,j)}function c(){var k=j.apply(this,arguments);k==null?this.removeAttribute(a):this.setAttribute(a,k)}function b(){var k=j.apply(this,arguments);k==null?this.removeAttributeNS(a.space,a.local):this.s
 etAttributeNS(a.space,a.local,k)}a=d3.ns.qualify(a);if(arguments.length<2){var i=this.node();return a.local?i.getAttributeNS(a.space,a.local):i.getAttribute(a)}return this.each(j==null?a.local?g:h:typeof j=="function"?a.local?b:c:a.local?e:f)},jL.classed=function(b,a){var f=b.split(iR),e=f.length,c=-1;if(arguments.length>1){while(++c<e){ag.call(this,f[c],a)}return this}while(++c<e){if(!ag.call(this,f[c])){return !1}}return !0};var iR=/\s+/g;jL.style=function(b,a,g){function f(){this.style.removeProperty(b)}function e(){this.style.setProperty(b,a,g)}function c(){var h=a.apply(this,arguments);h==null?this.style.removeProperty(b):this.style.setProperty(b,h,g)}return arguments.length<3&&(g=""),arguments.length<2?window.getComputedStyle(this.node(),null).getPropertyValue(b):this.each(a==null?f:typeof a=="function"?c:e)},jL.property=function(b,a){function f(){delete this[b]}function e(){this[b]=a}function c(){var g=a.apply(this,arguments);g==null?delete this[b]:this[b]=g}return arguments.
 length<2?this.node()[b]:this.each(a==null?f:typeof a=="function"?c:e)},jL.text=function(a){return arguments.length<1?this.node().textContent:this.each(typeof a=="function"?function(){var b=a.apply(this,arguments);this.textContent=b==null?"":b}:a==null?function(){this.textContent=""}:function(){this.textContent=a})},jL.html=function(a){return arguments.length<1?this.node().innerHTML:this.each(typeof a=="function"?function(){var b=a.apply(this,arguments);this.innerHTML=b==null?"":b}:a==null?function(){this.innerHTML=""}:function(){this.innerHTML=a})},jL.append=function(b){function a(){return this.appendChild(document.createElementNS(this.namespaceURI,b))}function c(){return this.appendChild(document.createElementNS(b.space,b.local))}return b=d3.ns.qualify(b),this.select(b.local?c:a)},jL.insert=function(b,a){function e(){return this.insertBefore(document.createElementNS(this.namespaceURI,b),jY(a,this))}function c(){return this.insertBefore(document.createElementNS(b.space,b.local),jY(a
 ,this))}return b=d3.ns.qualify(b),this.select(b.local?c:e)},jL.remove=function(){return this.each(function(){var a=this.parentNode;a&&a.removeChild(this)})},jL.data=function(c,b){function h(y,x){var w,v=y.length,q=x.length,o=Math.min(v,q),n=Math.max(v,q),m=[],l=[],u=[],s,r;if(b){var p=new gW,A=[],z,t=x.length;for(w=-1;++w<v;){z=b.call(s=y[w],s.__data__,w),p.has(z)?u[t++]=s:p.set(z,s),A.push(z)}for(w=-1;++w<q;){z=b.call(x,r=x[w],w),p.has(z)?(m[w]=s=p.get(z),s.__data__=r,l[w]=u[w]=null):(l[w]=ab(r),m[w]=u[w]=null),p.remove(z)}for(w=-1;++w<v;){p.has(A[w])&&(u[w]=y[w])}}else{for(w=-1;++w<o;){s=y[w],r=x[w],s?(s.__data__=r,m[w]=s,l[w]=u[w]=null):(l[w]=ab(r),m[w]=u[w]=null)}for(;w<q;++w){l[w]=ab(x[w]),m[w]=u[w]=null}for(;w<n;++w){u[w]=y[w],l[w]=m[w]=null}}l.update=m,l.parentNode=m.parentNode=u.parentNode=y.parentNode,g.push(l),f.push(m),e.push(u)}var a=-1,k=this.length,j,i;if(!arguments.length){c=new Array(k=(j=this[0]).length);while(++a<k){if(i=j[a]){c[a]=i.__data__}}return c}var g=jV([])
 ,f=j8([]),e=j8([]);if(typeof c=="function"){while(++a<k){h(j=this[a],c.call(j,j.parentNode.__data__,a))}}else{while(++a<k){h(j=this[a],c)}}return f.enter=function(){return g},f.exit=function(){return e},f},jL.datum=jL.map=function(a){return arguments.length<1?this.property("__data__"):this.property("__data__",a)},jL.filter=function(a){var j=[],i,h,g;typeof a!="function"&&(a=ka(a));for(var f=0,e=this.length;f<e;f++){j.push(i=[]),i.parentNode=(h=this[f]).parentNode;for(var c=0,b=h.length;c<b;c++){(g=h[c])&&a.call(g,g.__data__,c)&&i.push(g)}}return j8(j)},jL.order=function(){for(var b=-1,a=this.length;++b<a;){for(var g=this[b],f=g.length-1,e=g[f],c;--f>=0;){if(c=g[f]){e&&e!==c.nextSibling&&e.parentNode.insertBefore(c,e),e=c}}}return this},jL.sort=function(b){b=j7.apply(this,arguments);for(var a=-1,c=this.length;++a<c;){this[a].sort(b)}return this.order()},jL.on=function(b,a,f){arguments.length<3&&(f=!1);var e="__on"+b,c=b.indexOf(".");return c>0&&(b=b.substring(0,c)),arguments.length<2
 ?(c=this.node()[e])&&c._:this.each(function(h,g){function i(l){var m=d3.event;d3.event=l;try{a.call(k,k.__data__,g)}finally{d3.event=m}}var k=this,j=k[e];j&&(k.removeEventListener(b,j,j.$),delete k[e]),a&&(k.addEventListener(b,k[e]=i,i.$=f),i._=a)})},jL.each=function(c){for(var b=-1,a=this.length;++b<a;){for(var h=this[b],g=-1,f=h.length;++g<f;){var e=h[g];e&&c.call(e,e.__data__,g,b)}}return this},jL.call=function(a){return a.apply(this,(arguments[0]=this,arguments)),this},jL.empty=function(){return !this.node()},jL.node=function(c){for(var b=0,a=this.length;b<a;b++){for(var h=this[b],g=0,f=h.length;g<f;g++){var e=h[g];if(e){return e}}}return null},jL.transition=function(){var f=[],e,c;for(var b=-1,a=this.length;++b<a;){f.push(e=[]);for(var i=this[b],h=-1,g=i.length;++h<g;){e.push((c=i[h])?{node:c,delay:af,duration:ad}:null)}}return im(f,iP||++iU,Date.now())};var j1=j8([[document]]);j1[0].parentNode=h1,d3.select=function(a){return typeof a=="string"?j1.select(a):j8([[a]])},d3.select
 All=function(a){return typeof a=="string"?j1.selectAll(a):j8([hM(a)])};var iz=[];d3.selection.enter=jV,d3.selection.enter.prototype=iz,iz.append=jL.append,iz.insert=jL.insert,iz.empty=jL.empty,iz.node=jL.node,iz.select=function(f){var e=[],c,b,a,l,k;for(var j=-1,i=this.length;++j<i;){a=(l=this[j]).update,e.push(c=[]),c.parentNode=l.parentNode;for(var h=-1,g=l.length;++h<g;){(k=l[h])?(c.push(a[h]=b=f.call(l.parentNode,k.__data__,h)),b.__data__=k.__data__):c.push(null)}}return j8(e)};var ji={},i0=[],iU=0,iP=0,iL=0,aj=250,ah=d3.ease("cubic-in-out"),af=iL,ad=aj,ac=ah;i0.call=jL.call,d3.transition=function(a){return arguments.length?iP?a.transition():a:j1.transition()},d3.transition.prototype=i0,i0.select=function(c){var b=[],a,k,j;typeof c!="function"&&(c=jo(c));for(var i=-1,h=this.length;++i<h;){b.push(a=[]);for(var g=this[i],f=-1,e=g.length;++f<e;){(j=g[f])&&(k=c.call(j.node,j.node.__data__,f))?("__data__" in j.node&&(k.__data__=j.node.__data__),a.push({node:k,delay:j.delay,duration:j
 .duration})):a.push(null)}}return im(b,this.id,this.time).ease(this.ease())},i0.selectAll=function(h){var g=[],f,e,c;typeof h!="function"&&(h=i9(h));for(var b=-1,a=this.length;++b<a;){for(var m=this[b],l=-1,k=m.length;++l<k;){if(c=m[l]){e=h.call(c.node,c.node.__data__,l),g.push(f=[]);for(var j=-1,i=e.length;++j<i;){f.push({node:e[j],delay:c.delay,duration:c.duration})}}}}return im(g,this.id,this.time).ease(this.ease())},i0.attr=function(b,a){return this.attrTween(b,i6(b,a))},i0.attrTween=function(b,a){function e(i,h){var g=a.call(this,i,h,this.getAttribute(f));return g===ji?(this.removeAttribute(f),null):g&&function(j){this.setAttribute(f,g(j))}}function c(i,h){var g=a.call(this,i,h,this.getAttributeNS(f.space,f.local));return g===ji?(this.removeAttributeNS(f.space,f.local),null):g&&function(j){this.setAttributeNS(f.space,f.local,g(j))}}var f=d3.ns.qualify(b);return this.tween("attr."+b,f.local?c:e)},i0.style=function(b,a,c){return arguments.length<3&&(c=""),this.styleTween(b,i6(b,a
 ),c)},i0.styleTween=function(b,a,c){return arguments.length<3&&(c=""),this.tween("style."+b,function(e,g){var f=a.call(this,e,g,window.getComputedStyle(this,null).getPropertyValue(b));return f===ji?(this.style.removeProperty(b),null):f&&function(h){this.style.setProperty(b,f(h),c)}})},i0.text=function(a){return this.tween("text",function(c,b){this.textContent=typeof a=="function"?a.call(this,c,b):a})},i0.remove=function(){return this.each("end.transition",function(){var a;!this.__transition__&&(a=this.parentNode)&&a.removeChild(this)})},i0.delay=function(b){var a=this;return a.each(typeof b=="function"?function(c,f,e){a[e][f].delay=b.apply(this,arguments)|0}:(b|=0,function(c,f,e){a[e][f].delay=b}))},i0.duration=function(b){var a=this;return a.each(typeof b=="function"?function(c,f,e){a[e][f].duration=Math.max(1,b.apply(this,arguments)|0)}:(b=Math.max(1,b|0),function(c,f,e){a[e][f].duration=b}))},i0.transition=function(){return this.select(iE)};var jO=null,jI,jC;d3.timer=function(b,a
 ,g){var f=!1,e,c=jO;if(arguments.length<3){if(arguments.length<2){a=0}else{if(!isFinite(a)){return}}g=Date.now()}while(c){if(c.callback===b){c.then=g,c.delay=a,f=!0;break}e=c,c=c.next}f||(jO={callback:b,then:g,delay:a,next:jO}),jI||(jC=clearTimeout(jC),jI=1,jk(jz))},d3.timer.flush=function(){var b,a=Date.now(),c=jO;while(c){b=a-c.then,c.delay||(c.flush=c.callback(b)),c=c.next}jt()};var jk=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(a){setTimeout(a,17)};d3.transform=function(b){var a=document.createElementNS(d3.ns.prefix.svg,"g"),c={a:1,b:0,c:0,d:1,e:0,f:0};return(d3.transform=function(f){a.setAttribute("transform",f);var e=a.transform.baseVal.consolidate();return new jh(e?e.matrix:c)})(b)},jh.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var i5=180/Math.PI;d3.mouse=functio
 n(a){return id(a,j6())};var io=/WebKit/.test(navigator.userAgent)?-1:0;d3.touches=function(b,a){return arguments.length<2&&(a=j6().touches),a?hM(a).map(function(e){var c=id(b,e);return c.identifier=e.identifier,c}):[]},d3.scale={},d3.scale.linear=function(){return g0([0,1],[0,1],d3.interpolate,!1)},d3.scale.log=function(){return j2(d3.scale.linear(),h9)};var iw=d3.format(".0e");h9.pow=function(a){return Math.pow(10,a)},hR.pow=function(a){return -Math.pow(10,-a)},d3.scale.pow=function(){return hz(d3.scale.linear(),1)},d3.scale.sqrt=function(){return d3.scale.pow().exponent(0.5)},d3.scale.ordinal=function(){return d9([],{t:"range",x:[]})},d3.scale.category10=function(){return d3.scale.ordinal().range(d4)},d3.scale.category20=function(){return d3.scale.ordinal().range(c7)},d3.scale.category20b=function(){return d3.scale.ordinal().range(iZ)},d3.scale.category20c=function(){return d3.scale.ordinal().range(iN)};var d4=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2",
 "#7f7f7f","#bcbd22","#17becf"],c7=["#1f77b4","#aec7e8","#ff7f0e","#ffbb78","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5","#8c564b","#c49c94","#e377c2","#f7b6d2","#7f7f7f","#c7c7c7","#bcbd22","#dbdb8d","#17becf","#9edae5"],iZ=["#393b79","#5254a3","#6b6ecf","#9c9ede","#637939","#8ca252","#b5cf6b","#cedb9c","#8c6d31","#bd9e39","#e7ba52","#e7cb94","#843c39","#ad494a","#d6616b","#e7969c","#7b4173","#a55194","#ce6dbd","#de9ed6"],iN=["#3182bd","#6baed6","#9ecae1","#c6dbef","#e6550d","#fd8d3c","#fdae6b","#fdd0a2","#31a354","#74c476","#a1d99b","#c7e9c0","#756bb1","#9e9ac8","#bcbddc","#dadaeb","#636363","#969696","#bdbdbd","#d9d9d9"];d3.scale.quantile=function(){return hW([],[])},d3.scale.quantize=function(){return hK(0,1,[0,1])},d3.scale.identity=function(){return hB([0,1])},d3.svg={},d3.svg.arc=function(){function c(){var i=b.apply(this,arguments),h=a.apply(this,arguments),g=f.apply(this,arguments)+hp,p=e.apply(this,arguments)+hp,o=(p<g&&(o=g,g=p,p=o),p-g),n=o<Math.PI?"0":"1",
 m=Math.cos(g),l=Math.sin(g),k=Math.cos(p),j=Math.sin(p);return o>=jS?i?"M0,"+h+"A"+h+","+h+" 0 1,1 0,"+-h+"A"+h+","+h+" 0 1,1 0,"+h+"M0,"+i+"A"+i+","+i+" 0 1,0 0,"+-i+"A"+i+","+i+" 0 1,0 0,"+i+"Z":"M0,"+h+"A"+h+","+h+" 0 1,1 0,"+-h+"A"+h+","+h+" 0 1,1 0,"+h+"Z":i?"M"+h*m+","+h*l+"A"+h+","+h+" 0 "+n+",1 "+h*k+","+h*j+"L"+i*k+","+i*j+"A"+i+","+i+" 0 "+n+",0 "+i*m+","+i*l+"Z":"M"+h*m+","+h*l+"A"+h+","+h+" 0 "+n+",1 "+h*k+","+h*j+"L0,0Z"}var b=jM,a=jD,f=jv,e=i7;return c.innerRadius=function(g){return arguments.length?(b=ke(g),c):b},c.outerRadius=function(g){return arguments.length?(a=ke(g),c):a},c.startAngle=function(g){return arguments.length?(f=ke(g),c):f},c.endAngle=function(g){return arguments.length?(e=ke(g),c):e},c.centroid=function(){var h=(b.apply(this,arguments)+a.apply(this,arguments))/2,g=(f.apply(this,arguments)+e.apply(this,arguments))/2+hp;return[Math.cos(g)*h,Math.sin(g)*h]},c};var hp=-Math.PI/2,jS=2*Math.PI-0.000001;d3.svg.line=function(){return iH(gz)};var kc="linear",j
 3=d3.map({linear:jX,"step-before":ic,"step-after":hX,basis:iI,"basis-open":ae,"basis-closed":jZ,bundle:jK,cardinal:jF,"cardinal-open":hG,"cardinal-closed":ho,monotone:f8}),ih=[0,2/3,1/3,0],h5=[0,1/3,2/3,0],hT=[0,1/6,2/3,1/6];d3.svg.line.radial=function(){var a=iH(f3);return a.radius=a.x,delete a.x,a.angle=a.y,delete a.y,a},ic.reverse=hX,hX.reverse=ic,d3.svg.area=function(){return f0(Object)},d3.svg.area.radial=function(){var a=f0(f3);return a.radius=a.x,delete a.x,a.innerRadius=a.x0,delete a.x0,a.outerRadius=a.x1,delete a.x1,a.angle=a.y,delete a.y,a.startAngle=a.y0,delete a.y0,a.endAngle=a.y1,delete a.y1,a},d3.svg.chord=function(){function i(m,l){var o=h(this,c,m,l),n=h(this,b,m,l);return"M"+o.p0+f(o.r,o.p1,o.a1-o.a0)+(g(o,n)?e(o.r,o.p1,o.r,o.p0):e(o.r,o.p1,n.r,n.p0)+f(n.r,n.p1,n.a1-n.a0)+e(n.r,n.p1,o.r,o.p0))+"Z"}function h(o,l,n,m){var s=l.call(o,n,m),r=a.call(o,s,m),q=k.call(o,s,m)+hp,p=j.call(o,s,m)+hp;return{r:r,a0:q,a1:p,p0:[r*Math.cos(q),r*Math.sin(q)],p1:[r*Math.cos(p),r*Mat
 h.sin(p)]}}function g(m,l){return m.a0==l.a0&&m.a1==l.a1}function f(m,l,n){return"A"+m+","+m+" 0 "+ +(n>Math.PI)+",1 "+l}function e(m,l,o,n){return"Q 0,0 "+n}var c=e5,b=e1,a=jy,k=jv,j=i7;return i.radius=function(l){return arguments.length?(a=ke(l),i):a},i.source=function(l){return arguments.length?(c=ke(l),i):c},i.target=function(l){return arguments.length?(b=ke(l),i):b},i.startAngle=function(l){return arguments.length?(k=ke(l),i):k},i.endAngle=function(l){return arguments.length?(j=ke(l),i):j},i},d3.svg.diagonal=function(){function c(h,g){var f=b.call(this,h,g),k=a.call(this,h,g),j=(f.y+k.y)/2,i=[f,{x:f.x,y:j},{x:k.x,y:j},k];return i=i.map(e),"M"+i[0]+"C"+i[1]+" "+i[2]+" "+i[3]}var b=e5,a=e1,e=iJ;return c.source=function(f){return arguments.length?(b=ke(f),c):b},c.target=function(f){return arguments.length?(a=ke(f),c):a},c.projection=function(f){return arguments.length?(e=f,c):e},c},d3.svg.diagonal.radial=function(){var b=d3.svg.diagonal(),a=iJ,c=b.projection;return b.projection=fu
 nction(e){return arguments.length?c(b8(a=e)):a},b},d3.svg.mouse=d3.mouse,d3.svg.touches=d3.touches,d3.svg.symbol=function(){function c(f,e){return(hc.get(b.call(this,f,e))||hh)(a.call(this,f,e))}var b=hk,a=b4;return c.type=function(e){return arguments.length?(b=ke(e),c):b},c.size=function(e){return arguments.length?(a=ke(e),c):a},c};var hc=d3.map({circle:hh,cross:function(b){var a=Math.sqrt(b/5)/2;return"M"+-3*a+","+-a+"H"+-a+"V"+-3*a+"H"+a+"V"+-a+"H"+3*a+"V"+a+"H"+a+"V"+3*a+"H"+-a+"V"+a+"H"+-3*a+"Z"},diamond:function(b){var a=Math.sqrt(b/(2*g4)),c=a*g4;return"M0,"+-a+"L"+c+",0 0,"+a+" "+-c+",0Z"},square:function(b){var a=Math.sqrt(b)/2;return"M"+-a+","+-a+"L"+a+","+-a+" "+a+","+a+" "+-a+","+a+"Z"},"triangle-down":function(b){var a=Math.sqrt(b/g8),c=a*g8/2;return"M0,"+c+"L"+a+","+-c+" "+-a+","+-c+"Z"},"triangle-up":function(b){var a=Math.sqrt(b/g8),c=a*g8/2;return"M0,"+-c+"L"+a+","+c+" "+-a+","+c+"Z"}});d3.svg.symbolTypes=hc.keys();var g8=Math.sqrt(3),g4=Math.tan(30*Math.PI/180);d3.
 svg.axis=function(){function g(m){m.each(function(){var H=d3.select(this),G=j==null?f.ticks?f.ticks.apply(f,k):f.domain():j,F=i==null?f.tickFormat?f.tickFormat.apply(f,k):String:i,E=jm(f,G,h),C=H.selectAll(".minor").data(E,String),A=C.enter().insert("line","g").attr("class","tick minor").style("opacity",0.000001),v=d3.transition(C.exit()).style("opacity",0.000001).remove(),r=d3.transition(C).style("opacity",1),o=H.selectAll("g").data(G,String),D=o.enter().insert("g","path").style("opacity",0.000001),z=d3.transition(o.exit()).style("opacity",0.000001).remove(),y=d3.transition(o).style("opacity",1),w,u=jq(f),t=H.selectAll(".domain").data([0]),q=t.enter().append("path").attr("class","domain"),x=d3.transition(t),s=f.copy(),p=this.__chart__||s;this.__chart__=s,D.append("line").attr("class","tick"),D.append("text"),y.select("text").text(F);switch(e){case"bottom":w=g2,A.attr("y2",b),r.attr("x2",0).attr("y2",b),D.select("line").attr("y2",c),D.select("text").attr("y",Math.max(c,0)+l),y.selec
 t("line").attr("x2",0).attr("y2",c),y.select("text").attr("x",0).attr("y",Math.max(c,0)+l).attr("dy",".71em").attr("text-anchor","middle"),x.attr("d","M"+u[0]+","+a+"V0H"+u[1]+"V"+a);break;case"top":w=g2,A.attr("y2",-b),r.attr("x2",0).attr("y2",-b),D.select("line").attr("y2",-c),D.select("text").attr("y",-(Math.max(c,0)+l)),y.select("line").attr("x2",0).attr("y2",-c),y.select("text").attr("x",0).attr("y",-(Math.max(c,0)+l)).attr("dy","0em").attr("text-anchor","middle"),x.attr("d","M"+u[0]+","+-a+"V0H"+u[1]+"V"+-a);break;case"left":w=jE,A.attr("x2",-b),r.attr("x2",-b).attr("y2",0),D.select("line").attr("x2",-c),D.select("text").attr("x",-(Math.max(c,0)+l)),y.select("line").attr("x2",-c).attr("y2",0),y.select("text").attr("x",-(Math.max(c,0)+l)).attr("y",0).attr("dy",".32em").attr("text-anchor","end"),x.attr("d","M"+-a+","+u[0]+"H0V"+u[1]+"H"+-a);break;case"right":w=jE,A.attr("x2",b),r.attr("x2",b).attr("y2",0),D.select("line").attr("x2",c),D.select("text").attr("x",Math.max(c,0)+l),y
 .select("line").attr("x2",c).attr("y2",0),y.select("text").attr("x",Math.max(c,0)+l).attr("y",0).attr("dy",".32em").attr("text-anchor","start"),x.attr("d","M"+a+","+u[0]+"H0V"+u[1]+"H"+a)}if(f.ticks){D.call(w,p),y.call(w,s),z.call(w,s),A.call(w,p),r.call(w,s),v.call(w,s)}else{var n=s.rangeBand()/2,B=function(I){return s(I)+n};D.call(w,B),y.call(w,B)}})}var f=d3.scale.linear(),e="bottom",c=6,b=6,a=6,l=3,k=[10],j=null,i,h=0;return g.scale=function(m){return arguments.length?(f=m,g):f},g.orient=function(m){return arguments.length?(e=m,g):e},g.ticks=function(){return arguments.length?(k=arguments,g):k},g.tickValues=function(m){return arguments.length?(j=m,g):j},g.tickFormat=function(m){return arguments.length?(i=m,g):i},g.tickSize=function(n,m,p){if(!arguments.length){return c}var o=arguments.length-1;return c=+n,b=o>1?+m:c,a=o>0?+arguments[o]:c,g},g.tickPadding=function(m){return arguments.length?(l=+m,g):l},g.tickSubdivide=function(m){return arguments.length?(h=+m,g):h},g},d3.svg.brus
 h=function(){function k(m){m.each(function(){var p=d3.select(this),r=p.selectAll(".background").data([0]),q=p.selectAll(".extent").data([0]),o=p.selectAll(".resize").data(b,String),n;p.style("pointer-events","all").on("mousedown.brush",g).on("touchstart.brush",g),r.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair"),q.enter().append("rect").attr("class","extent").style("cursor","move"),o.enter().append("g").attr("class",function(s){return"resize "+s}).style("cursor",function(s){return iO[s]}).append("rect").attr("x",function(s){return/[ew]$/.test(s)?-3:null}).attr("y",function(s){return/^[ns]/.test(s)?-3:null}).attr("width",6).attr("height",6).style("visibility","hidden"),o.style("display",k.empty()?"none":null),o.exit().remove(),e&&(n=jq(e),r.attr("x",n[0]).attr("width",n[1]-n[0]),i(p)),c&&(n=jq(c),r.attr("y",n[0]).attr("height",n[1]-n[0]),h(p)),j(p)})}function j(m){m.selectAll(".resize").attr("transform",function(n){return"tra
 nslate("+a[+/e$/.test(n)][0]+","+a[+/^s/.test(n)][1]+")"})}function i(m){m.select(".extent").attr("x",a[0][0]),m.selectAll(".extent,.n>rect,.s>rect").attr("width",a[1][0]-a[0][0])}function h(m){m.select(".extent").attr("y",a[0][1]),m.selectAll(".extent,.e>rect,.w>rect").attr("height",a[1][1]-a[0][1])}function g(){function v(){var G=d3.event.changedTouches;return G?d3.touches(F,G)[0]:d3.mouse(F)}function t(){d3.event.keyCode==32&&(s||(p=null,n[0]-=a[1][0],n[1]-=a[1][1],s=2),ai())}function r(){d3.event.keyCode==32&&s==2&&(n[0]+=a[1][0],n[1]+=a[1][1],s=0,ai())}function u(){var G=v(),H=!1;m&&(G[0]+=m[0],G[1]+=m[1]),s||(d3.event.altKey?(p||(p=[(a[0][0]+a[1][0])/2,(a[0][1]+a[1][1])/2]),n[0]=a[+(G[0]<p[0])][0],n[1]=a[+(G[1]<p[1])][1]):p=null),z&&q(G,e,0)&&(i(C),H=!0),x&&q(G,c,1)&&(h(C),H=!0),H&&(j(C),D({type:"brush",mode:s?"move":"resize"}))}function q(G,P,O){var J=jq(P),I=J[0],H=J[1],N=n[O],M=a[1][O]-a[0][O],L,K;s&&(I-=N,H-=M+N),L=Math.max(I,Math.min(H,G[O])),s?K=(L+=N)+M:(p&&(N=Math.max(
 I,Math.min(H,2*p[O]-L))),N<L?(K=L,L=N):K=N);if(a[0][O]!==L||a[1][O]!==K){return l=null,a[0][O]=L,a[1][O]=K,!0}}function o(){u(),C.style("pointer-events","all").selectAll(".resize").style("display",k.empty()?"none":null),d3.select("body").style("cursor",null),A.on("mousemove.brush",null).on("mouseup.brush",null).on("touchmove.brush",null).on("touchend.brush",null).on("keydown.brush",null).on("keyup.brush",null),D({type:"brushend"}),ai()}var F=this,E=d3.select(d3.event.target),D=f.of(F,arguments),C=d3.select(F),B=E.datum(),z=!/^(n|s)$/.test(B)&&e,x=!/^(e|w)$/.test(B)&&c,s=E.classed("extent"),p,n=v(),m,A=d3.select(window).on("mousemove.brush",u).on("mouseup.brush",o).on("touchmove.brush",u).on("touchend.brush",o).on("keydown.brush",t).on("keyup.brush",r);if(s){n[0]=a[0][0]-n[0],n[1]=a[0][1]-n[1]}else{if(B){var y=+/w$/.test(B),w=+/^n/.test(B);m=[a[1-y][0]-n[0],a[1-w][1]-n[1]],n[0]=a[y][0],n[1]=a[w][1]}else{d3.event.altKey&&(p=n.slice())}}C.style("pointer-events","none").selectAll(".resi
 ze").style("display",null),d3.select("body").style("cursor",E.style("cursor")),D({type:"brushstart"}),u(),ai()}var f=jQ(k,"brushstart","brush","brushend"),e=null,c=null,b=ii[0],a=[[0,0],[0,0]],l;return k.x=function(m){return arguments.length?(e=m,b=ii[!e<<1|!c],k):e},k.y=function(m){return arguments.length?(c=m,b=ii[!e<<1|!c],k):c},k.extent=function(r){var q,p,o,n,m;return arguments.length?(l=[[0,0],[0,0]],e&&(q=r[0],p=r[1],c&&(q=q[0],p=p[0]),l[0][0]=q,l[1][0]=p,e.invert&&(q=e(q),p=e(p)),p<q&&(m=q,q=p,p=m),a[0][0]=q|0,a[1][0]=p|0),c&&(o=r[0],n=r[1],e&&(o=o[1],n=n[1]),l[0][1]=o,l[1][1]=n,c.invert&&(o=c(o),n=c(n)),n<o&&(m=o,o=n,n=m),a[0][1]=o|0,a[1][1]=n|0),k):(r=l||a,e&&(q=r[0][0],p=r[1][0],l||(q=a[0][0],p=a[1][0],e.invert&&(q=e.invert(q),p=e.invert(p)),p<q&&(m=q,q=p,p=m))),c&&(o=r[0][1],n=r[1][1],l||(o=a[0][1],n=a[1][1],c.invert&&(o=c.invert(o),n=c.invert(n)),n<o&&(m=o,o=n,n=m))),e&&c?[[q,o],[p,n]]:e?[q,p]:c&&[o,n])},k.clear=function(){return l=null,a[0][0]=a[0][1]=a[1][0]=a[1][1]=0
 ,k},k.empty=function(){return e&&a[0][0]===a[1][0]||c&&a[0][1]===a[1][1]},d3.rebind(k,f,"on")};var iO={n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},ii=[["n","e","s","w","nw","ne","se","sw"],["e","w"],["n","s"],[]];d3.behavior={},d3.behavior.drag=function(){function e(){this.on("mousedown.drag",c).on("touchstart.drag",c)}function c(){function m(){var r=i.parentNode,q=d3.event.changedTouches;return q?d3.touches(r,q)[0]:d3.mouse(r)}function l(){if(!i.parentNode){return k()}var r=m(),q=r[0]-p[0],s=r[1]-p[1];o|=q|s,p=r,ai(),h({type:"drag",x:r[0]+f[0],y:r[1]+f[1],dx:q,dy:s})}function k(){h({type:"dragend"}),o&&(ai(),d3.event.target===g&&n.on("click.drag",j,!0)),n.on("mousemove.drag",null).on("touchmove.drag",null).on("mouseup.drag",null).on("touchend.drag",null)}function j(){ai(),n.on("click.drag",null)}var i=this,h=b.of(i,arguments),g=d3.event.target,f,p=m(),o=0,n=d3.select(window).on("mousemove.drag",l).on("
 touchmove.drag",l).on("mouseup.drag",k,!0).on("touchend.drag",k,!0);a?(f=a.apply(i,arguments),f=[f.x-p[0],f.y-p[1]]):f=[0,0],ai(),h({type:"dragstart"})}var b=jQ(e,"drag","dragstart","dragend"),a=null;return e.origin=function(f){return arguments.length?(a=f,e):a},d3.rebind(e,b,"on")},d3.behavior.zoom=function(){function k(){this.on("mousedown.zoom",c).on("mousewheel.zoom",b).on("mousemove.zoom",a).on("DOMMouseScroll.zoom",b).on("dblclick.zoom",n).on("touchstart.zoom",l).on("touchmove.zoom",j).on("touchend.zoom",l)}function i(y){return[(y[0]-x[0])/v,(y[1]-x[1])/v]}function h(y){return[y[0]*v+x[0],y[1]*v+x[1]]}function g(y){v=Math.max(t[0],Math.min(t[1],y))}function f(z,y){y=h(y),x[0]+=z[0]-y[0],x[1]+=z[1]-y[1]}function e(y){q&&q.domain(r.range().map(function(z){return(z-x[0])/v}).map(r.invert)),o&&o.domain(p.range().map(function(z){return(z-x[1])/v}).map(p.invert)),d3.event.preventDefault(),y({type:"zoom",scale:v,translate:x})}function c(){function A(){D=1,f(d3.mouse(G),B),e(F)}functi
 on z(){D&&ai(),C.on("mousemove.zoom",null).on("mouseup.zoom",null),D&&d3.event.target===E&&C.on("click.zoom",y,!0)}function y(){ai(),C.on("click.zoom",null)}var G=this,F=s.of(G,arguments),E=d3.event.target,D=0,C=d3.select(window).on("mousemove.zoom",A).on("mouseup.zoom",z),B=i(d3.mouse(G));window.focus(),ai()}function b(){w||(w=i(d3.mouse(this))),g(Math.pow(2,hw()*0.002)*v),f(d3.mouse(this),w),e(s.of(this,arguments))}function a(){w=null}function n(){var z=d3.mouse(this),y=i(z);g(d3.event.shiftKey?v/2:v*2),f(z,y),e(s.of(this,arguments))}function l(){var A=d3.touches(this),y=Date.now();u=v,w={},A.forEach(function(C){w[C.identifier]=i(C)}),ai();if(A.length===1&&y-m<500){var B=A[0],z=i(A[0]);g(v*2),f(B,z),e(s.of(this,arguments))}m=y}function j(){var B=d3.touches(this),z=B[0],C=w[z.identifier];if(A=B[1]){var A,y=w[A.identifier];z=[(z[0]+A[0])/2,(z[1]+A[1])/2],C=[(C[0]+y[0])/2,(C[1]+y[1])/2],g(d3.event.scale*u)}f(z,C),e(s.of(this,arguments))}var x=[0,0],w,v=1,u,t=hH,s=jQ(k,"zoom"),r,q,p,o
 ,m;return k.translate=function(y){return arguments.length?(x=y.map(Number),k):x},k.scale=function(y){return arguments.length?(v=+y,k):v},k.scaleExtent=function(y){return arguments.length?(t=y==null?hH:y.map(Number),k):t},k.x=function(y){return arguments.length?(q=y,r=y.copy(),k):q},k.y=function(y){return arguments.length?(o=y,p=y.copy(),k):o},d3.rebind(k,s,"on")};var hZ,hH=[0,Infinity];d3.layout={},d3.layout.bundle=function(){return function(b){var a=[],e=-1,c=b.length;while(++e<c){a.push(jj(b[e]))}return a}},d3.layout.chord=function(){function h(){var x={},u=[],s=d3.range(a),r=[],q,p,o,m,B;e=[],c=[],q=0,m=-1;while(++m<a){p=0,B=-1;while(++B<a){p+=b[m][B]}u.push(p),r.push(d3.range(a)),q+=p}k&&s.sort(function(D,C){return k(u[D],u[C])}),j&&r.forEach(function(D,C){D.sort(function(F,E){return j(b[C][F],b[C][E])})}),q=(2*Math.PI-l*a)/q,p=0,m=-1;while(++m<a){o=p,B=-1;while(++B<a){var A=s[m],w=r[A][B],t=b[A][w],z=p,y=p+=t*q;x[A+"-"+w]={index:A,subindex:w,startAngle:z,endAngle:y,value:t}}c[A
 ]={index:A,startAngle:o,endAngle:p,value:(p-o)/q},p+=l}m=-1;while(++m<a){B=m-1;while(++B<a){var v=x[m+"-"+B],n=x[B+"-"+m];(v.value||n.value)&&e.push(v.value<n.value?{source:n,target:v}:{source:v,target:n})}}i&&g()}function g(){e.sort(function(n,m){return i((n.source.value+n.target.value)/2,(m.source.value+m.target.value)/2)})}var f={},e,c,b,a,l=0,k,j,i;return f.matrix=function(m){return arguments.length?(a=(b=m)&&b.length,e=c=null,f):b},f.padding=function(m){return arguments.length?(l=m,e=c=null,f):l},f.sortGroups=function(m){return arguments.length?(k=m,e=c=null,f):k},f.sortSubgroups=function(m){return arguments.length?(j=m,e=null,f):j},f.sortChords=function(m){return arguments.length?(i=m,e&&g(),f):i},f.chords=function(){return e||h(),e},f.groups=function(){return c||h(),c},f},d3.layout.force=function(){function c(u){return function(z,y,x,w,v){if(z.point!==u){var D=z.cx-u.x,C=z.cy-u.y,B=1/Math.sqrt(D*D+C*C);if((w-y)*B<e){var A=z.charge*B*B;return u.px-=D*A,u.py-=C*A,!0}if(z.point&
 &isFinite(B)){var A=z.pointCharge*B*B;u.px-=D*A,u.py-=C*A}}return !z.charge}}function a(u){gH(gL=u),gS=t}var t={},s=d3.dispatch("start","tick","end"),q=[1,1],o,l,j=0.9,i=j9,h=j0,g=-30,f=0.1,e=0.8,b,r=[],p=[],n,m,k;return t.tick=function(){if((l*=0.99)<0.005){return s.end({type:"end",alpha:l=0}),!0}var v=r.length,u=p.length,E,D,C,B,A,z,y,x,w;for(D=0;D<u;++D){C=p[D],B=C.source,A=C.target,x=A.x-B.x,w=A.y-B.y;if(z=x*x+w*w){z=l*m[D]*((z=Math.sqrt(z))-n[D])/z,x*=z,w*=z,A.x-=x*(y=B.weight/(A.weight+B.weight)),A.y-=w*y,B.x+=x*(y=1-y),B.y+=w*y}}if(y=l*f){x=q[0]/2,w=q[1]/2,D=-1;if(y){while(++D<v){C=r[D],C.x+=(x-C.x)*y,C.y+=(w-C.y)*y}}}if(g){kh(E=d3.geom.quadtree(r),l,k),D=-1;while(++D<v){(C=r[D]).fixed||E.visit(c(C))}}D=-1;while(++D<v){C=r[D],C.fixed?(C.x=C.px,C.y=C.py):(C.x-=(C.px-(C.px=C.x))*j,C.y-=(C.py-(C.py=C.y))*j)}s.tick({type:"tick",alpha:l})},t.nodes=function(u){return arguments.length?(r=u,t):r},t.links=function(u){return arguments.length?(p=u,t):p},t.size=function(u){return argumen
 ts.length?(q=u,t):q},t.linkDistance=function(u){return arguments.length?(i=ke(u),t):i},t.distance=t.linkDistance,t.linkStrength=function(u){return arguments.length?(h=ke(u),t):h},t.friction=function(u){return arguments.length?(j=u,t):j},t.charge=function(u){return arguments.length?(g=typeof u=="function"?u:+u,t):g},t.gravity=function(u){return arguments.length?(f=u,t):f},t.theta=function(u){return arguments.length?(e=u,t):e},t.alpha=function(u){return arguments.length?(l?u>0?l=u:l=0:u>0&&(s.start({type:"start",alpha:l=u}),d3.timer(t.tick)),t):l},t.start=function(){function z(H,J){var I=y(x),G=-1,F=I.length,E;while(++G<F){if(!isNaN(E=I[G][H])){return E}}return Math.random()*J}function y(){if(!B){B=[];for(w=0;w<v;++w){B[w]=[]}for(w=0;w<u;++w){var E=p[w];B[E.source.index].push(E.target),B[E.target.index].push(E.source)}}return B[x]}var x,w,v=r.length,u=p.length,D=q[0],C=q[1],B,A;for(x=0;x<v;++x){(A=r[x]).index=x,A.weight=0}n=[],m=[];for(x=0;x<u;++x){A=p[x],typeof A.source=="number"&&(A
 .source=r[A.source]),typeof A.target=="number"&&(A.target=r[A.target]),n[x]=i.call(this,A,x),m[x]=h.call(this,A,x),++A.source.weight,++A.target.weight}for(x=0;x<v;++x){A=r[x],isNaN(A.x)&&(A.x=z("x",D)),isNaN(A.y)&&(A.y=z("y",C)),isNaN(A.px)&&(A.px=A.x),isNaN(A.py)&&(A.py=A.y)}k=[];if(typeof g=="function"){for(x=0;x<v;++x){k[x]=+g.call(this,r[x],x)}}else{for(x=0;x<v;++x){k[x]=g}}return t.resume()},t.resume=function(){return t.alpha(0.1)},t.stop=function(){return t.alpha(0)},t.drag=function(){o||(o=d3.behavior.drag().origin(gz).on("dragstart",a).on("drag",iG).on("dragend",gw)),this.on("mouseover.force",gH).on("mouseout.force",gC).call(o)},d3.rebind(t,s,"on")};var gS,gL;d3.layout.partition=function(){function f(o,n,m,l){var k=o.children;o.x=n,o.y=o.depth*l,o.dx=m,o.dy=l;if(k&&(i=k.length)){var j=-1,i,h,g;m=o.value?m/o.value:0;while(++j<i){f(h=k[j],n,g=h.value*m,l),n+=g}}}function e(i){var h=i.children,g=0;if(h&&(j=h.length)){var k=-1,j;while(++k<j){g=Math.max(g,e(h[k]))}}return 1+g}fun
 ction c(g,i){var h=b.call(this,g,i);return f(h[0],0,a[0],a[1]/e(h[0])),h}var b=d3.layout.hierarchy(),a=[1,1];return c.size=function(g){return arguments.length?(a=g,c):a},gE(c,b)},d3.layout.pie=function(){function c(m,k){var h=m.map(function(n,o){return +b.call(c,n,o)}),g=+(typeof f=="function"?f.apply(this,arguments):f),l=((typeof e=="function"?e.apply(this,arguments):e)-f)/d3.sum(h),j=d3.range(m.length);a!=null&&j.sort(a===ig?function(o,n){return h[n]-h[o]}:function(n,o){return a(m[n],m[o])});var i=[];return j.forEach(function(n){i[n]={data:m[n],value:d=h[n],startAngle:g,endAngle:g+=d*l}}),i}var b=Number,a=ig,f=0,e=2*Math.PI;return c.value=function(g){return arguments.length?(b=g,c):b},c.sort=function(g){return arguments.length?(a=g,c):a},c.startAngle=function(g){return arguments.length?(f=g,c):f},c.endAngle=function(g){return arguments.length?(e=g,c):e},c};var ig={};d3.layout.stack=function(){function e(m,l){var k=m.map(function(u,t){return c.call(e,u,t)}),j=k.map(function(t,u){re
 turn t.map(function(w,v){return[g.call(e,w,v),f.call(e,w,v)]})}),i=b.call(e,j,l);k=d3.permute(k,i),j=d3.permute(j,i);var s=a.call(e,j,l),r=k.length,q=k[0].length,p,o,n;for(o=0;o<q;++o){h.call(e,k[0][o],n=s[o],j[0][o][1]);for(p=1;p<r;++p){h.call(e,k[p][o],n+=j[p-1][o][1],j[p][o][1])}}return m}var c=gz,b=d0,a=hU,h=ht,g=h3,f=hL;return e.values=function(i){return arguments.length?(c=i,e):c},e.order=function(i){return arguments.length?(b=typeof i=="function"?i:jG.get(i)||d0,e):b},e.offset=function(i){return arguments.length?(a=typeof i=="function"?i:d5.get(i)||hU,e):a},e.x=function(i){return arguments.length?(g=i,e):g},e.y=function(i){return arguments.length?(f=i,e):f},e.out=function(i){return arguments.length?(h=i,e):h},e};var jG=d3.map({"inside-out":function(f){var e=f.length,c,b,a=f.map(c4),l=f.map(gX),k=d3.range(e).sort(function(n,m){return a[n]-a[m]}),j=0,i=0,h=[],g=[];for(c=0;c<e;++c){b=k[c],j<i?(j+=l[b],h.push(b)):(i+=l[b],g.push(b))}return g.reverse().concat(h)},reverse:function(
 a){return d3.range(a.length).reverse()},"default":d0}),d5=d3.map({silhouette:function(a){var j=a.length,i=a[0].length,h=[],g=0,f,e,c,b=[];for(e=0;e<i;++e){for(f=0,c=0;f<j;f++){c+=a[f][e][1]}c>g&&(g=c),h.push(c)}for(e=0;e<i;++e){b[e]=(g-h[e])/2}return b},wiggle:function(p){var n=p.length,l=p[0],k=l.length,j=0,i,h,g,f,e,c,b,a,o,m=[];m[0]=a=o=0;for(h=1;h<k;++h){for(i=0,f=0;i<n;++i){f+=p[i][h][1]}for(i=0,e=0,b=l[h][0]-l[h-1][0];i<n;++i){for(g=0,c=(p[i][h][1]-p[i][h-1][1])/(2*b);g<i;++g){c+=(p[g][h][1]-p[g][h-1][1])/b}e+=c*p[i][h][1]}m[h]=a-=f?e/f*b:0,a<o&&(o=a)}for(h=0;h<k;++h){m[h]-=o}return m},expand:function(f){var e=f.length,c=f[0].length,b=1/e,a,i,h,g=[];for(i=0;i<c;++i){for(a=0,h=0;a<e;a++){h+=f[a][i][1]}if(h){for(a=0;a<e;a++){f[a][i][1]/=h}}else{for(a=0;a<e;a++){f[a][i][1]=b}}}for(i=0;i<c;++i){g[i]=0}return g},zero:hU});d3.layout.histogram=function(){function c(k,j){var i=[],h=k.map(a,this),g=f.call(this,h,j),q=e.call(this,g,h,j),p,j=-1,o=h.length,n=q.length-1,m=b?1:1/o,l;while(+
 +j<n){p=i[j]=[],p.dx=q[j+1]-(p.x=q[j]),p.y=0}if(n>0){j=-1;while(++j<o){l=h[j],l>=g[0]&&l<=g[1]&&(p=i[d3.bisect(q,l,1,n)-1],p.y+=m,p.push(k[j]))}}return i}var b=!0,a=Number,f=gI,e=gQ;return c.value=function(g){return arguments.length?(a=g,c):a},c.range=function(g){return arguments.length?(f=ke(g),c):f},c.bins=function(g){return arguments.length?(e=typeof g=="number"?function(h){return gK(h,g)}:ke(g),c):e},c.frequency=function(g){return arguments.length?(b=!!g,c):b},c},d3.layout.hierarchy=function(){function f(j,i,h){var q=a.call(c,j,i),p=aL?j:{data:j};p.depth=i,h.push(p);if(q&&(n=q.length)){var o=-1,n,m=p.children=[],l=0,k=i+1;while(++o<n){d=f(q[o],k,h),d.parent=p,m.push(d),l+=d.value}b&&m.sort(b),g&&(p.value=l)}else{g&&(p.value=+g.call(c,j,i)||0)}return p}function e(h,k){var i=h.children,n=0;if(i&&(l=i.length)){var m=-1,l,j=k+1;while(++m<l){n+=e(i[m],j)}}else{g&&(n=+g.call(c,aL?h:h.data,k)||0)}return g&&(h.value=n),n}function c(i){var h=[];return f(i,0,h),h}var b=aS,a=gA,g=aV;return
  c.sort=function(h){return arguments.length?(b=h,c):b},c.children=function(h){return arguments.length?(a=h,c):a},c.value=function(h){return arguments.length?(g=h,c):g},c.revalue=function(h){return e(h,0),h},c};var aL=!1;d3.layout.pack=function(){function c(k,i){var g=b.call(this,k,i),f=g[0];f.x=0,f.y=0,il(f);var e=a[0],j=a[1],h=1/Math.max(2*f.r/e,2*f.r/j);return ij(f,e/2,j/2,h),g}var b=d3.layout.hierarchy().sort(e6),a=[1,1];return c.size=function(e){return arguments.length?(a=e,c):a},gE(c,b)},d3.layout.cluster=function(){function c(k,j){var i=b.call(this,k,j),h=i[0],g,f=0,q,p;hA(h,function(r){var s=r.children;s&&s.length?(r.x=e3(s),r.y=h6(s)):(r.x=g?f+=a(r,g):0,r.y=0,g=r)});var o=e2(h),n=c6(h),m=o.x-a(o,n)/2,l=n.x+a(n,o)/2;return hA(h,function(r){r.x=(r.x-m)/(l-m)*e[0],r.y=(1-(h.y?r.y/h.y:1))*e[1]}),i}var b=d3.layout.hierarchy().sort(null).value(null),a=c5,e=[1,1];return c.separation=function(f){return arguments.length?(a=f,c):a},c.size=function(f){return arguments.length?(e=f,c):e}
 ,gE(c,b)},d3.layout.tree=function(){function c(o,m){function i(B,A){var z=B.children,y=B._tree;if(z&&(x=z.length)){var x,w=z[0],u,s=w,v,t=-1;while(++t<x){v=z[t],i(v,u),s=g(v,u,s),u=v}hq(B);var C=0.5*(w._tree.prelim+v._tree.prelim);A?(y.prelim=A._tree.prelim+a(B,A),y.mod=y.prelim-C):y.prelim=C}else{A&&(y.prelim=A._tree.prelim+a(B,A))}}function h(v,u){v.x=v._tree.prelim+u;var t=v.children;if(t&&(w=t.length)){var s=-1,w;u+=v._tree.mod;while(++s<w){h(t[s],u)}}}function g(C,B,A){if(B){var z=C,x=C,y=B,w=C.parent.children[0],u=z._tree.mod,s=x._tree.mod,v=y._tree.mod,t=w._tree.mod,D;while(y=c1(y),z=c2(z),y&&z){w=c2(w),x=c1(x),x._tree.ancestor=C,D=y._tree.prelim+v-z._tree.prelim-u+a(y,z),D>0&&(gu(gq(y,C,A),C,D),u+=D,s+=D),v+=y._tree.mod,u+=z._tree.mod,t+=w._tree.mod,s+=x._tree.mod}y&&!c1(x)&&(x._tree.thread=y,x._tree.mod+=v-s),z&&!c2(w)&&(w._tree.thread=z,w._tree.mod+=u-t,A=C)}return A}var k=b.call(this,o,m),j=k[0];hA(j,function(t,s){t._tree={ancestor:t,prelim:0,mod:0,change:0,shift:0,number
 :s?s._tree.number+1:0}}),i(j),h(j,-j._tree.prelim);var f=iu(j,hY),r=iu(j,ia),q=iu(j,hP),p=f.x-a(f,r)/2,n=r.x+a(r,f)/2,l=q.depth||1;return hA(j,function(s){s.x=(s.x-p)/(n-p)*e[0],s.y=s.depth/l*e[1],delete s._tree}),k}var b=d3.layout.hierarchy().sort(null).value(null),a=c5,e=[1,1];return c.separation=function(f){return arguments.length?(a=f,c):a},c.size=function(f){return arguments.length?(e=f,c):e},gE(c,b)},d3.layout.treemap=function(){function c(p,u){var t=-1,s=p.length,r,q;while(++t<s){q=(r=p[t]).value*(u<0?0:u),r.area=isNaN(q)||q<=0?0:q}}function b(q){var p=q.children;if(p&&p.length){var y=h(q),x=[],w=p.slice(),v,u=Infinity,t,s=Math.min(y.dx,y.dy),r;c(w,y.dx*y.dy/q.value),x.area=0;while((r=w.length)>0){x.push(v=w[r-1]),x.area+=v.area,(t=o(x,s))<=u?(w.pop(),u=t):(x.area-=x.pop().area,m(x,s,y,!1),s=Math.min(y.dx,y.dy),x.length=x.area=0,u=Infinity)}x.length&&(m(x,s,y,!0),x.length=x.area=0),p.forEach(b)}}function a(p){var u=p.children;if(u&&u.length){var t=h(p),s=u.slice(),r,q=[];c(s,
 t.dx*t.dy/p.value),q.area=0;while(r=s.pop()){q.push(r),q.area+=r.area,r.z!=null&&(m(q,r.z?t.dx:t.dy,t,!s.length),q.length=q.area=0)}u.forEach(a

<TRUNCATED>

[073/100] [abbrv] [maven-release-plugin] prepare release 3.2.0

Posted by wi...@apache.org.
http://git-wip-us.apache.org/repos/asf/marmotta/blob/f5b5cf0c/platform/marmotta-security/pom.xml
----------------------------------------------------------------------
diff --git a/platform/marmotta-security/pom.xml b/platform/marmotta-security/pom.xml
index 54a5568..847559e 100644
--- a/platform/marmotta-security/pom.xml
+++ b/platform/marmotta-security/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0-SNAPSHOT</version>
+        <version>3.2.0</version>
         <relativePath>../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/f5b5cf0c/platform/marmotta-sparql/pom.xml
----------------------------------------------------------------------
diff --git a/platform/marmotta-sparql/pom.xml b/platform/marmotta-sparql/pom.xml
index 112026e..88636d6 100644
--- a/platform/marmotta-sparql/pom.xml
+++ b/platform/marmotta-sparql/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0-SNAPSHOT</version>
+        <version>3.2.0</version>
         <relativePath>../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/f5b5cf0c/platform/marmotta-user/pom.xml
----------------------------------------------------------------------
diff --git a/platform/marmotta-user/pom.xml b/platform/marmotta-user/pom.xml
index b9ea905..08012c5 100644
--- a/platform/marmotta-user/pom.xml
+++ b/platform/marmotta-user/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0-SNAPSHOT</version>
+        <version>3.2.0</version>
         <relativePath>../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/f5b5cf0c/platform/marmotta-versioning-common/pom.xml
----------------------------------------------------------------------
diff --git a/platform/marmotta-versioning-common/pom.xml b/platform/marmotta-versioning-common/pom.xml
index 83bcafa..cd08d5a 100644
--- a/platform/marmotta-versioning-common/pom.xml
+++ b/platform/marmotta-versioning-common/pom.xml
@@ -16,15 +16,13 @@
   ~ limitations under the License.
   -->
 
-<project xmlns="http://maven.apache.org/POM/4.0.0"
-         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0-SNAPSHOT</version>
+        <version>3.2.0</version>
         <relativePath>../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/f5b5cf0c/platform/marmotta-versioning-kiwi/pom.xml
----------------------------------------------------------------------
diff --git a/platform/marmotta-versioning-kiwi/pom.xml b/platform/marmotta-versioning-kiwi/pom.xml
index 1c5b6ef..55d4d8b 100644
--- a/platform/marmotta-versioning-kiwi/pom.xml
+++ b/platform/marmotta-versioning-kiwi/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0-SNAPSHOT</version>
+        <version>3.2.0</version>
         <relativePath>../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/f5b5cf0c/platform/marmotta-zookeeper/pom.xml
----------------------------------------------------------------------
diff --git a/platform/marmotta-zookeeper/pom.xml b/platform/marmotta-zookeeper/pom.xml
index 308074d..1a443fa 100644
--- a/platform/marmotta-zookeeper/pom.xml
+++ b/platform/marmotta-zookeeper/pom.xml
@@ -15,15 +15,13 @@
    See the License for the specific language governing permissions and
    limitations under the License.
 -->
-<project xmlns="http://maven.apache.org/POM/4.0.0"
-         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0-SNAPSHOT</version>
+        <version>3.2.0</version>
         <relativePath>../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/f5b5cf0c/platform/pom.xml
----------------------------------------------------------------------
diff --git a/platform/pom.xml b/platform/pom.xml
index 3614050..d6b3275 100644
--- a/platform/pom.xml
+++ b/platform/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0-SNAPSHOT</version>
+        <version>3.2.0</version>
         <relativePath>../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/f5b5cf0c/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 0e53d5c..d9979a0 100644
--- a/pom.xml
+++ b/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0-SNAPSHOT</version>
+        <version>3.2.0</version>
         <relativePath>parent</relativePath>
     </parent>
 
@@ -118,7 +118,7 @@
         <url>https://git-wip-us.apache.org/repos/asf/marmotta.git</url>
         <connection>scm:git:https://git-wip-us.apache.org/repos/asf/marmotta.git</connection>
         <developerConnection>scm:git:https://git-wip-us.apache.org/repos/asf/marmotta.git</developerConnection>
-        <tag>HEAD</tag>
+        <tag>3.2.0</tag>
     </scm>
 
     <issueManagement>


[084/100] [abbrv] git commit: reverted c3b393eb64a351211e52417b79aa074a0887138e

Posted by wi...@apache.org.
reverted c3b393eb64a351211e52417b79aa074a0887138e


Project: http://git-wip-us.apache.org/repos/asf/marmotta/repo
Commit: http://git-wip-us.apache.org/repos/asf/marmotta/commit/db70ff70
Tree: http://git-wip-us.apache.org/repos/asf/marmotta/tree/db70ff70
Diff: http://git-wip-us.apache.org/repos/asf/marmotta/diff/db70ff70

Branch: refs/heads/ldp
Commit: db70ff70997681ad7c1229bbc07cafc908682152
Parents: 49b6b3c
Author: Sergio Fernández <wi...@apache.org>
Authored: Wed Apr 16 11:04:30 2014 +0200
Committer: Sergio Fernández <wi...@apache.org>
Committed: Wed Apr 16 11:04:30 2014 +0200

----------------------------------------------------------------------
 launchers/marmotta-webapp/pom.xml | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/marmotta/blob/db70ff70/launchers/marmotta-webapp/pom.xml
----------------------------------------------------------------------
diff --git a/launchers/marmotta-webapp/pom.xml b/launchers/marmotta-webapp/pom.xml
index 91d7dda..fb87868 100644
--- a/launchers/marmotta-webapp/pom.xml
+++ b/launchers/marmotta-webapp/pom.xml
@@ -204,6 +204,7 @@
         <profile>
             <id>kiwi</id>
             <activation>
+                <activeByDefault>true</activeByDefault>
                 <property>
                     <name>marmotta.backend</name>
                     <value>kiwi</value>


[063/100] [abbrv] git commit: allowing, at least to compile, an experimental backend

Posted by wi...@apache.org.
allowing, at least to compile, an experimental backend


Project: http://git-wip-us.apache.org/repos/asf/marmotta/repo
Commit: http://git-wip-us.apache.org/repos/asf/marmotta/commit/41cd34a7
Tree: http://git-wip-us.apache.org/repos/asf/marmotta/tree/41cd34a7
Diff: http://git-wip-us.apache.org/repos/asf/marmotta/diff/41cd34a7

Branch: refs/heads/ldp
Commit: 41cd34a7a1c1619b86e23440e0001456c656a721
Parents: 5112274
Author: Sergio Fernández <wi...@apache.org>
Authored: Tue Apr 8 11:19:30 2014 +0200
Committer: Sergio Fernández <wi...@apache.org>
Committed: Tue Apr 8 11:19:40 2014 +0200

----------------------------------------------------------------------
 .../apache/marmotta/platform/backend/http/HTTPStoreProvider.java   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/marmotta/blob/41cd34a7/platform/backends/marmotta-backend-http/src/main/java/org/apache/marmotta/platform/backend/http/HTTPStoreProvider.java
----------------------------------------------------------------------
diff --git a/platform/backends/marmotta-backend-http/src/main/java/org/apache/marmotta/platform/backend/http/HTTPStoreProvider.java b/platform/backends/marmotta-backend-http/src/main/java/org/apache/marmotta/platform/backend/http/HTTPStoreProvider.java
index c541c96..3cbd346 100644
--- a/platform/backends/marmotta-backend-http/src/main/java/org/apache/marmotta/platform/backend/http/HTTPStoreProvider.java
+++ b/platform/backends/marmotta-backend-http/src/main/java/org/apache/marmotta/platform/backend/http/HTTPStoreProvider.java
@@ -78,7 +78,7 @@ public class HTTPStoreProvider implements StoreProvider {
         Federation store = new Federation();
         store.addMember(httpRepository);
 
-        return store;
+        return (NotifyingSail)store;
     }
 
     /**


[024/100] [abbrv] [partial] Reverting the erroneous merge by Sebastian according to the instructions in INFRA-6876

Posted by wi...@apache.org.
http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/launchers/marmotta-installer/src/main/resources/installer/NOTICE.txt
----------------------------------------------------------------------
diff --git a/launchers/marmotta-installer/src/main/resources/installer/NOTICE.txt b/launchers/marmotta-installer/src/main/resources/installer/NOTICE.txt
index 3da7e34..3e23da2 100644
--- a/launchers/marmotta-installer/src/main/resources/installer/NOTICE.txt
+++ b/launchers/marmotta-installer/src/main/resources/installer/NOTICE.txt
@@ -1,6 +1,8 @@
-Apache Marmotta Installer, Copyright 2012-2013 The Apache Software Foundation
+Apache Marmotta Installer
+Copyright 2012-2013 The Apache Software Foundation
 
-This product includes software developed at The Apache Software Foundation (http://www.apache.org).
+This product includes software developed at 
+The Apache Software Foundation (http://www.apache.org).
 
 Portions of this software were originally based on the following:
 
@@ -8,295 +10,33 @@ Portions of this software were originally based on the following:
 
 These have been licensed to the Apache Software Foundation under a software grant.
 
-This product also includes the following third-party components:
+This product also includes some third-party binary components:
 
-* Apache Tomcat, http://tomcat.apache.org
+ * H2 Database, Copyright (c) 2013 H2 Group, is licensed under the Eclipse Public 
+   License (EPL) 1.0. The original software is available from http://www.h2database.com
 
-  Copyright (c) 2013 The Apache Software Foundation
+ * Logback, Copyright (C) 2012 QOS.ch, is licensed under the Eclipse Public 
+   License (EPL) 1.0. The original software is available from http://logback.qos.ch
 
-  Java compilation software for JSP pages is provided by Eclipse,
-  which is open source software.  The original software and
-  related information is available at http://www.eclipse.org.
+ * Javassist, Copyright (c) 2013 Shigeru Chiba, is licensed under the Mozilla 
+   Public License (MPL) 1.1. The original software is available from 
+   http://www.jboss.org/javassist
 
-  The bayeux implementation is derivative work originating at 
-  the Dojo Foundation
-    * Copyright 2007-2008 Guy Molinari
-    * Copyright 2007-2008 Filip Hanik
-    * Copyright 2007 Dojo Foundation
-    * Copyright 2007 Mort Bay Consulting Pty. Ltd.
+ * Java Activation, Copyright (c) 2012 Oracle Corporation, is licensed under the
+   Common Development and Distribution License (CDDL) v1.0. The original software 
+   is available from http://www.oracle.com
 
-  The original XML Schemas for Java EE Deployment Descriptors:
-    - javaee_5.xsd
-    - javaee_web_services_1_2.xsd
-    - javaee_web_services_client_1_2.xsd
-    - javaee_6.xsd
-    - javaee_web_services_1_3.xsd
-    - javaee_web_services_client_1_3.xsd
-    - jsp_2_2.xsd
-    - web-app_3_0.xsd
-    - web-common_3_0.xsd
-    - web-fragment_3_0.xsd
-  may be obtained from http://java.sun.com/xml/ns/javaee/
+ * Java Servlet API, Copyright (c) 2012 Oracle Corporation, is licensed under the
+   Common Development and Distribution License (CDDL) v1.0. The original software 
+   is available from http://www.oracle.com
 
-* H2, http://www.h2database.com
+ * Common Annotations (JSR-250), Copyright (c) 2012 Oracle Corporation, is licensed 
+   under the Common Development and Distribution License (CDDL) v1.0. The original 
+   software is available from http://www.oracle.com
 
-  Copyright (c) 2013 H2 Group
-
-* Logback, http://logback.qos.ch
-
-  Copyright (C) 2012 QOS.ch
-
-* JDOM, http://www.jdom.org
-
-  Copyright (c) 2012 Jason Hunter & Brett McLaughlin
-
-* Freemarker, http://freemarker.org
-
-  Copyright (c) 2003 The Visigoth Software Society
-
-* CAL10N, http://cal10n.qos.ch
-
-  Copyright (c) 2009 QOS.ch
-
-* Guava, http://guava-libraries.googlecode.com
-
-  Copyright (c) 2013 Google Inc.
-
-* Jackson, http://jackson.codehaus.org
-
-  Copyright (c) 2010 FasterXML LLC.
-
-* MimeUtil, http://mime-util.sourceforge.net
-
-  Copyright (c) 2010 Medsea Business Solutions S.L.
-
-* IzPack, http://izpack.org
-
-  Copyright (c) 2012 Julien Ponge
-
-* Apache Ant, http://ant.apache.org
-
-  Copyright (c) 2012 The Apache Software Foundation
-
-  This product includes also software developed by:
-    - the W3C consortium, http://www.w3.org
-    - the SAX project, http://www.saxproject.org
-
-  Please read the different LICENSE files present in the 
-  root directory of this distribution.
-
-* OpenCSV, http://opencsv.sourceforge.net
-
-  Copyright (c) 2005 Bytecode Pty Ltd.
-
-* OpenRDF Sesame, http://www.openrdf.org
-
-  Copyright (c) 2013 Aduna
-
-  This software includes code developed by Aduna
-  (http://www.aduna-software.com/).
-
-  This software includes code developed by Ontotext AD
-  (http://www.ontotext.com/).
-
-  This software includes code developed by 3 Round Stones
-  (http://www.3roundstones.com/).
-
-  This software includes code developed by Fluid Operations
-  (http://www.fluidops.com/).
-
-  This software includes code developed by the Information Management Group at
-  Food & Biobased Research, Wageningen University (http://www.fbr.wur.nl/).
-
-  This software includes code developed by Clark & Parsia
-  (http://clarkparsia.com/).
-
-  This software includes code developed by the Institute for Defense Analyses
-  (IDA) (http://www.ida.org/).
-
-  This software includes code developed by Atos (http://www.atos.net/).
-
-  This software includes code developed by Peter Ansell.
-
-  The above parties have licensed their code contributions to Aduna under the
-  terms of a contributor license agreement (CLA).
-
-  This product includes software developed by the JUnit project
-  (http://www.junit.org). License: http://junit.sourceforge.net/cpl-v10.html
-
-  Parts of this product use software developed by JSON.org
-  (http://www.json.org). License: http://www.json.org/license.html
-
-  Parts of this product use software developed by the Mockito project
-  (http://mockito.googlecode.com). License: https://github.com/mockito/mockito/blob/master/LICENSE
-
-* PostgreSQL JDBC, http://jdbc.postgresql.org
-
-  Copyright (c) 2011 PostgreSQL Global Development Group
-
-* Scannotation, http://scannotation.sourceforge.net
-
-  Copyright (c) 2011 Bill Burke
-
-* SLF4J, http://www.slf4j.org
-
-  Copyright (c) 2013 QOS.ch
-
-* Semargl, http://semarglproject.org
-
-  Copyright (c) 2012 Lev Khomich
-
-  This product uses software developed by The Apache Software Foundation:
-  Clerezza, Jena, IO Commons (http://www.apache.org/).
-
-  This product includes/uses test suite developed by Hewlett-Packard
-  (http://hp.com/). Copyright (c) 2002, Hewlett-Packard Company.
-
-  This product includes/uses test suite developed by W3C Consortium.
-
-  This product includes/uses RDFa test harness developed by RDF Web Applications
-  Working Group (http://www.w3.org/2010/02/rdfa/).
-
-* Janino, http://janino.codehaus.org
-
-  Copyright (c) 2010 Arno Unkrig
-
-* Java Injection API, http://atinject.googlecode.com
-
-  Copyright (c) 2009 The JSR-330 Expert Group
-
-* Javassist, http://www.jboss.org/javassist
-
-  Copyright (c) 2013 Shigeru Chiba
-
-* Jaxen, http://jaxen.codehaus.org
-
-  Copyright (c) 2006 The Werken Company
-
-* JSoup, http://jsoup.org
-
-  Copyright (c) 2013 Jonathan Hedley
-
-* EHCache, http://ehcache.org
-
-  Copyright (c) 2010 Terracotta, Inc.
-
-* CDI, http://github.com/jboss/cdi
-
-  Copyright (c) 2012 Red Hat Middleware, LLC
-
-* Weld, http://github.com/weld
-
-  Copyright (c) 2012 Red Hat Middleware, LLC
-
-* Bean Validation, http://github.com/hibernate/hibernate-validator
-
-  Copyright (c) 2012 Red Hat Middleware, LLC
-
-* JBoss EJB Common Interceptor, http://github.com/jbossinterceptors/jbossinterceptors
-
-  Copyright (c) 2012 Red Hat Middleware, LLC
-
-* RESTEasy, http://www.jboss.org/resteasy
-
-  Copyright (c) 2012 Red Hat Middleware, LLC
-
-* Java Activation, http://www.oracle.com
-
-  Copyright (c) 2012 Oracle Corporation
-
-* Java Servlet API, http://www.oracle.com
-
-  Copyright (c) 2012 Oracle Corporation
-
-* Common Annotations (JSR-250), http://www.oracle.com
-
-  Copyright (c) 2012 Oracle Corporation
-
-* Expression Language, http://www.oracle.com
-
-  Copyright (c) 2012 Oracle Corporation
-
-* Apache Xerces, http://xerces.apache.org
-
-  Copyright (c) 2013 The Apache Software Foundation
-
-  Portions of this software were originally based on the following:
-   - software copyright (c) 1999, IBM Corporation, http://www.ibm.com.
-   - software copyright (c) 1999, Sun Microsystems, http://www.sun.com.
-   - voluntary contributions made by Paul Eng on behalf of the
-     Apache Software Foundation that were originally developed at
-     iClick, Inc., software copyright (c) 1999.
-
-* "Java Concurrency in Practice" book annotations component, http://jcip.net
-
-  Copyright (c) 2005 Brian Goetz and Tim Peierls
-
-* Hamcrest, http://www.hamcrest.org
-
-  Copyright (c) 2000-2006 Joe Walnes, Nat Pryce, Steve Freeman
-
-* D3.js, http://d3js.org
-
-  Copyright (c) 2013 Michael Bostock
-
-* Dracula Graph Library, http://www.graphdracula.net
-
-  Copyright (c) 2013 Johann Philipp Strathausen
-
-* strftime, http://hacks.bluesmoon.info/strftime
-
-  Copyright (c) 2008 Philip S Tellis
-
-* jQuery, http://jquery.com
-
-  Copyright (c) 2013 jQuery Foundation
-
-* CodeMirror, http://codemirror.net
-
-  Copyright (c) 2013 Marijn Haverbeke
-
-* D2R Snorql, http://www4.wiwiss.fu-berlin.de/bizer/d2r-server/,
-
-  Copyright (c) 2007 Richard Cyganiak
-
-* script.aculo.us, http://script.aculo.us
-
-  Copyright (c) 2010 Thomas Fuchs
-
-* Prototype, http://prototypejs.org
-
-  Copyright (c) 2010 Sam Stephenson
-
-* SPARQL Flint Editor, http://github.com/TSO-Openup/FlintSparqlEditor
-
-  Copyright (c) 2011 TSO Ltd
-
-* Sgvizler, http://sgvizler.googlecode.com
-
-  Copyright (c) 2011 Martin G. Skjæveland
-
-* MigLayout, http://www.migcalendar.com/miglayout
-
-  Copyright (c) 2004 MiG InfoCom AB
-
-* SwingBits, http://swingbits.sourceforge.net
-
-  Copyright (c) 2006 EzWare
-
-* ROME, http://rometools.jira.com
-
-  Copyright (c) 2004 Sun Microsystems
-
-* JSONLD-Java, http://github.com/tristan/jsonld-java
-
-  Copyright (c) 2012, Deutsches Forschungszentrum für Künstliche Intelligenz GmbH
-
-* JSON-LD Test Suite, http://json-ld.org/test-suite
-
-  Public Domain (Creative Commons Zero license) without copyright
-
-* ical4j test suite, http://ical4j.googlecode.com
-
-  Copyright (c) 2011 Ben Fortuna
+ * Expression Language, Copyright (c) 2012 Oracle Corporation, is licensed under
+   the Common Development and Distribution License (CDDL) v1.0. The original 
+   software is available from http://www.oracle.com
 
+ * Javolution, Copyright (c) 2012 Javolution, is licensed under BSD license. The
+   original source code is available from http://javolution.org

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/launchers/marmotta-splash/pom.xml
----------------------------------------------------------------------
diff --git a/launchers/marmotta-splash/pom.xml b/launchers/marmotta-splash/pom.xml
index 2d67d85..aea7c89 100644
--- a/launchers/marmotta-splash/pom.xml
+++ b/launchers/marmotta-splash/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>
 
@@ -36,7 +36,7 @@
         <dependency>
             <groupId>org.apache.tomcat</groupId>
             <artifactId>tomcat-catalina</artifactId>
-            <version>7.0.37</version>
+            <version>7.0.39</version>
         </dependency>
         <dependency>
             <groupId>org.apache.geronimo.ext.tomcat</groupId>

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/launchers/marmotta-splash/src/ext/resources/META-INF/NOTICE
----------------------------------------------------------------------
diff --git a/launchers/marmotta-splash/src/ext/resources/META-INF/NOTICE b/launchers/marmotta-splash/src/ext/resources/META-INF/NOTICE
index 312a0bd..22b650e 100644
--- a/launchers/marmotta-splash/src/ext/resources/META-INF/NOTICE
+++ b/launchers/marmotta-splash/src/ext/resources/META-INF/NOTICE
@@ -1,10 +1,11 @@
 Apache Marmotta LDPath
-Copyright [2012-2013] The Apache Software Foundation
+Copyright 2012-2013 The Apache Software Foundation
 
 This product includes software developed at
 The Apache Software Foundation (http://www.apache.org/).
 
-Additionally, it includes the following 3rd party modules:
+Portions of this software were originally based on the following:
 
-  MigLayout licensed under New BSD License
-  SwingBits licensed under New BSD License
+    Copyright 2008-2012 Salzburg Research Forschungsgesellschaft mbH
+
+These have been licensed to the Apache Software Foundation under a software grant.

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/launchers/marmotta-splash/src/main/resources/META-INF/NOTICE
----------------------------------------------------------------------
diff --git a/launchers/marmotta-splash/src/main/resources/META-INF/NOTICE b/launchers/marmotta-splash/src/main/resources/META-INF/NOTICE
index 0feb1c2..da32381 100644
--- a/launchers/marmotta-splash/src/main/resources/META-INF/NOTICE
+++ b/launchers/marmotta-splash/src/main/resources/META-INF/NOTICE
@@ -1,15 +1,11 @@
 Apache Marmotta Splash Screen
-Copyright [2012-2013] The Apache Software Foundation
+Copyright 2012-2013 The Apache Software Foundation
 
 This product includes software developed at
 The Apache Software Foundation (http://www.apache.org/).
 
-Additionally, it includes the following 3rd party modules:
+Portions of this software were originally based on the following:
 
-* MigLayout, http://www.migcalendar.com/miglayout
+    Copyright 2008-2012 Salzburg Research Forschungsgesellschaft mbH
 
-  Copyright (c) 2004 MiG InfoCom AB
-
-* SwingBits, http://swingbits.sourceforge.net
-
-  Copyright (c) 2006 EzWare
+These have been licensed to the Apache Software Foundation under a software grant.

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/launchers/marmotta-webapp/pom.xml
----------------------------------------------------------------------
diff --git a/launchers/marmotta-webapp/pom.xml b/launchers/marmotta-webapp/pom.xml
index 142537c..60d6f86 100644
--- a/launchers/marmotta-webapp/pom.xml
+++ b/launchers/marmotta-webapp/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>
 
@@ -76,22 +76,10 @@
                         <skip>true</skip>
                     </configuration>
                 </plugin>
-                <plugin>
-                    <groupId>org.apache.tomcat.maven</groupId>
-                    <artifactId>tomcat6-maven-plugin</artifactId>
-                    <version>2.0</version>
-                    <configuration>
-                        <path>${marmotta.context}</path>
-                        <port>${marmotta.port}</port>
-                        <systemProperties>
-                            <marmotta.home>${marmotta.home}</marmotta.home>
-                        </systemProperties>
-                    </configuration>
-                </plugin>
-                <plugin>
+                 <plugin>
                     <groupId>org.apache.tomcat.maven</groupId>
                     <artifactId>tomcat7-maven-plugin</artifactId>
-                    <version>2.0</version>
+                    <version>2.1</version>
                     <configuration>
                         <path>${marmotta.context}</path>
                         <port>${marmotta.port}</port>
@@ -102,28 +90,7 @@
                         <!-- <backgroundProcessorDelay>10</backgroundProcessorDelay> -->
                     </configuration>
                 </plugin>
-                <plugin>
-                    <groupId>org.mortbay.jetty</groupId>
-                    <artifactId>maven-jetty-plugin</artifactId>
-                    <version>6.1.10</version>
-                    <configuration>
-                        <contextPath>${marmotta.context}</contextPath>
-                        <connectors>
-                            <connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
-                                <port>${marmotta.port}</port>
-                            </connector>
-                        </connectors>
-                        <systemProperties>
-                            <systemProperty>
-                                <name>marmotta.home</name>
-                                <value>${marmotta.home}</value>
-                            </systemProperty>
-                        </systemProperties>
-                        <stopKey>marmotta</stopKey>
-                        <stopPort>9999</stopPort>
-                    </configuration>
-                </plugin>
-            </plugins>
+             </plugins>
         </pluginManagement>
         <resources>
             <resource>
@@ -134,17 +101,9 @@
         <plugins>
             <plugin>
                 <groupId>org.apache.tomcat.maven</groupId>
-                <artifactId>tomcat6-maven-plugin</artifactId>
-            </plugin>
-            <plugin>
-                <groupId>org.apache.tomcat.maven</groupId>
                 <artifactId>tomcat7-maven-plugin</artifactId>
             </plugin>
             <plugin>
-                <groupId>org.mortbay.jetty</groupId>
-                <artifactId>maven-jetty-plugin</artifactId>
-            </plugin>
-            <plugin>
                 <artifactId>maven-dependency-plugin</artifactId>
             </plugin>
 
@@ -262,7 +221,7 @@
         <!-- Servlet / CDI Environment -->
         <dependency>
             <groupId>javax.el</groupId>
-            <artifactId>el-api</artifactId>
+            <artifactId>javax.el-api</artifactId>
             <scope>provided</scope>
         </dependency>
         <dependency>
@@ -278,7 +237,7 @@
             <artifactId>h2</artifactId>
         </dependency>
         <dependency>
-            <groupId>org.jumpmind.symmetric.jdbc</groupId>
+            <groupId>org.postgresql</groupId>
             <artifactId>postgresql</artifactId>
         </dependency>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/launchers/marmotta-webapp/src/main/resources/ehcache-lmf.xml
----------------------------------------------------------------------
diff --git a/launchers/marmotta-webapp/src/main/resources/ehcache-lmf.xml b/launchers/marmotta-webapp/src/main/resources/ehcache-lmf.xml
deleted file mode 100644
index f2dca9c..0000000
--- a/launchers/marmotta-webapp/src/main/resources/ehcache-lmf.xml
+++ /dev/null
@@ -1,422 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
-    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.
-
--->
-<!--
-CacheManager Configuration
-==========================
-An ehcache-lmf.xml corresponds to a single CacheManager.
-
-See instructions below or the ehcache schema (ehcache.xsd) on how to configure.
-
-System property tokens can be specified in this file which are replaced when the configuration
-is loaded. For example multicastGroupPort=${multicastGroupPort} can be replaced with the
-System property either from an environment variable or a system property specified with a
-command line switch such as -DmulticastGroupPort=4446.
-
-The attributes of <ehcache> are:
-* name - an optional name for the CacheManager.  The name is optional and primarily used 
-for documentation or to distinguish Terracotta clustered cache state.  With Terracotta 
-clustered caches, a combination of CacheManager name and cache name uniquely identify a 
-particular cache store in the Terracotta clustered memory.
-* updateCheck - an optional boolean flag specifying whether this CacheManager should check
-for new versions of Ehcache over the Internet.  If not specified, updateCheck="true".
-* monitoring - an optional setting that determines whether the CacheManager should 
-automatically register the SampledCacheMBean with the system MBean server.  Currently,
-this monitoring is only useful when using Terracotta and thus the "autodetect" value 
-will detect the presence of Terracotta and register the MBean.  Other allowed values 
-are "on" and "off".  The default is "autodetect".
--->    
-<ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:noNamespaceSchemaLocation="http://ehcache.org/ehcache.xsd"
-         updateCheck="false"
-         name="lmf">
-
-    <!-- 
-    DiskStore configuration
-    =======================
-
-    The diskStore element is optional. To turn off disk store path creation, comment out the diskStore
-    element below.
-
-    Configure it if you have overflowToDisk or diskPersistent enabled for any cache.
-
-    If it is not configured, and a cache is created which requires a disk store, a warning will be
-     issued and java.io.tmpdir will automatically be used.
-
-    diskStore has only one attribute - "path". It is the path to the directory where
-    .data and .index files will be created.
-
-    If the path is one of the following Java System Property it is replaced by its value in the
-    running VM. For backward compatibility these are not specified without being enclosed in the ${token}
-    replacement syntax.
-
-    The following properties are translated:
-    * user.home - KiWiUser's home directory
-    * user.dir - KiWiUser's current working directory
-    * java.io.tmpdir - Default temp file path
-    * ehcache.disk.store.dir - A system property you would normally specify on the command line
-      e.g. java -Dehcache.disk.store.dir=/u01/myapp/diskdir ...
-
-    Subdirectories can be specified below the property e.g. java.io.tmpdir/one
-
-    -->
-    <diskStore path="java.io.tmpdir/lmf-cache/lmf"/>
-
-   <!--
-    Cachemanagereventlistener
-    =========================
-    Specifies a CacheManagerEventListenerFactory which is notified when Caches are added
-    or removed from the CacheManager.
-
-    The attributes of CacheManagerEventListenerFactory are:
-    * class - a fully qualified factory class name
-    * properties - comma separated properties having meaning only to the factory.
-
-    Sets the fully qualified class name to be registered as the CacheManager event listener.
-
-    The events include:
-    * adding a Cache
-    * removing a Cache
-
-    Callbacks to listener methods are synchronous and unsynchronized. It is the responsibility
-    of the implementer to safely handle the potential performance and thread safety issues
-    depending on what their listener is doing.
-
-    If no class is specified, no listener is created. There is no default.
-    -->
-    <cacheManagerEventListenerFactory class="" properties=""/>
-
-
-    <!--
-    CacheManagerPeerProvider
-    ========================
-    (For distributed operation)
-
-    Specifies a CacheManagerPeerProviderFactory which will be used to create a
-    CacheManagerPeerProvider, which discovers other CacheManagers in the cluster.
-
-    One or more providers can be configured. The first one in the ehcache-lmf.xml is the default, which is used
-    for replication and bootstrapping.
-
-    The attributes of cacheManagerPeerProviderFactory are:
-    * class - a fully qualified factory class name
-    * properties - comma separated properties having meaning only to the factory.
-
-    Providers are available for RMI, JGroups and JMS as shown following.
-
-    RMICacheManagerPeerProvider
-    +++++++++++++++++++++++++++
-
-    Ehcache comes with a built-in RMI-based distribution system with two means of discovery of
-    CacheManager peers participating in the cluster:
-    * automatic, using a multicast group. This one automatically discovers peers and detects
-      changes such as peers entering and leaving the group
-    * manual, using manual rmiURL configuration. A hardcoded list of peers is provided at
-      configuration time.
-
-    Configuring Automatic Discovery:
-    Automatic discovery is configured as per the following example:
-    <cacheManagerPeerProviderFactory
-                        class="net.sf.ehcache.distribution.RMICacheManagerPeerProviderFactory"
-                        properties="hostName=fully_qualified_hostname_or_ip,
-                                    peerDiscovery=automatic, multicastGroupAddress=230.0.0.1,
-                                    multicastGroupPort=4446, timeToLive=32"/>
-
-    Valid properties are:
-    * peerDiscovery (mandatory) - specify "automatic"
-    * multicastGroupAddress (mandatory) - specify a valid multicast group address
-    * multicastGroupPort (mandatory) - specify a dedicated port for the multicast heartbeat
-      traffic
-    * timeToLive - specify a value between 0 and 255 which determines how far the packets will
-      propagate.
-
-      By convention, the restrictions are:
-      0   - the same host
-      1   - the same subnet
-      32  - the same site
-      64  - the same region
-      128 - the same continent
-      255 - unrestricted
-
-     * hostName - the hostname or IP of the interface to be used for sending and receiving multicast packets
-       (relevant to mulithomed hosts only)
-
-    Configuring Manual Discovery:
-    Manual discovery requires a unique configuration per host. It is contains a list of rmiURLs for the peers, other
-    than itself. So, if we have server1, server2 and server3 the configuration will be:
-
-    In server1's configuration:
-    <cacheManagerPeerProviderFactory class=
-                          "net.sf.ehcache.distribution.RMICacheManagerPeerProviderFactory"
-                          properties="peerDiscovery=manual,
-                          rmiUrls=//server2:40000/sampleCache1|//server3:40000/sampleCache1
-                          | //server2:40000/sampleCache2|//server3:40000/sampleCache2"
-                          propertySeparator="," />
-
-    In server2's configuration:
-    <cacheManagerPeerProviderFactory class=
-                          "net.sf.ehcache.distribution.RMICacheManagerPeerProviderFactory"
-                          properties="peerDiscovery=manual,
-                          rmiUrls=//server1:40000/sampleCache1|//server3:40000/sampleCache1
-                          | //server1:40000/sampleCache2|//server3:40000/sampleCache2"
-                          propertySeparator="," />
-
-    In server3's configuration:
-    <cacheManagerPeerProviderFactory class=
-                          "net.sf.ehcache.distribution.RMICacheManagerPeerProviderFactory"
-                          properties="peerDiscovery=manual,
-                          rmiUrls=//server1:40000/sampleCache1|//server2:40000/sampleCache1
-                          | //server1:40000/sampleCache2|//server2:40000/sampleCache2"
-                          propertySeparator="," />
-
-
-    Valid properties are:
-    * peerDiscovery (mandatory) - specify "manual"
-    * rmiUrls (mandatory) - specify a pipe separated list of rmiUrls, in the form
-                            //hostname:port
-    * hostname (optional) - the hostname is the hostname of the remote CacheManager peer. The port is the listening
-      port of the RMICacheManagerPeerListener of the remote CacheManager peer.
-    
-    JGroupsCacheManagerPeerProvider
-    +++++++++++++++++++++++++++++++
-    <cacheManagerPeerProviderFactory class="net.sf.ehcache.distribution.jgroups.JGroupsCacheManagerPeerProviderFactory"
-                                     properties="connect=UDP(mcast_addr=231.12.21.132;mcast_port=45566;ip_ttl=32;
-                                     mcast_send_buf_size=150000;mcast_recv_buf_size=80000):
-                                     PING(timeout=2000;num_initial_members=6):
-                                     MERGE2(min_interval=5000;max_interval=10000):
-                                     FD_SOCK:VERIFY_SUSPECT(timeout=1500):
-                                     pbcast.NAKACK(gc_lag=10;retransmit_timeout=3000):
-                                     UNICAST(timeout=5000):
-                                     pbcast.STABLE(desired_avg_gossip=20000):
-                                     FRAG:
-                                     pbcast.GMS(join_timeout=5000;join_retry_timeout=2000;shun=false;print_local_addr=false)"
-                                     propertySeparator="::"
-            />
-     The only property necessary is the connect String used by jgroups to configure itself. Refer to the Jgroups documentation for explanation
-     of all the protocols. The example above uses UDP multicast. If the connect property is not specified the default JGroups connection will be
-     used.       
-
-
-    JMSCacheManagerPeerProviderFactory
-    ++++++++++++++++++++++++++++++++++
-    <cacheManagerPeerProviderFactory
-            class="net.sf.ehcache.distribution.jms.JMSCacheManagerPeerProviderFactory"
-            properties="..."
-            propertySeparator=","
-            />
-
-    The JMS PeerProviderFactory uses JNDI to maintain message queue independence. Refer to the manual for full configuration
-    examples using ActiveMQ and Open Message Queue.
-
-    Valid properties are:
-    * initialContextFactoryName (mandatory) - the name of the factory used to create the message queue initial context.
-    * providerURL (mandatory) - the JNDI configuration information for the service provider to use.
-    * topicConnectionFactoryBindingName (mandatory) - the JNDI binding name for the TopicConnectionFactory
-    * topicBindingName (mandatory) - the JNDI binding name for the topic name
-    * getQueueBindingName (mandatory only if using jmsCacheLoader) - the JNDI binding name for the queue name
-    * securityPrincipalName - the JNDI java.naming.security.principal
-    * securityCredentials - the JNDI java.naming.security.credentials
-    * urlPkgPrefixes - the JNDI java.naming.factory.url.pkgs
-    * userName - the user name to use when creating the TopicConnection to the Message Queue
-    * password - the password to use when creating the TopicConnection to the Message Queue
-    * acknowledgementMode - the JMS Acknowledgement mode for both publisher and subscriber. The available choices are
-                            AUTO_ACKNOWLEDGE, DUPS_OK_ACKNOWLEDGE and SESSION_TRANSACTED. The default is AUTO_ACKNOWLEDGE.
-    -->
-<!--    <cacheManagerPeerProviderFactory-->
-<!--            class="net.sf.ehcache.distribution.RMICacheManagerPeerProviderFactory"-->
-<!--            properties="peerDiscovery=automatic,-->
-<!--                        multicastGroupAddress=230.0.0.1,-->
-<!--                        multicastGroupPort=4446, timeToLive=1"-->
-<!--            propertySeparator=","-->
-<!--            />-->
-
-
-    <!--
-    CacheManagerPeerListener
-    ========================
-    (Enable for distributed operation)
-
-    Specifies a CacheManagerPeerListenerFactory which will be used to create a
-    CacheManagerPeerListener, which listens for messages from cache replicators participating in the cluster.
-
-    The attributes of cacheManagerPeerListenerFactory are:
-    class - a fully qualified factory class name
-    properties - comma separated properties having meaning only to the factory.
-
-    Ehcache comes with a built-in RMI-based distribution system. The listener component is
-    RMICacheManagerPeerListener which is configured using
-    RMICacheManagerPeerListenerFactory. It is configured as per the following example:
-
-    <cacheManagerPeerListenerFactory
-        class="net.sf.ehcache.distribution.RMICacheManagerPeerListenerFactory"
-        properties="hostName=fully_qualified_hostname_or_ip,
-                    port=40001,
-                    remoteObjectPort=40002,
-                    socketTimeoutMillis=120000"
-                    propertySeparator="," />
-
-    All properties are optional. They are:
-    * hostName - the hostName of the host the listener is running on. Specify
-      where the host is multihomed and you want to control the interface over which cluster
-      messages are received. Defaults to the host name of the default interface if not
-      specified.
-    * port - the port the RMI Registry listener listens on. This defaults to a free port if not specified.
-    * remoteObjectPort - the port number on which the remote objects bound in the registry receive calls.
-                         This defaults to a free port if not specified.
-    * socketTimeoutMillis - the number of ms client sockets will stay open when sending
-      messages to the listener. This should be long enough for the slowest message.
-      If not specified it defaults to 120000ms.
-
-    -->
-<!--    <cacheManagerPeerListenerFactory-->
-<!--            class="net.sf.ehcache.distribution.RMICacheManagerPeerListenerFactory"/>-->
-
-    <!-- Cache configuration.
-
-    The following attributes are required.
-
-    name:
-    Sets the name of the cache. This is used to identify the cache. It must be unique.
-
-    maxElementsInMemory:
-    Sets the maximum number of objects that will be created in memory
-
-        maxElementsOnDisk:
-    Sets the maximum number of objects that will be maintained in the DiskStore
-        The default value is zero, meaning unlimited.
-
-    eternal:
-    Sets whether elements are eternal. If eternal,  timeouts are ignored and the
-    element is never expired.
-
-    overflowToDisk:
-    Sets whether elements can overflow to disk when the memory store
-    has reached the maxInMemory limit.
-
-    The following attributes are optional.
-
-    timeToIdleSeconds:
-    Sets the time to idle for an element before it expires.
-    i.e. The maximum amount of time between accesses before an element expires
-    Is only used if the element is not eternal.
-    Optional attribute. A value of 0 means that an Element can idle for infinity.
-    The default value is 0.
-
-    timeToLiveSeconds:
-    Sets the time to live for an element before it expires.
-    i.e. The maximum time between creation time and when an element expires.
-    Is only used if the element is not eternal.
-    Optional attribute. A value of 0 means that and Element can live for infinity.
-    The default value is 0.
-
-    diskPersistent:
-    Whether the disk store persists between restarts of the Virtual Machine.
-    The default value is false.
-
-    diskExpiryThreadIntervalSeconds:
-    The number of seconds between runs of the disk expiry thread. The default value
-    is 120 seconds.
-
-    memoryStoreEvictionPolicy:
-    Policy would be enforced upon reaching the maxElementsInMemory limit. Default
-    policy is Least Recently Used (specified as LRU). Other policies available -
-    First In First Out (specified as FIFO) and Less Frequently Used
-    (specified as LFU)
-
-    -->
-
-    <!--
-    Mandatory Default Cache configuration. These settings will be applied to caches
-    created programmtically using CacheManager.add(String cacheName)
-    -->
-    <defaultCache
-            maxElementsInMemory="20000"
-            overflowToDisk="false"
-            memoryStoreEvictionPolicy="LRU"
-            />
-
-
-    <!-- the cache used for triple queries by KiWi -->
-    <cache name="uri-node-cache"
-           statistics="true"
-           maxElementsInMemory="100000"
-           timeToIdleSeconds="3600"
-           overflowToDisk="false"/>
-    <cache name="anon-node-cache"
-           statistics="true"
-           maxElementsInMemory="10000"
-           timeToIdleSeconds="3600"
-           overflowToDisk="false"/>
-    <cache name="literal-cache"
-           statistics="true"
-           maxElementsInMemory="10000"
-           timeToIdleSeconds="3600"
-           overflowToDisk="false"/>
-
-    <cache name="namespace-prefix-cache"
-           statistics="true"
-           maxElementsInMemory="100"
-           overflowToDisk="true"/>
-
-    <cache name="namespace-uri-cache"
-           statistics="true"
-           maxElementsInMemory="100"
-           overflowToDisk="true"/>
-
-    <!-- the cache used for triple queries by KiWi -->
-    <cache name="query-cache"
-           statistics="true"
-           maxElementsInMemory="200000"
-           timeToIdleSeconds="3600"
-           overflowToDisk="false"/>
-
-    <!-- the cache used for resource lookups from module jar files -->
-    <cache name="resource-cache"
-           statistics="true"
-           maxElementsInMemory="10000"
-           timeToIdleSeconds="3600"
-           timeToLiveSeconds="3600"
-           overflowToDisk="false"
-           memoryStoreEvictionPolicy="LRU"/>
-
-    <!-- the cache used for triple queries by KiWi -->
-    <cache name="page-cache"
-           statistics="true"
-           maxElementsInMemory="500"
-           timeToIdleSeconds="3600"
-           memoryStoreEvictionPolicy="LRU"
-           overflowToDisk="true"/>
-
-    <cache name="http-content-cache"
-           statistics="true"
-           maxElementsInMemory="500"
-           timeToIdleSeconds="3600"
-           memoryStoreEvictionPolicy="LRU"
-           overflowToDisk="true"/>
-
-
-    <!--  uncomment to enable cache debugging -->
-<!-- 
-	<cacheManagerPeerListenerFactory
-	    class="org.terracotta.ehcachedx.monitor.probe.ProbePeerListenerFactory"
-	    properties="monitorAddress=localhost, monitorPort=9889" />
--->
-
-</ehcache>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/launchers/marmotta-webapp/src/main/resources/ehcache-marmotta.xml
----------------------------------------------------------------------
diff --git a/launchers/marmotta-webapp/src/main/resources/ehcache-marmotta.xml b/launchers/marmotta-webapp/src/main/resources/ehcache-marmotta.xml
new file mode 100644
index 0000000..eb01074
--- /dev/null
+++ b/launchers/marmotta-webapp/src/main/resources/ehcache-marmotta.xml
@@ -0,0 +1,407 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    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.
+
+-->
+<!--
+CacheManager Configuration
+==========================
+An ehcache-marmotta.xml corresponds to a single CacheManager.
+
+See instructions below or the ehcache schema (ehcache.xsd) on how to configure.
+
+System property tokens can be specified in this file which are replaced when the configuration
+is loaded. For example multicastGroupPort=${multicastGroupPort} can be replaced with the
+System property either from an environment variable or a system property specified with a
+command line switch such as -DmulticastGroupPort=4446.
+
+The attributes of <ehcache> are:
+* name - an optional name for the CacheManager.  The name is optional and primarily used 
+for documentation or to distinguish Terracotta clustered cache state.  With Terracotta 
+clustered caches, a combination of CacheManager name and cache name uniquely identify a 
+particular cache store in the Terracotta clustered memory.
+* updateCheck - an optional boolean flag specifying whether this CacheManager should check
+for new versions of Ehcache over the Internet.  If not specified, updateCheck="true".
+* monitoring - an optional setting that determines whether the CacheManager should 
+automatically register the SampledCacheMBean with the system MBean server.  Currently,
+this monitoring is only useful when using Terracotta and thus the "autodetect" value 
+will detect the presence of Terracotta and register the MBean.  Other allowed values 
+are "on" and "off".  The default is "autodetect".
+-->    
+<ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:noNamespaceSchemaLocation="http://ehcache.org/ehcache.xsd"
+         updateCheck="false"
+         name="lmf">
+
+    <!-- 
+    DiskStore configuration
+    =======================
+
+    The diskStore element is optional. To turn off disk store path creation, comment out the diskStore
+    element below.
+
+    Configure it if you have overflowToDisk or diskPersistent enabled for any cache.
+
+    If it is not configured, and a cache is created which requires a disk store, a warning will be
+     issued and java.io.tmpdir will automatically be used.
+
+    diskStore has only one attribute - "path". It is the path to the directory where
+    .data and .index files will be created.
+
+    If the path is one of the following Java System Property it is replaced by its value in the
+    running VM. For backward compatibility these are not specified without being enclosed in the ${token}
+    replacement syntax.
+
+    The following properties are translated:
+    * user.home - KiWiUser's home directory
+    * user.dir - KiWiUser's current working directory
+    * java.io.tmpdir - Default temp file path
+    * ehcache.disk.store.dir - A system property you would normally specify on the command line
+      e.g. java -Dehcache.disk.store.dir=/u01/myapp/diskdir ...
+
+    Subdirectories can be specified below the property e.g. java.io.tmpdir/one
+
+    -->
+    <!--
+    <diskStore path="java.io.tmpdir/lmf-cache/lmf"/>
+    -->
+   <!--
+    Cachemanagereventlistener
+    =========================
+    Specifies a CacheManagerEventListenerFactory which is notified when Caches are added
+    or removed from the CacheManager.
+
+    The attributes of CacheManagerEventListenerFactory are:
+    * class - a fully qualified factory class name
+    * properties - comma separated properties having meaning only to the factory.
+
+    Sets the fully qualified class name to be registered as the CacheManager event listener.
+
+    The events include:
+    * adding a Cache
+    * removing a Cache
+
+    Callbacks to listener methods are synchronous and unsynchronized. It is the responsibility
+    of the implementer to safely handle the potential performance and thread safety issues
+    depending on what their listener is doing.
+
+    If no class is specified, no listener is created. There is no default.
+    -->
+    <cacheManagerEventListenerFactory class="" properties=""/>
+
+
+    <!--
+    CacheManagerPeerProvider
+    ========================
+    (For distributed operation)
+
+    Specifies a CacheManagerPeerProviderFactory which will be used to create a
+    CacheManagerPeerProvider, which discovers other CacheManagers in the cluster.
+
+    One or more providers can be configured. The first one in the ehcache-marmotta.xml is the default, which is used
+    for replication and bootstrapping.
+
+    The attributes of cacheManagerPeerProviderFactory are:
+    * class - a fully qualified factory class name
+    * properties - comma separated properties having meaning only to the factory.
+
+    Providers are available for RMI, JGroups and JMS as shown following.
+
+    RMICacheManagerPeerProvider
+    +++++++++++++++++++++++++++
+
+    Ehcache comes with a built-in RMI-based distribution system with two means of discovery of
+    CacheManager peers participating in the cluster:
+    * automatic, using a multicast group. This one automatically discovers peers and detects
+      changes such as peers entering and leaving the group
+    * manual, using manual rmiURL configuration. A hardcoded list of peers is provided at
+      configuration time.
+
+    Configuring Automatic Discovery:
+    Automatic discovery is configured as per the following example:
+    <cacheManagerPeerProviderFactory
+                        class="net.sf.ehcache.distribution.RMICacheManagerPeerProviderFactory"
+                        properties="hostName=fully_qualified_hostname_or_ip,
+                                    peerDiscovery=automatic, multicastGroupAddress=230.0.0.1,
+                                    multicastGroupPort=4446, timeToLive=32"/>
+
+    Valid properties are:
+    * peerDiscovery (mandatory) - specify "automatic"
+    * multicastGroupAddress (mandatory) - specify a valid multicast group address
+    * multicastGroupPort (mandatory) - specify a dedicated port for the multicast heartbeat
+      traffic
+    * timeToLive - specify a value between 0 and 255 which determines how far the packets will
+      propagate.
+
+      By convention, the restrictions are:
+      0   - the same host
+      1   - the same subnet
+      32  - the same site
+      64  - the same region
+      128 - the same continent
+      255 - unrestricted
+
+     * hostName - the hostname or IP of the interface to be used for sending and receiving multicast packets
+       (relevant to mulithomed hosts only)
+
+    Configuring Manual Discovery:
+    Manual discovery requires a unique configuration per host. It is contains a list of rmiURLs for the peers, other
+    than itself. So, if we have server1, server2 and server3 the configuration will be:
+
+    In server1's configuration:
+    <cacheManagerPeerProviderFactory class=
+                          "net.sf.ehcache.distribution.RMICacheManagerPeerProviderFactory"
+                          properties="peerDiscovery=manual,
+                          rmiUrls=//server2:40000/sampleCache1|//server3:40000/sampleCache1
+                          | //server2:40000/sampleCache2|//server3:40000/sampleCache2"
+                          propertySeparator="," />
+
+    In server2's configuration:
+    <cacheManagerPeerProviderFactory class=
+                          "net.sf.ehcache.distribution.RMICacheManagerPeerProviderFactory"
+                          properties="peerDiscovery=manual,
+                          rmiUrls=//server1:40000/sampleCache1|//server3:40000/sampleCache1
+                          | //server1:40000/sampleCache2|//server3:40000/sampleCache2"
+                          propertySeparator="," />
+
+    In server3's configuration:
+    <cacheManagerPeerProviderFactory class=
+                          "net.sf.ehcache.distribution.RMICacheManagerPeerProviderFactory"
+                          properties="peerDiscovery=manual,
+                          rmiUrls=//server1:40000/sampleCache1|//server2:40000/sampleCache1
+                          | //server1:40000/sampleCache2|//server2:40000/sampleCache2"
+                          propertySeparator="," />
+
+
+    Valid properties are:
+    * peerDiscovery (mandatory) - specify "manual"
+    * rmiUrls (mandatory) - specify a pipe separated list of rmiUrls, in the form
+                            //hostname:port
+    * hostname (optional) - the hostname is the hostname of the remote CacheManager peer. The port is the listening
+      port of the RMICacheManagerPeerListener of the remote CacheManager peer.
+    
+    JGroupsCacheManagerPeerProvider
+    +++++++++++++++++++++++++++++++
+    <cacheManagerPeerProviderFactory class="net.sf.ehcache.distribution.jgroups.JGroupsCacheManagerPeerProviderFactory"
+                                     properties="connect=UDP(mcast_addr=231.12.21.132;mcast_port=45566;ip_ttl=32;
+                                     mcast_send_buf_size=150000;mcast_recv_buf_size=80000):
+                                     PING(timeout=2000;num_initial_members=6):
+                                     MERGE2(min_interval=5000;max_interval=10000):
+                                     FD_SOCK:VERIFY_SUSPECT(timeout=1500):
+                                     pbcast.NAKACK(gc_lag=10;retransmit_timeout=3000):
+                                     UNICAST(timeout=5000):
+                                     pbcast.STABLE(desired_avg_gossip=20000):
+                                     FRAG:
+                                     pbcast.GMS(join_timeout=5000;join_retry_timeout=2000;shun=false;print_local_addr=false)"
+                                     propertySeparator="::"
+            />
+     The only property necessary is the connect String used by jgroups to configure itself. Refer to the Jgroups documentation for explanation
+     of all the protocols. The example above uses UDP multicast. If the connect property is not specified the default JGroups connection will be
+     used.       
+
+
+    JMSCacheManagerPeerProviderFactory
+    ++++++++++++++++++++++++++++++++++
+    <cacheManagerPeerProviderFactory
+            class="net.sf.ehcache.distribution.jms.JMSCacheManagerPeerProviderFactory"
+            properties="..."
+            propertySeparator=","
+            />
+
+    The JMS PeerProviderFactory uses JNDI to maintain message queue independence. Refer to the manual for full configuration
+    examples using ActiveMQ and Open Message Queue.
+
+    Valid properties are:
+    * initialContextFactoryName (mandatory) - the name of the factory used to create the message queue initial context.
+    * providerURL (mandatory) - the JNDI configuration information for the service provider to use.
+    * topicConnectionFactoryBindingName (mandatory) - the JNDI binding name for the TopicConnectionFactory
+    * topicBindingName (mandatory) - the JNDI binding name for the topic name
+    * getQueueBindingName (mandatory only if using jmsCacheLoader) - the JNDI binding name for the queue name
+    * securityPrincipalName - the JNDI java.naming.security.principal
+    * securityCredentials - the JNDI java.naming.security.credentials
+    * urlPkgPrefixes - the JNDI java.naming.factory.url.pkgs
+    * userName - the user name to use when creating the TopicConnection to the Message Queue
+    * password - the password to use when creating the TopicConnection to the Message Queue
+    * acknowledgementMode - the JMS Acknowledgement mode for both publisher and subscriber. The available choices are
+                            AUTO_ACKNOWLEDGE, DUPS_OK_ACKNOWLEDGE and SESSION_TRANSACTED. The default is AUTO_ACKNOWLEDGE.
+    -->
+<!--    <cacheManagerPeerProviderFactory-->
+<!--            class="net.sf.ehcache.distribution.RMICacheManagerPeerProviderFactory"-->
+<!--            properties="peerDiscovery=automatic,-->
+<!--                        multicastGroupAddress=230.0.0.1,-->
+<!--                        multicastGroupPort=4446, timeToLive=1"-->
+<!--            propertySeparator=","-->
+<!--            />-->
+
+
+    <!--
+    CacheManagerPeerListener
+    ========================
+    (Enable for distributed operation)
+
+    Specifies a CacheManagerPeerListenerFactory which will be used to create a
+    CacheManagerPeerListener, which listens for messages from cache replicators participating in the cluster.
+
+    The attributes of cacheManagerPeerListenerFactory are:
+    class - a fully qualified factory class name
+    properties - comma separated properties having meaning only to the factory.
+
+    Ehcache comes with a built-in RMI-based distribution system. The listener component is
+    RMICacheManagerPeerListener which is configured using
+    RMICacheManagerPeerListenerFactory. It is configured as per the following example:
+
+    <cacheManagerPeerListenerFactory
+        class="net.sf.ehcache.distribution.RMICacheManagerPeerListenerFactory"
+        properties="hostName=fully_qualified_hostname_or_ip,
+                    port=40001,
+                    remoteObjectPort=40002,
+                    socketTimeoutMillis=120000"
+                    propertySeparator="," />
+
+    All properties are optional. They are:
+    * hostName - the hostName of the host the listener is running on. Specify
+      where the host is multihomed and you want to control the interface over which cluster
+      messages are received. Defaults to the host name of the default interface if not
+      specified.
+    * port - the port the RMI Registry listener listens on. This defaults to a free port if not specified.
+    * remoteObjectPort - the port number on which the remote objects bound in the registry receive calls.
+                         This defaults to a free port if not specified.
+    * socketTimeoutMillis - the number of ms client sockets will stay open when sending
+      messages to the listener. This should be long enough for the slowest message.
+      If not specified it defaults to 120000ms.
+
+    -->
+<!--    <cacheManagerPeerListenerFactory-->
+<!--            class="net.sf.ehcache.distribution.RMICacheManagerPeerListenerFactory"/>-->
+
+    <!-- Cache configuration.
+
+    The following attributes are required.
+
+    name:
+    Sets the name of the cache. This is used to identify the cache. It must be unique.
+
+    maxElementsInMemory:
+    Sets the maximum number of objects that will be created in memory
+
+        maxElementsOnDisk:
+    Sets the maximum number of objects that will be maintained in the DiskStore
+        The default value is zero, meaning unlimited.
+
+    eternal:
+    Sets whether elements are eternal. If eternal,  timeouts are ignored and the
+    element is never expired.
+
+    overflowToDisk:
+    Sets whether elements can overflow to disk when the memory store
+    has reached the maxInMemory limit.
+
+    The following attributes are optional.
+
+    timeToIdleSeconds:
+    Sets the time to idle for an element before it expires.
+    i.e. The maximum amount of time between accesses before an element expires
+    Is only used if the element is not eternal.
+    Optional attribute. A value of 0 means that an Element can idle for infinity.
+    The default value is 0.
+
+    timeToLiveSeconds:
+    Sets the time to live for an element before it expires.
+    i.e. The maximum time between creation time and when an element expires.
+    Is only used if the element is not eternal.
+    Optional attribute. A value of 0 means that and Element can live for infinity.
+    The default value is 0.
+
+    diskPersistent:
+    Whether the disk store persists between restarts of the Virtual Machine.
+    The default value is false.
+
+    diskExpiryThreadIntervalSeconds:
+    The number of seconds between runs of the disk expiry thread. The default value
+    is 120 seconds.
+
+    memoryStoreEvictionPolicy:
+    Policy would be enforced upon reaching the maxElementsInMemory limit. Default
+    policy is Least Recently Used (specified as LRU). Other policies available -
+    First In First Out (specified as FIFO) and Less Frequently Used
+    (specified as LFU)
+
+    -->
+
+    <!--
+    Mandatory Default Cache configuration. These settings will be applied to caches
+    created programmtically using CacheManager.add(String cacheName)
+    -->
+    <defaultCache
+            maxElementsInMemory="20000"
+            overflowToDisk="false"
+            memoryStoreEvictionPolicy="LRU"
+            />
+
+
+    <!-- the cache used for triple queries by KiWi -->
+    <cache name="uri-node-cache"
+           statistics="true"
+           maxElementsInMemory="100000"
+           timeToIdleSeconds="3600"
+           overflowToDisk="false"/>
+    <cache name="anon-node-cache"
+           statistics="true"
+           maxElementsInMemory="10000"
+           timeToIdleSeconds="3600"
+           overflowToDisk="false"/>
+    <cache name="literal-cache"
+           statistics="true"
+           maxElementsInMemory="10000"
+           timeToIdleSeconds="3600"
+           overflowToDisk="false"/>
+
+    <cache name="namespace-prefix-cache"
+           statistics="true"
+           maxElementsInMemory="100"
+           overflowToDisk="false"/>
+
+    <cache name="namespace-uri-cache"
+           statistics="true"
+           maxElementsInMemory="100"
+           overflowToDisk="false"/>
+
+    <!-- the cache used for triple queries by KiWi -->
+    <cache name="query-cache"
+           statistics="true"
+           maxElementsInMemory="200000"
+           timeToIdleSeconds="3600"
+           overflowToDisk="false"/>
+
+    <!-- the cache used for resource lookups from module jar files -->
+    <cache name="resource-cache"
+           statistics="true"
+           maxElementsInMemory="10000"
+           timeToIdleSeconds="3600"
+           timeToLiveSeconds="3600"
+           overflowToDisk="false"
+           memoryStoreEvictionPolicy="LRU"/>
+
+    <!--  uncomment to enable cache debugging -->
+<!-- 
+	<cacheManagerPeerListenerFactory
+	    class="org.terracotta.ehcachedx.monitor.probe.ProbePeerListenerFactory"
+	    properties="monitorAddress=localhost, monitorPort=9889" />
+-->
+
+</ehcache>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/launchers/marmotta-webapp/src/main/webapp/META-INF/LICENSE
----------------------------------------------------------------------
diff --git a/launchers/marmotta-webapp/src/main/webapp/META-INF/LICENSE b/launchers/marmotta-webapp/src/main/webapp/META-INF/LICENSE
index 9631d61..28c0c4f 100644
--- a/launchers/marmotta-webapp/src/main/webapp/META-INF/LICENSE
+++ b/launchers/marmotta-webapp/src/main/webapp/META-INF/LICENSE
@@ -2689,6 +2689,37 @@ For the JSONLD-Java component,
     THE POSSIBILITY OF SUCH DAMAGE.
         
 
+For the marmotta-commons component,
+
+    located at commons/marmotta-commons/src/ext/java
+
+   Javolution - Java(tm) Solution for Real-Time and Embedded Systems
+   Copyright (c) 2012, Javolution (http://javolution.org/)
+   All rights reserved.
+
+   Redistribution and use in source and binary forms, with or without
+   modification, are permitted provided that the following conditions are met:
+
+      1. Redistributions of source code must retain the above copyright
+         notice, this list of conditions and the following disclaimer.
+
+      2. Redistributions in binary form must reproduce the above copyright
+         notice, this list of conditions and the following disclaimer in the
+         documentation and/or other materials provided with the distribution.
+
+   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+   CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+   EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+   PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+   PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+   LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+   NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+   SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
 
 Apache Marmotta 3rd party data files:
 ====================================

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/launchers/marmotta-webapp/src/main/webapp/META-INF/NOTICE
----------------------------------------------------------------------
diff --git a/launchers/marmotta-webapp/src/main/webapp/META-INF/NOTICE b/launchers/marmotta-webapp/src/main/webapp/META-INF/NOTICE
index 881a91a..f2b7b92 100644
--- a/launchers/marmotta-webapp/src/main/webapp/META-INF/NOTICE
+++ b/launchers/marmotta-webapp/src/main/webapp/META-INF/NOTICE
@@ -1,6 +1,8 @@
-Apache Marmotta Webapp, Copyright 2012-2013 The Apache Software Foundation
+Apache Marmotta Webapp
+Copyright 2012-2013 The Apache Software Foundation
 
-This product includes software developed at The Apache Software Foundation (http://www.apache.org).
+This product includes software developed at 
+The Apache Software Foundation (http://www.apache.org).
 
 Portions of this software were originally based on the following:
 
@@ -8,252 +10,33 @@ Portions of this software were originally based on the following:
 
 These have been licensed to the Apache Software Foundation under a software grant.
 
-This product also includes the following third-party components:
+This product also includes some third-party binary components:
 
-* H2, http://www.h2database.com
+ * H2 Database, Copyright (c) 2013 H2 Group, is licensed under the Eclipse Public 
+   License (EPL) 1.0. The original software is available from http://www.h2database.com
 
-  Copyright (c) 2013 H2 Group
+ * Logback, Copyright (C) 2012 QOS.ch, is licensed under the Eclipse Public 
+   License (EPL) 1.0. The original software is available from http://logback.qos.ch
 
-* Logback, http://logback.qos.ch
+ * Javassist, Copyright (c) 2013 Shigeru Chiba, is licensed under the Mozilla 
+   Public License (MPL) 1.1. The original software is available from 
+   http://www.jboss.org/javassist
 
-  Copyright (C) 2012 QOS.ch
+ * Java Activation, Copyright (c) 2012 Oracle Corporation, is licensed under the
+   Common Development and Distribution License (CDDL) v1.0. The original software 
+   is available from http://www.oracle.com
 
-* JDOM, http://www.jdom.org
+ * Java Servlet API, Copyright (c) 2012 Oracle Corporation, is licensed under the
+   Common Development and Distribution License (CDDL) v1.0. The original software 
+   is available from http://www.oracle.com
 
-  Copyright (c) 2012 Jason Hunter & Brett McLaughlin
+ * Common Annotations (JSR-250), Copyright (c) 2012 Oracle Corporation, is licensed 
+   under the Common Development and Distribution License (CDDL) v1.0. The original 
+   software is available from http://www.oracle.com
 
-* Freemarker, http://freemarker.org
-
-  Copyright (c) 2003 The Visigoth Software Society
-
-* CAL10N, http://cal10n.qos.ch
-
-  Copyright (c) 2009 QOS.ch
-
-* Guava, http://guava-libraries.googlecode.com
-
-  Copyright (c) 2013 Google Inc.
-
-* Jackson, http://jackson.codehaus.org
-
-  Copyright (c) 2010 FasterXML LLC.
-
-* MimeUtil, http://mime-util.sourceforge.net
-
-  Copyright (c) 2010 Medsea Business Solutions S.L.
-
-* OpenCSV, http://opencsv.sourceforge.net
-
-  Copyright (c) 2005 Bytecode Pty Ltd.
-
-* OpenRDF Sesame, http://www.openrdf.org
-
-  Copyright (c) 2013 Aduna
-
-  This software includes code developed by Aduna
-  (http://www.aduna-software.com/).
-
-  This software includes code developed by Ontotext AD
-  (http://www.ontotext.com/).
-
-  This software includes code developed by 3 Round Stones
-  (http://www.3roundstones.com/).
-
-  This software includes code developed by Fluid Operations
-  (http://www.fluidops.com/).
-
-  This software includes code developed by the Information Management Group at
-  Food & Biobased Research, Wageningen University (http://www.fbr.wur.nl/).
-
-  This software includes code developed by Clark & Parsia
-  (http://clarkparsia.com/).
-
-  This software includes code developed by the Institute for Defense Analyses
-  (IDA) (http://www.ida.org/).
-
-  This software includes code developed by Atos (http://www.atos.net/).
-
-  This software includes code developed by Peter Ansell.
-
-  The above parties have licensed their code contributions to Aduna under the
-  terms of a contributor license agreement (CLA).
-
-  This product includes software developed by the JUnit project
-  (http://www.junit.org). License: http://junit.sourceforge.net/cpl-v10.html
-
-  Parts of this product use software developed by JSON.org
-  (http://www.json.org). License: http://www.json.org/license.html
-
-  Parts of this product use software developed by the Mockito project
-  (http://mockito.googlecode.com). License: https://github.com/mockito/mockito/blob/master/LICENSE
-
-* PostgreSQL JDBC, http://jdbc.postgresql.org
-
-  Copyright (c) 2011 PostgreSQL Global Development Group
-
-* Scannotation, http://scannotation.sourceforge.net
-
-  Copyright (c) 2011 Bill Burke
-
-* SLF4J, http://www.slf4j.org
-
-  Copyright (c) 2013 QOS.ch
-
-* Semargl, http://semarglproject.org
-
-  Copyright (c) 2012 Lev Khomich
-
-  This product uses software developed by The Apache Software Foundation:
-  Clerezza, Jena, IO Commons (http://www.apache.org/).
-
-  This product includes/uses test suite developed by Hewlett-Packard
-  (http://hp.com/). Copyright (c) 2002, Hewlett-Packard Company.
-
-  This product includes/uses test suite developed by W3C Consortium.
-
-  This product includes/uses RDFa test harness developed by RDF Web Applications
-  Working Group (http://www.w3.org/2010/02/rdfa/).
-
-* Janino, http://janino.codehaus.org
-
-  Copyright (c) 2010 Arno Unkrig
-
-* Java Injection API, http://atinject.googlecode.com
-
-  Copyright (c) 2009 The JSR-330 Expert Group
-
-* Javassist, http://www.jboss.org/javassist
-
-  Copyright (c) 2013 Shigeru Chiba
-
-* Jaxen, http://jaxen.codehaus.org
-
-  Copyright (c) 2006 The Werken Company
-
-* JSoup, http://jsoup.org
-
-  Copyright (c) 2013 Jonathan Hedley
-
-* EHCache, http://ehcache.org
-
-  Copyright (c) 2010 Terracotta, Inc.
-
-* CDI, http://github.com/jboss/cdi
-
-  Copyright (c) 2012 Red Hat Middleware, LLC
-
-* Weld, http://github.com/weld
-
-  Copyright (c) 2012 Red Hat Middleware, LLC
-
-* Bean Validation, http://github.com/hibernate/hibernate-validator
-
-  Copyright (c) 2012 Red Hat Middleware, LLC
-
-* JBoss EJB Common Interceptor, http://github.com/jbossinterceptors/jbossinterceptors
-
-  Copyright (c) 2012 Red Hat Middleware, LLC
-
-* RESTEasy, http://www.jboss.org/resteasy
-
-  Copyright (c) 2012 Red Hat Middleware, LLC
-
-* Java Activation, http://www.oracle.com
-
-  Copyright (c) 2012 Oracle Corporation
-
-* Java Servlet API, http://www.oracle.com
-
-  Copyright (c) 2012 Oracle Corporation
-
-* Common Annotations (JSR-250), http://www.oracle.com
-
-  Copyright (c) 2012 Oracle Corporation
-
-* Expression Language, http://www.oracle.com
-
-  Copyright (c) 2012 Oracle Corporation
-
-* Apache Xerces, http://xerces.apache.org
-
-  Copyright (c) 2013 The Apache Software Foundation
-
-  Portions of this software were originally based on the following:
-   - software copyright (c) 1999, IBM Corporation, http://www.ibm.com.
-   - software copyright (c) 1999, Sun Microsystems, http://www.sun.com.
-   - voluntary contributions made by Paul Eng on behalf of the
-     Apache Software Foundation that were originally developed at
-     iClick, Inc., software copyright (c) 1999.
-
-* "Java Concurrency in Practice" book annotations component, http://jcip.net
-
-  Copyright (c) 2005 Brian Goetz and Tim Peierls
-
-* Hamcrest, http://www.hamcrest.org
-
-  Copyright (c) 2000-2006 Joe Walnes, Nat Pryce, Steve Freeman
-
-* D3.js, http://d3js.org
-
-  Copyright (c) 2013 Michael Bostock
-
-* Dracula Graph Library, http://www.graphdracula.net
-
-  Copyright (c) 2013 Johann Philipp Strathausen
-
-* strftime, http://hacks.bluesmoon.info/strftime
-
-  Copyright (c) 2008 Philip S Tellis
-
-* jQuery, http://jquery.com
-
-  Copyright (c) 2013 jQuery Foundation
-
-* CodeMirror, http://codemirror.net
-
-  Copyright (c) 2013 Marijn Haverbeke
-
-* D2R Snorql, http://www4.wiwiss.fu-berlin.de/bizer/d2r-server/,
-
-  Copyright (c) 2007 Richard Cyganiak
-
-* script.aculo.us, http://script.aculo.us
-
-  Copyright (c) 2010 Thomas Fuchs
-
-* Prototype, http://prototypejs.org
-
-  Copyright (c) 2010 Sam Stephenson
-
-* SPARQL Flint Editor, http://github.com/TSO-Openup/FlintSparqlEditor
-
-  Copyright (c) 2011 TSO Ltd
-
-* Sgvizler, http://sgvizler.googlecode.com
-
-  Copyright (c) 2011 Martin G. Skjæveland
-
-* MigLayout, http://www.migcalendar.com/miglayout
-
-  Copyright (c) 2004 MiG InfoCom AB
-
-* SwingBits, http://swingbits.sourceforge.net
-
-  Copyright (c) 2006 EzWare
-
-* ROME, http://rometools.jira.com
-
-  Copyright (c) 2004 Sun Microsystems
-
-* JSONLD-Java, http://github.com/tristan/jsonld-java
-
-  Copyright (c) 2012, Deutsches Forschungszentrum für Künstliche Intelligenz GmbH
-
-* JSON-LD Test Suite, http://json-ld.org/test-suite
-
-  Public Domain (Creative Commons Zero license) without copyright
-
-* ical4j test suite, http://ical4j.googlecode.com
-
-  Copyright (c) 2011 Ben Fortuna
+ * Expression Language, Copyright (c) 2012 Oracle Corporation, is licensed under
+   the Common Development and Distribution License (CDDL) v1.0. The original 
+   software is available from http://www.oracle.com
 
+ * Javolution, Copyright (c) 2012 Javolution, is licensed under BSD license. The
+   original source code is available from http://javolution.org

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/launchers/marmotta-webapp/src/main/webapp/WEB-INF/web.xml
----------------------------------------------------------------------
diff --git a/launchers/marmotta-webapp/src/main/webapp/WEB-INF/web.xml b/launchers/marmotta-webapp/src/main/webapp/WEB-INF/web.xml
index 528ad91..fd0e8be 100644
--- a/launchers/marmotta-webapp/src/main/webapp/WEB-INF/web.xml
+++ b/launchers/marmotta-webapp/src/main/webapp/WEB-INF/web.xml
@@ -51,8 +51,8 @@
 
     <!-- handle OPTIONS requests -->
     <filter>
-      <filter-name>MarmottaOptionsFilter</filter-name>
-      <filter-class>org.apache.marmotta.platform.core.servlet.MarmottaOptionsFilter</filter-class>
+        <filter-name>MarmottaOptionsFilter</filter-name>
+        <filter-class>org.apache.marmotta.platform.core.servlet.MarmottaOptionsFilter</filter-class>
     </filter>
     <filter-mapping>
         <filter-name>MarmottaOptionsFilter</filter-name>
@@ -73,13 +73,11 @@
 
         <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>
-        <!-- CORS Filter mapping -->
         <filter-name>CORS</filter-name>
         <url-pattern>/*</url-pattern>
     </filter-mapping>

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/launchers/marmotta-webapp/src/test/resources/ehcache.xml
----------------------------------------------------------------------
diff --git a/launchers/marmotta-webapp/src/test/resources/ehcache.xml b/launchers/marmotta-webapp/src/test/resources/ehcache.xml
index 727aef0..7cd8120 100644
--- a/launchers/marmotta-webapp/src/test/resources/ehcache.xml
+++ b/launchers/marmotta-webapp/src/test/resources/ehcache.xml
@@ -19,7 +19,7 @@
 <!--
 CacheManager Configuration
 ==========================
-An ehcache-lmf.xml corresponds to a single CacheManager.
+An ehcache-marmotta.xml corresponds to a single CacheManager.
 
 See instructions below or the ehcache schema (ehcache.xsd) on how to configure.
 
@@ -107,7 +107,7 @@ are "on" and "off".  The default is "autodetect".
     Specifies a CacheManagerPeerProviderFactory which will be used to create a
     CacheManagerPeerProvider, which discovers other CacheManagers in the cluster.
 
-    One or more providers can be configured. The first one in the ehcache-lmf.xml is the default, which is used
+    One or more providers can be configured. The first one in the ehcache-marmotta.xml is the default, which is used
     for replication and bootstrapping.
 
     The attributes of cacheManagerPeerProviderFactory are:

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/launchers/pom.xml
----------------------------------------------------------------------
diff --git a/launchers/pom.xml b/launchers/pom.xml
index 01fc15b..8aa8a8d 100644
--- a/launchers/pom.xml
+++ b/launchers/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/marmotta/blob/582abb5b/libraries/kiwi/kiwi-contextaware/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-contextaware/pom.xml b/libraries/kiwi/kiwi-contextaware/pom.xml
index ce9fda9..c4bcf84 100644
--- a/libraries/kiwi/kiwi-contextaware/pom.xml
+++ b/libraries/kiwi/kiwi-contextaware/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>kiwi-parent</artifactId>
-        <version>3.1.0-incubating-SNAPSHOT</version>
+        <version>3.1.0-incubating</version>
         <relativePath>../</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/kiwi/kiwi-reasoner/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-reasoner/pom.xml b/libraries/kiwi/kiwi-reasoner/pom.xml
index 8d77e79..e76b396 100644
--- a/libraries/kiwi/kiwi-reasoner/pom.xml
+++ b/libraries/kiwi/kiwi-reasoner/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>kiwi-parent</artifactId>
-        <version>3.1.0-incubating-SNAPSHOT</version>
+        <version>3.1.0-incubating</version>
         <relativePath>../</relativePath>
     </parent>
 
@@ -56,7 +56,6 @@
             <plugin>
                 <groupId>org.codehaus.mojo</groupId>
                 <artifactId>build-helper-maven-plugin</artifactId>
-                <version>1.7</version>
                 <executions>
                     <execution>
                         <id>add-source</id>
@@ -115,8 +114,8 @@
             <artifactId>guava</artifactId>
         </dependency>
         <dependency>
-            <groupId>commons-lang</groupId>
-            <artifactId>commons-lang</artifactId>
+            <groupId>org.apache.commons</groupId>
+            <artifactId>commons-lang3</artifactId>
         </dependency>
         <dependency>
             <groupId>org.apache.marmotta</groupId>
@@ -167,7 +166,7 @@
             <scope>test</scope>
         </dependency>
         <dependency>
-            <groupId>org.jumpmind.symmetric.jdbc</groupId>
+            <groupId>org.postgresql</groupId>
             <artifactId>postgresql</artifactId>
             <scope>test</scope>
         </dependency>
@@ -208,6 +207,11 @@
             <scope>test</scope>
         </dependency>
 
+        <dependency>
+            <groupId>org.openrdf.sesame</groupId>
+            <artifactId>sesame-store-testsuite</artifactId>
+            <scope>test</scope>
+        </dependency>
     </dependencies>
 
 </project>


[067/100] [abbrv] git commit: Merge branch 'develop' of https://git-wip-us.apache.org/repos/asf/marmotta into develop

Posted by wi...@apache.org.
Merge branch 'develop' of https://git-wip-us.apache.org/repos/asf/marmotta into develop


Project: http://git-wip-us.apache.org/repos/asf/marmotta/repo
Commit: http://git-wip-us.apache.org/repos/asf/marmotta/commit/44836449
Tree: http://git-wip-us.apache.org/repos/asf/marmotta/tree/44836449
Diff: http://git-wip-us.apache.org/repos/asf/marmotta/diff/44836449

Branch: refs/heads/ldp
Commit: 448364494cf48c7a76721ce00cb91591680a5a9d
Parents: a789e49 e3c9fe6
Author: Sebastian Schaffert <ss...@apache.org>
Authored: Tue Apr 8 16:42:48 2014 +0200
Committer: Sebastian Schaffert <ss...@apache.org>
Committed: Tue Apr 8 16:42:48 2014 +0200

----------------------------------------------------------------------
 .../src/main/java/webservices/MyWebService.java |   4 +-
 .../test/java/webservices/MyWebServiceTest.java |  18 +-
 .../main/resources/archetype-resources/pom.xml  |  16 +-
 .../src/test/resources/verification.xml         |   4 +-
 build/pom.xml                                   |   1 -
 .../apache/marmotta/commons/vocabulary/LDP.java | 221 ++++++++++++++++++-
 commons/marmotta-sesame-tools/pom.xml           |   2 +
 .../src/main/resources/installer/standalone.xml |   2 +-
 launchers/marmotta-webapp/pom.xml               |  16 +-
 .../EHCacheRepositoryConnectionTest.java        |  12 +
 .../HazelcastRepositoryConnectionTest.java      |  12 +
 .../EmbeddedRepositoryConnectionTest.java       |  13 ++
 .../remote/HotRodRepositoryConnectionTest.java  |  13 ++
 .../KiWiRepositoryConnectionTest.java           |  13 ++
 parent/pom.xml                                  |   2 +-
 .../backend/http/HTTPStoreProvider.java         |   2 +-
 .../core/api/templating/TemplatingService.java  |   7 +-
 .../core/services/prefix/PrefixServiceImpl.java |  30 +--
 .../templating/TemplatingServiceImpl.java       |  98 ++++----
 platform/marmotta-ldp/pom.xml                   |   2 +-
 platform/pom.xml                                |  13 +-
 21 files changed, 389 insertions(+), 112 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/marmotta/blob/44836449/parent/pom.xml
----------------------------------------------------------------------


[083/100] [abbrv] git commit: MARMOTTA-438: more work on test suite execution

Posted by wi...@apache.org.
MARMOTTA-438: more work on test suite execution


Project: http://git-wip-us.apache.org/repos/asf/marmotta/repo
Commit: http://git-wip-us.apache.org/repos/asf/marmotta/commit/49b6b3c0
Tree: http://git-wip-us.apache.org/repos/asf/marmotta/tree/49b6b3c0
Diff: http://git-wip-us.apache.org/repos/asf/marmotta/diff/49b6b3c0

Branch: refs/heads/ldp
Commit: 49b6b3c0dcc89731c423cb01ac7e14b4f19e5a20
Parents: c3b393e
Author: Sergio Fernández <wi...@apache.org>
Authored: Tue Apr 15 16:31:38 2014 +0200
Committer: Sergio Fernández <wi...@apache.org>
Committed: Tue Apr 15 16:31:38 2014 +0200

----------------------------------------------------------------------
 .../platform/ldp/services/LdpServiceImpl.java   |  1 +
 .../ldp/testsuite/LdpTestCaseRunner.java        | 20 ++++-
 .../platform/ldp/testsuite/LdpTestCases.java    |  2 +-
 .../ldp/testsuite/LdpTestCasesRunner.java       | 82 +++++++++++---------
 4 files changed, 66 insertions(+), 39 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/marmotta/blob/49b6b3c0/platform/marmotta-ldp/src/main/java/org/apache/marmotta/platform/ldp/services/LdpServiceImpl.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-ldp/src/main/java/org/apache/marmotta/platform/ldp/services/LdpServiceImpl.java b/platform/marmotta-ldp/src/main/java/org/apache/marmotta/platform/ldp/services/LdpServiceImpl.java
index 75d7923..8d28aae 100644
--- a/platform/marmotta-ldp/src/main/java/org/apache/marmotta/platform/ldp/services/LdpServiceImpl.java
+++ b/platform/marmotta-ldp/src/main/java/org/apache/marmotta/platform/ldp/services/LdpServiceImpl.java
@@ -44,6 +44,7 @@ import org.openrdf.rio.*;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import javax.annotation.PostConstruct;
 import javax.enterprise.context.ApplicationScoped;
 import javax.inject.Inject;
 import javax.ws.rs.core.EntityTag;

http://git-wip-us.apache.org/repos/asf/marmotta/blob/49b6b3c0/platform/marmotta-ldp/src/test/java/org/apache/marmotta/platform/ldp/testsuite/LdpTestCaseRunner.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-ldp/src/test/java/org/apache/marmotta/platform/ldp/testsuite/LdpTestCaseRunner.java b/platform/marmotta-ldp/src/test/java/org/apache/marmotta/platform/ldp/testsuite/LdpTestCaseRunner.java
index 79a6079..3c2f36b 100644
--- a/platform/marmotta-ldp/src/test/java/org/apache/marmotta/platform/ldp/testsuite/LdpTestCaseRunner.java
+++ b/platform/marmotta-ldp/src/test/java/org/apache/marmotta/platform/ldp/testsuite/LdpTestCaseRunner.java
@@ -70,14 +70,30 @@ public class LdpTestCaseRunner extends Runner {
         notifier.fireTestFinished(getDescription());
     }
 
+    /**
+     * Actual test case run method, which build the test case execution
+     * on the fly based on
+     */
     private void run() {
         Assume.assumeNotNull(baseUrl);
         assertNotNull(testCase);
         assertNotNull(testCase.getUri());
         String context = buildContext(testCase);
-        log.info("Executing LDP Test Case {} over context {}...", testCase.getUri().getLocalName(), context);
+        log.warn("Executing LDP Test Case {} over context {}...", testCase.getUri().getLocalName(), context);
 
-        //TODO: actual test case execution
+        //basic pre-checking
+        //RestAssured.expect().statusCode(200).get(baseUrl); //TODO: clarify this (root container?)
+        RestAssured.expect().statusCode(404).get(context);
+
+        //load all information of the test cases
+        readTestCase(testCase);
+
+        //actual test case execution
+
+    }
+
+    private void readTestCase(LdpTestCase testCase) {
+        //TODO: read all details
     }
 
     private String buildContext(LdpTestCase testCase) {

http://git-wip-us.apache.org/repos/asf/marmotta/blob/49b6b3c0/platform/marmotta-ldp/src/test/java/org/apache/marmotta/platform/ldp/testsuite/LdpTestCases.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-ldp/src/test/java/org/apache/marmotta/platform/ldp/testsuite/LdpTestCases.java b/platform/marmotta-ldp/src/test/java/org/apache/marmotta/platform/ldp/testsuite/LdpTestCases.java
index c60aba4..ace1b23 100644
--- a/platform/marmotta-ldp/src/test/java/org/apache/marmotta/platform/ldp/testsuite/LdpTestCases.java
+++ b/platform/marmotta-ldp/src/test/java/org/apache/marmotta/platform/ldp/testsuite/LdpTestCases.java
@@ -53,7 +53,7 @@ public class LdpTestCases {
 
         @Override
         protected void before() throws Throwable {
-            marmotta = new JettyMarmotta("/marmotta-ldp", LdpWebService.class);
+            marmotta = new JettyMarmotta("/marmotta", LdpWebService.class);
             RestAssured.baseURI = "http://localhost";
             RestAssured.port = marmotta.getPort();
             RestAssured.basePath = marmotta.getContext();

http://git-wip-us.apache.org/repos/asf/marmotta/blob/49b6b3c0/platform/marmotta-ldp/src/test/java/org/apache/marmotta/platform/ldp/testsuite/LdpTestCasesRunner.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-ldp/src/test/java/org/apache/marmotta/platform/ldp/testsuite/LdpTestCasesRunner.java b/platform/marmotta-ldp/src/test/java/org/apache/marmotta/platform/ldp/testsuite/LdpTestCasesRunner.java
index f9fc57a..4cb18a7 100644
--- a/platform/marmotta-ldp/src/test/java/org/apache/marmotta/platform/ldp/testsuite/LdpTestCasesRunner.java
+++ b/platform/marmotta-ldp/src/test/java/org/apache/marmotta/platform/ldp/testsuite/LdpTestCasesRunner.java
@@ -18,6 +18,7 @@
 package org.apache.marmotta.platform.ldp.testsuite;
 
 import org.apache.commons.lang3.StringUtils;
+import org.apache.marmotta.platform.ldp.webservices.LdpWebService;
 import org.junit.rules.TestRule;
 import org.junit.runner.Runner;
 import org.junit.runner.notification.RunNotifier;
@@ -37,6 +38,7 @@ import java.io.IOException;
 import java.lang.annotation.Annotation;
 import java.lang.reflect.Field;
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.List;
 
 /**
@@ -50,9 +52,28 @@ public class LdpTestCasesRunner extends Suite {
 
     private LdpTestCases.MarmottaResource marmotta;
 
+    private Repository repo;
+
+    private List<Runner> runners;
+
     public LdpTestCasesRunner(Class<?> klass) throws Throwable {
-        super(klass, buildTestCasesFromManifest());
+        super(klass, Collections.EMPTY_LIST);
+
+        //load test cases manifest
+        repo = loadManifest();
 
+        //get children runners for each test cases from manifest
+        RepositoryConnection conn = repo.getConnection();
+        try {
+            conn.begin();
+            runners = buildTestCasesFromManifest(conn);
+            log.info("Initialized LDP test suite with {} test cases", runners.size());
+            conn.commit();
+        } finally {
+            conn.close();
+        }
+
+        //get embedded marmotta from rules
         //TODO: it should be an easier way to do it...
         for (TestRule rule : this.classRules()) {
             if (LdpTestCases.MarmottaResource.class.equals(rule.getClass())) {
@@ -63,55 +84,44 @@ public class LdpTestCasesRunner extends Suite {
     }
 
     @Override
+    protected List<Runner> getChildren() {
+        return Collections.unmodifiableList(runners);
+    }
+
+    @Override
     protected void runChild(Runner runner, RunNotifier notifier) {
         if (runner instanceof LdpTestCaseRunner) {
-            ((LdpTestCaseRunner)runner).setBaseUrl(marmotta.baseUrl);
+            ((LdpTestCaseRunner)runner).setBaseUrl(marmotta.baseUrl + LdpWebService.PATH);
         }
         super.runChild(runner, notifier);
     }
 
-    private static List<Runner> buildTestCasesFromManifest() throws Throwable {
-        List<Runner> runners = new ArrayList<>();
-
+    private Repository loadManifest() throws RepositoryException, RDFParseException, IOException {
         String path = LdpTestCases.ROOT_PATH + LdpTestCases.MANIFEST_CACHE + ".ttl";
+        return LdpTestCasesUtils.loadData(path, RDFFormat.TURTLE);
+    }
+
+    private static List<Runner> buildTestCasesFromManifest(RepositoryConnection conn) throws Throwable {
+        List<Runner> runners = new ArrayList<>();
         try {
-            Repository repo = LdpTestCasesUtils.loadData(path, RDFFormat.TURTLE);
-            RepositoryConnection conn = repo.getConnection();
+            String testCasesQuery = LdpTestCasesUtils.getNormativeNamespacesSparql()+ "\n"
+                    + "SELECT ?tc WHERE { ?tc a td:TestCase }";
+            TupleQuery tupleQuery = conn.prepareTupleQuery(QueryLanguage.SPARQL, testCasesQuery);
+            TupleQueryResult results = tupleQuery.evaluate();
             try {
-                conn.begin();
-
-                String testCasesQuery = LdpTestCasesUtils.getNormativeNamespacesSparql()+ "\n"
-                        + "SELECT ?tc WHERE { ?tc a td:TestCase }";
-                TupleQuery tupleQuery = conn.prepareTupleQuery(QueryLanguage.SPARQL, testCasesQuery);
-                TupleQueryResult results = tupleQuery.evaluate();
-                try {
-                    while (results.hasNext()) {
-                        BindingSet bindings = results.next();
-                        LdpTestCase testCase = new LdpTestCase((URI)bindings.getValue("tc"));
-                        runners.add(new LdpTestCaseRunner(testCase));
-                    }
-                } finally {
-                    results.close();
+                while (results.hasNext()) {
+                    BindingSet bindings = results.next();
+                    LdpTestCase testCase = new LdpTestCase((URI)bindings.getValue("tc"));
+                    runners.add(new LdpTestCaseRunner(testCase));
                 }
-                conn.commit();
-            } catch (RepositoryException e) {
-                log.error("Error loading test cases: {}", e.getMessage(), e);
-                return runners;
-            } catch (QueryEvaluationException | MalformedQueryException e) {
-                log.error("Error performing test cases' query: {}", e.getMessage(), e);
-                return runners;
             } finally {
-                conn.close();
+                results.close();
             }
-        } catch (RDFParseException | IOException e) {
-            log.error("Error loading test cases: {}", e.getMessage(), e);
-            return runners;
         } catch (RepositoryException e) {
-            log.error("Error connecting with the repository: {}", e.getMessage(), e);
-            return runners;
+            log.error("Error loading test cases: {}", e.getMessage(), e);
+        } catch (QueryEvaluationException | MalformedQueryException e) {
+            log.error("Error performing test cases' query: {}", e.getMessage(), e);
         }
-
-        log.info("Initialized LDP test suite with {} test cases", runners.size());
         return runners;
     }
 


[018/100] [abbrv] [partial] Reverting the erroneous merge by Sebastian according to the instructions in INFRA-6876

Posted by wi...@apache.org.
http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/kiwi/kiwi-triplestore/src/main/java/org/apache/marmotta/kiwi/persistence/KiWiConnection.java
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-triplestore/src/main/java/org/apache/marmotta/kiwi/persistence/KiWiConnection.java b/libraries/kiwi/kiwi-triplestore/src/main/java/org/apache/marmotta/kiwi/persistence/KiWiConnection.java
index e582631..9c7de67 100644
--- a/libraries/kiwi/kiwi-triplestore/src/main/java/org/apache/marmotta/kiwi/persistence/KiWiConnection.java
+++ b/libraries/kiwi/kiwi-triplestore/src/main/java/org/apache/marmotta/kiwi/persistence/KiWiConnection.java
@@ -17,38 +17,35 @@
  */
 package org.apache.marmotta.kiwi.persistence;
 
+import info.aduna.iteration.*;
+
 import org.apache.marmotta.commons.sesame.model.LiteralCommons;
 import org.apache.marmotta.commons.sesame.model.Namespaces;
 import org.apache.marmotta.commons.util.DateUtils;
+
 import com.google.common.base.Preconditions;
-import info.aduna.iteration.CloseableIteration;
-import info.aduna.iteration.EmptyIteration;
-import info.aduna.iteration.ExceptionConvertingIteration;
+
 import net.sf.ehcache.Cache;
 import net.sf.ehcache.Element;
-import org.apache.commons.lang.LocaleUtils;
+
 import org.apache.marmotta.kiwi.caching.KiWiCacheManager;
+import org.apache.marmotta.kiwi.config.KiWiConfiguration;
+import org.apache.marmotta.kiwi.model.caching.TripleTable;
 import org.apache.marmotta.kiwi.model.rdf.*;
 import org.apache.marmotta.kiwi.persistence.util.ResultSetIteration;
 import org.apache.marmotta.kiwi.persistence.util.ResultTransformerFunction;
 import org.openrdf.model.Literal;
+import org.openrdf.model.Resource;
 import org.openrdf.model.Statement;
 import org.openrdf.repository.RepositoryException;
 import org.openrdf.repository.RepositoryResult;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import java.sql.Connection;
-import java.sql.PreparedStatement;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.sql.Timestamp;
+import java.sql.*;
+import java.util.*;
 import java.util.Date;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Locale;
-import java.util.Map;
-import java.util.Set;
+import java.util.concurrent.locks.ReentrantLock;
 
 /**
  * A KiWiConnection offers methods for storing and retrieving KiWiTriples, KiWiNodes, and KiWiNamespaces in the
@@ -70,6 +67,7 @@ public class KiWiConnection {
 
     protected KiWiCacheManager cacheManager;
 
+    protected TripleTable<KiWiTriple> tripleBatch;
 
     /**
      * Cache nodes by database ID
@@ -119,11 +117,34 @@ public class KiWiConnection {
 
     private boolean autoCommit = false;
 
+    private boolean batchCommit = true;
+
+    private int batchSize = 1000;
+
+    private ReentrantLock commitLock;
+
+    private ReentrantLock literalLock;
+    private ReentrantLock uriLock;
+    private ReentrantLock bnodeLock;
+
+
+    // this set keeps track of all statements that have been deleted in the active transaction of this connection
+    // this is needed to be able to determine if adding the triple again will merely undo a deletion or is a
+    // completely new addition to the triple store
+    private HashSet<Long> deletedStatementsLog;
+
+    private static long numberOfCommits = 0;
 
     public KiWiConnection(KiWiPersistence persistence, KiWiDialect dialect, KiWiCacheManager cacheManager) throws SQLException {
         this.cacheManager = cacheManager;
         this.dialect      = dialect;
         this.persistence  = persistence;
+        this.commitLock   = new ReentrantLock();
+        this.literalLock   = new ReentrantLock();
+        this.uriLock   = new ReentrantLock();
+        this.bnodeLock   = new ReentrantLock();
+        this.batchCommit  = dialect.isBatchSupported();
+        this.deletedStatementsLog = new HashSet<Long>();
 
         initCachePool();
         initStatementCache();
@@ -163,6 +184,9 @@ public class KiWiConnection {
             connection = persistence.getJDBCConnection();
             connection.setAutoCommit(autoCommit);
         }
+        if(tripleBatch == null) {
+            tripleBatch = new TripleTable<KiWiTriple>();
+        }
     }
 
     /**
@@ -170,7 +194,9 @@ public class KiWiConnection {
      *
      * @return
      */
-    public Connection getJDBCConnection() {
+    public Connection getJDBCConnection() throws SQLException {
+        requireJDBCConnection();
+
         return connection;
     }
 
@@ -182,6 +208,14 @@ public class KiWiConnection {
         return cacheManager;
     }
 
+    public KiWiDialect getDialect() {
+        return dialect;
+    }
+
+    public KiWiConfiguration getConfiguration() {
+        return persistence.getConfiguration();
+    }
+
     /**
      * Load a KiWiNamespace with the given prefix, or null if the namespace does not exist. The method will first
      * look in the node cache for cached nodes. If no cache entry is found, it will run a database query
@@ -317,9 +351,9 @@ public class KiWiConnection {
         ResultSet result = querySize.executeQuery();
         try {
             if(result.next()) {
-                return result.getLong(1);
+                return result.getLong(1) + (tripleBatch != null ? tripleBatch.size() : 0);
             } else {
-                return 0;
+                return 0  + (tripleBatch != null ? tripleBatch.size() : 0);
             }
         } finally {
             result.close();
@@ -344,9 +378,9 @@ public class KiWiConnection {
         ResultSet result = querySize.executeQuery();
         try {
             if(result.next()) {
-                return result.getLong(1);
+                return result.getLong(1) + (tripleBatch != null ? tripleBatch.listTriples(null,null,null,context, false).size() : 0);
             } else {
-                return 0;
+                return 0 + (tripleBatch != null ? tripleBatch.listTriples(null,null,null,context, false).size() : 0);
             }
         } finally {
             result.close();
@@ -391,20 +425,22 @@ public class KiWiConnection {
 
         // prepare a query; we will only iterate once, read only, and need only one result row since the id is unique
         PreparedStatement query = getPreparedStatement("load.node_by_id");
-        query.setLong(1,id);
-        query.setMaxRows(1);
+        synchronized (query) {
+            query.setLong(1,id);
+            query.setMaxRows(1);
 
-        // run the database query and if it yields a result, construct a new node; the method call will take care of
-        // caching the constructed node for future calls
-        ResultSet result = query.executeQuery();
-        try {
-            if(result.next()) {
-                return constructNodeFromDatabase(result);
-            } else {
-                return null;
+            // run the database query and if it yields a result, construct a new node; the method call will take care of
+            // caching the constructed node for future calls
+            ResultSet result = query.executeQuery();
+            try {
+                if(result.next()) {
+                    return constructNodeFromDatabase(result);
+                } else {
+                    return null;
+                }
+            } finally {
+                result.close();
             }
-        } finally {
-            result.close();
         }
 
     }
@@ -451,6 +487,8 @@ public class KiWiConnection {
      * @return the KiWiUriResource identified by the given URI  or null if it does not exist
      */
     public KiWiUriResource loadUriResource(String uri) throws SQLException {
+        Preconditions.checkNotNull(uri);
+
         // look in cache
         Element element = uriCache.get(uri);
         if(element != null) {
@@ -459,22 +497,27 @@ public class KiWiConnection {
 
         requireJDBCConnection();
 
-        // prepare a query; we will only iterate once, read only, and need only one result row since the id is unique
-        PreparedStatement query = getPreparedStatement("load.uri_by_uri");
-        query.setString(1, uri);
-        query.setMaxRows(1);
-
-        // run the database query and if it yields a result, construct a new node; the method call will take care of
-        // caching the constructed node for future calls
-        ResultSet result = query.executeQuery();
+        uriLock.lock();
         try {
-            if(result.next()) {
-                return (KiWiUriResource)constructNodeFromDatabase(result);
-            } else {
-                return null;
+            // prepare a query; we will only iterate once, read only, and need only one result row since the id is unique
+            PreparedStatement query = getPreparedStatement("load.uri_by_uri");
+            query.setString(1, uri);
+            query.setMaxRows(1);
+
+            // run the database query and if it yields a result, construct a new node; the method call will take care of
+            // caching the constructed node for future calls
+            ResultSet result = query.executeQuery();
+            try {
+                if(result.next()) {
+                    return (KiWiUriResource)constructNodeFromDatabase(result);
+                } else {
+                    return null;
+                }
+            } finally {
+                result.close();
             }
         } finally {
-            result.close();
+            uriLock.unlock();
         }
     }
 
@@ -500,22 +543,29 @@ public class KiWiConnection {
 
         requireJDBCConnection();
 
-        // prepare a query; we will only iterate once, read only, and need only one result row since the id is unique
-        PreparedStatement query = getPreparedStatement("load.bnode_by_anonid");
-        query.setString(1,id);
-        query.setMaxRows(1);
 
-        // run the database query and if it yields a result, construct a new node; the method call will take care of
-        // caching the constructed node for future calls
-        ResultSet result = query.executeQuery();
+        bnodeLock.lock();
+
         try {
-            if(result.next()) {
-                return (KiWiAnonResource)constructNodeFromDatabase(result);
-            } else {
-                return null;
+            // prepare a query; we will only iterate once, read only, and need only one result row since the id is unique
+            PreparedStatement query = getPreparedStatement("load.bnode_by_anonid");
+            query.setString(1,id);
+            query.setMaxRows(1);
+
+            // run the database query and if it yields a result, construct a new node; the method call will take care of
+            // caching the constructed node for future calls
+            ResultSet result = query.executeQuery();
+            try {
+                if(result.next()) {
+                    return (KiWiAnonResource)constructNodeFromDatabase(result);
+                } else {
+                    return null;
+                }
+            } finally {
+                result.close();
             }
         } finally {
-            result.close();
+            bnodeLock.unlock();
         }
     }
 
@@ -541,42 +591,48 @@ public class KiWiConnection {
             return (KiWiLiteral)element.getObjectValue();
         }
 
+        requireJDBCConnection();
+
         // ltype not persisted
         if(ltype != null && ltype.getId() == null) {
             return null;
         }
 
-        requireJDBCConnection();
-
-        // otherwise prepare a query, depending on the parameters given
-        final PreparedStatement query;
-        if(lang == null && ltype == null) {
-            query = getPreparedStatement("load.literal_by_v");
-            query.setString(1,value);
-        } else if(lang != null) {
-            query = getPreparedStatement("load.literal_by_vl");
-            query.setString(1,value);
-            query.setString(2, lang);
-        } else if(ltype != null) {
-            query = getPreparedStatement("load.literal_by_vt");
-            query.setString(1,value);
-            query.setLong(2,ltype.getId());
-        } else {
-            // This cannot happen...
-            throw new IllegalArgumentException("Impossible combination of lang/type in loadLiteral!");
-        }
+        literalLock.lock();
 
-        // run the database query and if it yields a result, construct a new node; the method call will take care of
-        // caching the constructed node for future calls
-        ResultSet result = query.executeQuery();
         try {
-            if(result.next()) {
-                return (KiWiLiteral)constructNodeFromDatabase(result);
+            // otherwise prepare a query, depending on the parameters given
+            final PreparedStatement query;
+            if(lang == null && ltype == null) {
+                query = getPreparedStatement("load.literal_by_v");
+                query.setString(1,value);
+            } else if(lang != null) {
+                query = getPreparedStatement("load.literal_by_vl");
+                query.setString(1,value);
+                query.setString(2, lang);
+            } else if(ltype != null) {
+                query = getPreparedStatement("load.literal_by_vt");
+                query.setString(1,value);
+                query.setLong(2,ltype.getId());
             } else {
-                return null;
+                // This cannot happen...
+                throw new IllegalArgumentException("Impossible combination of lang/type in loadLiteral!");
+            }
+
+            // run the database query and if it yields a result, construct a new node; the method call will take care of
+            // caching the constructed node for future calls
+            ResultSet result = query.executeQuery();
+            try {
+                if(result.next()) {
+                    return (KiWiLiteral)constructNodeFromDatabase(result);
+                } else {
+                    return null;
+                }
+            } finally {
+                result.close();
             }
         } finally {
-            result.close();
+            literalLock.unlock();
         }
     }
 
@@ -594,36 +650,42 @@ public class KiWiConnection {
      * @throws SQLException
      */
     public KiWiDateLiteral loadLiteral(Date date) throws SQLException {
-        KiWiUriResource ltype = loadUriResource(Namespaces.NS_XSD + "dateTime");
-
-        if(ltype == null || ltype.getId() == null) {
-            return null;
-        }
-
         // look in cache
-        Element element = literalCache.get(LiteralCommons.createCacheKey(DateUtils.getDateWithoutFraction(date),ltype.stringValue()));
+        Element element = literalCache.get(LiteralCommons.createCacheKey(DateUtils.getDateWithoutFraction(date),Namespaces.NS_XSD + "dateTime"));
         if(element != null) {
             return (KiWiDateLiteral)element.getObjectValue();
         }
 
         requireJDBCConnection();
 
-        // otherwise prepare a query, depending on the parameters given
-        PreparedStatement query = getPreparedStatement("load.literal_by_tv");
-        query.setTimestamp(1, new Timestamp(DateUtils.getDateWithoutFraction(date).getTime()));
-        query.setLong(2,ltype.getId());
+        KiWiUriResource ltype = loadUriResource(Namespaces.NS_XSD + "dateTime");
 
-        // run the database query and if it yields a result, construct a new node; the method call will take care of
-        // caching the constructed node for future calls
-        ResultSet result = query.executeQuery();
+        if(ltype == null || ltype.getId() == null) {
+            return null;
+        }
+
+        literalLock.lock();
         try {
-            if(result.next()) {
-                return (KiWiDateLiteral)constructNodeFromDatabase(result);
-            } else {
-                return null;
+
+            // otherwise prepare a query, depending on the parameters given
+            PreparedStatement query = getPreparedStatement("load.literal_by_tv");
+            query.setTimestamp(1, new Timestamp(DateUtils.getDateWithoutFraction(date).getTime()));
+            query.setLong(2,ltype.getId());
+
+            // run the database query and if it yields a result, construct a new node; the method call will take care of
+            // caching the constructed node for future calls
+            ResultSet result = query.executeQuery();
+            try {
+                if(result.next()) {
+                    return (KiWiDateLiteral)constructNodeFromDatabase(result);
+                } else {
+                    return null;
+                }
+            } finally {
+                result.close();
             }
         } finally {
-            result.close();
+            literalLock.unlock();
         }
     }
 
@@ -642,6 +704,14 @@ public class KiWiConnection {
      * @throws SQLException
      */
     public KiWiIntLiteral loadLiteral(long value) throws SQLException {
+        // look in cache
+        Element element = literalCache.get(LiteralCommons.createCacheKey(Long.toString(value),null,Namespaces.NS_XSD + "integer"));
+        if(element != null) {
+            return (KiWiIntLiteral)element.getObjectValue();
+        }
+
+        requireJDBCConnection();
+
         KiWiUriResource ltype = loadUriResource(Namespaces.NS_XSD + "integer");
 
         // ltype not persisted
@@ -649,30 +719,29 @@ public class KiWiConnection {
             return null;
         }
 
-        // look in cache
-        Element element = literalCache.get(LiteralCommons.createCacheKey(Long.toString(value),null,ltype.stringValue()));
-        if(element != null) {
-            return (KiWiIntLiteral)element.getObjectValue();
-        }
+        literalLock.lock();
 
-        requireJDBCConnection();
+        try {
 
-        // otherwise prepare a query, depending on the parameters given
-        PreparedStatement query = getPreparedStatement("load.literal_by_iv");
-        query.setLong(1,value);
-        query.setLong(2,ltype.getId());
+            // otherwise prepare a query, depending on the parameters given
+            PreparedStatement query = getPreparedStatement("load.literal_by_iv");
+            query.setLong(1,value);
+            query.setLong(2,ltype.getId());
 
-        // run the database query and if it yields a result, construct a new node; the method call will take care of
-        // caching the constructed node for future calls
-        ResultSet result = query.executeQuery();
-        try {
-            if(result.next()) {
-                return (KiWiIntLiteral)constructNodeFromDatabase(result);
-            } else {
-                return null;
+            // run the database query and if it yields a result, construct a new node; the method call will take care of
+            // caching the constructed node for future calls
+            ResultSet result = query.executeQuery();
+            try {
+                if(result.next()) {
+                    return (KiWiIntLiteral)constructNodeFromDatabase(result);
+                } else {
+                    return null;
+                }
+            } finally {
+                result.close();
             }
         } finally {
-            result.close();
+            literalLock.unlock();
         }
     }
 
@@ -689,38 +758,44 @@ public class KiWiConnection {
      * @return a KiWiDoubleLiteral with the correct value, or null if it does not exist
      * @throws SQLException
      */
-    public KiWiDoubleLiteral loadLiteral(double value) throws SQLException {
-        KiWiUriResource ltype = loadUriResource(Namespaces.NS_XSD + "double");
-
-        // ltype not persisted
-        if(ltype == null || ltype.getId() == null) {
-            return null;
-        }
-
+    public synchronized KiWiDoubleLiteral loadLiteral(double value) throws SQLException {
         // look in cache
-        Element element = literalCache.get(LiteralCommons.createCacheKey(Double.toString(value),null,ltype.stringValue()));
+        Element element = literalCache.get(LiteralCommons.createCacheKey(Double.toString(value),null,Namespaces.NS_XSD + "double"));
         if(element != null) {
             return (KiWiDoubleLiteral)element.getObjectValue();
         }
 
         requireJDBCConnection();
 
-        // otherwise prepare a query, depending on the parameters given
-        PreparedStatement query = getPreparedStatement("load.literal_by_dv");
-        query.setDouble(1, value);
-        query.setLong(2,ltype.getId());
+        KiWiUriResource ltype = loadUriResource(Namespaces.NS_XSD + "double");
+
+        // ltype not persisted
+        if(ltype == null || ltype.getId() == null) {
+            return null;
+        }
+
+        literalLock.lock();
 
-        // run the database query and if it yields a result, construct a new node; the method call will take care of
-        // caching the constructed node for future calls
-        ResultSet result = query.executeQuery();
         try {
-            if(result.next()) {
-                return (KiWiDoubleLiteral)constructNodeFromDatabase(result);
-            } else {
-                return null;
+            // otherwise prepare a query, depending on the parameters given
+            PreparedStatement query = getPreparedStatement("load.literal_by_dv");
+            query.setDouble(1, value);
+            query.setLong(2,ltype.getId());
+
+            // run the database query and if it yields a result, construct a new node; the method call will take care of
+            // caching the constructed node for future calls
+            ResultSet result = query.executeQuery();
+            try {
+                if(result.next()) {
+                    return (KiWiDoubleLiteral)constructNodeFromDatabase(result);
+                } else {
+                    return null;
+                }
+            } finally {
+                result.close();
             }
         } finally {
-            result.close();
+            literalLock.unlock();
         }
     }
 
@@ -738,15 +813,8 @@ public class KiWiConnection {
      * @throws SQLException
      */
     public KiWiBooleanLiteral loadLiteral(boolean value) throws SQLException {
-        KiWiUriResource ltype = loadUriResource(Namespaces.NS_XSD + "boolean");
-
-        // ltype not persisted
-        if(ltype == null || ltype.getId() == null) {
-            return null;
-        }
-
         // look in cache
-        Element element = literalCache.get(LiteralCommons.createCacheKey(Boolean.toString(value),null,ltype.stringValue()));
+        Element element = literalCache.get(LiteralCommons.createCacheKey(Boolean.toString(value),null,Namespaces.NS_XSD + "boolean"));
         if(element != null) {
             return (KiWiBooleanLiteral)element.getObjectValue();
         }
@@ -754,22 +822,36 @@ public class KiWiConnection {
 
         requireJDBCConnection();
 
-        // otherwise prepare a query, depending on the parameters given
-        PreparedStatement query = getPreparedStatement("load.literal_by_bv");
-        query.setBoolean(1, value);
-        query.setLong(2,ltype.getId());
+        KiWiUriResource ltype = loadUriResource(Namespaces.NS_XSD + "boolean");
+
+        // ltype not persisted
+        if(ltype == null || ltype.getId() == null) {
+            return null;
+        }
+
+        literalLock.lock();
 
-        // run the database query and if it yields a result, construct a new node; the method call will take care of
-        // caching the constructed node for future calls
-        ResultSet result = query.executeQuery();
         try {
-            if(result.next()) {
-                return (KiWiBooleanLiteral)constructNodeFromDatabase(result);
-            } else {
-                return null;
+
+            // otherwise prepare a query, depending on the parameters given
+            PreparedStatement query = getPreparedStatement("load.literal_by_bv");
+            query.setBoolean(1, value);
+            query.setLong(2,ltype.getId());
+
+            // run the database query and if it yields a result, construct a new node; the method call will take care of
+            // caching the constructed node for future calls
+            ResultSet result = query.executeQuery();
+            try {
+                if(result.next()) {
+                    return (KiWiBooleanLiteral)constructNodeFromDatabase(result);
+                } else {
+                    return null;
+                }
+            } finally {
+                result.close();
             }
         } finally {
-            result.close();
+            literalLock.unlock();
         }
     }
 
@@ -779,6 +861,11 @@ public class KiWiConnection {
 //    }
 
 
+
+    public long getNodeId() throws SQLException {
+        return getNextSequence("seq.nodes");
+    }
+
     /**
      * Store a new node in the database. The method will retrieve a new database id for the node and update the
      * passed object. Afterwards, the node data will be inserted into the database using appropriate INSERT
@@ -786,28 +873,27 @@ public class KiWiConnection {
      * <p/>
      * If the node already has an ID, the method will do nothing (assuming that it is already persistent)
      *
+     *
      * @param node
+     * @param batch
      * @throws SQLException
      */
-    public synchronized void storeNode(KiWiNode node) throws SQLException {
-        // if the node already has an ID, storeNode should not be called, since it is already persisted
-        if(node.getId() != null) {
-            log.warn("node {} already had a node ID, not persisting", node);
-            return;
-        }
+    public synchronized void storeNode(KiWiNode node, boolean batch) throws SQLException {
 
         // ensure the data type of a literal is persisted first
         if(node instanceof KiWiLiteral) {
             KiWiLiteral literal = (KiWiLiteral)node;
             if(literal.getType() != null && literal.getType().getId() == null) {
-                storeNode(literal.getType());
+                storeNode(literal.getType(), batch);
             }
         }
 
         requireJDBCConnection();
 
         // retrieve a new node id and set it in the node object
-        node.setId(getNextSequence("seq.nodes"));
+        if(node.getId() == null) {
+            node.setId(getNextSequence("seq.nodes"));
+        }
 
         // distinguish the different node types and run the appropriate updates
         if(node instanceof KiWiUriResource) {
@@ -817,7 +903,12 @@ public class KiWiConnection {
             insertNode.setLong(1,node.getId());
             insertNode.setString(2,uriResource.stringValue());
             insertNode.setTimestamp(3, new Timestamp(uriResource.getCreated().getTime()));
-            insertNode.executeUpdate();
+
+            if(batch) {
+                insertNode.addBatch();
+            } else {
+                insertNode.executeUpdate();
+            }
 
         } else if(node instanceof KiWiAnonResource) {
             KiWiAnonResource anonResource = (KiWiAnonResource)node;
@@ -826,7 +917,12 @@ public class KiWiConnection {
             insertNode.setLong(1,node.getId());
             insertNode.setString(2,anonResource.stringValue());
             insertNode.setTimestamp(3, new Timestamp(anonResource.getCreated().getTime()));
-            insertNode.executeUpdate();
+
+            if(batch) {
+                insertNode.addBatch();
+            } else {
+                insertNode.executeUpdate();
+            }
         } else if(node instanceof KiWiDateLiteral) {
             KiWiDateLiteral dateLiteral = (KiWiDateLiteral)node;
 
@@ -840,7 +936,11 @@ public class KiWiConnection {
                 throw new IllegalStateException("a date literal must have a datatype");
             insertNode.setTimestamp(5, new Timestamp(dateLiteral.getCreated().getTime()));
 
-            insertNode.executeUpdate();
+            if(batch) {
+                insertNode.addBatch();
+            } else {
+                insertNode.executeUpdate();
+            }
         } else if(node instanceof KiWiIntLiteral) {
             KiWiIntLiteral intLiteral = (KiWiIntLiteral)node;
 
@@ -855,7 +955,11 @@ public class KiWiConnection {
                 throw new IllegalStateException("an integer literal must have a datatype");
             insertNode.setTimestamp(6, new Timestamp(intLiteral.getCreated().getTime()));
 
-            insertNode.executeUpdate();
+            if(batch) {
+                insertNode.addBatch();
+            } else {
+                insertNode.executeUpdate();
+            }
         } else if(node instanceof KiWiDoubleLiteral) {
             KiWiDoubleLiteral doubleLiteral = (KiWiDoubleLiteral)node;
 
@@ -869,7 +973,11 @@ public class KiWiConnection {
                 throw new IllegalStateException("a double literal must have a datatype");
             insertNode.setTimestamp(5, new Timestamp(doubleLiteral.getCreated().getTime()));
 
-            insertNode.executeUpdate();
+            if(batch) {
+                insertNode.addBatch();
+            } else {
+                insertNode.executeUpdate();
+            }
         } else if(node instanceof KiWiBooleanLiteral) {
             KiWiBooleanLiteral booleanLiteral = (KiWiBooleanLiteral)node;
 
@@ -883,7 +991,11 @@ public class KiWiConnection {
                 throw new IllegalStateException("a boolean literal must have a datatype");
             insertNode.setTimestamp(5, new Timestamp(booleanLiteral.getCreated().getTime()));
 
-            insertNode.executeUpdate();
+            if(batch) {
+                insertNode.addBatch();
+            } else {
+                insertNode.executeUpdate();
+            }
         } else if(node instanceof KiWiStringLiteral) {
             KiWiStringLiteral stringLiteral = (KiWiStringLiteral)node;
 
@@ -902,7 +1014,11 @@ public class KiWiConnection {
             }
             insertNode.setTimestamp(5, new Timestamp(stringLiteral.getCreated().getTime()));
 
-            insertNode.executeUpdate();
+            if(batch) {
+                insertNode.addBatch();
+            } else {
+                insertNode.executeUpdate();
+            }
         } else {
             log.warn("unrecognized node type: {}", node.getClass().getCanonicalName());
         }
@@ -911,45 +1027,165 @@ public class KiWiConnection {
     }
 
     /**
+     * Start a batch operation for inserting nodes. Afterwards, storeNode needs to be called with the batch argument
+     * set to "true".
+     *
+     * @throws SQLException
+     */
+    public void startNodeBatch() throws SQLException {
+        for(String stmt : new String[] { "store.uri", "store.sliteral", "store.bliteral", "store.dliteral", "store.iliteral", "store.tliteral", "store.bnode"}) {
+            PreparedStatement insertNode = getPreparedStatement(stmt);
+            insertNode.clearParameters();
+            insertNode.clearBatch();
+        }
+    }
+
+    /**
+     * Execute the batch operation for inserting nodes into the database.
+     * @throws SQLException
+     */
+    public void commitNodeBatch() throws SQLException {
+        for(String stmt : new String[] { "store.uri", "store.sliteral", "store.bliteral", "store.dliteral", "store.iliteral", "store.tliteral", "store.bnode"}) {
+            PreparedStatement insertNode = getPreparedStatement(stmt);
+            insertNode.executeBatch();
+        }
+        connection.commit();
+    }
+
+    /**
      * Store a triple in the database. This method assumes that all nodes used by the triple are already persisted.
      *
      * @param triple     the triple to store
      * @throws SQLException
      * @throws NullPointerException in case the subject, predicate, object or context have not been persisted
+     * @return true in case the update added a new triple to the database, false in case the triple already existed
      */
-    public synchronized void storeTriple(KiWiTriple triple) throws SQLException {
-        // if the node already has an ID, storeNode should not be called, since it is already persisted
-        if(triple.getId() != null) {
-            log.warn("triple {} already had a triple ID, not persisting", triple);
-            return;
-        }
+    public synchronized boolean storeTriple(final KiWiTriple triple) throws SQLException {
+        // mutual exclusion: prevent parallel adding and removing of the same triple
+        synchronized (triple) {
 
-        Preconditions.checkNotNull(triple.getSubject().getId());
-        Preconditions.checkNotNull(triple.getPredicate().getId());
-        Preconditions.checkNotNull(triple.getObject().getId());
-        Preconditions.checkNotNull(triple.getContext().getId());
+            requireJDBCConnection();
 
+            boolean hasId = triple.getId() != null;
 
-        requireJDBCConnection();
+            if(hasId && deletedStatementsLog.contains(triple.getId())) {
+                // this is a hack for a concurrency problem that may occur in case the triple is removed in the
+                // transaction and then added again; in these cases the createStatement method might return
+                // an expired state of the triple because it uses its own database connection
 
-        // retrieve a new triple ID and set it in the object
-        triple.setId(getNextSequence("seq.triples"));
+                //deletedStatementsLog.remove(triple.getId());
+                undeleteTriple(triple);
 
-        PreparedStatement insertTriple = getPreparedStatement("store.triple");
-        insertTriple.setLong(1,triple.getId());
-        insertTriple.setLong(2,triple.getSubject().getId());
-        insertTriple.setLong(3,triple.getPredicate().getId());
-        insertTriple.setLong(4,triple.getObject().getId());
-        insertTriple.setLong(5,triple.getContext().getId());
-        insertTriple.setBoolean(6,triple.isInferred());
-        insertTriple.setTimestamp(7, new Timestamp(triple.getCreated().getTime()));
-        insertTriple.executeUpdate();
+                return true;
+            } else {
+                // retrieve a new triple ID and set it in the object
+                if(triple.getId() == null) {
+                    triple.setId(getNextSequence("seq.triples"));
+                }
 
-        cacheTriple(triple);
+                if(batchCommit) {
+                    commitLock.lock();
+                    try {
+                        cacheTriple(triple);
+                        tripleBatch.add(triple);
+                        if(tripleBatch.size() >= batchSize) {
+                            flushBatch();
+                        }
+                    } finally {
+                        commitLock.unlock();
+                    }
+                    return !hasId;
+                }  else {
+                    Preconditions.checkNotNull(triple.getSubject().getId());
+                    Preconditions.checkNotNull(triple.getPredicate().getId());
+                    Preconditions.checkNotNull(triple.getObject().getId());
+
+
+                    try {
+                        RetryExecution<Boolean> execution = new RetryExecution<>("STORE");
+                        execution.setUseSavepoint(true);
+                        execution.execute(connection, new RetryCommand<Boolean>() {
+                            @Override
+                            public Boolean run() throws SQLException {
+                                PreparedStatement insertTriple = getPreparedStatement("store.triple");
+                                insertTriple.setLong(1,triple.getId());
+                                insertTriple.setLong(2,triple.getSubject().getId());
+                                insertTriple.setLong(3,triple.getPredicate().getId());
+                                insertTriple.setLong(4,triple.getObject().getId());
+                                if(triple.getContext() != null) {
+                                    insertTriple.setLong(5,triple.getContext().getId());
+                                } else {
+                                    insertTriple.setNull(5, Types.BIGINT);
+                                }
+                                insertTriple.setBoolean(6,triple.isInferred());
+                                insertTriple.setTimestamp(7, new Timestamp(triple.getCreated().getTime()));
+                                int count = insertTriple.executeUpdate();
+
+                                cacheTriple(triple);
+
+                                return count > 0;
+                            }
+                        });
+
+                        return !hasId;
+
+                    } catch(SQLException ex) {
+                        if("HYT00".equals(ex.getSQLState())) { // H2 table locking timeout
+                            throw new ConcurrentModificationException("the same triple was modified in concurrent transactions (triple="+triple+")");
+                        } else {
+                            throw ex;
+                        }
+                    }
+                }
+            }
+        }
     }
 
 
     /**
+     * Return the identifier of the triple with the given subject, predicate, object and context, or null if this
+     * triple does not exist. Used for quick existance checks of triples.
+     *
+     * @param subject
+     * @param predicate
+     * @param object
+     * @param context
+     * @param inferred
+     * @return
+     */
+    public synchronized Long getTripleId(final KiWiResource subject, final KiWiUriResource predicate, final KiWiNode object, final KiWiResource context, final boolean inferred) throws SQLException {
+        if(tripleBatch != null && tripleBatch.size() > 0) {
+            Collection<KiWiTriple> batched = tripleBatch.listTriples(subject,predicate,object,context, false);
+            if(batched.size() > 0) {
+                return batched.iterator().next().getId();
+            }
+        }
+
+        requireJDBCConnection();
+        PreparedStatement loadTripleId = getPreparedStatement("load.triple");
+        loadTripleId.setLong(1, subject.getId());
+        loadTripleId.setLong(2, predicate.getId());
+        loadTripleId.setLong(3, object.getId());
+        if(context != null) {
+            loadTripleId.setLong(4, context.getId());
+        } else {
+            loadTripleId.setNull(4, Types.BIGINT);
+        }
+
+        ResultSet result = loadTripleId.executeQuery();
+        try {
+            if(result.next()) {
+                return result.getLong(1);
+            } else {
+                return null;
+            }
+
+        } finally {
+            result.close();
+        }
+    }
+
+    /**
      * Mark the triple passed as argument as deleted, setting the "deleted" flag to true and
      * updating the timestamp value of "deletedAt".
      * <p/>
@@ -958,23 +1194,62 @@ public class KiWiConnection {
      *
      * @param triple
      */
-    public void deleteTriple(KiWiTriple triple) throws SQLException {
-        if(triple.getId() == null) {
-            log.warn("attempting to remove non-persistent triple: {}",triple);
-            return;
-        }
-
+    public void deleteTriple(final KiWiTriple triple) throws SQLException {
         requireJDBCConnection();
 
-        PreparedStatement deleteTriple = getPreparedStatement("delete.triple");
-        deleteTriple.setLong(1,triple.getId());
-        deleteTriple.executeUpdate();
+        RetryExecution execution = new RetryExecution("DELETE");
+        execution.setUseSavepoint(true);
+        execution.execute(connection, new RetryCommand<Void>() {
+            @Override
+            public Void run() throws SQLException {
+                // mutual exclusion: prevent parallel adding and removing of the same triple
+                synchronized (triple) {
+
+                    // make sure the triple is marked as deleted in case some service still holds a reference
+                    triple.setDeleted(true);
+                    triple.setDeletedAt(new Date());
+
+                    if (triple.getId() == null) {
+                        log.warn("attempting to remove non-persistent triple: {}", triple);
+                        removeCachedTriple(triple);
+                    } else {
+                        if (batchCommit) {
+                            // need to remove from triple batch and from database
+                            commitLock.lock();
+                            try {
+                                if (tripleBatch == null || !tripleBatch.remove(triple)) {
+
+                                    PreparedStatement deleteTriple = getPreparedStatement("delete.triple");
+                                    synchronized (deleteTriple) {
+                                        deleteTriple.setLong(1, triple.getId());
+                                        deleteTriple.executeUpdate();
+                                    }
+                                    deletedStatementsLog.add(triple.getId());
+                                }
+                            } finally {
+                                commitLock.unlock();
+                            }
+                        } else {
+                            requireJDBCConnection();
+
+                            PreparedStatement deleteTriple = getPreparedStatement("delete.triple");
+                            synchronized (deleteTriple) {
+                                deleteTriple.setLong(1, triple.getId());
+                                deleteTriple.executeUpdate();
+                            }
+                            deletedStatementsLog.add(triple.getId());
+
+
+                        }
+                        removeCachedTriple(triple);
+                    }
+                }
+
+                return null;
+            }
+        });
 
-        removeCachedTriple(triple);
 
-        // make sure the triple is marked as deleted in case some service still holds a reference
-        triple.setDeleted(true);
-        triple.setDeletedAt(new Date());
     }
 
     /**
@@ -994,20 +1269,20 @@ public class KiWiConnection {
 
         requireJDBCConnection();
 
+        // make sure the triple is not marked as deleted in case some service still holds a reference
+        triple.setDeleted(false);
+        triple.setDeletedAt(null);
+
+
         synchronized (triple) {
             if(!triple.isDeleted()) {
                 log.warn("attemting to undelete triple that was not deleted: {}",triple);
-                return;
             }
 
             PreparedStatement undeleteTriple = getPreparedStatement("undelete.triple");
             undeleteTriple.setLong(1, triple.getId());
             undeleteTriple.executeUpdate();
 
-            // make sure the triple is marked as deleted in case some service still holds a reference
-            triple.setDeleted(false);
-            triple.setDeletedAt(null);
-
             cacheTriple(triple);
         }
 
@@ -1015,30 +1290,85 @@ public class KiWiConnection {
 
 
     /**
-     * Remove from the database all triples that have been marked as deleted and are not referenced by any other
-     * entity.
+     * List all contexts used in this triple store. See query.contexts .
+     * @return
+     * @throws SQLException
      */
-    public void cleanupTriples() {
-        throw new UnsupportedOperationException("garbage collection of triples is not yet supported!");
-    }
+    public CloseableIteration<KiWiResource, SQLException> listContexts() throws SQLException {
+        requireJDBCConnection();
+
+        PreparedStatement queryContexts = getPreparedStatement("query.contexts");
+
+        final ResultSet result = queryContexts.executeQuery();
 
+        if(tripleBatch != null && tripleBatch.size() > 0) {
+            return new DistinctIteration<KiWiResource, SQLException>(
+                    new UnionIteration<KiWiResource, SQLException>(
+                            new ConvertingIteration<Resource,KiWiResource,SQLException>(new IteratorIteration<Resource, SQLException>(tripleBatch.listContextIDs().iterator())) {
+                                @Override
+                                protected KiWiResource convert(Resource sourceObject) throws SQLException {
+                                    return (KiWiResource)sourceObject;
+                                }
+                            },
+                            new ResultSetIteration<KiWiResource>(result, new ResultTransformerFunction<KiWiResource>() {
+                                @Override
+                                public KiWiResource apply(ResultSet row) throws SQLException {
+                                    return (KiWiResource)loadNodeById(result.getLong("context"));
+                                }
+                            })
+                    )
+            );
+
+
+        } else {
+            return new ResultSetIteration<KiWiResource>(result, new ResultTransformerFunction<KiWiResource>() {
+                @Override
+                public KiWiResource apply(ResultSet row) throws SQLException {
+                    return (KiWiResource)loadNodeById(result.getLong("context"));
+                }
+            });
+        }
+
+    }
 
     /**
      * List all contexts used in this triple store. See query.contexts .
      * @return
      * @throws SQLException
      */
-    public CloseableIteration<KiWiResource, SQLException> listContexts() throws SQLException {
+    public CloseableIteration<KiWiResource, SQLException> listResources() throws SQLException {
         requireJDBCConnection();
 
-        PreparedStatement queryContexts = getPreparedStatement("query.contexts");
+        PreparedStatement queryContexts = getPreparedStatement("query.resources");
 
         final ResultSet result = queryContexts.executeQuery();
 
         return new ResultSetIteration<KiWiResource>(result, new ResultTransformerFunction<KiWiResource>() {
             @Override
             public KiWiResource apply(ResultSet row) throws SQLException {
-                return (KiWiResource)loadNodeById(result.getLong("context"));
+                return (KiWiResource)constructNodeFromDatabase(row);
+            }
+        });
+
+    }
+
+    /**
+     * List all contexts used in this triple store. See query.contexts .
+     * @return
+     * @throws SQLException
+     */
+    public CloseableIteration<KiWiUriResource, SQLException> listResources(String prefix) throws SQLException {
+        requireJDBCConnection();
+
+        PreparedStatement queryContexts = getPreparedStatement("query.resources_prefix");
+        queryContexts.setString(1, prefix+"%");
+
+        final ResultSet result = queryContexts.executeQuery();
+
+        return new ResultSetIteration<KiWiUriResource>(result, new ResultTransformerFunction<KiWiUriResource>() {
+            @Override
+            public KiWiUriResource apply(ResultSet row) throws SQLException {
+                return (KiWiUriResource)constructNodeFromDatabase(row);
             }
         });
 
@@ -1078,20 +1408,47 @@ public class KiWiConnection {
      * @param object     the object to query for, or null for a wildcard query
      * @param context    the context to query for, or null for a wildcard query
      * @param inferred   if true, the result will also contain triples inferred by the reasoner, if false not
+     * @param wildcardContext if true, a null context will be interpreted as a wildcard, if false, a null context will be interpreted as "no context"
      * @return a new RepositoryResult with a direct connection to the database; the result should be properly closed
      *         by the caller
      */
-    public RepositoryResult<Statement> listTriples(KiWiResource subject, KiWiUriResource predicate, KiWiNode object, KiWiResource context, boolean inferred) throws SQLException {
-
-        return new RepositoryResult<Statement>(
-                new ExceptionConvertingIteration<Statement, RepositoryException>(listTriplesInternal(subject,predicate,object,context,inferred)) {
-                    @Override
-                    protected RepositoryException convert(Exception e) {
-                        return new RepositoryException("database error while iterating over result set",e);
+    public RepositoryResult<Statement> listTriples(final KiWiResource subject, final KiWiUriResource predicate, final KiWiNode object, final KiWiResource context, final boolean inferred, final boolean wildcardContext) throws SQLException {
+
+
+        if(tripleBatch != null && tripleBatch.size() > 0) {
+            synchronized (tripleBatch) {
+                return new RepositoryResult<Statement>(
+                        new ExceptionConvertingIteration<Statement, RepositoryException>(
+                                new UnionIteration<Statement, SQLException>(
+                                        new IteratorIteration<Statement, SQLException>(tripleBatch.listTriples(subject,predicate,object,context, wildcardContext).iterator()),
+                                        new DelayedIteration<Statement, SQLException>() {
+                                            @Override
+                                            protected Iteration<? extends Statement, ? extends SQLException> createIteration() throws SQLException {
+                                                return listTriplesInternal(subject,predicate,object,context,inferred, wildcardContext);
+                                            }
+                                        }
+
+                                )
+                        ) {
+                            @Override
+                            protected RepositoryException convert(Exception e) {
+                                return new RepositoryException("database error while iterating over result set",e);
+                            }
+                        }
+
+                );
+            }
+        }  else {
+            return new RepositoryResult<Statement>(
+                    new ExceptionConvertingIteration<Statement, RepositoryException>(listTriplesInternal(subject,predicate,object,context,inferred, wildcardContext)) {
+                        @Override
+                        protected RepositoryException convert(Exception e) {
+                            return new RepositoryException("database error while iterating over result set",e);
+                        }
                     }
-                }
 
-        );
+            );
+        }
     }
 
     /**
@@ -1103,10 +1460,11 @@ public class KiWiConnection {
      * @param object     the object to query for, or null for a wildcard query
      * @param context    the context to query for, or null for a wildcard query
      * @param inferred   if true, the result will also contain triples inferred by the reasoner, if false not
+     * @param wildcardContext if true, a null context will be interpreted as a wildcard, if false, a null context will be interpreted as "no context"
      * @return a ClosableIteration that wraps the database ResultSet; needs to be closed explicitly by the caller
      * @throws SQLException
      */
-    private CloseableIteration<Statement, SQLException> listTriplesInternal(KiWiResource subject, KiWiUriResource predicate, KiWiNode object, KiWiResource context, boolean inferred) throws SQLException {
+    private CloseableIteration<Statement, SQLException> listTriplesInternal(KiWiResource subject, KiWiUriResource predicate, KiWiNode object, KiWiResource context, boolean inferred, final boolean wildcardContext) throws SQLException {
         // if one of the database ids is null, there will not be any database results, so we can return an empty result
         if(subject != null && subject.getId() == null) {
             return new EmptyIteration<Statement, SQLException>();
@@ -1126,12 +1484,16 @@ public class KiWiConnection {
         // otherwise we need to create an appropriate SQL query and execute it, the repository result will be read-only
         // and only allow forward iteration, so we can limit the query using the respective flags
         PreparedStatement query = connection.prepareStatement(
-                constructTripleQuery(subject,predicate,object,context,inferred),
+                constructTripleQuery(subject,predicate,object,context,inferred, wildcardContext),
                 ResultSet.TYPE_FORWARD_ONLY,
                 ResultSet.CONCUR_READ_ONLY
         );
         query.clearParameters();
 
+        if(persistence.getDialect().isCursorSupported()) {
+            query.setFetchSize(persistence.getConfiguration().getCursorSize());
+        }
+
         // set query parameters
         int position = 1;
         if(subject != null) {
@@ -1149,7 +1511,6 @@ public class KiWiConnection {
 
         final ResultSet result = query.executeQuery();
 
-
         return new ResultSetIteration<Statement>(result, true, new ResultTransformerFunction<Statement>() {
             @Override
             public Statement apply(ResultSet row) throws SQLException {
@@ -1168,7 +1529,7 @@ public class KiWiConnection {
      * @param inferred   if true, the result will also contain triples inferred by the reasoner, if false not
      * @return an SQL query string representing the triple pattern
      */
-    protected String constructTripleQuery(KiWiResource subject, KiWiUriResource predicate, KiWiNode object, KiWiResource context, boolean inferred) {
+    protected String constructTripleQuery(KiWiResource subject, KiWiUriResource predicate, KiWiNode object, KiWiResource context, boolean inferred, boolean wildcardContext) {
         StringBuilder builder = new StringBuilder();
         builder.append("SELECT id,subject,predicate,object,context,deleted,inferred,creator,createdAt,deletedAt FROM triples WHERE deleted = false");
         if(subject != null) {
@@ -1182,6 +1543,8 @@ public class KiWiConnection {
         }
         if(context != null) {
             builder.append(" AND context = ?");
+        } else if(!wildcardContext) {
+            builder.append(" AND context IS NULL");
         }
         if(!inferred) {
             builder.append(" AND inferred = false");
@@ -1244,7 +1607,7 @@ public class KiWiConnection {
             if(row.getLong("ltype") != 0) {
                 result.setType((KiWiUriResource) loadNodeById(row.getLong("ltype")));
             } else {
-                log.warn("Loaded literal without type: '{}' (id:{}).", result.getContent(), result.getId());
+                log.debug("Loaded literal without type: '{}' (id:{}).", result.getContent(), result.getId());
             }
 
             cacheNode(result);
@@ -1340,7 +1703,7 @@ public class KiWiConnection {
             result.setCreator((KiWiResource)loadNodeById(row.getLong("creator")));
         }
         result.setDeleted(row.getBoolean("deleted"));
-        result.setInferred(row.getBoolean("deleted"));
+        result.setInferred(row.getBoolean("inferred"));
         result.setCreated(new Date(row.getTimestamp("createdAt").getTime()));
         try {
             if(row.getDate("deletedAt") != null) {
@@ -1359,10 +1722,15 @@ public class KiWiConnection {
 
     protected static Locale getLocale(String language) {
         Locale locale = localeMap.get(language);
-        if(locale == null) {
-            locale = LocaleUtils.toLocale(language);
-            localeMap.put(language,locale);
-
+        if(locale == null && language != null) {
+            try {
+                Locale.Builder builder = new Locale.Builder();
+                builder.setLanguageTag(language);
+                locale = builder.build();
+                localeMap.put(language, locale);
+            } catch (IllformedLocaleException ex) {
+                throw new IllegalArgumentException("Language was not a valid BCP47 language: " + language, ex);
+            }
         }
         return locale;
     }
@@ -1379,11 +1747,14 @@ public class KiWiConnection {
         requireJDBCConnection();
 
         PreparedStatement statement = statementCache.get(key);
-        if(statement == null) {
+        if(statement == null || statement.isClosed()) {
             statement = connection.prepareStatement(dialect.getStatement(key));
             statementCache.put(key,statement);
         }
         statement.clearParameters();
+        if(persistence.getDialect().isCursorSupported()) {
+            statement.setFetchSize(persistence.getConfiguration().getCursorSize());
+        }
         return statement;
     }
 
@@ -1396,26 +1767,30 @@ public class KiWiConnection {
      * @throws SQLException
      */
     public long getNextSequence(String sequenceName) throws SQLException {
-        requireJDBCConnection();
+        if(batchCommit && persistence.getConfiguration().isMemorySequences()) {
+            return persistence.incrementAndGetMemorySequence(sequenceName);
+        } else {
+            requireJDBCConnection();
 
-        // retrieve a new node id and set it in the node object
+            // retrieve a new node id and set it in the node object
 
-        // if there is a preparation needed to update the transaction, run it first
-        if(dialect.hasStatement(sequenceName+".prep")) {
-            PreparedStatement prepNodeId = getPreparedStatement(sequenceName+".prep");
-            prepNodeId.executeUpdate();
-        }
+            // if there is a preparation needed to update the transaction, run it first
+            if(dialect.hasStatement(sequenceName+".prep")) {
+                PreparedStatement prepNodeId = getPreparedStatement(sequenceName+".prep");
+                prepNodeId.executeUpdate();
+            }
 
-        PreparedStatement queryNodeId = getPreparedStatement(sequenceName);
-        ResultSet resultNodeId = queryNodeId.executeQuery();
-        try {
-            if(resultNodeId.next()) {
-                return resultNodeId.getLong(1);
-            } else {
-                throw new SQLException("the sequence did not return a new value");
+            PreparedStatement queryNodeId = getPreparedStatement(sequenceName);
+            ResultSet resultNodeId = queryNodeId.executeQuery();
+            try {
+                if(resultNodeId.next()) {
+                    return resultNodeId.getLong(1);
+                } else {
+                    throw new SQLException("the sequence did not return a new value");
+                }
+            } finally {
+                resultNodeId.close();
             }
-        } finally {
-            resultNodeId.close();
         }
 
     }
@@ -1423,7 +1798,7 @@ public class KiWiConnection {
 
     private void cacheNode(KiWiNode node) {
         if(node.getId() != null) {
-            nodeCache.put(new Element(node.getId(),node));
+            nodeCache.put(new Element(node.getId(), node));
         }
         if(node instanceof KiWiUriResource) {
             uriCache.put(new Element(node.stringValue(), node));
@@ -1553,6 +1928,47 @@ public class KiWiConnection {
     }
 
     /**
+     * Return true if batched commits are enabled. Batched commits will try to group database operations and
+     * keep a memory log while storing triples. This can considerably improve the database performance.
+     * @return
+     */
+    public boolean isBatchCommit() {
+        return batchCommit;
+    }
+
+    /**
+     * Enabled batched commits. Batched commits will try to group database operations and
+     * keep a memory log while storing triples. This can considerably improve the database performance.
+     * @return
+     */
+    public void setBatchCommit(boolean batchCommit) {
+        if(dialect.isBatchSupported()) {
+            this.batchCommit = batchCommit;
+        } else {
+            log.warn("batch commits are not supported by this database dialect");
+        }
+    }
+
+
+    /**
+     * Return the size of a batch for batched commits. Batched commits will try to group database operations and
+     * keep a memory log while storing triples. This can considerably improve the database performance.
+     * @return
+     */
+    public int getBatchSize() {
+        return batchSize;
+    }
+
+    /**
+     * Set the size of a batch for batched commits. Batched commits will try to group database operations and
+     * keep a memory log while storing triples. This can considerably improve the database performance.
+     * @param batchSize
+     */
+    public void setBatchSize(int batchSize) {
+        this.batchSize = batchSize;
+    }
+
+    /**
      * Makes all changes made since the previous
      * commit/rollback permanent and releases any database locks
      * currently held by this <code>Connection</code> object.
@@ -1565,10 +1981,68 @@ public class KiWiConnection {
      *            <code>Connection</code> object is in auto-commit mode
      * @see #setAutoCommit
      */
-    public void commit() throws SQLException {
-        if(connection != null) {
-            connection.commit();
+    public synchronized void commit() throws SQLException {
+        numberOfCommits++;
+
+        RetryExecution execution = new RetryExecution("COMMIT");
+        execution.execute(connection, new RetryCommand<Void>() {
+            @Override
+            public Void run() throws SQLException {
+                if(persistence.getConfiguration().isCommitSequencesOnCommit() || numberOfCommits % 100 == 0) {
+                    commitMemorySequences();
+                }
+
+
+                if(tripleBatch != null && tripleBatch.size() > 0) {
+                    flushBatch();
+                }
+
+
+                deletedStatementsLog.clear();
+
+                if(connection != null) {
+                    connection.commit();
+                }
+
+                return null;
+            }
+        });
+    }
+
+    /**
+     * Store the values of all memory sequences back into the database. Should be called at least on repository shutdown
+     * but possibly even when a transaction commits.
+     */
+    public void commitMemorySequences() throws SQLException {
+        if(persistence.getMemorySequences() != null) {
+            synchronized (persistence.getMemorySequences()) {
+                requireJDBCConnection();
+
+                Set<String> updated = persistence.getSequencesUpdated();
+                persistence.setSequencesUpdated(new HashSet<String>());
+
+                try {
+                    for(Map.Entry<String,Long> entry : persistence.getMemorySequences().asMap().entrySet()) {
+                        if( updated.contains(entry.getKey()) && entry.getValue() > 0) {
+                            PreparedStatement updateSequence = getPreparedStatement(entry.getKey()+".set");
+                            updateSequence.setLong(1, entry.getValue());
+                            if(updateSequence.execute()) {
+                                updateSequence.getResultSet().close();
+                            } else {
+                                updateSequence.getUpdateCount();
+                            }
+                        }
+                    }
+                } catch(SQLException ex) {
+                    // MySQL deadlock state, in this case we retry anyways
+                    if(!"40001".equals(ex.getSQLState())) {
+                        log.error("SQL exception:",ex);
+                    }
+                    throw ex;
+                }
+            }
         }
+
     }
 
     /**
@@ -1584,6 +2058,15 @@ public class KiWiConnection {
      * @see #setAutoCommit
      */
     public void rollback() throws SQLException {
+        if(tripleBatch != null && tripleBatch.size() > 0) {
+            synchronized (tripleBatch) {
+                for(KiWiTriple triple : tripleBatch) {
+                    triple.setId(null);
+                }
+                tripleBatch.clear();
+            }
+        }
+        deletedStatementsLog.clear();
         if(connection != null && !connection.isClosed()) {
             connection.rollback();
         }
@@ -1643,7 +2126,192 @@ public class KiWiConnection {
                 log.debug("database system does not allow closing statements");
             }
 
-            connection.close();
+            persistence.releaseJDBCConnection(connection);
         }
     }
+
+
+    int retry = 0;
+
+    public synchronized void flushBatch() throws SQLException {
+        if(batchCommit && tripleBatch != null) {
+            requireJDBCConnection();
+
+            commitLock.lock();
+            try {
+                if(persistence.getValueFactory() != null) {
+                    persistence.getValueFactory().flushBatch();
+                }
+
+
+                RetryExecution execution = new RetryExecution("FLUSH BATCH");
+                execution.setUseSavepoint(true);
+                execution.execute(connection, new RetryCommand<Void>() {
+                    @Override
+                    public Void run() throws SQLException {
+                        PreparedStatement insertTriple = getPreparedStatement("store.triple");
+                        insertTriple.clearParameters();
+                        insertTriple.clearBatch();
+
+                        synchronized (tripleBatch) {
+                            for(KiWiTriple triple : tripleBatch) {
+                                // if the triple has been marked as deleted, this can only have been done by another connection
+                                // in this case the triple id is no longer usable (might result in key conflicts), so we set it to
+                                // a new id
+                                if(triple.isDeleted()) {
+                                    triple.setId(getNextSequence("seq.triples"));
+                                    triple.setDeleted(false);
+                                    triple.setDeletedAt(null);
+                                }
+
+                                // retrieve a new triple ID and set it in the object
+                                if(triple.getId() == null) {
+                                    triple.setId(getNextSequence("seq.triples"));
+                                }
+
+                                insertTriple.setLong(1,triple.getId());
+                                insertTriple.setLong(2,triple.getSubject().getId());
+                                insertTriple.setLong(3,triple.getPredicate().getId());
+                                insertTriple.setLong(4,triple.getObject().getId());
+                                if(triple.getContext() != null) {
+                                    insertTriple.setLong(5,triple.getContext().getId());
+                                } else {
+                                    insertTriple.setNull(5, Types.BIGINT);
+                                }
+                                insertTriple.setBoolean(6,triple.isInferred());
+                                insertTriple.setTimestamp(7, new Timestamp(triple.getCreated().getTime()));
+
+                                insertTriple.addBatch();
+                            }
+                        }
+                        insertTriple.executeBatch();
+
+                        tripleBatch.clear();
+
+                        return null;
+                    }
+                });
+
+            }  finally {
+                commitLock.unlock();
+            }
+
+        }
+
+    }
+
+
+    protected static interface RetryCommand<T> {
+
+        public T run() throws SQLException;
+    }
+
+    /**
+     * A generic implementation of an SQL command that might fail (e.g. because of a timeout or concurrency situation)
+     * and should be retried several times before giving up completely.
+     *
+     */
+    protected static class RetryExecution<T>  {
+
+        // counter for current number of retries
+        private int retries = 0;
+
+        // how often to reattempt the operation
+        private int maxRetries = 10;
+
+        // how long to wait before retrying
+        private long retryInterval = 1000;
+
+        // use an SQL savepoint and roll back in case a retry is needed?
+        private boolean useSavepoint = false;
+
+        private String name;
+
+        // if non-empty: only retry on the SQL states contained in this set
+        private Set<String> sqlStates;
+
+        public RetryExecution(String name) {
+            this.name = name;
+            this.sqlStates = new HashSet<>();
+        }
+
+
+        public String getName() {
+            return name;
+        }
+
+        public void setName(String name) {
+            this.name = name;
+        }
+
+        public int getMaxRetries() {
+            return maxRetries;
+        }
+
+        public void setMaxRetries(int maxRetries) {
+            this.maxRetries = maxRetries;
+        }
+
+        public long getRetryInterval() {
+            return retryInterval;
+        }
+
+        public void setRetryInterval(long retryInterval) {
+            this.retryInterval = retryInterval;
+        }
+
+        public boolean isUseSavepoint() {
+            return useSavepoint;
+        }
+
+        public void setUseSavepoint(boolean useSavepoint) {
+            this.useSavepoint = useSavepoint;
+        }
+
+        public Set<String> getSqlStates() {
+            return sqlStates;
+        }
+
+        public T execute(Connection connection, RetryCommand<T> command) throws SQLException {
+            Savepoint savepoint = null;
+            if(useSavepoint) {
+                savepoint = connection.setSavepoint();
+            }
+            try {
+                T result = command.run();
+
+                if(useSavepoint && savepoint != null) {
+                    connection.releaseSavepoint(savepoint);
+                }
+
+                return result;
+            } catch (SQLException ex) {
+                if(retries < maxRetries && (sqlStates.size() == 0 || sqlStates.contains(ex.getSQLState()))) {
+                    if(useSavepoint && savepoint != null) {
+                        connection.rollback(savepoint);
+                    }
+                    Random rnd = new Random();
+                    long sleep = retryInterval - 250 + rnd.nextInt(500);
+                    log.warn("{}: temporary conflict, retrying in {} ms ... (thread={}, retry={})", name, sleep, Thread.currentThread().getName(), retries);
+                    try {
+                        Thread.sleep(sleep);
+                    } catch (InterruptedException e) {}
+                    retries++;
+                    T result = execute(connection, command);
+                    retries--;
+
+                    return result;
+                } else {
+                    log.error("{}: temporary conflict could not be solved! (error: {})", name, ex.getMessage());
+
+                    log.debug("main exception:",ex);
+                    log.debug("next exception:",ex.getNextException());
+                    throw ex;
+                }
+            }
+
+
+        }
+
+    }
 }

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/kiwi/kiwi-triplestore/src/main/java/org/apache/marmotta/kiwi/persistence/KiWiDialect.java
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-triplestore/src/main/java/org/apache/marmotta/kiwi/persistence/KiWiDialect.java b/libraries/kiwi/kiwi-triplestore/src/main/java/org/apache/marmotta/kiwi/persistence/KiWiDialect.java
index 9cd130e..cbf6fbf 100644
--- a/libraries/kiwi/kiwi-triplestore/src/main/java/org/apache/marmotta/kiwi/persistence/KiWiDialect.java
+++ b/libraries/kiwi/kiwi-triplestore/src/main/java/org/apache/marmotta/kiwi/persistence/KiWiDialect.java
@@ -17,14 +17,13 @@
  */
 package org.apache.marmotta.kiwi.persistence;
 
+import com.google.common.collect.ImmutableSet;
 import org.apache.commons.io.IOUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import java.net.URL;
-import java.util.Enumeration;
-import java.util.Properties;
-import java.util.Set;
+import java.util.*;
 
 /**
  * A dialect provides the SQL statements necessary to access the different types of database systems. Each
@@ -36,7 +35,7 @@ public abstract class KiWiDialect {
 
     private static Logger log = LoggerFactory.getLogger(KiWiDialect.class);
 
-    private final static int VERSION = 1;
+    private final static int VERSION = 2;
 
     private Properties statements;
 
@@ -69,6 +68,12 @@ public abstract class KiWiDialect {
 
 
     /**
+     * Return true if batched commits are supported by this dialect.
+     * @return
+     */
+    public abstract boolean isBatchSupported();
+
+    /**
      * Return the contents of the SQL create script used for initialising an empty database
      * @return
      */
@@ -112,7 +117,7 @@ public abstract class KiWiDialect {
         StringBuilder builder = new StringBuilder();
         for(int i = oldVersion+1; i <= VERSION; i++ ) {
             try {
-                String script = String.format("upgrade_"+name+"_%02d_%02d.sql",i-1,i);
+                String script = String.format("upgrade_"+name+"_%03d_%03d.sql",i-1,i);
 
                 builder.append(IOUtils.toString(this.getClass().getResourceAsStream(script)));
             } catch (Exception e) {
@@ -152,4 +157,81 @@ public abstract class KiWiDialect {
     public Set<String> getStatementIdentifiers() {
         return statements.stringPropertyNames();
     }
+
+    /**
+     * Return the names of all sequences that have been configured in the system, i.e. all statements starting with "seq."
+     * @return
+     */
+    public Set<String> listSequences(String scriptName) {
+        // quick hack for current modules, fix later!
+        if("base".equals(scriptName)) {
+            return ImmutableSet.of("seq.nodes", "seq.triples", "seq.namespaces");
+        } else if("reasoner".equals(scriptName)) {
+            return ImmutableSet.of("seq.rules", "seq.justifications", "seq.programs");
+        } else if("versioning".equals(scriptName)) {
+            return ImmutableSet.of("seq.versions");
+        } else if("ldcache".equals(scriptName)) {
+            return ImmutableSet.of("seq.ldcache");
+        } else {
+            return Collections.EMPTY_SET;
+        }
+
+
+        /*
+        Set<String> names = new HashSet<String>();
+        Enumeration e = statements.propertyNames();
+        while(e.hasMoreElements()) {
+            String[] keys = e.nextElement().toString().split("\\.");
+            if(keys[0].equals("seq")) {
+                names.add(keys[0] + "." + keys[1]);
+            }
+        }
+        return names;
+        */
+    }
+
+    /**
+     * Return the database specific operator for matching a text against a regular expression.
+     *
+     * @param text
+     * @param pattern
+     * @return
+     */
+    public abstract String getRegexp(String text, String pattern);
+
+
+    /**
+     * Return the database specific case insensitive like comparison, e.g. ILIKE in Postgres.
+     *
+     * @param text
+     * @param pattern
+     * @return
+     */
+    public abstract String getILike(String text, String pattern);
+
+
+    /**
+     * Get the database specific string concatenation function for the (variable number of) arguments.
+     *
+     * @param args
+     * @return
+     */
+    public abstract String getConcat(String... args);
+
+
+    /**
+     * Get the query string that can be used for validating that a JDBC connection to this database is still valid.
+     * Typically, this should be an inexpensive operation like "SELECT 1",
+     * @return
+     */
+    public abstract String getValidationQuery();
+
+
+    /**
+     * Return true in case the database system supports using cursors for queries over large data tables.
+     * @return
+     */
+    public boolean isCursorSupported() {
+        return false;
+    }
 }

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/kiwi/kiwi-triplestore/src/main/java/org/apache/marmotta/kiwi/persistence/KiWiGarbageCollector.java
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-triplestore/src/main/java/org/apache/marmotta/kiwi/persistence/KiWiGarbageCollector.java b/libraries/kiwi/kiwi-triplestore/src/main/java/org/apache/marmotta/kiwi/persistence/KiWiGarbageCollector.java
index f832dd8..d29104b 100644
--- a/libraries/kiwi/kiwi-triplestore/src/main/java/org/apache/marmotta/kiwi/persistence/KiWiGarbageCollector.java
+++ b/libraries/kiwi/kiwi-triplestore/src/main/java/org/apache/marmotta/kiwi/persistence/KiWiGarbageCollector.java
@@ -22,10 +22,13 @@ import org.slf4j.LoggerFactory;
 
 import java.sql.Connection;
 import java.sql.PreparedStatement;
+import java.sql.ResultSet;
 import java.sql.SQLException;
+import java.util.ArrayList;
 import java.util.HashSet;
 import java.util.Iterator;
 import java.util.Set;
+import java.util.concurrent.TimeUnit;
 
 /**
  * This class implements a garbage collector for the database that cleans up deleted triples and nodes when they
@@ -42,7 +45,7 @@ public class KiWiGarbageCollector extends Thread {
     private Set<TableDependency> tripleTableDependencies;
     private Set<TableDependency>  nodeTableDependencies;
 
-    private long interval = 60 * 60 * 1000;
+    private long interval = TimeUnit.MILLISECONDS.convert(24L, TimeUnit.HOURS);
 
     private long round = 0;
 
@@ -98,11 +101,107 @@ public class KiWiGarbageCollector extends Thread {
         nodeTableDependencies.add(new TableDependency(tableName,columnName));
     }
 
+    protected boolean checkConsistency() throws SQLException {
+        boolean consistent = true;
 
-    private int garbageCollect() throws SQLException {
+        String checkNodeDuplicatesQuery = "SELECT svalue, ntype, count(id) FROM nodes group by svalue, ntype having count(id) > 1";
+
+        try(Connection con = persistence.getJDBCConnection()) {
+            PreparedStatement checkNodeDuplicatesStatement = con.prepareStatement(checkNodeDuplicatesQuery);
+
+            try(ResultSet result = checkNodeDuplicatesStatement.executeQuery()) {
+                if(result.next()) {
+                    log.warn("DATABASE INCONSISTENCY: duplicate node entries found, please try to fix the consistency with fixConsistency()!");
+                    do {
+                        if(result.getString("ntype").equals("uri")) {
+                            log.warn(" - inconsistent resource: {}", result.getString("svalue"));
+                        }
+                    } while(result.next());
+
+                    consistent = false;
+                }
+            }
+
+        }
+
+        if(!consistent) {
+            log.warn("DATABASE INCONSISTENCY: attempting to auto-fix inconsistencies where possible");
+            try {
+                fixConsistency();
+            } catch (SQLException ex) {
+                log.error("DATABASE INCONSISTENCY: auto-fixing inconsistencies failed ({})", ex.getMessage());
+            }
+        }
+
+        return consistent;
+    }
+
+
+    protected void fixConsistency() throws SQLException {
+        String checkNodeDuplicatesQuery = "SELECT svalue, ntype, count(id), max(id) FROM nodes group by svalue, ntype having count(id) > 1";
+        String getNodeIdsQuery = "SELECT id FROM nodes WHERE svalue = ? AND ntype = ? AND id != ?";
+
+        try(Connection con = persistence.getJDBCConnection(true)) {
+            PreparedStatement checkNodeDuplicatesStatement = con.prepareStatement(persistence.getDialect().getStatement("gc.check_consistency"));
+            PreparedStatement getNodeIdsStatement = con.prepareStatement(persistence.getDialect().getStatement("gc.list_node_ids"));
+
+            ResultSet result = checkNodeDuplicatesStatement.executeQuery();
+            while(result.next()) {
+                if(result.getString("ntype").equals("uri")) {
+                    log.warn("DATABASE INCONSISTENCY: attempting to fix references for resource {}", result.getString("svalue"));
+                } else {
+                    log.warn("DATABASE INCONSISTENCY: attempting to fix references for literal or anonymous node {}", result.getString("svalue"));
+                }
+
+                long latest_id = result.getLong(4);
+
+                // first we collect all ids of nodes that have the same svalue and ntype
+                getNodeIdsStatement.clearParameters();
+                getNodeIdsStatement.setString(1, result.getString("svalue"));
+                getNodeIdsStatement.setString(2,result.getString("ntype"));
+                getNodeIdsStatement.setLong(3, latest_id);
+
+                ArrayList<Long> ids = new ArrayList<>();
+                try(ResultSet idResult = getNodeIdsStatement.executeQuery()) {
+                    while(idResult.next()) {
+                        ids.add(idResult.getLong(1));
+                    }
+                }
+                getNodeIdsStatement.close();
+
+                // then we "fix" the triples table by making sure that all subjects, predicates, objects and contexts point to
+                // the latest version only; we use the nodes dependency table for this purpose
+                for(TableDependency dep : nodeTableDependencies) {
+                    String fixNodeIdsQuery = "UPDATE " + dep.table + " SET " + dep.column + " = " + latest_id + " WHERE " + dep.column + " = ?";
+                    PreparedStatement fixNodeIdsStatement = con.prepareStatement(fixNodeIdsQuery);
+                    for(Long id : ids) {
+                        fixNodeIdsStatement.setLong(1, id);
+                        fixNodeIdsStatement.addBatch();
+                    }
+                    fixNodeIdsStatement.executeBatch();
+                }
+
+                // finally we clean up all now unused node ids
+                String deleteDuplicatesQuery = "DELETE FROM nodes WHERE id = ?";
+                PreparedStatement deleteDuplicatesStatement = con.prepareStatement(deleteDuplicatesQuery);
+                for(Long id : ids) {
+                    deleteDuplicatesStatement.setLong(1, id);
+                    deleteDuplicatesStatement.addBatch();
+                }
+                deleteDuplicatesStatement.executeBatch();
+                deleteDuplicatesStatement.close();
+            }
+            checkNodeDuplicatesStatement.close();
+        }
+    }
+
+
+    protected int garbageCollect() throws SQLException {
         round++;
 
-        Connection con = persistence.getJDBCConnection();
+        long start = System.currentTimeMillis();
+
+        Connection con = persistence.getJDBCConnection(false);
         try {
             int count = 0;
 
@@ -120,9 +219,14 @@ public class KiWiGarbageCollector extends Thread {
             }
 
             // garbage collect nodes (only every 10th garbage collection, only makes sense when we previously deleted triples ...)
-            // TODO: this is currently not working, because the nodes remain in the cache; we need to find a different solution ...
-            //if(count > 0 && round % 10 == 1) {
-            if(false) {
+            if(count > 0 && round % 10 == 1) {
+                // flush all nodes from the value factory first
+                if(persistence.getValueFactory() != null) {
+                    persistence.getValueFactory().flushBatch();
+                }
+
+
+                // then delete all unconnected nodes
                 try {
                     String gcNodesQuery = buildGCNodesQuery();
                     PreparedStatement stmtGcNodes = con.prepareStatement(gcNodesQuery);
@@ -135,10 +239,11 @@ public class KiWiGarbageCollector extends Thread {
                     log.warn("SQL error while executing garbage collection on nodes table: {}", ex.getMessage());
                 }
             }
+            log.info("... cleaned up {} entries (duration: {} ms)", count, (System.currentTimeMillis()-start));
 
             return count;
         } finally {
-            con.close();
+            persistence.releaseJDBCConnection(con);
         }
     }
 
@@ -149,7 +254,6 @@ public class KiWiGarbageCollector extends Thread {
      *
      * @see #start()
      * @see #stop()
-     * @see #Thread(ThreadGroup, Runnable, String)
      */
     @Override
     public void run() {
@@ -160,11 +264,16 @@ public class KiWiGarbageCollector extends Thread {
             while(!shutdown) {
                 // don't run immediately on startup
                 if(started) {
-                    long start = System.currentTimeMillis();
+                    log.info("running database consistency checks ...");
+                    try {
+                        checkConsistency();
+                    } catch (SQLException e) {
+                        log.error("error while executing consistency checks: {}",e.getMessage());
+                    }
+
                     log.info("running garbage collection ...");
                     try {
                         int count = garbageCollect();
-                        log.info("... cleaned up {} entries (duration: {} ms)", count, (System.currentTimeMillis()-start));
                     } catch (SQLException e) {
                         log.error("error while executing garbage collection: {}",e.getMessage());
                     }


[048/100] [abbrv] [partial] Reverting the erroneous merge by Sebastian according to the instructions in INFRA-6876

Posted by wi...@apache.org.
http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/marmotta-commons/src/ext/java/javolution/util/FastCollection.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-commons/src/ext/java/javolution/util/FastCollection.java b/commons/marmotta-commons/src/ext/java/javolution/util/FastCollection.java
new file mode 100644
index 0000000..100d59e
--- /dev/null
+++ b/commons/marmotta-commons/src/ext/java/javolution/util/FastCollection.java
@@ -0,0 +1,634 @@
+/*
+ * 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.util;
+
+import javolution.lang.Immutable;
+import javolution.lang.Parallelizable;
+import javolution.lang.Realtime;
+import javolution.util.function.*;
+import javolution.util.internal.collection.*;
+import javolution.util.service.CollectionService;
+
+import java.io.Serializable;
+import java.util.Collection;
+import java.util.Comparator;
+import java.util.ConcurrentModificationException;
+import java.util.Iterator;
+
+import static javolution.lang.Realtime.Limit.*;
+
+/**
+ * <p> A closure-based collection supporting numerous views which can be chained.
+ * <ul>
+ *    <li>{@link #atomic} - Thread-safe view for which all reads are mutex-free 
+ *    and collection updates (including {@link #addAll addAll}, {@link #removeIf removeIf}} are atomic.</li>
+ *    <li>{@link #shared} - Thread-safe view using allowing concurrent reads based 
+ *    on mutex (<a href="http://en.wikipedia.org/wiki/Readers%E2%80%93writer_lock">
+ *    readers-writer locks).</li>
+ *    <li>{@link #parallel} - A view allowing parallel processing including {@link #update updates}.</li>
+ *    <li>{@link #sequential} - View disallowing parallel processing.</li>
+ *    <li>{@link #unmodifiable} - View which does not allow any modification.</li>
+ *    <li>{@link #filtered filtered(filter)} - View exposing only the elements matching the specified filter.</li>
+ *    <li>{@link #mapped mapped(function)} - View exposing elements through the specified mapping function.</li>
+ *    <li>{@link #sorted sorted(comparator)} - View exposing elements sorted according to their natural order 
+ *                          of using a specified comparator.</li>
+ *    <li>{@link #reversed} - View exposing elements in the reverse iterative order.</li>
+ *    <li>{@link #distinct} - View exposing each element only once.</li>
+ * </ul></p>
+ * 
+ * <p> Unmodifiable collections are not always immutable. An {@link javolution.lang.Immutable immutable}. 
+ *     reference (or const reference) can only be {@link #toImmutable() obtained} when the originator  
+ *     guarantees that the collection source will not be modified even by himself 
+ *     (the value of the immutable reference being an {@link #unmodifiable unmodifiable} collection).
+ * [code]
+ * Immutable<List<String>> winners 
+ *     = new FastTable<String>().addAll("John Deuff", "Otto Graf", "Sim Kamil").toImmutable();
+ *     // Immutability is guaranteed, no reference left on the collection source.
+ * [/code]</p>
+ * 
+ * <p> Atomic collections use <a href="http://en.wikipedia.org/wiki/Copy-on-write">Copy-On-Write</a> 
+ *     optimizations in order to provide mutex-free read access. Only writes operations are mutually 
+ *     exclusive. Collections can be optimized to not require the full copy during write operations
+ *     (e.g. immutable parts don't need to be copied). Still, when multiple updates are performed,
+ *     it is beneficial to group them into one single {@link #update update} operation.
+ * [code]
+ * FastTable<String> tokens = new FastTable<String>().atomic();
+ * ...
+ * // Replace null with "" in tokens. If tokens is atomic the update is atomic.
+ * // If tokens is parallel, the update is also performed concurrently !
+ * tokens.update(new Consumer<List<String>>() {  
+ *     public void accept(List<String> view) {
+ *         for (int i=0, n = view.size(); i < n; i++)
+ *             if (view.get(i) == null) view.set(i, "");
+ *         }
+ *     }
+ * });[/code]</p>
+ * <p> The same code using closure (Java 8).
+ * [code]
+ *  tokens.update((List<String> view) -> {
+ *      for (int i = 0, n = view.size(); i < n; i++) {
+ *          if (view.get(i) == null) view.set(i, "");
+ *      }
+ *  });[/code]</p>
+ * 
+ * <p> Views are similar to <a href="http://lambdadoc.net/api/java/util/stream/package-summary.html">
+ *     Java 8 streams</a> except that views are themselves collections (virtual collections)
+ *     and actions on a view can impact the original collection. Collection views are nothing "new" 
+ *     since they already existed in the original java.util collection classes (e.g. List.subList(...),
+ *     Map.keySet(), Map.values()). Javolution extends to this concept and allows views to be chained 
+ *     which addresses the concern of class proliferation.</p> 
+ * [code]
+ * FastTable<String> names = new FastTable<String>().addAll("Oscar Thon", "Eva Poret", "Paul Auchon");
+ * boolean found = names.comparator(Equalities.LEXICAL_CASE_INSENSITIVE).contains("LUC SURIEUX"); 
+ * names.subTable(0, n).clear(); // Removes the n first names (see java.util.List.subList).
+ * names.distinct().add("Guy Liguili"); // Adds "Guy Liguili" only if not already present.
+ * names.filtered(isLong).clear(); // Removes all the persons with long names.
+ * names.filtered(isLong).parallel().clear(); // Same as above but performed concurrently !
+ * ...
+ * Predicate<CharSequence> isLong = new Predicate<CharSequence>() { 
+ *     public boolean test(CharSequence csq) {
+ *         return csq.length() > 16; 
+ *     }
+ * });[/code]</p>
+ *    
+ * <p> Views can of course be used to perform "stream" oriented filter-map-reduce operations with the same benefits:
+ *     Parallelism support, excellent memory characteristics (no caching and cost nothing to create), etc.
+ * [code]
+ * String anyLongName = names.filtered(isLong).any(String.class); // Returns any long name.
+ * int nbrChars = names.mapped(toLength).reduce(Reducers.sum()); // Returns the total number of characters.
+ * int maxLength = names.mapped(toLength).parallel().max(); // Finds the longest name in parallel.
+ * ...
+ * Function<CharSequence, Integer> toLength = new Function<CharSequence, Integer>() {
+ *    public Integer apply(CharSequence csq) {
+ *        return csq.length(); 
+ *    }
+ * });
+ *    
+ * // JDK Class.getEnclosingMethod using Javolution's views and Java 8 (to be compared with the current 20 lines implementation !).
+ * Method matching = new FastTable<Method>().addAll(enclosingInfo.getEnclosingClass().getDeclaredMethods())
+ *     .filtered(m -> Equalities.STANDARD.areEqual(m.getName(), enclosingInfo.getName())
+ *     .filtered(m -> Equalities.ARRAY.areEqual(m.getParameterTypes(), parameterClasses))
+ *     .filtered(m -> Equalities.STANDARD.areEqual(m.getReturnType(), returnType))
+ *     .any(Method.class);
+ * if (matching == null) throw new InternalError("Enclosing method not found");
+ * return matching;[/code]</p>
+ *           
+ * <p> If a collection (or a map) is shared, derived views are also thread-safe.
+ *     Similarly, if a collection is {@link #parallel parallel}, closure-based iterations 
+ *     on derived views are performed concurrently.
+ * [code]
+ * FastTable<Person> persons = new FastTable<Person>().parallel();
+ * ...
+ * // Since persons is parallel, the search is done concurrently.
+ * Person john = persons.filtered(new Predicate<Person>() { 
+ *     public boolean test(Person person) {
+ *         return person.getName().equals("John");
+ *     }
+ * }).any(Person.class);[/code]</p>
+ * 
+ * <p> With Java 8, closures are greatly simplified using lambda expressions.
+ * [code]
+ * Person john = persons.filtered(person -> person.getName().equals("John")).any(Person.class); // Same as above.
+ * tasks.parallel().forEach(task -> task.run());
+ * names.sorted().reversed().forEach(str -> System.out.println(str)); // Prints names in reverse alphabetical order. 
+ * [/code]</p>
+ *     
+ * @author <a href="mailto:jean-marie@dautelle.com">Jean-Marie Dautelle</a>
+ * @version 6.0, July 21, 2013
+ */
+@Realtime
+public abstract class FastCollection<E> implements Collection<E>, Serializable {
+
+    private static final long serialVersionUID = 0x600L; // Version.
+
+    /**
+     * Default constructor.
+     */
+    protected FastCollection() {}
+
+    ////////////////////////////////////////////////////////////////////////////
+    // Views.
+    //
+
+    /**
+     * Returns an atomic view over this collection. All operations that write 
+     * or access multiple elements in the collection (such as addAll(), 
+     * retainAll()) are atomic. 
+     * Iterators on atomic collections are <b>thread-safe</b> 
+     * (no {@link ConcurrentModificationException} possible).
+     */
+    @Parallelizable(mutexFree = true, comment = "Except for write operations, all read operations are mutex-free.")
+    public FastCollection<E> atomic() {
+        return new AtomicCollectionImpl<E>(service());
+    }
+
+    /**
+     * Returns a thread-safe view over this collection. The shared view
+     * allows for concurrent read as long as there is no writer. 
+     * The default implementation is based on <a href=
+     * "http://en.wikipedia.org/wiki/Readers%E2%80%93writer_lock">
+     * readers-writers locks</a> giving priority to writers. 
+     * Iterators on shared collections are <b>thread-safe</b> 
+     * (no {@link ConcurrentModificationException} possible).
+     */
+    @Parallelizable(mutexFree = false, comment = "Use multiple-readers/single-writer lock.")
+    public FastCollection<E> shared() {
+        return new SharedCollectionImpl<E>(service());
+    }
+
+    /** 
+     * Returns a sequential view of this collection. Using this view, 
+     * all closure-based iterations are performed sequentially.
+     */
+    public FastCollection<E> sequential() {
+        return new SequentialCollectionImpl<E>(service());
+    }
+
+    /**
+     * Returns an unmodifiable view over this collection. Any attempt to 
+     * modify the collection through this view will result into 
+     * a {@link java.lang.UnsupportedOperationException} being raised.
+     */
+    public FastCollection<E> unmodifiable() {
+        return new UnmodifiableCollectionImpl<E>(service());
+    }
+
+    /** 
+     * Returns a view exposing only the elements matching the specified 
+     * filter.  Adding elements not matching the specified filter has 
+     * no effect. If this collection is initially empty, using a filtered
+     * view to add new elements ensure that this collection has only elements
+     * satisfying the filter predicate.
+     */
+    public FastCollection<E> filtered(Predicate<? super E> filter) {
+        return new FilteredCollectionImpl<E>(service(), filter);
+    }
+
+    /** 
+     * Returns a view exposing elements through the specified mapping function.
+     * The returned view does not allow new elements to be added.
+     */
+    public <R> FastCollection<R> mapped(
+            Function<? super E, ? extends R> function) {
+        return new MappedCollectionImpl<E, R>(service(), function);
+    }
+
+    /** 
+     * Returns a view exposing elements sorted according to the 
+     * collection {@link #comparator() order}. 
+     */
+    public FastCollection<E> sorted() {
+        return new SortedCollectionImpl<E>(service(), comparator());
+    }
+
+    /** 
+     * Returns a view exposing elements sorted according to the specified 
+     * comparator.
+     */
+    public FastCollection<E> sorted(Comparator<? super E> cmp) {
+        return new SortedCollectionImpl<E>(service(), cmp);
+    }
+
+    /** 
+     * Returns a view exposing elements in reverse iterative order.
+     */
+    public FastCollection<E> reversed() {
+        return new ReversedCollectionImpl<E>(service());
+    }
+
+    /** 
+     * Returns a view exposing only distinct elements (it does not iterate twice 
+     * over the {@link #comparator() same} elements). Adding elements already 
+     * in the collection through this view has no effect. If this collection is 
+     * initially empty, using a distinct view to add new elements ensures that
+     * this collection has no duplicate.  
+     */
+    public FastCollection<E> distinct() {
+        return new DistinctCollectionImpl<E>(service());
+    }
+
+    ////////////////////////////////////////////////////////////////////////////
+    // Closure operations.
+    //
+
+    /** 
+     * Executes the specified read action on this collection.
+     * That logic may be performed concurrently (on parallel views) 
+     * if this collection is {@link #parallel() parallel}.
+     * 
+     *    
+     * @param action the read-only action.
+     * @throws ClassCastException if the action type is not compatible with 
+     *         this collection (e.g. action on set and this is a list). 
+     * @see #update(Consumer)
+     */
+    @SuppressWarnings("unchecked")
+    @Realtime(limit = LINEAR)
+    public void perform(Consumer<? extends Collection<E>> action) {
+        service().perform((Consumer<CollectionService<E>>) action, service());
+    }
+
+    /** 
+     * Executes the specified update action on this collection. 
+     * For {@link #atomic() atomic} collections the update is atomic 
+     * (either concurrent readers see the full result of the action or
+     * nothing).
+     * The update may be performed concurrently (through parallel views)
+     * if this collection is {@link #parallel() parallel}.
+     *    
+     * @param action the update action.
+     * @throws ClassCastException if the action type is not compatible with 
+     *         this collection (e.g. action on a {@link java.util.Set Set} 
+     *         and this is a {@link java.util.List List}). 
+     * @see #perform(Consumer)
+     */
+    @SuppressWarnings("unchecked")
+    @Realtime(limit = LINEAR)
+    public void update(Consumer<? extends Collection<E>> action) {
+        service().update((Consumer<CollectionService<E>>) action, service());
+    }
+
+    /** 
+     * Iterates over all this collection elements applying the specified 
+     * consumer (convenience method). Iterations are performed concurrently 
+     * if the collection is {@link #parallel() parallel}.
+     * 
+     * @param consumer the functional consumer applied to the collection elements.
+     */
+    @Realtime(limit = LINEAR)
+    public void forEach(final Consumer<? super E> consumer) {
+        perform(new Consumer<Collection<E>>() {
+            public void accept(Collection<E> view) {
+                Iterator<E> it = view.iterator();
+                while (it.hasNext()) {
+                    consumer.accept(it.next());
+                }
+            }
+        });
+    }
+
+    /**
+     * Removes from this collection all the elements matching the specified
+     * functional predicate (convenience method). Removals are performed 
+     * concurrently if this collection is {@link #parallel() parallel} and 
+     * atomically if this collection is {@link #atomic() atomic}.
+     * 
+     * @param filter a predicate returning {@code true} for elements to be removed.
+     * @return {@code true} if at least one element has been removed;
+     *         {@code false} otherwise.
+     */
+    @Realtime(limit = LINEAR)
+    public boolean removeIf(final Predicate<? super E> filter) {
+        final boolean[] removed = new boolean[1];
+        update(new Consumer<Collection<E>>() {
+            public void accept(Collection<E> view) {
+                Iterator<E> it = view.iterator();
+                while (it.hasNext()) {
+                    if (filter.test(it.next())) {
+                        it.remove(); // Ok mutable iteration.
+                        removed[0] = true;
+                    }
+                }
+            }
+        });
+        return removed[0];
+    }
+
+    /** 
+     * Performs a reduction of the elements of this collection using the 
+     * specified reducer. This may not involve iterating  over all the 
+     * collection elements, for example the reducers: {@link Reducers#any},
+     * {@link Reducers#and} and {@link Reducers#or} may stop iterating 
+     * early. Reduction is performed concurrently if this collection is 
+     * {@link #parallel() parallel}. 
+     *    
+     * @param reducer the collection reducer.
+     * @return the reduction result.
+     * @see #any(Class)
+     * @see #min()
+     * @see #max()
+     */
+    @Realtime(limit = LINEAR)
+    public E reduce(Reducer<E> reducer) {
+        perform(reducer);
+        return reducer.get();
+    }
+
+    ////////////////////////////////////////////////////////////////////////////
+    // Collection operations.
+    //
+
+    /** Adds the specified element to this collection */
+    @Override
+    @Realtime(limit = LINEAR, comment = "Could iterate the whole collection (e.g. distinct view).")
+    public boolean add(E element) {
+        return service().add(element);
+    }
+
+    /** Indicates if this collection is empty. */
+    @Override
+    @Realtime(limit = LINEAR, comment = "Could iterate the whole collection (e.g. filtered view).")
+    public boolean isEmpty() {
+        return iterator().hasNext();
+    }
+
+    /** Returns the size of this collection. */
+    @Override
+    @Realtime(limit = LINEAR, comment = "Could count the elements (e.g. filtered view).")
+    public int size() {
+        return service().size();
+    }
+
+    /** Removes all elements from this collection. */
+    @Override
+    @Realtime(limit = LINEAR, comment = "Could remove the elements one at a time.")
+    public void clear() {
+        service().clear();
+    }
+
+    /** Indicates if this collection contains the specified element. */
+    @Override
+    @Realtime(limit = LINEAR, comment = "Could search the whole collection.")
+    public boolean contains(Object searched) {
+        return service().contains(searched);
+    }
+
+    /**  Removes the specified element from this collection.*/
+    @Override
+    @Realtime(limit = LINEAR, comment = "Could search the whole collection.")
+    public boolean remove(Object searched) {
+        return service().remove(searched);
+    }
+
+    /**
+     * Returns an iterator over this collection elements. For 
+     * shared/atomic collections the iterator is immune to 
+     * concurrent modifications. In other words the elements iterated over
+     * may or may not reflect the current state of the collection.
+     */
+    @Override
+    @Realtime(limit = N_SQUARE, comment = "Sorted view iterator require sorting the elements.")
+    public Iterator<E> iterator() {
+        return service().iterator();
+    }
+
+    /** Adds all the specified elements to this collection. */
+    @Override
+    @Realtime(limit = LINEAR)
+    public boolean addAll(final Collection<? extends E> that) {
+        return service().addAll(that);
+    }
+
+    /** Indicates if this collection contains all the specified elements. */
+    @Override
+    @Realtime(limit = N_SQUARE)
+    public boolean containsAll(Collection<?> that) {
+        return service().containsAll(that);
+    }
+
+    /** Removes all the specified element from this collection. */
+    @Override
+    @Realtime(limit = N_SQUARE)
+    public boolean removeAll(final Collection<?> that) {
+        return service().removeAll(that);
+    }
+
+    /** Removes all the elements except those in the specified collection. */
+    @Override
+    @Realtime(limit = N_SQUARE)
+    public boolean retainAll(final Collection<?> that) {
+        return service().retainAll(that);
+    }
+
+    /** Returns an array holding this collection elements. */
+    @Override
+    @Realtime(limit = LINEAR)
+    public Object[] toArray() {
+        return service().toArray();
+    }
+
+    /** 
+     * Returns the specified array holding this collection elements if 
+     * enough capacity. 
+     */
+    @Override
+    @Realtime(limit = LINEAR)
+    public <T> T[] toArray(final T[] array) {
+        return service().toArray(array);
+    }
+
+    ////////////////////////////////////////////////////////////////////////////
+    // Misc.
+    //
+
+    /**
+     * Returns any non-null element of the specified type (convenience method).
+     * The search is performed concurrently if this collection is 
+     * {@link #parallel() parallel}.
+     * 
+     * @param type the element type searched for.
+     * @return {@code reduce(Reducers.any(type))}
+     * @see Reducers#any
+     */
+    @SuppressWarnings("unchecked")
+    @Realtime(limit = LINEAR)
+    public <T extends E> T any(Class<T> type) {
+        return (T) reduce((Reducer<E>) Reducers.any(type));
+    }
+
+    /**
+     * Returns the smallest element of this collection using this 
+     * collection {@link #comparator() comparator} (convenience method).
+     * Returns {@code null} if this collection is empty. 
+     * The search is performed concurrently if this collection is 
+     * {@link #parallel() parallel}.
+     * 
+     * @return {@code reduce(Reducers.min(comparator()))}
+     * @see Reducers#min
+     */
+    @Realtime(limit = LINEAR)
+    public E min() {
+        return reduce((Reducer<E>)Reducers.min(comparator())); // Cast only necessary on JDK 1.6 !
+    }
+
+    /**
+     * Returns the largest element of this collection using this 
+     * collection {@link #comparator() comparator} (convenience method). 
+     * Returns {@code null} if this collection is empty. 
+     * The search is performed concurrently if this collection is 
+     * {@link #parallel() parallel}.
+      * 
+     * @return {@code reduce(Reducers.max(comparator()))}
+     * @see Reducers#max
+     */
+    @Realtime(limit = LINEAR)
+    public E max() {
+        return reduce((Reducer<E>)Reducers.max(comparator())); // Cast only necessary on JDK 1.6 !
+    }
+
+    /**
+     * Returns this collection with the specified element added. 
+     * 
+     * @param elements the elements to be added.
+     * @return {@code this}
+     */
+    @Realtime(limit = LINEAR)
+    public FastCollection<E> addAll(E... elements) {
+        for (E e : elements) {
+            add(e);
+        }
+        return this;
+    }
+
+    /**
+     * Returns this collection with the specified collection's elements added
+     * in sequence. 
+     */
+    @Realtime(limit = LINEAR)
+    public FastCollection<E> addAll(FastCollection<? extends E> that) {
+        addAll((Collection<? extends E>) that);
+        return this;
+    }
+
+    /** 
+     * Returns the comparator uses by this collection for equality and/or 
+     * ordering if this collection is sorted.
+     */
+    @Realtime(limit = CONSTANT)
+    public Equality<? super E> comparator() {
+        return service().comparator();
+    }
+
+    /** 
+     * Returns an immutable reference over this collection. The immutable 
+     * value is an {@link #unmodifiable() unmodifiable} view of this collection.
+     * The caller must guarantees that the original collection is never going 
+     * to be updated (e.g. there is no reference left on the original collection).
+     */
+    @Realtime(limit = CONSTANT)
+    public <T extends Collection<E>> Immutable<T> toImmutable() {
+        return new Immutable<T>() {
+            @SuppressWarnings("unchecked")
+            final T value = (T) unmodifiable();
+
+            @Override
+            public T value() {
+                return value;
+            }
+        };
+    }
+
+    /**
+     * Compares the specified object with this collection for equality.
+     * This method follows the {@link Collection#equals(Object)} specification 
+     * if this collection {@link #comparator comparator} is 
+     * {@link Equalities#STANDARD} (default). Otherwise, only collections
+     * using the same comparator can be considered equals.  
+     * 
+     * @param obj the object to be compared for equality with this collection
+     * @return <code>true</code> if both collections are considered equals;
+     *        <code>false</code> otherwise. 
+     */
+    @Override
+    @Realtime(limit = LINEAR)
+    public boolean equals(Object obj) {
+        if(obj instanceof FastCollection) {
+            return service().equals(((FastCollection) obj).service());
+        } else {
+            return false;
+        }
+    }
+
+    /**
+     * Returns the hash code of this collection.
+     * This method follows the {@link Collection#hashCode()} specification 
+     * if this collection {@link #comparator comparator} is 
+     * {@link Equalities#STANDARD}.
+     *    
+     * @return this collection hash code. 
+     */
+    @Override
+    @Realtime(limit = LINEAR)
+    public int hashCode() {
+        return service().hashCode();
+    }
+
+    @Override
+    @Realtime(limit = LINEAR)
+    public String toString() {
+        StringBuilder builder = new StringBuilder();
+        builder.append("[");
+
+        Iterator<E> it = this.iterator();
+        while(it.hasNext()) {
+            builder.append(it.next().toString());
+            if(it.hasNext()) {
+                builder.append(",");
+            }
+        }
+        builder.append("]");
+        return builder.toString();
+    }
+
+    /**
+     * Returns the service implementation of this collection (for sub-classes).
+     */
+    protected abstract CollectionService<E> service();
+
+    /**
+     * Returns the service implementation of any fast collection 
+     * (for sub-classes).
+     */
+    protected static <E> CollectionService<E> serviceOf(
+            FastCollection<E> collection) {
+        return collection.service();
+    }
+
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/marmotta-commons/src/ext/java/javolution/util/FastMap.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-commons/src/ext/java/javolution/util/FastMap.java b/commons/marmotta-commons/src/ext/java/javolution/util/FastMap.java
new file mode 100644
index 0000000..528aa47
--- /dev/null
+++ b/commons/marmotta-commons/src/ext/java/javolution/util/FastMap.java
@@ -0,0 +1,402 @@
+/*
+ * 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.util;
+
+import javolution.lang.Immutable;
+import javolution.lang.Parallelizable;
+import javolution.lang.Realtime;
+import javolution.util.function.Consumer;
+import javolution.util.function.Equalities;
+import javolution.util.function.Equality;
+import javolution.util.internal.map.*;
+import javolution.util.service.CollectionService;
+import javolution.util.service.MapService;
+
+import java.io.Serializable;
+import java.util.ConcurrentModificationException;
+import java.util.Map;
+import java.util.concurrent.ConcurrentMap;
+
+import static javolution.lang.Realtime.Limit.CONSTANT;
+import static javolution.lang.Realtime.Limit.LINEAR;
+
+/**
+ * <p> A high-performance hash map with {@link Realtime real-time} behavior. 
+ *     Related to {@link FastCollection}, fast map supports various views.
+ * <ul>
+ *    <li>{@link #atomic} - Thread-safe view for which all reads are mutex-free 
+ *    and map updates (e.g. {@link #putAll putAll}) are atomic.</li>
+ *    <li>{@link #shared} - View allowing concurrent modifications.</li>
+ *    <li>{@link #parallel} - A view allowing parallel processing including {@link #update updates}.</li>
+ *    <li>{@link #sequential} - View disallowing parallel processing.</li>
+ *    <li>{@link #unmodifiable} - View which does not allow any modifications.</li>
+ *    <li>{@link #entrySet} - {@link FastSet} view over the map entries allowing 
+ *                            entries to be added/removed.</li>
+ *    <li>{@link #keySet} - {@link FastSet} view over the map keys allowing keys 
+ *                           to be added (map entry with {@code null} value).</li>
+ *    <li>{@link #values} - {@link FastCollection} view over the map values (add not supported).</li>
+ * </ul>      
+ * <p> The iteration order over the map keys, values or entries is deterministic 
+ *     (unlike {@link java.util.HashMap}). It is either the insertion order (default) 
+ *     or the key order for the {@link FastSortedMap} subclass. 
+ *     This class permits {@code null} keys.</p> 
+ *     
+ * <p> Fast maps can advantageously replace any of the standard <code>java.util</code> maps.</p> 
+ * [code]
+ * FastMap<Foo, Bar> hashMap = new FastMap<Foo, Bar>(); 
+ * FastMap<Foo, Bar> concurrentHashMap = new FastMap<Foo, Bar>().shared(); // FastMap implements ConcurrentMap interface.
+ * FastMap<Foo, Bar> linkedHashMap = new FastMap<Foo, Bar>(); // Deterministic iteration order (insertion order).
+ * FastMap<Foo, Bar> treeMap = new FastSortedMap<Foo, Bar>(); 
+ * FastMap<Foo, Bar> concurrentSkipListMap = new FastSortedMap<Foo, Bar>().shared();
+ * FastMap<Foo, Bar> identityHashMap = new FastMap<Foo, Bar>(Equalities.IDENTITY);[/code]</p>
+ * <p> and adds more ... 
+ * [code]
+ * FastMap<Foo, Bar> atomicMap = new FastMap<Foo, Bar>().atomic(); // Mutex-free access,  all updates (e.g. putAll) atomics (unlike ConcurrentHashMap).
+ * FastMap<Foo, Bar> atomicTree = new FastSortedMap<Foo, Bar>().atomic(); // Mutex-free access,  all updates (e.g. putAll) atomics.
+ * FastMap<Foo, Bar> parallelMap = new FastMap<Foo, Bar>().parallel(); // Map actions (perform/update) performed concurrently.
+ * FastMap<Foo, Bar> linkedConcurrentHashMap = new FastMap<Foo, Bar>().shared(); // No equivalent in java.util !
+ * FastMap<String, Bar> lexicalHashMap = new FastMap<String, Bar>(Equalities.LEXICAL);  // Allows for value retrieval using any CharSequence key.
+ * FastMap<String, Bar> fastStringHashMap = new FastMap<String, Bar>(Equalities.LEXICAL_FAST);  // Same with faster hashcode calculations.
+ * ...[/code]</p>
+ *  
+ *  <p> Of course all views (entry, key, values) over a fast map are fast collections 
+ *      and allow parallel processing.
+ * [code]
+ * Consumer<Collection<String>> removeNull = new Consumer<Collection<String>>() {  
+ *     public void accept(Collection<String> view) {
+ *         Iterator<String> it = view.iterator();
+ *         while (it.hasNext()) {
+ *             if (it.next() == null) it.remove();
+ *         }
+ *     }
+ * };
+ * FastMap<Person, String> names = ...
+ * names.values().update(removeNull); // Remove all entries with null values.
+ * names.atomic().values().update(removeNull); // Same but performed atomically.
+ * names.parallel().values().update(removeNull); // Same but performed in parallel.
+ * [/code]</p> 
+ *             
+ * @author <a href="mailto:jean-marie@dautelle.com">Jean-Marie Dautelle </a>
+ * @version 6.0, July 21, 2013
+ */
+@Realtime
+public class FastMap<K, V> implements Map<K, V>, ConcurrentMap<K, V>,
+        Serializable {
+
+    private static final long serialVersionUID = 0x600L; // Version.
+
+    /**
+     * Holds the actual map service implementation.
+     */
+    private final MapService<K, V> service;
+
+    /**
+     * Creates an empty fast map.
+     */
+    public FastMap() {
+        this(Equalities.STANDARD);
+    }
+
+    /**
+     * Creates an empty fast map using the specified comparator for keys 
+     * equality.
+     */
+    public FastMap(Equality<? super K> keyEquality) {
+        this(keyEquality, Equalities.STANDARD);
+    }
+
+    /**
+     * Creates an empty fast map using the specified comparators for keys 
+     * equality and values equality.
+     */
+    public FastMap(Equality<? super K> keyEquality,
+            Equality<? super V> valueEquality) {
+        service = new FastMapImpl<K, V>(keyEquality, valueEquality);
+    }
+
+    /**
+     * Creates a map backed up by the specified service implementation.
+     */
+    protected FastMap(MapService<K, V> service) {
+        this.service = service;
+    }
+
+    ////////////////////////////////////////////////////////////////////////////
+    // Views.
+    //
+
+    /**
+     * Returns an atomic view over this map. All operations that write 
+     * or access multiple elements in the map (such as putAll(), 
+     * keySet().retainAll(), ...) are atomic. 
+     * Iterators on atomic collections are <b>thread-safe</b> 
+     * (no {@link ConcurrentModificationException} possible).
+     */
+    @Parallelizable(mutexFree = true, comment = "Except for write operations, all read operations are mutex-free.")
+    public FastMap<K, V> atomic() {
+        return new FastMap<K, V>(new AtomicMapImpl<K, V>(service));
+    }
+
+    /**
+     * Returns a thread-safe view over this map. The shared view
+     * allows for concurrent read as long as there is no writer. 
+     * The default implementation is based on <a href=
+     * "http://en.wikipedia.org/wiki/Readers%E2%80%93writer_lock">
+     * readers-writers locks</a> giving priority to writers. 
+     * Iterators on shared collections are <b>thread-safe</b> 
+     * (no {@link ConcurrentModificationException} possible).
+     */
+    @Parallelizable(mutexFree = false, comment = "Use multiple-readers/single-writer lock.")
+    public FastMap<K, V> shared() {
+        return new FastMap<K, V>(new SharedMapImpl<K, V>(service));
+    }
+
+    /** 
+     * Returns a sequential view of this collection. Using this view, 
+     * all closure-based iterations are performed sequentially.
+     */
+    public FastMap<K, V> sequential() {
+        return new FastMap<K, V>(new SequentialMapImpl<K, V>(service));
+    }
+
+    /**
+     * Returns an unmodifiable view over this map. Any attempt to 
+     * modify the map through this view will result into 
+     * a {@link java.lang.UnsupportedOperationException} being raised.
+     */
+    public FastMap<K, V> unmodifiable() {
+        return new FastMap<K, V>(new UnmodifiableMapImpl<K, V>(service));
+    }
+
+    /**
+     * Returns a set view of the keys contained in this map.
+     * The set is backed by the map, so changes to the map are
+     * reflected in the set, and vice-versa.  The set supports 
+     * adding new keys for which the corresponding entry value 
+     * is always {@code null}.
+     */
+    public FastSet<K> keySet() {
+        return new FastSet<K>(service.keySet());
+    }
+
+    /**
+     * Returns a collection view of the values contained in this map.
+     * The collection is backed by the map, so changes to the map are
+     * reflected in the collection, and vice-versa. The collection
+     * supports removing values (hence entries) but not adding new values. 
+     */
+    public FastCollection<V> values() {
+        return new FastCollection<V>() {
+            private static final long serialVersionUID = 0x600L; // Version.
+            private final CollectionService<V> serviceValues = service.values();
+
+            @Override
+            protected CollectionService<V> service() {
+                return serviceValues;
+            }
+        };
+    }
+
+    /**
+     * Returns a set view of the mappings contained in 
+     * this map. The set is backed by the map, so changes to the map are
+     * reflected in the set, and vice-versa. The set 
+     * support adding/removing entries. As far as the set is concerned,
+     * two entries are considered equals if they have the same keys regardless
+     * of their values. 
+     */
+    public FastSet<Entry<K, V>> entrySet() {
+        return new FastSet<Entry<K, V>>(service.entrySet());
+    }
+
+    ////////////////////////////////////////////////////////////////////////////
+    // Closures operations.
+    //
+
+    /** 
+     * Executes the specified read-only action on this map.
+     * That logic may be performed concurrently on sub-maps 
+     * if this map is {@link #parallel() parallel}.
+     *    
+     * @param action the read-only action.
+     * @throws UnsupportedOperationException if the action tries to update 
+     *         this map.
+     * @throws ClassCastException if the action type is not compatible with 
+     *         this map (e.g. action on sorted map and this is a hash map). 
+     * @see #update(Consumer)
+     */
+    @Realtime(limit = LINEAR)
+    @SuppressWarnings("unchecked")
+    public void perform(Consumer<? extends Map<K, V>> action) {
+        service().perform((Consumer<MapService<K, V>>) action, service());
+    }
+
+    /** 
+     * Executes the specified update action on this map. 
+     * That logic may be performed concurrently on sub-maps
+     * if this map is {@link #parallel() parallel}.
+     * For {@link #atomic() atomic} maps the update is atomic (either concurrent 
+     * readers see the full result of the action or nothing).
+     *    
+     * @param action the update action.
+     * @throws ClassCastException if the action type is not compatible with 
+     *         this map (e.g. action on sorted map and this is a hash map). 
+     * @see #perform(Consumer)
+     */
+    @Realtime(limit = LINEAR)
+    @SuppressWarnings("unchecked")
+    public void update(Consumer<? extends Map<K, V>> action) {
+        service().update((Consumer<MapService<K, V>>) action, service());
+    }
+
+    ////////////////////////////////////////////////////////////////////////////
+    // Map Interface.
+    //
+
+    /** Returns the number of entries/keys/values in this map. */
+    @Override
+    @Realtime(limit = CONSTANT)
+    public int size() {
+        return service.size();
+    }
+
+    /** Indicates if this map is empty */
+    @Override
+    @Realtime(limit = CONSTANT)
+    public boolean isEmpty() {
+        return service.isEmpty();
+    }
+
+    /** Indicates if this map contains the specified key. */
+    @Override
+    @Realtime(limit = CONSTANT)
+    public boolean containsKey(Object key) {
+        return service.containsKey(key);
+    }
+
+    /** Indicates if this map contains the specified value. */
+    @Override
+    @Realtime(limit = LINEAR)
+    public boolean containsValue(Object value) {
+        return service.containsValue(value);
+    }
+
+    /** Returns the value for the specified key. */
+    @Override
+    @Realtime(limit = CONSTANT)
+    public V get(Object key) {
+        return service.get(key);
+    }
+
+    /** Associates the specified value with the specified key. */
+    @Override
+    @Realtime(limit = CONSTANT)
+    public V put(K key, V value) {
+        return service.put(key, value);
+    }
+
+    /** Adds the specified map entries to this map. */
+    @Override
+    @Realtime(limit = LINEAR)
+    public void putAll(Map<? extends K, ? extends V> map) {
+        service.putAll(map);
+    }
+
+    /** Removes the entry for the specified key. */
+    @Override
+    @Realtime(limit = CONSTANT)
+    public V remove(Object key) {
+        return service.remove(key);
+    }
+
+    /** Removes all this map's entries. */
+    @Override
+    @Realtime(limit = CONSTANT)
+    public void clear() {
+        service.clear();
+    }
+
+    ////////////////////////////////////////////////////////////////////////////
+    // ConcurrentMap Interface.
+    //
+
+    /** Associates the specified value with the specified key only if the 
+     * specified key has no current mapping. */
+    @Override
+    @Realtime(limit = CONSTANT)
+    public V putIfAbsent(K key, V value) {
+        return service.putIfAbsent(key, value);
+    }
+
+    /** Removes the entry for a key only if currently mapped to a given value. */
+    @Override
+    @Realtime(limit = CONSTANT)
+    public boolean remove(Object key, Object value) {
+        return service.remove(key, value);
+    }
+
+    /** Replaces the entry for a key only if currently mapped to a given value. */
+    @Override
+    @Realtime(limit = CONSTANT)
+    public boolean replace(K key, V oldValue, V newValue) {
+        return service.replace(key, oldValue, newValue);
+    }
+
+    /** Replaces the entry for a key only if currently mapped to some value. */
+    @Override
+    @Realtime(limit = CONSTANT)
+    public V replace(K key, V value) {
+        return service.replace(key, value);
+    }
+
+    ////////////////////////////////////////////////////////////////////////////
+    // Misc.
+    //
+
+    /**
+     * Returns this map with the specified map's entries added.
+     */
+    public FastMap<K, V> putAll(FastMap<? extends K, ? extends V> that) {
+        putAll((Map<? extends K, ? extends V>) that);
+        return this;
+    }
+
+    /** 
+     * Returns an immutable reference over this map. The immutable 
+     * value is an {@link #unmodifiable() unmodifiable} view of this map
+     * for which the caller guarantees that no change will ever be made 
+     * (e.g. there is no reference left to the original map).
+     */
+    public <T extends Map<K, V>> Immutable<T> toImmutable() {
+        return new Immutable<T>() {
+            @SuppressWarnings("unchecked")
+            final T value = (T) unmodifiable();
+
+            @Override
+            public T value() {
+                return value;
+            }
+        };
+    }
+
+    /** Returns the string representation of this map entries. */
+    @Override
+    @Realtime(limit = LINEAR)
+    public String toString() {
+        return entrySet().toString();
+    }
+
+    /**
+      * Returns this map service implementation.
+      */
+    protected MapService<K, V> service() {
+        return service;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/marmotta-commons/src/ext/java/javolution/util/FastSet.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-commons/src/ext/java/javolution/util/FastSet.java b/commons/marmotta-commons/src/ext/java/javolution/util/FastSet.java
new file mode 100644
index 0000000..c5283c5
--- /dev/null
+++ b/commons/marmotta-commons/src/ext/java/javolution/util/FastSet.java
@@ -0,0 +1,146 @@
+/*
+ * 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.util;
+
+import javolution.lang.Realtime;
+import javolution.util.function.Equalities;
+import javolution.util.function.Equality;
+import javolution.util.function.Predicate;
+import javolution.util.internal.map.FastMapImpl;
+import javolution.util.internal.set.AtomicSetImpl;
+import javolution.util.internal.set.FilteredSetImpl;
+import javolution.util.internal.set.SharedSetImpl;
+import javolution.util.internal.set.UnmodifiableSetImpl;
+import javolution.util.service.SetService;
+
+import java.util.Set;
+
+import static javolution.lang.Realtime.Limit.CONSTANT;
+
+/**
+ * <p> A high-performance hash set with {@link Realtime real-time} behavior.</p>
+ *     
+ * <p> The iteration order over the set elements is deterministic 
+ *     (unlike {@link java.util.HashSet}).It is either the insertion order (default) 
+ *     or the key order for the {@link FastSortedSet} subclass.
+ *     This class permits {@code null} elements.</p>
+ *      
+ * @author  <a href="mailto:jean-marie@dautelle.com">Jean-Marie Dautelle</a>
+ * @version 6.0, July 21, 2013
+ */
+public class FastSet<E> extends FastCollection<E> implements Set<E> {
+
+    private static final long serialVersionUID = 0x600L; // Version.
+
+    /**
+     * Holds the actual service implementation.
+     */
+    private final SetService<E> service;
+
+    /**
+     * Creates an empty set backed up by a {@link FastMap} and having  
+     * the same real-time characteristics.
+     */
+    public FastSet() {
+        this(Equalities.STANDARD);
+    }
+
+    /**
+     * Creates an empty set backed up by a {@link FastMap} and using the 
+     * specified comparator for key equality.
+    */
+    public FastSet(Equality<? super E> comparator) {
+        service = new FastMapImpl<E, Void>(comparator, Equalities.IDENTITY)
+                .keySet();
+    }
+
+    /**
+      * Creates a fast set backed up by the specified service implementation.
+      */
+    protected FastSet(SetService<E> service) {
+        this.service = service;
+    }
+
+    ////////////////////////////////////////////////////////////////////////////
+    // Views.
+    //
+
+    @Override
+    public FastSet<E> atomic() {
+        return new FastSet<E>(new AtomicSetImpl<E>(service()));
+    }
+
+    @Override
+    public FastSet<E> filtered(final Predicate<? super E> filter) {
+        return new FastSet<E>(new FilteredSetImpl<E>(service(), filter));
+    }
+
+    @Override
+    public FastSet<E> shared() {
+        return new FastSet<E>(new SharedSetImpl<E>(service()));
+    }
+
+    @Override
+    public FastSet<E> unmodifiable() {
+        return new FastSet<E>(new UnmodifiableSetImpl<E>(service()));
+    }
+
+    ////////////////////////////////////////////////////////////////////////////
+    // Set operations new annotations.
+    //
+
+    @Override
+    @Realtime(limit = CONSTANT)
+    public boolean isEmpty() {
+        return size() == 0;
+    }
+
+    @Override
+    @Realtime(limit = CONSTANT)
+    public int size() {
+        return service.size();
+    }
+
+    @Override
+    @Realtime(limit = CONSTANT)
+    public void clear() {
+        service.clear();
+    }
+
+    @Override
+    @Realtime(limit = CONSTANT)
+    public boolean contains(Object obj) {
+        return service.contains(obj);
+    }
+
+    @Override
+    @Realtime(limit = CONSTANT)
+    public boolean remove(Object obj) {
+        return service.remove(obj);
+    }
+
+    ////////////////////////////////////////////////////////////////////////////
+    // Misc.
+    //
+
+    @Override
+    public FastSet<E> addAll(E... elements) {
+        return (FastSet<E>) super.addAll(elements);
+    }
+
+    @Override
+    public FastSet<E> addAll(FastCollection<? extends E> that) {
+        return (FastSet<E>) super.addAll(that);
+    }
+
+    @Override
+    protected SetService<E> service() {
+        return service;
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/marmotta-commons/src/ext/java/javolution/util/FastSortedMap.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-commons/src/ext/java/javolution/util/FastSortedMap.java b/commons/marmotta-commons/src/ext/java/javolution/util/FastSortedMap.java
new file mode 100644
index 0000000..7623f78
--- /dev/null
+++ b/commons/marmotta-commons/src/ext/java/javolution/util/FastSortedMap.java
@@ -0,0 +1,205 @@
+/*
+ * 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.util;
+
+import javolution.lang.Realtime;
+import javolution.util.function.Equalities;
+import javolution.util.function.Equality;
+import javolution.util.internal.map.sorted.AtomicSortedMapImpl;
+import javolution.util.internal.map.sorted.FastSortedMapImpl;
+import javolution.util.internal.map.sorted.SharedSortedMapImpl;
+import javolution.util.internal.map.sorted.UnmodifiableSortedMapImpl;
+import javolution.util.service.SortedMapService;
+
+import java.util.Comparator;
+import java.util.SortedMap;
+
+import static javolution.lang.Realtime.Limit.LOG_N;
+
+/**
+ * <p> A high-performance sorted map with {@link Realtime real-time} behavior.</p>
+ *     
+ * <p> This map provides a total ordering based on the keys natural order or 
+ *     using custom {@link #FastSortedMap(Equality) comparators}.</p>
+ *        
+ * @author  <a href="mailto:jean-marie@dautelle.com">Jean-Marie Dautelle</a>
+ * @version 6.0, July 21, 2013
+ */
+public class FastSortedMap<K, V> extends FastMap<K, V> implements
+        SortedMap<K, V> {
+
+    private static final long serialVersionUID = 0x600L; // Version.
+
+    /**
+     * Creates an empty sorted map ordered on keys natural order.
+     */
+    public FastSortedMap() {
+        this(Equalities.STANDARD);
+    }
+
+    /**
+      * Creates an empty sorted map ordered using the specified comparator 
+      * for order.
+    */
+    public FastSortedMap(Equality<? super K> keyComparator) {
+        this(keyComparator, Equalities.STANDARD);
+    }
+
+    /**
+      * Creates an empty sorted map ordered using the specified key comparator 
+      * for order and value comparator for values equality.
+    */
+    public FastSortedMap(Equality<? super K> keyComparator,
+            Equality<? super V> valueComparator) {
+        super(new FastSortedMapImpl<K, V>(keyComparator, valueComparator));
+    }
+
+    /**
+     * Creates a sorted map backed up by the specified service implementation.
+     */
+    protected FastSortedMap(SortedMapService<K, V> service) {
+        super(service);
+    }
+
+    ////////////////////////////////////////////////////////////////////////////
+    // Views.
+    //
+
+    @Override
+    public FastSortedMap<K, V> atomic() {
+        return new FastSortedMap<K, V>(new AtomicSortedMapImpl<K, V>(service()));
+    }
+
+    @Override
+    public FastSortedMap<K, V> shared() {
+        return new FastSortedMap<K, V>(new SharedSortedMapImpl<K, V>(service()));
+    }
+
+    @Override
+    public FastSortedMap<K, V> unmodifiable() {
+        return new FastSortedMap<K, V>(new UnmodifiableSortedMapImpl<K, V>(
+                service()));
+    }
+
+    @Override
+    public FastSortedSet<Entry<K, V>> entrySet() {
+        return new FastSortedSet<Entry<K, V>>(service().entrySet());
+    }
+
+    @Override
+    public FastSortedSet<K> keySet() {
+        return new FastSortedSet<K>(service().keySet());
+    }
+
+    /** Returns a view of the portion of this map whose keys range from fromKey, inclusive, to toKey, exclusive. */
+    @Override
+    public FastSortedMap<K, V> subMap(K fromKey, K toKey) {
+        return new FastSortedMap<K, V>(service().subMap(fromKey, toKey));
+    }
+
+    /** Returns a view of the portion of this map whose keys are strictly less than toKey. */
+    @Override
+    public FastSortedMap<K, V> headMap(K toKey) {
+        return new FastSortedMap<K, V>(service().subMap(firstKey(), toKey));
+    }
+
+    /** Returns a view of the portion of this map whose keys are greater than or equal to fromKey. */
+    @Override
+    public FastSortedMap<K, V> tailMap(K fromKey) {
+        return new FastSortedMap<K, V>(service().subMap(fromKey, lastKey()));
+    }
+
+    ////////////////////////////////////////////////////////////////////////////
+    // Change in time limit behavior.
+    //
+
+    @Override
+    @Realtime(limit = LOG_N)
+    public boolean containsKey(Object key) {
+        return super.containsKey(key);
+    }
+
+    @Override
+    @Realtime(limit = LOG_N)
+    public V get(Object key) {
+        return super.get(key);
+    }
+
+    @Override
+    @Realtime(limit = LOG_N)
+    public V put(K key, V value) {
+        return super.put(key, value);
+    }
+
+    @Override
+    @Realtime(limit = LOG_N)
+    public V remove(Object key) {
+        return super.remove(key);
+    }
+
+    @Override
+    @Realtime(limit = LOG_N)
+    public V putIfAbsent(K key, V value) {
+        return super.putIfAbsent(key, value);
+    }
+
+    @Override
+    @Realtime(limit = LOG_N)
+    public boolean remove(Object key, Object value) {
+        return super.remove(key, value);
+    }
+
+    @Override
+    @Realtime(limit = LOG_N)
+    public boolean replace(K key, V oldValue, V newValue) {
+        return super.replace(key, oldValue, newValue);
+    }
+
+    @Override
+    @Realtime(limit = LOG_N)
+    public V replace(K key, V value) {
+        return super.replace(key, value);
+    }
+
+    ////////////////////////////////////////////////////////////////////////////
+    // SortedMap Interface.
+    //
+
+    /** Returns the first (lowest) key currently in this map. */
+    @Override
+    public K firstKey() {
+        return service().firstKey();
+    }
+
+    /** Returns the last (highest) key currently in this map. */
+    @Override
+    public K lastKey() {
+        return service().lastKey();
+    }
+
+    /** Returns the comparator used to order the keys in this map (never null). */
+    @Override
+    public Comparator<? super K> comparator() {
+        return keySet().comparator();
+    }
+
+    ////////////////////////////////////////////////////////////////////////////
+    // Misc.
+    //
+
+    @Override
+    public FastSortedMap<K, V> putAll(FastMap<? extends K, ? extends V> that) {
+        return (FastSortedMap<K, V>) super.putAll(that);
+    }
+
+    @Override
+    protected SortedMapService<K, V> service() {
+        return (SortedMapService<K, V>) super.service();
+    }
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/marmotta-commons/src/ext/java/javolution/util/FastSortedSet.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-commons/src/ext/java/javolution/util/FastSortedSet.java b/commons/marmotta-commons/src/ext/java/javolution/util/FastSortedSet.java
new file mode 100644
index 0000000..8559070
--- /dev/null
+++ b/commons/marmotta-commons/src/ext/java/javolution/util/FastSortedSet.java
@@ -0,0 +1,153 @@
+/*
+ * 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.util;
+
+import javolution.lang.Realtime;
+import javolution.util.function.Equalities;
+import javolution.util.function.Equality;
+import javolution.util.internal.map.sorted.FastSortedMapImpl;
+import javolution.util.internal.set.sorted.AtomicSortedSetImpl;
+import javolution.util.internal.set.sorted.SharedSortedSetImpl;
+import javolution.util.internal.set.sorted.UnmodifiableSortedSetImpl;
+import javolution.util.service.SortedSetService;
+
+import java.util.SortedSet;
+
+import static javolution.lang.Realtime.Limit.LOG_N;
+
+/**
+ * <p> A high-performance sorted set with {@link Realtime real-time} behavior.</p>
+ *     
+ * @author  <a href="mailto:jean-marie@dautelle.com">Jean-Marie Dautelle</a>
+ * @version 6.0, July 21, 2013
+ */
+public class FastSortedSet<E> extends FastSet<E> implements SortedSet<E> {
+
+    private static final long serialVersionUID = 0x600L; // Version.
+
+    /**
+     * Creates an empty sorted set ordered on elements natural order.
+     */
+    public FastSortedSet() {
+        this(Equalities.STANDARD);
+    }
+
+    /**
+    * Creates an empty sorted set ordered using the specified comparator.
+    */
+    public FastSortedSet(Equality<? super E> comparator) {
+        super(new FastSortedMapImpl<E, Void>(comparator, Equalities.IDENTITY)
+                .keySet());
+    }
+
+    /**
+     * Creates a sorted set backed up by the specified service implementation.
+     */
+    protected FastSortedSet(SortedSetService<E> service) {
+        super(service);
+    }
+
+    ////////////////////////////////////////////////////////////////////////////
+    // Views.
+    //
+
+    @Override
+    public FastSortedSet<E> atomic() {
+        return new FastSortedSet<E>(new AtomicSortedSetImpl<E>(service()));
+    }
+
+    @Override
+    public FastSortedSet<E> shared() {
+        return new FastSortedSet<E>(new SharedSortedSetImpl<E>(service()));
+    }
+
+    @Override
+    public FastSortedSet<E> unmodifiable() {
+        return new FastSortedSet<E>(new UnmodifiableSortedSetImpl<E>(service()));
+    }
+
+    ////////////////////////////////////////////////////////////////////////////
+    // Change in time limit behavior.
+    //
+
+    @Override
+    @Realtime(limit = LOG_N)
+    public boolean add(E e) {
+        return super.add(e);
+    }
+
+    @Override
+    @Realtime(limit = LOG_N)
+    public boolean contains(Object obj) {
+        return super.contains(obj);
+    }
+
+    @Override
+    @Realtime(limit = LOG_N)
+    public boolean remove(Object obj) {
+        return super.remove(obj);
+    }
+
+    ////////////////////////////////////////////////////////////////////////////
+    // SortedSet Interface.
+    //
+
+    /** Returns a view of the portion of this set whose elements range from fromElement, inclusive, to toElement, exclusive. */
+    @Override
+    @Realtime(limit = LOG_N)
+    public FastSortedSet<E> subSet(E fromElement, E toElement) {
+        return new FastSortedSet<E>(service().subSet(fromElement, toElement));
+    }
+
+    /** Returns a view of the portion of this set whose elements are strictly less than toElement. */
+    @Override
+    @Realtime(limit = LOG_N)
+    public FastSortedSet<E> headSet(E toElement) {
+        return subSet(first(), toElement);
+    }
+
+    /** Returns a view of the portion of this set whose elements are greater than or equal to fromElement. */
+    @Override
+    @Realtime(limit = LOG_N)
+    public FastSortedSet<E> tailSet(E fromElement) {
+        return subSet(fromElement, last());
+    }
+
+    /** Returns the first (lowest) element currently in this set. */
+    @Override
+    public E first() {
+        return service().first();
+    }
+
+    /** Returns the last (highest) element currently in this set. */
+    @Override
+    public E last() {
+        return service().last();
+    }
+
+    ////////////////////////////////////////////////////////////////////////////
+    // Misc.
+    //
+
+    @Override
+    public FastSortedSet<E> addAll(E... elements) {
+        return (FastSortedSet<E>) super.addAll(elements);
+    }
+
+    @Override
+    public FastSortedSet<E> addAll(FastCollection<? extends E> that) {
+        return (FastSortedSet<E>) super.addAll(that);
+    }
+
+    @Override
+    protected SortedSetService<E> service() {
+        return (SortedSetService<E>) super.service();
+    }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/marmotta-commons/src/ext/java/javolution/util/FastSortedTable.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-commons/src/ext/java/javolution/util/FastSortedTable.java b/commons/marmotta-commons/src/ext/java/javolution/util/FastSortedTable.java
new file mode 100644
index 0000000..1b90692
--- /dev/null
+++ b/commons/marmotta-commons/src/ext/java/javolution/util/FastSortedTable.java
@@ -0,0 +1,138 @@
+/*
+ * 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.util;
+
+import javolution.lang.Realtime;
+import javolution.util.function.Equalities;
+import javolution.util.function.Equality;
+import javolution.util.internal.table.sorted.AtomicSortedTableImpl;
+import javolution.util.internal.table.sorted.FastSortedTableImpl;
+import javolution.util.internal.table.sorted.SharedSortedTableImpl;
+import javolution.util.internal.table.sorted.UnmodifiableSortedTableImpl;
+import javolution.util.service.SortedTableService;
+
+import static javolution.lang.Realtime.Limit.LOG_N;
+
+/**
+ * <p> A high-performance sorted table with {@link Realtime real-time} behavior.
+ *      Sorted table have significantly faster {@link #contains}, 
+ *     {@link #indexOf} and {@link #remove} methods).</p>
+ *     
+ * <p>This class is comparable to {@link FastSortedSet} in performance, 
+ *    but it allows for duplicate and implements the {@link java.util.List}
+ *    interface.</p>
+ *     
+ * @author  <a href="mailto:jean-marie@dautelle.com">Jean-Marie Dautelle</a>
+ * @version 6.0, July 21, 2013
+ */
+public class FastSortedTable<E> extends FastTable<E> {
+
+    private static final long serialVersionUID = 0x600L; // Version.
+
+    /**
+      * Creates an empty table sorted using its elements natural order.     
+     */
+    public FastSortedTable() {
+        this(Equalities.STANDARD);
+    }
+
+    /**
+     * Creates an empty table sorted using the specified element comparator.
+     */
+    public FastSortedTable(Equality<? super E> comparator) {
+        super(new FastSortedTableImpl<E>(comparator));
+    }
+
+    /**
+     * Creates a sorted table backed up by the specified service implementation.
+     */
+    protected FastSortedTable(SortedTableService<E> service) {
+        super(service);
+    }
+
+    ////////////////////////////////////////////////////////////////////////////
+    // Views.
+    //
+
+    @Override
+    public FastSortedTable<E> atomic() {
+        return new FastSortedTable<E>(new AtomicSortedTableImpl<E>(service()));
+    }
+
+    @Override
+    public FastSortedTable<E> shared() {
+        return new FastSortedTable<E>(new SharedSortedTableImpl<E>(service()));
+    }
+
+    @Override
+    public FastSortedTable<E> unmodifiable() {
+        return new FastSortedTable<E>(new UnmodifiableSortedTableImpl<E>(
+                service()));
+    }
+
+    ////////////////////////////////////////////////////////////////////////////
+    // Change in time limit behavior.
+    //
+
+    @Realtime(limit = LOG_N)
+    public boolean contains(Object obj) {
+        return service().contains(obj);
+    }
+
+    @Realtime(limit = LOG_N)
+    public boolean remove(Object obj) {
+        return service().remove(obj);
+    }
+
+    @Override
+    @Realtime(limit = LOG_N)
+    public int indexOf(final Object obj) {
+        return service().indexOf(obj);
+    }
+
+    ////////////////////////////////////////////////////////////////////////////
+    // Misc.
+    //
+
+    /** 
+     * Adds the specified element only if not already present.
+     *  
+     * @return {@code true} if the element has been added; 
+     *         {@code false} otherwise.
+     */
+    @Realtime(limit = LOG_N)
+    public boolean addIfAbsent(E element) {
+        return service().addIfAbsent(element);
+    }
+
+    /** 
+     * Returns what would be the index of the specified element if it were
+     * to be added or the index of the specified element if already present.
+     */
+    @Realtime(limit = LOG_N)
+    public int positionOf(E element) {
+        return service().positionOf(element);
+    }
+
+    @Override
+    public FastSortedTable<E> addAll(E... elements) {
+        return (FastSortedTable<E>) super.addAll(elements);
+    }
+
+    @Override
+    public FastSortedTable<E> addAll(FastCollection<? extends E> that) {
+        return (FastSortedTable<E>) super.addAll(that);
+    }
+
+    @Override
+    protected SortedTableService<E> service() {
+        return (SortedTableService<E>) super.service();
+    }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/marmotta-commons/src/ext/java/javolution/util/FastTable.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-commons/src/ext/java/javolution/util/FastTable.java b/commons/marmotta-commons/src/ext/java/javolution/util/FastTable.java
new file mode 100644
index 0000000..40c171a
--- /dev/null
+++ b/commons/marmotta-commons/src/ext/java/javolution/util/FastTable.java
@@ -0,0 +1,438 @@
+/*
+ * 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.util;
+
+import javolution.lang.Realtime;
+import javolution.util.function.Consumer;
+import javolution.util.function.Equalities;
+import javolution.util.function.Equality;
+import javolution.util.internal.table.*;
+import javolution.util.service.TableService;
+
+import java.util.*;
+
+import static javolution.lang.Realtime.Limit.*;
+
+/**
+ * <p> A high-performance table (fractal-based) with {@link Realtime real-time}
+ *      behavior.</p>
+ *     
+ * <p> The fractal-based implementation ensures that add/insertion/deletion operations 
+ *     <b>worst</b> execution time is always in less than <i><b>O(log(size))</b></i>. 
+ *     For comparison {@code ArrayList.add} is in <i><b>O(size)</b></i> due to resize. </p>
+ *     
+ *     <a href="doc-files/FastTable-WCET.png">
+ *     <img src="doc-files/FastTable-WCET.png" alt="Worst Case Execution Time" height="210" width="306" />
+ *     </a>
+ *     
+ * <p> Instances of this class can advantageously replace {@link java.util.ArrayList ArrayList},
+ *     {@link java.util.LinkedList LinkedList} or {@link java.util.ArrayDeque ArrayDeque}
+ *     in terms of adaptability, space or performance.
+ *     Fast tables can be concurrently iterated / modified using their {@link #shared() shared}/{@link #atomic() atomic} 
+ *     views. They inherit all the fast collection views and support the {@link #subTable subTable} view over a portion of the table.
+ * [code]
+ * FastTable<String> names = new FastTable<String>().addAll("John Deuff", "Otto Graf", "Sim Kamil");
+ * names.sort(Equalities.LEXICAL_CASE_INSENSITIVE); // Sorts the names in place (different from sorted() which returns a sorted view).
+ * names.subTable(0, names.size() / 2).clear(); // Removes the first half of the table (see java.util.List.subList specification).
+ * names.filtered(str -> str.startsWith("A")).clear(); // Removes all the names starting with "A" (Java 8 notation).
+ * names.filtered(str -> str.startsWith("A")).parallel().clear(); // Same as above but performed concurrently.
+ * [/code]</p>
+ *
+ * <p> As for any {@link FastCollection fast collection}, iterations can be 
+ *     performed using closures.
+ * [code]
+ * FastTable<Person> persons = ...
+ * Person findWithName(final String name) { 
+ *     return persons.filtered(new Predicate<Person>() { 
+ *         public boolean test(Person person) {
+ *             return (person.getName().equals(name));
+ *         }
+ *     }).any(Person.class);
+ * }[/code]</p>
+ * 
+ * <p>  The notation is shorter with Java 8.
+ * [code]
+ * Person findWithName(String name) {
+ *     return persons.filtered(person -> person.getName().equals(name)).any(Person.class);
+ * }[/code]</p>
+ * 
+ *  <p> FastTable iteration order is the {@link #add insertion} order; specialization may 
+ *      have a different order, for example the iteration order of {@link FastSortedTable} 
+ *      is based on the table sorting order.</p> 
+ *
+ * @author <a href="mailto:jean-marie@dautelle.com">Jean-Marie Dautelle</a>
+ * @version 6.0, July 21, 2013
+ */
+public class FastTable<E> extends FastCollection<E> implements List<E>,
+        Deque<E>, RandomAccess {
+
+    private static final long serialVersionUID = 0x600L; // Version.
+
+    /**
+     * Holds the actual service implementation.
+     */
+    private final TableService<E> service;
+
+    /**
+     * Creates an empty table whose capacity increments/decrements smoothly
+     * without large resize operations to best fit the table current size.
+     */
+    public FastTable() {
+        this(Equalities.STANDARD);
+    }
+
+    /**
+     * Creates an empty table using the specified comparator for element 
+     * equality.
+    */
+    public FastTable(Equality<? super E> comparator) {
+        service = new FastTableImpl<E>(comparator);
+    }
+
+    /**
+     * Creates a fast table backed up by the specified service implementation.
+     */
+    protected FastTable(TableService<E> service) {
+        this.service = service;
+    }
+
+    ////////////////////////////////////////////////////////////////////////////
+    // Views.
+    //
+
+    @Override
+    public FastTable<E> atomic() {
+        return new FastTable<E>(new AtomicTableImpl<E>(service));
+    }
+
+    @Override
+    public FastTable<E> reversed() {
+        return new FastTable<E>(new ReversedTableImpl<E>(service));
+    }
+
+    @Override
+    public FastTable<E> shared() {
+        return new FastTable<E>(new SharedTableImpl<E>(service));
+    }
+
+    @Override
+    public FastTable<E> unmodifiable() {
+        return new FastTable<E>(new UnmodifiableTableImpl<E>(service));
+    }
+
+    /**
+     * Returns a view over a portion of the table (equivalent to 
+     * {@link java.util.List#subList(int, int)}).
+     */
+    public FastTable<E> subTable(int fromIndex, int toIndex) {
+        return new FastTable<E>(
+                new SubTableImpl<E>(service, fromIndex, toIndex));
+    }
+
+    ////////////////////////////////////////////////////////////////////////////
+    // Change in time limit behavior.
+    //
+
+    @Override
+    @Realtime(limit = CONSTANT)
+    public boolean isEmpty() {
+        return service.isEmpty();
+    }
+
+    @Override
+    @Realtime(limit = CONSTANT)
+    public int size() {
+        return service.size();
+    }
+
+    @Override
+    @Realtime(limit = CONSTANT)
+    public void clear() {
+        service.clear();
+    }
+
+    ////////////////////////////////////////////////////////////////////////////
+    // List Interface.
+    //
+
+    /** Inserts the specified element at the specified position in this table. */
+    @Override
+    @Realtime(limit = LOG_N)
+    public void add(int index, E element) {
+        service.add(index, element);
+    }
+
+    /** Inserts all of the elements in the specified collection into this table
+     *  at the specified position. */
+    @Override
+    @Realtime(limit = N_LOG_N)
+    public boolean addAll(final int index, Collection<? extends E> elements) {
+        return service.addAll(index, elements);
+    }
+
+    /** Removes the element at the specified position in this table. */
+    @Override
+    @Realtime(limit = LOG_N)
+    public E remove(int index) {
+        return service.remove(index);
+    }
+
+    /** Returns the element at the specified position in this table. */
+    @Override
+    @Realtime(limit = CONSTANT)
+    public E get(int index) {
+        return service.get(index);
+    }
+
+    /** Replaces the element at the specified position in this table with the specified element. */
+    @Override
+    @Realtime(limit = CONSTANT)
+    public E set(int index, E element) {
+        return service.set(index, element);
+    }
+
+    /** Returns the index of the first occurrence of the specified element in this table,
+     *  or -1 if this table does not contain the element. */
+    @Override
+    @Realtime(limit = LINEAR)
+    public int indexOf(Object element) {
+        return service.indexOf(element);
+    }
+
+    /** Returns the index of the last occurrence of the specified element in this table,
+     * or -1 if this table does not contain the element. */
+    @Override
+    @Realtime(limit = LINEAR)
+    public int lastIndexOf(final Object element) {
+        return service.lastIndexOf(element);
+    }
+
+    /** Returns a list iterator over the elements in this table. */
+    @Override
+    @Realtime(limit = CONSTANT)
+    public ListIterator<E> listIterator() {
+        return service.listIterator();
+    }
+
+    /** Returns a list iterator over the elements in this table, starting 
+     * at the specified position in the table. */
+    @Override
+    @Realtime(limit = CONSTANT)
+    public ListIterator<E> listIterator(int index) {
+        return service.listIterator(index);
+    }
+
+    ////////////////////////////////////////////////////////////////////////////
+    // Deque Interface.
+    //
+
+    /** Inserts the specified element at the front of this table. */
+    @Override
+    @Realtime(limit = CONSTANT)
+    public void addFirst(E element) {
+        service.addFirst(element);
+    }
+
+    /** Inserts the specified element at the end of this table. */
+    @Override
+    @Realtime(limit = CONSTANT)
+    public void addLast(E element) {
+        service.addLast(element);
+    }
+
+    /** Retrieves, but does not remove, the first element of this table. */
+    @Override
+    @Realtime(limit = CONSTANT)
+    public E getFirst() {
+        return service.getFirst();
+    }
+
+    /** Retrieves, but does not remove, the last element of this table. */
+    @Override
+    @Realtime(limit = CONSTANT)
+    public E getLast() {
+        return service.getLast();
+    }
+
+    /** Retrieves, but does not remove, the first element of this table, 
+     * or returns null if this table is empty. */
+    @Override
+    @Realtime(limit = CONSTANT)
+    public E peekFirst() {
+        return service.peekFirst();
+    }
+
+    /** Retrieves, but does not remove, the last element of this table,
+     *  or returns null if this table is empty. */
+    @Override
+    @Realtime(limit = CONSTANT)
+    public E peekLast() {
+        return service.peekLast();
+    }
+
+    /** Retrieves and removes the first element of this table, 
+     * or returns null if this table is empty. */
+    @Override
+    @Realtime(limit = CONSTANT)
+    public E pollFirst() {
+        return service.pollFirst();
+    }
+
+    /** . */
+    @Override
+    @Realtime(limit = CONSTANT)
+    public E pollLast() {
+        return service.pollLast();
+    }
+
+    /** Retrieves and removes the last element of this table, 
+     * or returns null if this table is empty. */
+    @Override
+    @Realtime(limit = CONSTANT)
+    public E removeFirst() {
+        return service.removeFirst();
+    }
+
+    /** Retrieves and removes the last element of this table. */
+    @Override
+    @Realtime(limit = CONSTANT)
+    public E removeLast() {
+        return service.removeLast();
+    }
+
+    /** Inserts the specified element at the front of this table. */
+    @Override
+    @Realtime(limit = CONSTANT)
+    public boolean offerFirst(E e) {
+        return service.offerFirst(e);
+    }
+
+    /** Inserts the specified element at the end of this table. */
+    @Override
+    @Realtime(limit = CONSTANT)
+    public boolean offerLast(E e) {
+        return service.offerLast(e);
+    }
+
+    /** Removes the first occurrence of the specified element from this table. */
+    @Override
+    @Realtime(limit = LINEAR)
+    public boolean removeFirstOccurrence(Object o) {
+        return service.removeFirstOccurrence(o);
+    }
+
+    /** Removes the last occurrence of the specified element from this table. */
+    @Override
+    @Realtime(limit = LINEAR)
+    public boolean removeLastOccurrence(Object o) {
+        return service.removeLastOccurrence(o);
+    }
+
+    /** Inserts the specified element into the queue represented by this table. */
+    @Override
+    @Realtime(limit = CONSTANT)
+    public boolean offer(E e) {
+        return service.offer(e);
+    }
+
+    /** Retrieves and removes the head of the queue represented by this table. */
+    @Override
+    @Realtime(limit = CONSTANT)
+    public E remove() {
+        return service.remove();
+    }
+
+    /** Retrieves and removes the head of the queue represented by this table. */
+    @Override
+    @Realtime(limit = CONSTANT)
+    public E poll() {
+        return service.poll();
+    }
+
+    /** Retrieves, but does not remove, the head of the queue represented by this table. */
+    @Override
+    @Realtime(limit = CONSTANT)
+    public E element() {
+        return service.element();
+    }
+
+    /** Retrieves, but does not remove, the head of the queue represented by this table. */
+    @Override
+    @Realtime(limit = CONSTANT)
+    public E peek() {
+        return service.peek();
+    }
+
+    /** Pushes an element onto the stack represented by this table. */
+    @Override
+    @Realtime(limit = CONSTANT)
+    public void push(E e) {
+        service.push(e);
+    }
+
+    /** Pops an element from the stack represented by this table. */
+    @Override
+    @Realtime(limit = CONSTANT)
+    public E pop() {
+        return service.pop();
+    }
+
+    /** Returns an iterator over the elements in this table in reverse sequential order. */
+    @Override
+    @Realtime(limit = CONSTANT)
+    public Iterator<E> descendingIterator() {
+        return service.descendingIterator();
+    }
+
+    ////////////////////////////////////////////////////////////////////////////
+    // Misc.
+    //
+
+    /**
+     * Sorts this table in place (quick sort).
+     */
+    @Realtime(limit = N_SQUARE)
+    public void sort() {
+        update(new Consumer<TableService<E>>() {
+            @Override
+            public void accept(TableService<E> table) {
+                QuickSort<E> qs = new QuickSort<E>(table, table.comparator());
+                qs.sort();
+            }
+        });
+    }
+
+    @Override
+    @Realtime(limit = LINEAR)
+    public FastTable<E> addAll(E... elements) {
+        return (FastTable<E>) super.addAll(elements);
+    }
+
+    @Override
+    @Realtime(limit = LINEAR)
+    public FastTable<E> addAll(FastCollection<? extends E> that) {
+        return (FastTable<E>) super.addAll(that);
+    }
+
+    /**
+     * Replaced by  {@link #subTable(int, int)}. The term "List" for an 
+     * interface with random access is disturbing !
+     */
+    @Override
+    @Deprecated
+    public FastTable<E> subList(int fromIndex, int toIndex) {
+        return subTable(fromIndex, toIndex);
+    }
+
+    @Override
+    protected TableService<E> service() {
+        return service;
+    }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/marmotta-commons/src/ext/java/javolution/util/function/Consumer.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-commons/src/ext/java/javolution/util/function/Consumer.java b/commons/marmotta-commons/src/ext/java/javolution/util/function/Consumer.java
new file mode 100644
index 0000000..9c03869
--- /dev/null
+++ b/commons/marmotta-commons/src/ext/java/javolution/util/function/Consumer.java
@@ -0,0 +1,29 @@
+/*
+ * 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.util.function;
+
+/**
+ * <p> A special type of function which does not return anything.</p>
+ * 
+ * <p> Note: In future version this interface may derive from 
+ *           {@code Function<P, Void>}.</p>
+ *           
+ * @param <T> The type of input parameter to accept.
+ *           
+ * @author  <a href="mailto:jean-marie@dautelle.com">Jean-Marie Dautelle</a>
+ * @version 6.0, July 21, 2013
+ */
+public interface Consumer<T> {
+
+    /**
+     * Accepts an input value.
+     */
+    void accept(T param);
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/marmotta-commons/src/ext/java/javolution/util/function/Equalities.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-commons/src/ext/java/javolution/util/function/Equalities.java b/commons/marmotta-commons/src/ext/java/javolution/util/function/Equalities.java
new file mode 100644
index 0000000..4eb4c29
--- /dev/null
+++ b/commons/marmotta-commons/src/ext/java/javolution/util/function/Equalities.java
@@ -0,0 +1,74 @@
+package javolution.util.function;
+
+import javolution.lang.Parallelizable;
+import javolution.lang.Realtime;
+import javolution.util.internal.comparator.*;
+
+import static javolution.lang.Realtime.Limit.*;
+
+/**
+ * <p> A set of useful equalities comparators.</p>
+ * 
+ * @author <a href="mailto:jean-marie@dautelle.com">Jean-Marie Dautelle</a>
+ * @version 6.0, July 21, 2013
+ */
+public class Equalities {
+
+    /**
+     * A standard object comparator (based on the object hashCode and equals 
+     * methods).  Comparisons either use the object natural order (which 
+     * should be consistent with equals) or an empirical method 
+     * (if the object does not implement {@link Comparable}).
+     * 
+     */
+    @Parallelizable
+    @Realtime(limit = UNKNOWN)
+    public static final Equality<Object> STANDARD = new StandardComparatorImpl<Object>();
+
+    /**
+     * A comparator for which instances are only equals to themselves.
+     * For comparisons an empirical method consistent with equals ({@code == })
+     * is used.
+     */
+    @Parallelizable
+    @Realtime(limit = CONSTANT)
+    public static final Equality<Object> IDENTITY = new IdentityComparatorImpl<Object>();
+
+    /**
+     * A content array comparator. If the content of an array is also 
+     * an array (multi-dimensional arrays), that same comparator is used 
+     * for equality and comparison (recursive). The {@link #STANDARD standard}
+     * comparator is used for non-array elements. 
+     */
+    @Parallelizable
+    @Realtime(limit = LINEAR)
+    public static final Equality<Object> ARRAY = new ArrayComparatorImpl();
+
+    /**
+     * A lexicographic comparator for any {@link CharSequence}.
+     */
+    @Parallelizable
+    @Realtime(limit = LINEAR)
+    public static final Equality<CharSequence> LEXICAL = new LexicalComparatorImpl();
+
+    /**
+     * A case insensitive lexicographic comparator for any {@link CharSequence}.
+     */
+    @Parallelizable
+    @Realtime(limit = LINEAR)
+    public static final Equality<CharSequence> LEXICAL_CASE_INSENSITIVE = new LexicalCaseInsensitiveComparatorImpl();
+
+    /**
+     * An optimized lexical comparator for any {@link CharSequence} taking 
+     * a sample of few characters instead of the whole character sequence to 
+     * calculate the hash code (still equality comparison checks all characters).
+     */
+    @Parallelizable
+    @Realtime(limit = LINEAR)
+    public static final Equality<CharSequence> LEXICAL_FAST = new LexicalFastComparatorImpl();
+
+    /**
+     * Utility class (private constructor).
+     */
+    private Equalities() {}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/marmotta-commons/src/ext/java/javolution/util/function/Equality.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-commons/src/ext/java/javolution/util/function/Equality.java b/commons/marmotta-commons/src/ext/java/javolution/util/function/Equality.java
new file mode 100644
index 0000000..1d7e8dc
--- /dev/null
+++ b/commons/marmotta-commons/src/ext/java/javolution/util/function/Equality.java
@@ -0,0 +1,77 @@
+/*
+ * 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.util.function;
+
+import java.io.Serializable;
+import java.util.Comparator;
+
+/**
+ * <p> A comparator to be used for element equality as well as for 
+ *     ordering. Implementing classes should ensure that:
+ *     <ul>
+ *        <li> The {@link #compare compare} function is consistent with 
+ *             {@link #areEqual equals}. If two objects {@link #compare compare}
+ *             to {@code 0} then they are {@link #areEqual equals} and the 
+ *             the reciprocal is true (this ensures that sorted collections/maps
+ *             do not break the general contract of their parent class based on
+ *             object equal).</li>
+ *        <li> The {@link #hashCodeOf hashcode} function is consistent with
+ *             {@link #areEqual equals}: If two objects are equals, they have 
+ *             the same hashcode (the reciprocal is not true).</li>
+ *        <li> The {@code null} value is supported (even for 
+ *             {@link #compare comparisons}) and the {@link #hashCodeOf(Object)
+ *             hashcode} value of {@code null} is {@code 0}.</li>
+ *     </ul>
+ * </p>
+ * 
+ * @param <T> the type of objects that may be compared for equality or order.
+ * 
+ * @author <a href="mailto:jean-marie@dautelle.com">Jean-Marie Dautelle</a>
+ * @version 6.0, July 21, 2013
+ * @see Equalities
+ */
+public interface Equality<T> extends Comparator<T>, Serializable {
+
+    /**
+     * Returns the hash code for the specified object (consistent with 
+     * {@link #areEqual}). Two objects considered {@link #areEqual equal} have 
+     * the same hash code. The hash code of <code>null</code> is always 
+     * <code>0</code>.
+     * 
+     * @param  object the object to return the hashcode for.
+     * @return the hashcode for the specified object.
+     */
+    int hashCodeOf(T object);
+
+    /**
+     * Indicates if the specified objects can be considered equal.
+     * This methods is equivalent to {@code (compare(o1, o2) == 0)} but 
+     * usually faster.
+     * 
+     * @param left the first object (or <code>null</code>).
+     * @param right the second object (or <code>null</code>).
+     * @return <code>true</code> if both objects are considered equal;
+     *         <code>false</code> otherwise. 
+     */
+    boolean areEqual(T left, T right);
+
+    /**
+     * Compares the specified objects for order. Returns a negative integer, 
+     * zero, or a positive integer as the first argument is less than, possibly 
+     * equal to, or greater than the second. Implementation classes should 
+     * ensure that comparisons with {@code null} is supported.
+     * 
+     * @param left the first object.
+     * @param right the second object.
+     * @return a negative integer, zero, or a positive integer as the first
+     *         argument is less than, possibly equal to, or greater than the second.
+     */
+    int compare(T left, T right);
+
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/marmotta-commons/src/ext/java/javolution/util/function/Function.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-commons/src/ext/java/javolution/util/function/Function.java b/commons/marmotta-commons/src/ext/java/javolution/util/function/Function.java
new file mode 100644
index 0000000..35471de
--- /dev/null
+++ b/commons/marmotta-commons/src/ext/java/javolution/util/function/Function.java
@@ -0,0 +1,33 @@
+/*
+ * 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.util.function;
+
+
+/**
+ * <p> A function that perform some operation and returns the result of 
+ *     that operation.</p>
+ * 
+ * @param <T> the type of the input parameter of the apply operation.
+ * @param <R> the type of the result of the apply operation.
+ *                   
+ * @author  <a href="mailto:jean-marie@dautelle.com">Jean-Marie Dautelle</a>
+ * @version 6.0, July 21, 2013
+ * @see <a href="http://en.wikipedia.org/wiki/Function_(computer_science)">Wikipedia: Function<a>    
+ */
+public interface Function<T, R> {
+
+    /**
+     * Returns the result of applying this function to the specified parameter. 
+     * 
+     * @param param the parameter object on which the function is performed. 
+     * @return the result of the function.
+     */
+    R apply(T param);
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/marmotta-commons/src/ext/java/javolution/util/function/Iteration.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-commons/src/ext/java/javolution/util/function/Iteration.java b/commons/marmotta-commons/src/ext/java/javolution/util/function/Iteration.java
new file mode 100644
index 0000000..8d870ce
--- /dev/null
+++ b/commons/marmotta-commons/src/ext/java/javolution/util/function/Iteration.java
@@ -0,0 +1,32 @@
+/*
+ * 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.util.function;
+
+import java.util.Iterator;
+
+/**
+ * <p> A function iterating over a collection.</p>
+ * 
+ * <p> Except for {@link Mutable} instances, iterations are not 
+ *     allowed to modify the collection iterated.
+ * 
+ * @author <a href="mailto:jean-marie@dautelle.com">Jean-Marie Dautelle</a>
+ * @version 6.0, July 21, 2013
+ */
+public interface Iteration<E>  {
+
+    public interface Mutable<E> extends Iteration<E> {}
+    public interface Sequential<E> extends Iteration<E> {}
+       
+     /** 
+     * Runs the iteration using the specified iterator.
+     */
+    void run(Iterator<E> it);
+  
+ }
\ No newline at end of file


[034/100] [abbrv] [partial] Reverting the erroneous merge by Sebastian according to the instructions in INFRA-6876

Posted by wi...@apache.org.
http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/extras/webjars/codemirror/src/main/resources/ldpath.html
----------------------------------------------------------------------
diff --git a/extras/webjars/codemirror/src/main/resources/ldpath.html b/extras/webjars/codemirror/src/main/resources/ldpath.html
new file mode 100644
index 0000000..4a0ea12
--- /dev/null
+++ b/extras/webjars/codemirror/src/main/resources/ldpath.html
@@ -0,0 +1,246 @@
+<!--
+
+    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.
+
+-->
+<!doctype html>
+<html>
+<head>
+<title>CodeMirror: LDPath Demo</title>
+<link rel="stylesheet" href="codemirror.css">
+<link rel="stylesheet" href="simple-hint.css">
+
+<script type="text/javascript" src="../../../webjars/jquery/1.8.2/jquery.min.js"></script>
+
+<script src="codemirror.js"></script>
+<script src="simple-hint.js"></script>
+<script src="ldpath.js"></script>
+
+<link rel="stylesheet" href="ldpath.css">
+
+<style type="text/css">
+.CodeMirror {
+    border: 1px solid #eee;
+}
+
+td {
+    padding-right: 20px;
+}
+body {
+  font-family: Droid Sans, Arial, sans-serif;
+  line-height: 1.5;
+  max-width: 64.3em;
+  margin: 3em auto;
+  padding: 0 1em;
+}
+
+h1 {
+  letter-spacing: -3px;
+  font-size: 3.23em;
+  font-weight: bold;
+  margin: 0;
+}
+
+h2 {
+  font-size: 1.23em;
+  font-weight: bold;
+  margin: .5em 0;
+  letter-spacing: -1px;
+}
+
+h3 {
+  font-size: 1em;
+  font-weight: bold;
+  margin: .4em 0;
+}
+
+pre {
+  background-color: #eee;
+  -moz-border-radius: 6px;
+  -webkit-border-radius: 6px;
+  border-radius: 6px;
+  padding: 1em;
+}
+
+pre.code {
+  margin: 0 1em;
+}
+
+.grey {
+  font-size: 2.2em;
+  padding: .5em 1em;
+  line-height: 1.2em;
+  margin-top: .5em;
+  position: relative;
+}
+
+img.logo {
+  position: absolute;
+  right: -25px;
+  bottom: 4px;
+}
+
+a:link, a:visited, .quasilink {
+  color: #df0019;
+  cursor: pointer;
+  text-decoration: none;
+}
+
+a:hover, .quasilink:hover {
+  color: #800004;
+}
+
+h1 a:link, h1 a:visited, h1 a:hover {
+  color: black;
+}
+
+ul {
+  margin: 0;
+  padding-left: 1.2em;
+}
+
+a.download {
+  color: white;
+  background-color: #df0019;
+  width: 100%;
+  display: block;
+  text-align: center;
+  font-size: 1.23em;
+  font-weight: bold;
+  text-decoration: none;
+  -moz-border-radius: 6px;
+  -webkit-border-radius: 6px;
+  border-radius: 6px;
+  padding: .5em 0;
+  margin-bottom: 1em;
+}
+
+a.download:hover {
+  background-color: #bb0010;
+}
+
+.rel {
+  margin-bottom: 0;
+}
+
+.rel-note {
+  color: #777;
+  font-size: .9em;
+  margin-top: .1em;
+}
+
+.logo-braces {
+  color: #df0019;
+  position: relative;
+  top: -4px;
+}
+
+.blk {
+  float: left;
+}
+
+.left {
+  width: 37em;
+  padding-right: 6.53em;
+  padding-bottom: 1em;
+}
+
+.left1 {
+  width: 15.24em;
+  padding-right: 6.45em;
+}
+
+.left2 {
+  width: 15.24em;
+}
+
+.right {
+  width: 20.68em;
+}
+
+.leftbig {
+  width: 42.44em;
+  padding-right: 6.53em;
+}
+
+.rightsmall {
+  width: 15.24em;
+}
+
+.clear:after {
+  visibility: hidden;
+  display: block;
+  font-size: 0;
+  content: " ";
+  clear: both;
+  height: 0;
+}
+.clear { display: inline-block; }
+/* start commented backslash hack \*/
+* html .clear { height: 1%; }
+.clear { display: block; }
+/* close commented backslash hack */
+</style>
+</head>
+<body>
+  <h1>CodeMirror: LDPath demo</h1>
+  <div>
+    Read about the <a href="http://marmotta.incubator.apache.org/ldpath/language.html" title="LDPath">LDPath Syntax</a>
+    in <a href="http://marmotta.incubator.apache.org/">Apache Marmotta</a>.
+  </div>
+  <div>
+    <button onclick="javascript:createEditor()">Editor</button>
+    <button onclick="javascript:removeEditor()">Plain</button>
+  </div>
+  <form>
+    <textarea id="code" name="code">
+@prefix iptc : <http://iptc.org/std/nar/2006-10-01/> ;
+@prefix foaf ;
+@prefix rss: ;
+@prefix sioc: ;
+@filter rdf:type is rss:item | rdf:type is isig:WebPage | rdf:type is sioc:Post ;
+  date = dc:date :: xsd:date(multiValued="false") ;
+  desc = dc:description[@de] :: lmf:text_en ;
+  feed = (^rss:items / rss:title | (page:partOf | sioc:has_container / dc:title)) :: xsd:string ;
+  lang = fn:first(^rss:items / dc:language, "de") :: xsd:string ;
+  summary = fn:removeTags((rss:description | dc:description)) :: lmf:text_en ;
+  title = (rss:title | (html:title | dc:title)) :: lmf:text_en ;
+  user = dc:creator :: xsd:string(multiValue="false") ;
+</textarea>
+  </form>
+  <script>
+            var editor = null;
+            function createEditor() {
+                if (editor === null) {
+                    editor = CodeMirror.fromTextArea(document.getElementById("code"), {
+                        lineNumbers : true,
+                        matchBrackets : true,
+						extraKeys: {"Ctrl-Space": "ldpathAutocomplete"},
+                        mode : "ldpath"
+                    });
+                }
+            }
+            function removeEditor() {
+                if (editor) {
+                    editor.toTextArea();
+                    editor = null;
+                }
+            }
+            createEditor();
+        </script>
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/extras/webjars/codemirror/src/main/resources/ldpath.js
----------------------------------------------------------------------
diff --git a/extras/webjars/codemirror/src/main/resources/ldpath.js b/extras/webjars/codemirror/src/main/resources/ldpath.js
new file mode 100644
index 0000000..a5eb1a4
--- /dev/null
+++ b/extras/webjars/codemirror/src/main/resources/ldpath.js
@@ -0,0 +1,471 @@
+/*
+ * 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.
+ */
+if (CodeMirror && CodeMirror.defineMode) {
+CodeMirror.defineMode("ldpath", function(config, parserConfig) {
+    var token = {
+        COMMENT: "comment",
+        OP: "operator",
+        KWD: "keyword",
+        PREFIX: "qualifier",
+        IDENT: "atom",
+        DEF: "builtin",
+        TEST: "meta",
+        URL: "link",
+        STR: "string",
+        INT: "number",
+        BRACKET: "bracket",
+        WARNING: "string-2",
+        ERROR: "error"
+    },
+        predefinedNamespaces = parserConfig.namespaces || {},
+        baseURL = parserConfig.baseURL || null;
+    
+    function log(stream, status, result) {
+        return;
+        if (console && console.log) {
+            console.log(stream.current() + " := " + result + " (-> " + status.current() + ")");
+        }
+    }
+    
+    function getInitialState() {
+        return {
+            tmp: {},
+            namespaces: {},
+            predefinedNamespaces: predefinedNamespaces,
+            lmfBaseURL: baseURL,
+            stack: ['default'],
+            /* STACKING */
+            push: function(next) {
+                this.stack.unshift(next);
+            },
+            pop: function() {
+                if (this.stack.length <= 1) {
+                    return this.current();
+                } else {
+                    return this.stack.shift();
+                }
+            },
+            current: function() {
+                return this.stack[0];
+            },
+            reset: function() {
+                this.stack = ['default'];
+                this.tmp = {};
+            },
+            height: function() {
+                return this.stack.length;
+            },
+            /* PARSING */
+            parser: function(stream, state) {
+                var parser = parsers[this.current()] || parsers['default'];
+                return parser(stream, state);
+            },
+            /* NAMESPACES */
+            addPrefix: function(prefix, namespace) {
+                if (prefix && namespace)
+                    this.namespaces[prefix] = namespace;
+            },
+            getNamespace: function(prefix) {
+                return this.namespaces[prefix] || this.predefinedNamespaces[prefix];
+            }
+        };
+    }
+
+    function tokenError(stream, state) {
+        if (state.current() !== 'error') state.push('error');
+        stream.skipToEnd();
+        return token.ERROR;
+    }
+    
+    function tokenDefault(stream, state) {
+        // /* ... */
+        if (stream.match('/*')) {
+            state.push('comment');
+            return token.COMMENT;
+        }
+    
+        // @...
+        var kw = stream.match(/^@(\w+)/, true);
+        if (kw) {
+            state.push(kw[1]);
+            return token.KWD;
+        }
+
+        // <URL>
+        if (stream.eat('<')) {
+            state.push('url');
+            return token.BRACKET;
+        }
+        if (stream.eat('[')) {
+            state.push('test');
+            return token.BRACKET;
+        }
+        if (stream.eat('(')) {
+            if (state.current() == "transformer") {
+                state.push('config');
+            }
+            return token.BRACKET;
+        }
+        if (stream.eat(')')) {
+            if (state.current() == "config") {
+                state.pop();
+            }
+            return token.BRACKET;
+        }
+        if (stream.eat(/[\]>\{\}]/)) {
+            return token.BRACKET;
+        }
+
+        // prefix:label
+        if (stream.match(/^\w+:\w*/, false)) {
+            stream.skipTo(":")
+            if (state.current() == 'prefix') {
+                state.tmp["prefix"] = stream.current();
+                return token.PREFIX;
+            } else {
+                px = stream.current();
+                stream.eat(':');
+                if (state.getNamespace(px))
+                    return token.PREFIX;
+                else return token.WARNING;
+            }
+        }
+
+        if (stream.match("=", true)) {
+            if (state.current() == "default") {
+                state.push("path");
+            }
+            return token.DEF;
+        }
+        if (stream.match("::", true)) {
+            state.push("transformer");
+            return token.DEF;
+        }
+        // OPERATORS
+        if (stream.eat(/[:,&\|\/^\+\*.]/)) {
+            return token.OP;
+        }
+
+        if (stream.eat('"')) {
+            if (stream.skipTo('"') && stream.eat('"'))
+                return token.STR;
+            return tokenError(stream, state);
+        }
+        
+        // NUMBERS
+        if (stream.match(/^\d+/, true)) {
+            return token.INT;
+        }
+
+        // IDENT
+        if (state.current() == "prefix") {
+            if (stream.match(/^\w+/, true)) {
+                state.tmp["prefix"] = stream.current();
+                return token.PREFIX;
+            }
+        } else {
+            if (stream.match(/^[\w.-]+/, true)) {
+                return token.IDENT;
+            }
+        }
+
+        return tokenError(stream, state);
+    }
+
+    function tokenURL(stream, state) {
+        if (stream.eat('>')) {
+            state.pop();
+            return token.BRACKET;
+        }
+        if (stream.skipTo('>')) {
+            //state.pop();
+            var url = stream.current();
+            if (url.search(/^https?:\/\//) < 0 || url.search(/\s/) >= 0) {
+                return token.ERROR;
+            }
+            if (state.stack.indexOf("prefix") >= 0) {
+                state.tmp["ns"] = url;
+            }
+            return token.URL;
+        }
+        return tokenError(stream, state);
+    }
+
+    function tokenTest(stream, state) {
+        if (stream.eat(']')) {
+            state.pop();
+            return token.BRACKET;
+        }
+        if (stream.match(/@\w+/, true) || stream.match("^^", true)) {
+            return token.TEST;
+        }
+        if (stream.match("is-a", true)) {
+            return token.TEST;
+        }
+        if (stream.match("is ", false)) {
+            stream.match("is", true);
+            return token.TEST;
+        }
+        if (stream.eat(/[&\|]/)) {
+            return token.TEST;
+        }
+        return tokenDefault(stream, state);
+    }
+
+    var parsers = {
+        'default': tokenDefault,
+        filter: tokenTest,
+        url: tokenURL,
+        test: tokenTest,
+        error: tokenError
+    }
+
+
+    return {
+        startState: getInitialState,
+        compareStates: function(state1, state2) {
+            return state1.stack == state2.stack && state1.namespaces == state2.namespaces;
+        },
+        token: function(stream, state) {
+            // parse comments
+            if (state.current() == "comment") {
+                stream.skipTo('*') || stream.skipToEnd();
+                if (stream.match('*/')) {
+                    state.pop();
+                } else stream.eat('*');
+                return token.COMMENT;
+            } else if (stream.match('/*')) {
+                state.tmp.commentStart = stream.column();
+                state.push("comment");
+                return this.token(stream, state);
+            }
+            // ignore spaces
+            if (stream.eatSpace()) return null;
+            // ; starts parsing from scratch
+            if (stream.eat(';')) {
+                if (state.current() == "prefix") {
+                    state.addPrefix(state.tmp['prefix'], state.tmp['ns']); 
+                }
+                log(stream, state, "RESET");
+                state.reset(); 
+                return token.OP;
+            }
+            var result = state.parser(stream, state);
+            log(stream, state, result);
+            return result;
+        },
+        electricChars: "/@=[];",
+        indent: function(state, textAfter) {
+            switch (state.current()) {
+            case 'comment':
+                return state.tmp.commentStart +(textAfter.search(/^\s*\*\//)==0?1:3);
+                break;
+            case 'test':
+            case 'filter':
+                return 2 * config.indentUnit;
+                break;
+            case 'default':
+                // no indent for @prefix etc...
+                if (textAfter.search(/^\s*@/) == 0) {
+                    return 0;
+                }
+                return config.indentUnit;
+                break;
+            }
+            return 0;
+        }
+    }
+});
+
+// Autocompletion
+if (CodeMirror.simpleHint && jQuery) {
+    function completePrefix(editor, cur, token) {
+        var line = editor.getLine(cur.line);
+        var match = line.match(/(^|;)\s*@prefix\s+(\w+)\s*(:\s*<?)?(;|$)/);
+        if (match && match[2] && match[2] !== "") {
+            var prefix = match[2], result;
+            try {
+                jQuery.ajax(token.state.lmfBaseURL + "ldpath/util/prefix", {
+                    async: false,
+                    data: {prefix: prefix},
+                    success: function(data) {
+                        result = data[prefix];
+                    },
+                    dataType: "json"
+                });
+            } catch (e) {}
+            if (result !== undefined) {
+                var pfx = line.substr(0,cur.ch);
+                var st = pfx.search(/\s*(:\s*<?)?$/);
+                return {
+                    list: [ ": <"+result+">;" ],
+                    from: {line: cur.line, ch: st},
+                    to: cur
+                };
+            }
+        }
+        return false;
+    }
+    function completeURI(editor, cur, token) {
+        var bC = token.string.substr(0, cur.ch - token.start),
+        aC = token.string.substr(cur.ch - token.start),
+        replUntil = token.state.current()=='url'?token.end+1:cur.ch + Math.max(aC.search(/[\s]/), 0);
+        
+        var suggestions;
+        try {
+            var qs = {};
+            if (token.state.stack.indexOf("transformer") >= 0) qs['mode'] = "transformer";
+            for (var n in token.state.namespaces) {
+                qs['ns_'+n] = token.state.getNamespace(n);
+            }
+            qs['uri'] = bC;
+            
+            jQuery.ajax(token.state.lmfBaseURL + "ldpath/util/complete", {
+               async: false,
+               data: qs,
+               success: function(data) {
+                   suggestions = data;  
+               },
+               dataType: "json"
+            });
+        } catch (e) {}
+        if (suggestions !== undefined) {
+            for (var i = 0; i < suggestions.length; i++) {
+                if (suggestions[i].match(/^\w+:\w+$/)) {
+                    // curie!
+                    suggestions[i] = suggestions[i] + " ";
+                } else {
+                    suggestions[i] = "<" + suggestions[i] + "> ";
+                }
+            }
+            return {
+              list: suggestions,
+              from: {line: cur.line, ch: token.start - 1},
+              to: {line: cur.line, ch: replUntil}
+            };
+        }
+        return false;
+    }
+    function completeCUIE(editor, cur, token) {
+        var from = token.start, 
+            to = token.end, 
+            req = token.string.substr(0, cur.ch - token.start);
+        var prevToken = editor.getTokenAt({line: cur.line, ch: token.start});
+        if (token.className == 'atom' && prevToken.className == 'qualifier') {
+            from = prevToken.start;
+            req = prevToken.string + req;
+        }
+        
+        var suggestions;
+        try {
+            var qs = {};
+            if (token.state.stack.indexOf("transformer") >= 0) qs['mode'] = "transformer";
+            for (var n in token.state.namespaces) {
+                qs['ns_'+n] = token.state.getNamespace(n);
+            }
+            qs['prefix'] = req;
+
+            jQuery.ajax(token.state.lmfBaseURL + "ldpath/util/complete", {
+               async: false,
+               data: qs,
+               success: function(data) {
+                   suggestions = data;  
+               },
+               dataType: "json"
+            });
+        } catch (e) {}
+        if (suggestions !== undefined) {
+            for (var i = 0; i < suggestions.length; i++) {
+                if (suggestions[i].match(/^\w+:\w+(\(\))?$/)) {
+                    // curie!
+                    suggestions[i] = suggestions[i] + " ";
+                } else {
+                    // prefix only
+                    suggestions[i] = suggestions[i] + ":";
+                }
+            }
+            return {
+              list: suggestions,
+              from: {line: cur.line, ch: from},
+              to: {line: cur.line, ch: to}
+            };
+        }
+        
+        return false;
+    }
+    function insertPrefixDef(editor, cur, token) {
+        var prefix = token.string.replace(/:?$/, ""), result;
+        try {
+            jQuery.ajax(token.state.lmfBaseURL + "ldpath/util/prefix", {
+//            jQuery.ajax("http://prefix.cc/" + prefix + ".file.json", {
+                async: false,
+                data: {prefix: prefix},
+                success: function(data) {
+                    result = data[prefix];
+                },
+                dataType: "json"
+            });
+        } catch (e) {}
+        if (result !== undefined) {
+            // check if this url is already prefixed
+            var px;
+            for (var i in token.state.namespaces) {
+                if (token.state.namespaces[i] == result) {
+                    px = i;
+                    break;
+                }
+            } 
+            if (px) {
+                return {
+                    list: [ px + ":" ],
+                    from: { line: cur.line, ch: token.start },
+                    to: { line: cur.line, ch: token.end }
+                };
+            } else {
+            return {
+                list: [ "@prefix " + prefix + ": <" + result + "> ;\n" ],
+                from: {line: 0, ch: 0},
+                to: {line: 0, ch: 0}
+            };
+            } 
+        }
+    }
+    CodeMirror.commands.ldpathAutocomplete = function(cm) {
+        CodeMirror.simpleHint(cm, function(editor) {
+            var cur = editor.getCursor();
+            var line = editor.getLine(cur.line);
+            var token = editor.getTokenAt(cur);
+        
+            if (token.state.stack.indexOf('prefix') >= 0) {
+                return completePrefix(editor, cur, token);
+            } else if (token.state.current() == 'url' || (token.state.current() == 'error' && token.state.stack[1] == 'url')) {
+                return completeURI(editor, cur, token);
+            } else if (token.className == "qualifier" || (token.className == "atom" && token.state.stack.indexOf("path") >= 0)) {
+                return completeCUIE(editor, cur, token);
+            } else if (token.className == "string-2") {
+                return insertPrefixDef(editor, cur, token);
+            } else {
+                if (console && console.log) {
+                    console.log("State: " + token.state.stack);
+                }
+            }
+        });
+    }
+}
+
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/extras/webjars/codemirror/src/main/resources/matchbrackets.js
----------------------------------------------------------------------
diff --git a/extras/webjars/codemirror/src/main/resources/matchbrackets.js b/extras/webjars/codemirror/src/main/resources/matchbrackets.js
new file mode 100644
index 0000000..131fe83
--- /dev/null
+++ b/extras/webjars/codemirror/src/main/resources/matchbrackets.js
@@ -0,0 +1,86 @@
+(function() {
+  var ie_lt8 = /MSIE \d/.test(navigator.userAgent) &&
+    (document.documentMode == null || document.documentMode < 8);
+
+  var Pos = CodeMirror.Pos;
+
+  var matching = {"(": ")>", ")": "(<", "[": "]>", "]": "[<", "{": "}>", "}": "{<"};
+  function findMatchingBracket(cm, where, strict) {
+    var state = cm.state.matchBrackets;
+    var maxScanLen = (state && state.maxScanLineLength) || 10000;
+
+    var cur = where || cm.getCursor(), line = cm.getLineHandle(cur.line), pos = cur.ch - 1;
+    var match = (pos >= 0 && matching[line.text.charAt(pos)]) || matching[line.text.charAt(++pos)];
+    if (!match) return null;
+    var forward = match.charAt(1) == ">", d = forward ? 1 : -1;
+    if (strict && forward != (pos == cur.ch)) return null;
+    var style = cm.getTokenTypeAt(Pos(cur.line, pos + 1));
+
+    var stack = [line.text.charAt(pos)], re = /[(){}[\]]/;
+    function scan(line, lineNo, start) {
+      if (!line.text) return;
+      var pos = forward ? 0 : line.text.length - 1, end = forward ? line.text.length : -1;
+      if (line.text.length > maxScanLen) return null;
+      if (start != null) pos = start + d;
+      for (; pos != end; pos += d) {
+        var ch = line.text.charAt(pos);
+        if (re.test(ch) && cm.getTokenTypeAt(Pos(lineNo, pos + 1)) == style) {
+          var match = matching[ch];
+          if (match.charAt(1) == ">" == forward) stack.push(ch);
+          else if (stack.pop() != match.charAt(0)) return {pos: pos, match: false};
+          else if (!stack.length) return {pos: pos, match: true};
+        }
+      }
+    }
+    for (var i = cur.line, found, e = forward ? Math.min(i + 100, cm.lineCount()) : Math.max(-1, i - 100); i != e; i+=d) {
+      if (i == cur.line) found = scan(line, i, pos);
+      else found = scan(cm.getLineHandle(i), i);
+      if (found) break;
+    }
+    return {from: Pos(cur.line, pos), to: found && Pos(i, found.pos),
+            match: found && found.match, forward: forward};
+  }
+
+  function matchBrackets(cm, autoclear) {
+    // Disable brace matching in long lines, since it'll cause hugely slow updates
+    var maxHighlightLen = cm.state.matchBrackets.maxHighlightLineLength || 1000;
+    var found = findMatchingBracket(cm);
+    if (!found || cm.getLine(found.from.line).length > maxHighlightLen ||
+       found.to && cm.getLine(found.to.line).length > maxHighlightLen)
+      return;
+
+    var style = found.match ? "CodeMirror-matchingbracket" : "CodeMirror-nonmatchingbracket";
+    var one = cm.markText(found.from, Pos(found.from.line, found.from.ch + 1), {className: style});
+    var two = found.to && cm.markText(found.to, Pos(found.to.line, found.to.ch + 1), {className: style});
+    // Kludge to work around the IE bug from issue #1193, where text
+    // input stops going to the textare whever this fires.
+    if (ie_lt8 && cm.state.focused) cm.display.input.focus();
+    var clear = function() {
+      cm.operation(function() { one.clear(); two && two.clear(); });
+    };
+    if (autoclear) setTimeout(clear, 800);
+    else return clear;
+  }
+
+  var currentlyHighlighted = null;
+  function doMatchBrackets(cm) {
+    cm.operation(function() {
+      if (currentlyHighlighted) {currentlyHighlighted(); currentlyHighlighted = null;}
+      if (!cm.somethingSelected()) currentlyHighlighted = matchBrackets(cm, false);
+    });
+  }
+
+  CodeMirror.defineOption("matchBrackets", false, function(cm, val, old) {
+    if (old && old != CodeMirror.Init)
+      cm.off("cursorActivity", doMatchBrackets);
+    if (val) {
+      cm.state.matchBrackets = typeof val == "object" ? val : {};
+      cm.on("cursorActivity", doMatchBrackets);
+    }
+  });
+
+  CodeMirror.defineExtension("matchBrackets", function() {matchBrackets(this, true);});
+  CodeMirror.defineExtension("findMatchingBracket", function(pos, strict){
+    return findMatchingBracket(this, pos, strict);
+  });
+})();

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/extras/webjars/codemirror/src/main/resources/simple-hint.css
----------------------------------------------------------------------
diff --git a/extras/webjars/codemirror/src/main/resources/simple-hint.css b/extras/webjars/codemirror/src/main/resources/simple-hint.css
new file mode 100644
index 0000000..2deea4e
--- /dev/null
+++ b/extras/webjars/codemirror/src/main/resources/simple-hint.css
@@ -0,0 +1,20 @@
+/* CodeMirror version 2.24
+ *
+ * License: MIT-License <http://codemirror.net/LICENSE>
+*/
+#center .CodeMirror-completions, .CodeMirror-completions {
+  position: absolute;
+  z-index: 10;
+  overflow: hidden;
+  -webkit-box-shadow: 2px 3px 5px rgba(0,0,0,.2);
+  -moz-box-shadow: 2px 3px 5px rgba(0,0,0,.2);
+  box-shadow: 2px 3px 5px rgba(0,0,0,.2);
+}
+#center .CodeMirror-completions select, .CodeMirror-completions select {
+  background: #fafafa;
+  outline: none;
+  border: none;
+  padding: 0;
+  margin: 0;
+  font-family: monospace;
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/extras/webjars/codemirror/src/main/resources/simple-hint.js
----------------------------------------------------------------------
diff --git a/extras/webjars/codemirror/src/main/resources/simple-hint.js b/extras/webjars/codemirror/src/main/resources/simple-hint.js
new file mode 100644
index 0000000..ad0f5eb
--- /dev/null
+++ b/extras/webjars/codemirror/src/main/resources/simple-hint.js
@@ -0,0 +1,80 @@
+// CodeMirror version 2.24
+//
+// All functions that need access to the editor's state live inside
+// the CodeMirror function. Below that, at the bottom of the file,
+// some utilities are defined.
+//
+// License: MIT-License <http://codemirror.net/LICENSE>
+
+(function() {
+  CodeMirror.simpleHint = function(editor, getHints) {
+    // We want a single cursor position.
+    if (editor.somethingSelected()) return;
+    var result = getHints(editor);
+    if (!result || !result.list.length) return;
+    var completions = result.list;
+    function insert(str) {
+      editor.replaceRange(str, result.from, result.to);
+    }
+    // When there is only one completion, use it directly.
+    if (completions.length == 1) {insert(completions[0]); return true;}
+
+    // Build the select widget
+    var complete = document.createElement("div");
+    complete.className = "CodeMirror-completions";
+    var sel = complete.appendChild(document.createElement("select"));
+    // Opera doesn't move the selection when pressing up/down in a
+    // multi-select, but it does properly support the size property on
+    // single-selects, so no multi-select is necessary.
+    if (!window.opera) sel.multiple = true;
+    for (var i = 0; i < completions.length; ++i) {
+      var opt = sel.appendChild(document.createElement("option"));
+      opt.appendChild(document.createTextNode(completions[i]));
+    }
+    sel.firstChild.selected = true;
+    sel.size = Math.min(10, completions.length);
+    var pos = editor.cursorCoords();
+    complete.style.left = pos.x + "px";
+    complete.style.top = pos.yBot + "px";
+    document.body.appendChild(complete);
+    // If we're at the edge of the screen, then we want the menu to appear on the left of the cursor.
+    var winW = window.innerWidth || Math.max(document.body.offsetWidth, document.documentElement.offsetWidth);
+    if(winW - pos.x < sel.clientWidth)
+      complete.style.left = (pos.x - sel.clientWidth) + "px";
+    // Hack to hide the scrollbar.
+    if (completions.length <= 10)
+      complete.style.width = (sel.clientWidth - 1) + "px";
+
+    var done = false;
+    function close() {
+      if (done) return;
+      done = true;
+      complete.parentNode.removeChild(complete);
+    }
+    function pick() {
+      insert(completions[sel.selectedIndex]);
+      close();
+      setTimeout(function(){editor.focus();}, 50);
+    }
+    CodeMirror.connect(sel, "blur", close);
+    CodeMirror.connect(sel, "keydown", function(event) {
+      var code = event.keyCode;
+      // Enter
+      if (code == 13) {CodeMirror.e_stop(event); pick();}
+      // Escape
+      else if (code == 27) {CodeMirror.e_stop(event); close(); editor.focus();}
+      else if (code != 38 && code != 40) {
+        close(); editor.focus();
+        // Pass the event to the CodeMirror instance so that it can handle things like backspace properly.
+        editor.triggerOnKeyDown(event);
+        setTimeout(function(){CodeMirror.simpleHint(editor, getHints);}, 50);
+      }
+    });
+    CodeMirror.connect(sel, "dblclick", pick);
+
+    sel.focus();
+    // Opera sometimes ignores focusing a freshly created node
+    if (window.opera) setTimeout(function(){if (!done) sel.focus();}, 100);
+    return true;
+  };
+})();

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/extras/webjars/codemirror/src/main/resources/skwrl.html
----------------------------------------------------------------------
diff --git a/extras/webjars/codemirror/src/main/resources/skwrl.html b/extras/webjars/codemirror/src/main/resources/skwrl.html
new file mode 100644
index 0000000..6ed695b
--- /dev/null
+++ b/extras/webjars/codemirror/src/main/resources/skwrl.html
@@ -0,0 +1,254 @@
+<!--
+
+    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.
+
+-->
+<!doctype html>
+<html>
+<head>
+<title>CodeMirror: SKWRL Demo</title>
+<link rel="stylesheet" href="codemirror.css">
+<link rel="stylesheet" href="simple-hint.css">
+
+<script type="text/javascript" src="../../../webjars/jquery/1.8.2/jquery.min.js"></script>
+
+<script src="codemirror.js"></script>
+<script src="simple-hint.js"></script>
+<script src="skwrl.js"></script>
+
+<link rel="stylesheet" href="skwrl.css">
+
+<style type="text/css">
+.CodeMirror {
+    border: 1px solid #eee;
+}
+
+td {
+    padding-right: 20px;
+}
+body {
+  font-family: Droid Sans, Arial, sans-serif;
+  line-height: 1.5;
+  max-width: 64.3em;
+  margin: 3em auto;
+  padding: 0 1em;
+}
+
+h1 {
+  letter-spacing: -3px;
+  font-size: 3.23em;
+  font-weight: bold;
+  margin: 0;
+}
+
+h2 {
+  font-size: 1.23em;
+  font-weight: bold;
+  margin: .5em 0;
+  letter-spacing: -1px;
+}
+
+h3 {
+  font-size: 1em;
+  font-weight: bold;
+  margin: .4em 0;
+}
+
+pre {
+  background-color: #eee;
+  -moz-border-radius: 6px;
+  -webkit-border-radius: 6px;
+  border-radius: 6px;
+  padding: 1em;
+}
+
+pre.code {
+  margin: 0 1em;
+}
+
+.grey {
+  font-size: 2.2em;
+  padding: .5em 1em;
+  line-height: 1.2em;
+  margin-top: .5em;
+  position: relative;
+}
+
+img.logo {
+  position: absolute;
+  right: -25px;
+  bottom: 4px;
+}
+
+a:link, a:visited, .quasilink {
+  color: #df0019;
+  cursor: pointer;
+  text-decoration: none;
+}
+
+a:hover, .quasilink:hover {
+  color: #800004;
+}
+
+h1 a:link, h1 a:visited, h1 a:hover {
+  color: black;
+}
+
+ul {
+  margin: 0;
+  padding-left: 1.2em;
+}
+
+a.download {
+  color: white;
+  background-color: #df0019;
+  width: 100%;
+  display: block;
+  text-align: center;
+  font-size: 1.23em;
+  font-weight: bold;
+  text-decoration: none;
+  -moz-border-radius: 6px;
+  -webkit-border-radius: 6px;
+  border-radius: 6px;
+  padding: .5em 0;
+  margin-bottom: 1em;
+}
+
+a.download:hover {
+  background-color: #bb0010;
+}
+
+.rel {
+  margin-bottom: 0;
+}
+
+.rel-note {
+  color: #777;
+  font-size: .9em;
+  margin-top: .1em;
+}
+
+.logo-braces {
+  color: #df0019;
+  position: relative;
+  top: -4px;
+}
+
+.blk {
+  float: left;
+}
+
+.left {
+  width: 37em;
+  padding-right: 6.53em;
+  padding-bottom: 1em;
+}
+
+.left1 {
+  width: 15.24em;
+  padding-right: 6.45em;
+}
+
+.left2 {
+  width: 15.24em;
+}
+
+.right {
+  width: 20.68em;
+}
+
+.leftbig {
+  width: 42.44em;
+  padding-right: 6.53em;
+}
+
+.rightsmall {
+  width: 15.24em;
+}
+
+.clear:after {
+  visibility: hidden;
+  display: block;
+  font-size: 0;
+  content: " ";
+  clear: both;
+  height: 0;
+}
+.clear { display: inline-block; }
+/* start commented backslash hack \*/
+* html .clear { height: 1%; }
+.clear { display: block; }
+/* close commented backslash hack */
+</style>
+</head>
+<body>
+  <h1>CodeMirror: SKWRL demo</h1>
+  <div>
+    Read about the <a href="http://marmotta.incubator.apache.org/kiwi/reasoner.html" title="Simple KiWi Reasoning Language">SKWRL Langugae</a>
+    in <a href="http://marmotta.incubator.apache.org/">Apache Marmotta</a>.
+  </div>
+  <div>
+    <button onclick="javascript:createEditor()">Editor</button>
+    <button onclick="javascript:removeEditor()">Plain</button>
+  </div>
+  <form>
+<textarea id="code" name="code">
+/* rules taken from http://www.w3.org/TR/2004/REC-rdf-mt-20040210/#RDFRules */
+@prefix rdfs: &lt;http://www.w3.org/2000/01/rdf-schema#&gt;
+@prefix rdf: &lt;http://www.w3.org/1999/02/22-rdf-syntax-ns#&gt;
+@prefix xsd: &lt;http://www.w3.org/2001/XMLSchema#&gt;
+@prefix foaf: &lt;http://xmlns.com/foaf/0.1/&gt;
+
+rdf1: ($u $a $y) -&gt; ($a rdf:type rdf:Property)
+rdfs2: ($a rdfs:domain $x), ($u $a $y) -&gt; ($u rdf:type $x)
+rdfs3: ($a rdfs:range $x),  ($u $a $v) -&gt; ($v rdf:type $x)
+rdfs4a: ($u $a $x) -&gt; ($u rdf:type rdfs:Resource)
+rdfs5: ($u rdfs:subPropertyOf $v), ($v rdfs:subPropertyOf $x) -&gt; ($u rdfs:subPropertyOf $x)
+rdfs6: ($u rdf:type rdf:Property) -&gt; ($u rdfs:subPropertyOf $u)
+rdfs7: ($a rdfs:subPropertyOf $b), ($u $a $y) -&gt; ($u $b $y)
+rdfs8: ($u rdf:type rdfs:Class) -&gt; ($u rdfs:subClassOf rdfs:Resource)
+rdfs9: ($u rdfs:subClassOf $x), ($v rdf:type $u) -&gt; ($v rdf:type $x)
+rdfs10: ($u rdf:type rdfs:Class) -&gt; ($u rdfs:subClassOf $u)
+rdfs11: ($u rdfs:subClassOf $v), ($v rdfs:subClassOf $x) -&gt; ($u rdfs:subClassOf $x)
+rdfs12: ($u rdf:type rdfs:ContainerMembershipProperty) -&gt; ($u rdfs:subPropertyOf rdfs:member)
+rdfs13: ($u rdf:type rdfs:Datatype) -&gt; ($u rdfs:subClassOf rdfs:Literal)
+
+</textarea>
+  </form>
+  <script>
+            var editor = null;
+            function createEditor() {
+                if (editor === null) {
+                    editor = CodeMirror.fromTextArea(document.getElementById("code"), {
+                        lineNumbers : true,
+                        matchBrackets : true,
+                        extraKeys: {"Ctrl-Space": "skwrlAutocomplete"},
+                        mode : "skwrl"
+                    });
+                }
+            }
+            function removeEditor() {
+                if (editor) {
+                    editor.toTextArea();
+                    editor = null;
+                }
+            }
+            createEditor();
+        </script>
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/extras/webjars/codemirror/src/main/resources/skwrl.js
----------------------------------------------------------------------
diff --git a/extras/webjars/codemirror/src/main/resources/skwrl.js b/extras/webjars/codemirror/src/main/resources/skwrl.js
new file mode 100644
index 0000000..7de04c3
--- /dev/null
+++ b/extras/webjars/codemirror/src/main/resources/skwrl.js
@@ -0,0 +1,491 @@
+/*
+ * 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.
+ */
+if (CodeMirror && CodeMirror.defineMode) {
+CodeMirror.defineMode("skwrl", function(config, parserConfig) {
+    var token = {
+        COMMENT: "comment",
+        KWD: "keyword",
+        IDENT: "atom",
+        OP: "operator",
+        BRACKET: "bracket",
+        URL: "link",
+        VAR: "variable-3",
+        PREFIX: "qualifier",
+        DEF: "variable",
+        WARNING: "string-2",
+        ERROR: "error"
+    },
+        predefinedNamespaces = parserConfig.namespaces || {},
+        baseURL = parserConfig.baseURL || null;
+    
+    function log(stream, status, result) {
+        return;
+        if (console && console.log) {
+            console.log(stream.current() + " := " + result + " (-> " + status.current() + ")");
+        }
+    }
+    
+    function getInitialState() {
+        return {
+            tmp: {},
+            namespaces: {},
+            predefinedNamespaces: predefinedNamespaces,
+            lmfBaseURL: baseURL,
+            stack: ['default'],
+            /* STACKING */
+            push: function(next) {
+                this.stack.unshift(next);
+            },
+            pop: function() {
+                if (this.stack.length <= 1) {
+                    return this.current();
+                } else {
+                    return this.stack.shift();
+                }
+            },
+            current: function() {
+                return this.stack[0];
+            },
+            reset: function() {
+                this.stack = ['default'];
+                this.tmp = {};
+            },
+            height: function() {
+                return this.stack.length;
+            },
+            /* PARSING */
+            parser: function(stream, state) {
+                var parser = parsers[this.current()] || parsers['default'];
+                return parser(stream, state);
+            },
+            /* NAMESPACES */
+            addPrefix: function(prefix, namespace) {
+                if (prefix && namespace)
+                    this.namespaces[prefix] = namespace;
+            },
+            getNamespace: function(prefix) {
+                return this.namespaces[prefix] || this.predefinedNamespaces[prefix];
+            }
+        };
+    }
+
+    function tokenError(stream, state) {
+        if (state.current() !== 'error') state.push('error');
+        stream.skipToEnd();
+        return token.ERROR;
+    }
+    
+    function tokenDefault(stream, state) {
+        // @...
+        var kw = stream.match(/^@(\w+)/, true);
+        if (kw) {
+            if (kw[1] == "prefix") {
+                state.push(kw[1]);
+                return token.KWD;
+            } else return token.ERROR;
+        }
+
+        // <URL>
+        if (stream.eat('<')) {
+            state.push('url');
+            return token.BRACKET;
+        }
+               
+        if (stream.eat('(')) {
+            state.tmp['rule'] = 0;
+            state.push('rule');
+            return token.BRACKET;
+        }
+        if (stream.eat(')')) {
+            if (state.current() != 'rule') return token.ERROR;
+            state.pop();
+            return token.BRACKET;
+        }
+        if (stream.eat(/[)(]/)) {
+            return token.BRACKET;
+        }
+
+        // prefix:label
+        if (stream.match(/^\w+:\w*/, false)) {
+            stream.skipTo(":")
+            if (state.current() == 'prefix') {
+                state.tmp["prefix"] = stream.current();
+                return token.PREFIX;
+            } else if (state.current() == 'default') {
+                return token.DEF;
+            } else {
+                px = stream.current();
+                stream.eat(':');
+                if (state.getNamespace(px))
+                    return token.PREFIX;
+                else return token.WARNING;
+            }
+        }
+
+        if (stream.match("->", true)) {
+            return token.DEF;
+        }
+        // OPERATORS
+        if (stream.eat(/[:,]/)) {
+            return token.OP;
+        }
+
+       
+        // IDENT
+        if (state.current() == "prefix") {
+
+        } else {
+            if (stream.match(/^[\w.-]+/, true)) {
+                return token.IDENT;
+            }
+        }
+
+        return tokenError(stream, state);
+    }
+    
+    function tokenRule(stream, state) {
+        if (stream.eat(')')) {
+            state.pop();
+            if (state.tmp['rule'] != 3) return token.ERROR;
+            return token.BRACKET;
+        } else if (state.tmp['rule'] >= 3) {
+            state.tmp['rule'] = 4;
+            stream.skipTo(')') || stream.next();
+            return token.ERROR;
+        } else
+        // <URL>
+        if (stream.eat('<')) {
+            state.push('url');
+            return token.BRACKET;
+        } else if (stream.eat('>')) {
+            state.tmp['rule']++;
+            return token.BRACKET;
+        } else        
+        // $s
+        if (stream.match(/^\$\w+/)) {
+            state.tmp['rule']++;
+            return token.VAR;
+        } else
+        // ns:local
+        if (stream.match(/^\w+:\w*/, false)) {
+            stream.skipTo(':');
+            var px = stream.current();
+            stream.eat(':');
+            if (!stream.match(/^\w+/, false)) {
+                return token.ERROR;
+            } else if (state.getNamespace(px))
+                return token.PREFIX;
+            else return token.WARNING;
+        } else if (stream.match(/^\w+/)) {
+            state.tmp['rule']++;
+            return token.IDENT;
+        } else if (stream.eat(')')) {
+            state.pop();
+            if (state.tmp['rule'] != 3) return token.ERROR;
+            return token.BRACKET;
+        } else {
+            stream.next();
+            return token.ERROR;
+        }
+
+        return tokenError(stream, state);
+    }
+    
+    function tokenPrefix(stream, state) {
+        if (stream.match(/^\w+/, true)) {
+            state.tmp["prefix"] = stream.current();
+            return token.PREFIX;
+        } else if (stream.eat(':')) {
+            return token.OP;
+        } else
+        // <URL>
+        if (stream.eat('<')) {
+            state.push('url');
+            return token.BRACKET;
+        } else if (stream.eat('>')) {
+            if (state.tmp['prefix'] && state.tmp['ns']) {
+                state.addPrefix(state.tmp['prefix'], state.tmp['ns']);
+                state.reset();
+                // End of prefix state:
+                state.pop();
+                return token.BRACKET;
+            } else return token.ERROR;
+        }
+        
+        return tokenError(stream, state);
+    }
+
+    function tokenURL(stream, state) {
+        if (stream.skipTo('>')) {
+            state.pop();
+            var url = stream.current();
+            if (url.search(/\s/) >= 0) {
+                return token.ERROR;
+            }
+            if (state.stack.indexOf("prefix") >= 0) {
+                state.tmp["ns"] = url;
+            }
+            return token.URL;
+        }
+        return tokenError(stream, state);
+    }
+
+    var parsers = {
+        'default': tokenDefault,
+        rule: tokenRule,
+        prefix: tokenPrefix,
+        url: tokenURL,
+        error: tokenError
+    };
+    
+
+
+    return {
+        startState: getInitialState,
+        compareStates: function(state1, state2) {
+            return state1.stack == state2.stack && state1.namespaces == state2.namespaces;
+        },
+        token: function(stream, state) {
+            // parse comments
+            if (state.current() == "comment") {
+                stream.skipTo('*') || stream.skipToEnd();
+                if (stream.match('*/')) {
+                    state.pop();
+                } else stream.eat('*');
+                return token.COMMENT;
+            } else if (stream.match('/*')) {
+                state.tmp.commentStart = stream.column();
+                state.push("comment");
+                return this.token(stream, state);
+            }
+            // ignore spaces
+            if (stream.eatSpace()) return null;
+            // ; starts parsing from scratch
+            /*
+            if (stream.eat(';')) {
+                if (state.current() == "prefix") {
+                    state.addPrefix(state.tmp['prefix'], state.tmp['ns']); 
+                }
+                log(stream, state, "RESET");
+                state.reset(); 
+                return token.OP;
+            }
+            */
+            var result = state.parser(stream, state);
+            log(stream, state, result);
+            return result;
+        },
+        electricChars: "/@=[];",
+        indent: function(state, textAfter) {
+            switch (state.current()) {
+            case 'comment':
+                return state.tmp.commentStart +(textAfter.search(/^\s*\*\//)==0?1:3);
+                break;
+            case 'default':
+                // no indent for @prefix etc...
+                if (textAfter.search(/^\s*@/) == 0) {
+                    return 0;
+                }
+                return config.indentUnit;
+                break;
+            }
+            return 0;
+        }
+    }
+});
+
+// Autocompletion
+if (CodeMirror.simpleHint && jQuery) {
+    function completePrefix(editor, cur, token) {
+        var line = editor.getLine(cur.line);
+        var match = line.match(/(^|>)\s*@prefix\s+(\w+)\s*(:\s*<?)?$/);
+        if (match && match[2] && match[2] !== "") {
+            var prefix = match[2], result;
+            try {
+//                jQuery.ajax(token.state.lmfBaseURL + "ldpath/util/prefix", {
+                jQuery.ajax("http://prefix.cc/" + prefix + ".file.json", {
+                    async: false,
+                    data: {prefix: prefix},
+                    success: function(data) {
+                        result = data[prefix];
+                    },
+                    dataType: "json"
+                });
+            } catch (e) {}
+            if (result !== undefined) {
+                var pfx = line.substr(0,cur.ch);
+                var st = pfx.search(/\s*(:\s*<?)?$/);
+                return {
+                    list: [ ": <"+result+">" ],
+                    from: {line: cur.line, ch: st},
+                    to: cur
+                };
+            }
+        }
+        return false;
+    }
+    function completeURI(editor, cur, token) {
+        return false; // No completion here in skwrl
+        var bC = token.string.substr(0, cur.ch - token.start),
+        aC = token.string.substr(cur.ch - token.start),
+        replUntil = token.state.current()=='url'?token.end+1:cur.ch + Math.max(aC.search(/[\s]/), 0);
+        
+        var suggestions;
+        try {
+            var qs = {};
+            if (token.state.stack.indexOf("transformer") >= 0) qs['mode'] = "transformer";
+            for (var n in token.state.namespaces) {
+                qs['ns_'+n] = token.state.getNamespace(n);
+            }
+            qs['uri'] = bC;
+            
+            jQuery.ajax(token.state.lmfBaseURL + "ldpath/util/complete", {
+               async: false,
+               data: qs,
+               success: function(data) {
+                   suggestions = data;  
+               },
+               dataType: "json"
+            });
+        } catch (e) {}
+        if (suggestions !== undefined) {
+            for (var i = 0; i < suggestions.length; i++) {
+                if (suggestions[i].match(/^\w+:\w+$/)) {
+                    // curie!
+                    suggestions[i] = suggestions[i] + " ";
+                } else {
+                    suggestions[i] = "<" + suggestions[i] + "> ";
+                }
+            }
+            return {
+              list: suggestions,
+              from: {line: cur.line, ch: token.start - 1},
+              to: {line: cur.line, ch: replUntil}
+            };
+        }
+        return false;
+    }
+    function completeCUIE(editor, cur, token) {
+        return false; // no completion here in skwrl
+        var from = token.start, 
+            to = token.end, 
+            req = token.string.substr(0, cur.ch - token.start);
+        var prevToken = editor.getTokenAt({line: cur.line, ch: token.start});
+        if (token.className == 'atom' && prevToken.className == 'qualifier') {
+            from = prevToken.start;
+            req = prevToken.string + req;
+        }
+        
+        var suggestions;
+        try {
+            var qs = {};
+            if (token.state.stack.indexOf("transformer") >= 0) qs['mode'] = "transformer";
+            for (var n in token.state.namespaces) {
+                qs['ns_'+n] = token.state.getNamespace(n);
+            }
+            qs['prefix'] = req;
+
+            jQuery.ajax(token.state.lmfBaseURL + "ldpath/util/complete", {
+               async: false,
+               data: qs,
+               success: function(data) {
+                   suggestions = data;  
+               },
+               dataType: "json"
+            });
+        } catch (e) {}
+        if (suggestions !== undefined) {
+            for (var i = 0; i < suggestions.length; i++) {
+                if (suggestions[i].match(/^\w+:\w+(\(\))?$/)) {
+                    // curie!
+                    suggestions[i] = suggestions[i] + " ";
+                } else {
+                    // prefix only
+                    suggestions[i] = suggestions[i] + ":";
+                }
+            }
+            return {
+              list: suggestions,
+              from: {line: cur.line, ch: from},
+              to: {line: cur.line, ch: to}
+            };
+        }
+        
+        return false;
+    }
+    function insertPrefixDef(editor, cur, token) {
+        var prefix = token.string.replace(/:?$/, ""), result;
+        try {
+//            jQuery.ajax(token.state.lmfBaseURL + "ldpath/util/prefix", {
+            jQuery.ajax("http://prefix.cc/" + prefix + ".file.json", {
+                async: false,
+                data: {prefix: prefix},
+                success: function(data) {
+                    result = data[prefix];
+                },
+                dataType: "json"
+            });
+        } catch (e) {}
+        if (result !== undefined) {
+            // check if this url is already prefixed
+            var px;
+            for (var i in token.state.namespaces) {
+                if (token.state.namespaces[i] == result) {
+                    px = i;
+                    break;
+                }
+            } 
+            if (px) {
+                return {
+                    list: [ px + ":" ],
+                    from: { line: cur.line, ch: token.start },
+                    to: { line: cur.line, ch: token.end }
+                };
+            } else {
+            return {
+                list: [ "@prefix " + prefix + ": <" + result + ">\n" ],
+                from: {line: 0, ch: 0},
+                to: {line: 0, ch: 0}
+            };
+            } 
+        }
+    }
+    CodeMirror.commands.skwrlAutocomplete = function(cm) {
+        CodeMirror.simpleHint(cm, function(editor) {
+            var cur = editor.getCursor();
+            var line = editor.getLine(cur.line);
+            var token = editor.getTokenAt(cur);
+        
+            if (token.state.stack.indexOf('prefix') >= 0) {
+                return completePrefix(editor, cur, token);
+//            } else if (token.state.current() == 'url' || (token.state.current() == 'error' && token.state.stack[1] == 'url')) {
+//                return completeURI(editor, cur, token);
+//            } else if (token.className == "qualifier" || (token.className == "atom" && token.state.stack.indexOf("path") >= 0)) {
+//                return completeCUIE(editor, cur, token);
+            } else if (token.className == "string-2") {
+                return insertPrefixDef(editor, cur, token);
+            } else {
+                if (console && console.log) {
+                    console.log("State: " + token.state.stack);
+                }
+            }
+        });
+    }
+}
+
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/extras/webjars/codemirror/src/main/resources/sparql.js
----------------------------------------------------------------------
diff --git a/extras/webjars/codemirror/src/main/resources/sparql.js b/extras/webjars/codemirror/src/main/resources/sparql.js
new file mode 100644
index 0000000..8ffa73b
--- /dev/null
+++ b/extras/webjars/codemirror/src/main/resources/sparql.js
@@ -0,0 +1,210 @@
+// CodeMirror version 2.24
+//
+// All functions that need access to the editor's state live inside
+// the CodeMirror function. Below that, at the bottom of the file,
+// some utilities are defined.
+//
+// License: MIT-License <http://codemirror.net/LICENSE>
+
+CodeMirror.defineMode("sparql", function(config) {
+  var indentUnit = config.indentUnit;
+  var curPunc;
+
+  function wordRegexp(words) {
+    return new RegExp("^(?:" + words.join("|") + ")$", "i");
+  }
+  var ops = wordRegexp(["str", "lang", "langmatches", "datatype", "bound", "sameterm", "isiri", "isuri",
+                        "isblank", "isliteral", "union", "a"]);
+  var keywords = wordRegexp(["base", "prefix", "select", "distinct", "reduced", "construct", "describe",
+                             "ask", "from", "named", "where", "group", "order", "limit", "offset", "filter", 
+                             "optional", "graph", "by", "asc", "desc", "insert", "data", "delete"]);
+  var operatorChars = /[*+\-<>=&|]/;
+
+  function tokenBase(stream, state) {
+    var ch = stream.next();
+    curPunc = null;
+    if (ch == "$" || ch == "?") {
+      stream.match(/^[\w\d]*/);
+      return "variable-2";
+    }
+    else if (ch == "<" && !stream.match(/^[\s\u00a0=]/, false)) {
+      stream.match(/^[^\s\u00a0>]*>?/);
+      return "atom";
+    }
+    else if (ch == "\"" || ch == "'") {
+      state.tokenize = tokenLiteral(ch);
+      return state.tokenize(stream, state);
+    }
+    else if (/[{}\(\),\.;\[\]]/.test(ch)) {
+      curPunc = ch;
+      return null;
+    }
+    else if (ch == "#") {
+      stream.skipToEnd();
+      return "comment";
+    }
+    else if (operatorChars.test(ch)) {
+      stream.eatWhile(operatorChars);
+      return null;
+    }
+    else if (ch == ":") {
+      stream.eatWhile(/[\w\d\._\-]/);
+      return "atom";
+    }
+    else {
+      stream.eatWhile(/[_\w\d]/);
+      if (stream.eat(":")) {
+        stream.eatWhile(/[\w\d_\-]/);
+        return "atom";
+      }
+      var word = stream.current(), type;
+      if (ops.test(word))
+        return null;
+      else if (keywords.test(word))
+        return "keyword";
+      else
+        return "variable";
+    }
+  }
+
+  function tokenLiteral(quote) {
+    return function(stream, state) {
+      var escaped = false, ch;
+      while ((ch = stream.next()) != null) {
+        if (ch == quote && !escaped) {
+          state.tokenize = tokenBase;
+          break;
+        }
+        escaped = !escaped && ch == "\\";
+      }
+      return "string";
+    };
+  }
+
+  function pushContext(state, type, col) {
+    state.context = {prev: state.context, indent: state.indent, col: col, type: type};
+  }
+  function popContext(state) {
+    state.indent = state.context.indent;
+    state.context = state.context.prev;
+  }
+
+  return {
+    startState: function(base) {
+      return {tokenize: tokenBase,
+              context: null,
+              indent: 0,
+              col: 0};
+    },
+
+    token: function(stream, state) {
+      if (stream.sol()) {
+        if (state.context && state.context.align == null) state.context.align = false;
+        state.indent = stream.indentation();
+      }
+      if (stream.eatSpace()) return null;
+      var style = state.tokenize(stream, state);
+
+      if (style != "comment" && state.context && state.context.align == null && state.context.type != "pattern") {
+        state.context.align = true;
+      }
+
+      if (curPunc == "(") pushContext(state, ")", stream.column());
+      else if (curPunc == "[") pushContext(state, "]", stream.column());
+      else if (curPunc == "{") pushContext(state, "}", stream.column());
+      else if (/[\]\}\)]/.test(curPunc)) {
+        while (state.context && state.context.type == "pattern") popContext(state);
+        if (state.context && curPunc == state.context.type) popContext(state);
+      }
+      else if (curPunc == "." && state.context && state.context.type == "pattern") popContext(state);
+      else if (/atom|string|variable/.test(style) && state.context) {
+        if (/[\}\]]/.test(state.context.type))
+          pushContext(state, "pattern", stream.column());
+        else if (state.context.type == "pattern" && !state.context.align) {
+          state.context.align = true;
+          state.context.col = stream.column();
+        }
+      }
+      
+      return style;
+    },
+
+    indent: function(state, textAfter) {
+      var firstChar = textAfter && textAfter.charAt(0);
+      var context = state.context;
+      if (/[\]\}]/.test(firstChar))
+        while (context && context.type == "pattern") context = context.prev;
+
+      var closing = context && firstChar == context.type;
+      if (!context)
+        return 0;
+      else if (context.type == "pattern")
+        return context.col;
+      else if (context.align)
+        return context.col + (closing ? 0 : 1);
+      else
+        return context.indent + (closing ? 0 : indentUnit);
+    }
+  };
+});
+
+if (CodeMirror.simpleHint && jQuery) {
+    function completePrefix(editor, cur, token, prevToken) {
+        var line = editor.getLine(cur.line);
+        var match = line.match(/(^|;)\s*PREFIX\s+(\w+)\s*(:\s*<?)?(;|$)/);
+        if (match && match[2] && match[2] !== "") {
+            var prefix = match[2], result;
+            try {
+                jQuery.ajax("http://prefix.cc/" + prefix + ".file.json", {
+                    async: false,
+                    success: function(data) {
+                        result = data[prefix];
+                    },
+                    dataType: "json"
+                });
+            } catch (e) {}
+            if (result !== undefined) {
+                var pfx = line.substr(0,cur.ch);
+                var st = pfx.search(/\s*(:\s*<?)?$/);
+                return {
+                    list: [ ": <"+result+">" ],
+                    from: {line: cur.line, ch: st},
+                    to: cur
+                };
+            }
+        }
+        return false;
+    }
+    CodeMirror.commands.sparqlAutocomplete = function(cm) {
+        CodeMirror.simpleHint(cm, function(editor) {
+            var cur = editor.getCursor();
+            var line = editor.getLine(cur.line);
+
+            // search for the last prefix
+            for(i = cur.ch; i >= 0; i--) {
+                var token = editor.getTokenAt({line: cur.line, ch: i});
+                if(token.className == "keyword" && token.string == "PREFIX") {
+                    break;
+                }
+            }
+            console.dir(token);
+
+            // search for the next atom
+            for(i = token.end + 1; i <= cur.ch; i++) {
+                var atomToken = editor.getTokenAt({line: cur.line, ch: i});
+                if(atomToken.className == "atom") {
+                    break;
+                }
+            }
+            console.dir(atomToken);
+
+
+            if (atomToken.className == "atom") {
+                return completePrefix(editor, cur, atomToken, token);
+            }
+        });
+    }
+}
+
+
+CodeMirror.defineMIME("application/x-sparql-query", "sparql");

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/extras/webjars/pom.xml
----------------------------------------------------------------------
diff --git a/extras/webjars/pom.xml b/extras/webjars/pom.xml
new file mode 100644
index 0000000..2450243
--- /dev/null
+++ b/extras/webjars/pom.xml
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ 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.
+  -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>org.apache.marmotta</groupId>
+        <artifactId>marmotta-parent</artifactId>
+        <version>3.1.0-incubating</version>
+        <relativePath>../../parent/</relativePath>
+    </parent>
+
+    <groupId>org.apache.marmotta.webjars</groupId>
+    <artifactId>webjars</artifactId>
+    <packaging>pom</packaging>
+
+    <build>
+        <plugins>
+            <plugin>
+                <!-- this is a reactor, no checking -->
+                <groupId>org.apache.rat</groupId>
+                <artifactId>apache-rat-plugin</artifactId>
+                <configuration>
+                    <excludes>
+                        <exclude>**</exclude>
+                    </excludes>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+
+    <modules>
+        <module>snorql</module>
+        <module>codemirror</module>
+        <module>sgvizler</module>
+        <module>strftime</module>
+    </modules>
+    
+</project>

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/extras/webjars/sgvizler/pom.xml
----------------------------------------------------------------------
diff --git a/extras/webjars/sgvizler/pom.xml b/extras/webjars/sgvizler/pom.xml
new file mode 100644
index 0000000..a611271
--- /dev/null
+++ b/extras/webjars/sgvizler/pom.xml
@@ -0,0 +1,80 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ 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.
+  -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>org.apache.marmotta</groupId>
+        <artifactId>marmotta-parent</artifactId>
+        <version>3.1.0-incubating</version>
+        <relativePath>../../../parent/</relativePath> 
+    </parent>
+
+    <properties>
+        <webjar.version>0.5.1</webjar.version>
+    </properties>
+
+    <groupId>org.apache.marmotta.webjars</groupId>
+    <artifactId>sgvizler</artifactId>
+    <packaging>jar</packaging>
+
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.sonatype.plugins</groupId>
+                <artifactId>yuicompressor-maven-plugin</artifactId>
+                <version>1.0.0</version>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>aggregate</goal>
+                        </goals>
+                    </execution>
+                </executions>
+                <configuration>
+                    <nomunge>true</nomunge>
+                    <sourceDirectory>${project.basedir}/src/main/resources</sourceDirectory>
+                    <output>${project.build.outputDirectory}/META-INF/resources/webjars/${project.artifactId}/${webjar.version}/sgvizler.js</output>
+                </configuration>
+            </plugin>
+            <plugin>
+                <!-- these are "extras", so they come from 3rd parties, no RAT check! -->
+                <groupId>org.apache.rat</groupId>
+                <artifactId>apache-rat-plugin</artifactId>
+                <configuration>
+                    <excludes>
+                        <exclude>src/**</exclude>
+                    </excludes>
+                </configuration>
+            </plugin>
+        </plugins>
+        <resources>
+            <resource>
+                <directory>src/main/resources</directory>
+                <excludes>
+                    <exclude>**/*.js</exclude>
+                </excludes>
+                <filtering>false</filtering>
+                <targetPath>${project.build.outputDirectory}/META-INF/resources/webjars/${project.artifactId}/${webjar.version}</targetPath>
+            </resource>
+        </resources>
+     </build>
+
+</project>


[078/100] [abbrv] git commit: Merge branch 'develop' of https://git-wip-us.apache.org/repos/asf/marmotta into develop

Posted by wi...@apache.org.
Merge branch 'develop' of https://git-wip-us.apache.org/repos/asf/marmotta into develop


Project: http://git-wip-us.apache.org/repos/asf/marmotta/repo
Commit: http://git-wip-us.apache.org/repos/asf/marmotta/commit/2c784942
Tree: http://git-wip-us.apache.org/repos/asf/marmotta/tree/2c784942
Diff: http://git-wip-us.apache.org/repos/asf/marmotta/diff/2c784942

Branch: refs/heads/ldp
Commit: 2c784942ba4f6caf3a21052549ece7c6ca497819
Parents: 6c47f77 c8bd0c0
Author: Sebastian Schaffert <ss...@apache.org>
Authored: Thu Apr 10 10:11:48 2014 +0200
Committer: Sebastian Schaffert <ss...@apache.org>
Committed: Thu Apr 10 10:11:48 2014 +0200

----------------------------------------------------------------------
 .../marmotta-archetype-module/pom.xml           |  4 ++--
 .../marmotta-archetype-webapp/pom.xml           | 24 ++++++++++----------
 build/archetypes/pom.xml                        |  2 +-
 build/checkstyle-resources/pom.xml              |  2 +-
 build/dependency-resource-supplement/pom.xml    |  2 +-
 build/plugins/buildinfo-maven-plugin/pom.xml    |  2 +-
 build/plugins/marmotta-maven-plugin/pom.xml     |  2 +-
 build/plugins/pom.xml                           |  2 +-
 build/plugins/refpack-maven-plugin/pom.xml      |  2 +-
 build/plugins/repocheck-maven-plugin/pom.xml    |  2 +-
 build/pom.xml                                   |  2 +-
 client/marmotta-client-java/pom.xml             |  2 +-
 client/marmotta-client-js/pom.xml               |  2 +-
 client/pom.xml                                  |  2 +-
 commons/marmotta-commons/pom.xml                |  2 +-
 .../marmotta-model-vocabs/pom.xml               |  2 +-
 .../marmotta-rio-api/pom.xml                    |  2 +-
 .../marmotta-rio-ical/pom.xml                   |  2 +-
 .../marmotta-rio-rss/pom.xml                    |  2 +-
 .../marmotta-rio-vcard/pom.xml                  |  2 +-
 .../marmotta-sail-contextaware/pom.xml          |  2 +-
 .../marmotta-sail-transactions/pom.xml          |  2 +-
 .../marmotta-sesame-matchers/pom.xml            |  2 +-
 .../marmotta-util-facading/pom.xml              |  2 +-
 .../marmotta-util-filter/pom.xml                |  2 +-
 .../marmotta-util-rdfpatch/pom.xml              |  2 +-
 .../marmotta-util-tripletable/pom.xml           |  2 +-
 commons/marmotta-sesame-tools/pom.xml           |  2 +-
 commons/pom.xml                                 |  2 +-
 extras/pom.xml                                  |  2 +-
 extras/webjars/codemirror/pom.xml               |  2 +-
 extras/webjars/pom.xml                          |  2 +-
 extras/webjars/strftime/pom.xml                 |  2 +-
 launchers/marmotta-installer/pom.xml            |  2 +-
 launchers/marmotta-splash/pom.xml               |  2 +-
 launchers/marmotta-webapp/pom.xml               |  2 +-
 launchers/pom.xml                               |  2 +-
 libraries/kiwi/kiwi-caching-ehcache/pom.xml     |  6 ++---
 libraries/kiwi/kiwi-caching-hazelcast/pom.xml   |  6 ++---
 libraries/kiwi/kiwi-caching-infinispan/pom.xml  |  6 ++---
 libraries/kiwi/kiwi-loader/pom.xml              |  5 ++--
 libraries/kiwi/kiwi-reasoner/pom.xml            |  2 +-
 libraries/kiwi/kiwi-sparql/pom.xml              |  2 +-
 libraries/kiwi/kiwi-triplestore/pom.xml         |  2 +-
 libraries/kiwi/kiwi-versioning/pom.xml          |  2 +-
 libraries/kiwi/pom.xml                          |  2 +-
 libraries/ldcache/ldcache-api/pom.xml           |  2 +-
 libraries/ldcache/ldcache-backend-file/pom.xml  |  2 +-
 .../ldcache/ldcache-backend-infinispan/pom.xml  |  6 ++---
 libraries/ldcache/ldcache-backend-kiwi/pom.xml  |  2 +-
 libraries/ldcache/ldcache-core/pom.xml          |  2 +-
 libraries/ldcache/ldcache-sail-generic/pom.xml  |  2 +-
 libraries/ldcache/ldcache-sail-kiwi/pom.xml     |  2 +-
 libraries/ldcache/pom.xml                       |  2 +-
 libraries/ldclient/ldclient-api/pom.xml         |  2 +-
 libraries/ldclient/ldclient-core/pom.xml        |  2 +-
 .../ldclient/ldclient-provider-facebook/pom.xml |  2 +-
 .../ldclient/ldclient-provider-freebase/pom.xml |  2 +-
 .../ldclient/ldclient-provider-html/pom.xml     |  2 +-
 .../ldclient/ldclient-provider-ldap/pom.xml     |  2 +-
 .../ldclient-provider-mediawiki/pom.xml         |  2 +-
 .../ldclient/ldclient-provider-phpbb/pom.xml    |  2 +-
 .../ldclient/ldclient-provider-rdf/pom.xml      |  2 +-
 .../ldclient/ldclient-provider-rdfa/pom.xml     |  2 +-
 .../ldclient/ldclient-provider-vimeo/pom.xml    |  2 +-
 .../ldclient/ldclient-provider-xml/pom.xml      |  2 +-
 .../ldclient/ldclient-provider-youtube/pom.xml  |  2 +-
 libraries/ldclient/pom.xml                      |  2 +-
 libraries/ldpath/ldpath-api/pom.xml             |  2 +-
 libraries/ldpath/ldpath-backend-file/pom.xml    |  2 +-
 libraries/ldpath/ldpath-backend-jena/pom.xml    |  2 +-
 .../ldpath-backend-linkeddata/assembly.xml      |  6 -----
 .../ldpath/ldpath-backend-linkeddata/pom.xml    |  6 ++++-
 libraries/ldpath/ldpath-backend-sesame/pom.xml  |  2 +-
 libraries/ldpath/ldpath-core-bundle/pom.xml     |  2 +-
 libraries/ldpath/ldpath-core/pom.xml            |  2 +-
 .../ldpath/ldpath-functions-collections/pom.xml |  2 +-
 libraries/ldpath/ldpath-functions-date/pom.xml  |  2 +-
 libraries/ldpath/ldpath-functions-html/pom.xml  |  2 +-
 libraries/ldpath/ldpath-functions-math/pom.xml  |  2 +-
 libraries/ldpath/ldpath-functions-text/pom.xml  |  2 +-
 libraries/ldpath/ldpath-functions-xml/pom.xml   |  2 +-
 .../ldpath/ldpath-template-linkeddata/pom.xml   |  2 +-
 libraries/ldpath/ldpath-template/pom.xml        |  2 +-
 libraries/ldpath/pom.xml                        |  2 +-
 libraries/pom.xml                               |  2 +-
 loader/marmotta-loader-berkeley/pom.xml         |  6 ++---
 loader/marmotta-loader-core/pom.xml             |  2 +-
 loader/marmotta-loader-hbase/pom.xml            |  6 ++---
 loader/marmotta-loader-kiwi/pom.xml             |  6 ++---
 loader/marmotta-loader-titan/pom.xml            |  2 +-
 loader/pom.xml                                  |  2 +-
 parent/pom.xml                                  |  2 +-
 platform/backends/marmotta-backend-kiwi/pom.xml |  6 ++---
 .../backends/marmotta-backend-memory/pom.xml    |  6 ++---
 .../backends/marmotta-backend-native/pom.xml    |  6 ++---
 .../backends/marmotta-backend-titan/pom.xml     |  6 ++---
 platform/backends/pom.xml                       |  2 +-
 .../ldcache/marmotta-ldcache-common/pom.xml     |  6 ++---
 platform/ldcache/marmotta-ldcache-file/pom.xml  |  2 +-
 platform/ldcache/marmotta-ldcache-kiwi/pom.xml  |  2 +-
 platform/ldcache/pom.xml                        |  2 +-
 platform/marmotta-core/pom.xml                  |  2 +-
 platform/marmotta-ldp/pom.xml                   |  2 +-
 platform/marmotta-ldpath/pom.xml                |  2 +-
 platform/marmotta-reasoner-kiwi/pom.xml         |  2 +-
 platform/marmotta-security/pom.xml              |  2 +-
 platform/marmotta-sparql/pom.xml                |  2 +-
 platform/marmotta-user/pom.xml                  |  2 +-
 platform/marmotta-versioning-common/pom.xml     |  6 ++---
 platform/marmotta-versioning-kiwi/pom.xml       |  2 +-
 platform/marmotta-zookeeper/pom.xml             |  6 ++---
 platform/pom.xml                                |  2 +-
 pom.xml                                         |  5 +++-
 114 files changed, 150 insertions(+), 172 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/marmotta/blob/2c784942/build/archetypes/marmotta-archetype-module/pom.xml
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/marmotta/blob/2c784942/build/archetypes/marmotta-archetype-webapp/pom.xml
----------------------------------------------------------------------


[072/100] [abbrv] git commit: Merge branch 'develop' into master for the 3.2.0 release

Posted by wi...@apache.org.
Merge branch 'develop' into master for the 3.2.0 release


Project: http://git-wip-us.apache.org/repos/asf/marmotta/repo
Commit: http://git-wip-us.apache.org/repos/asf/marmotta/commit/1c58043d
Tree: http://git-wip-us.apache.org/repos/asf/marmotta/tree/1c58043d
Diff: http://git-wip-us.apache.org/repos/asf/marmotta/diff/1c58043d

Branch: refs/heads/ldp
Commit: 1c58043d4130adacc46cbe07bb47d6675d1b424e
Parents: bc775f7 a20097e
Author: Jakob Frank <ja...@salzburgresearch.at>
Authored: Wed Apr 9 09:50:18 2014 +0200
Committer: Jakob Frank <ja...@salzburgresearch.at>
Committed: Wed Apr 9 09:50:18 2014 +0200

----------------------------------------------------------------------

----------------------------------------------------------------------



[011/100] [abbrv] [partial] Reverting the erroneous merge by Sebastian according to the instructions in INFRA-6876

Posted by wi...@apache.org.
http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/transformers/ShortTransformer.java
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/transformers/ShortTransformer.java b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/transformers/ShortTransformer.java
index 66fcfa1..352f6a1 100644
--- a/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/transformers/ShortTransformer.java
+++ b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/transformers/ShortTransformer.java
@@ -17,7 +17,7 @@
  */
 package org.apache.marmotta.ldpath.model.transformers;
 
-import org.apache.marmotta.ldpath.api.backend.NodeBackend;
+import org.apache.marmotta.ldpath.api.backend.RDFBackend;
 import org.apache.marmotta.ldpath.api.transformers.NodeTransformer;
 
 import java.util.Map;
@@ -25,7 +25,7 @@ import java.util.Map;
 public class ShortTransformer<Node> implements NodeTransformer<Short,Node> {
 
     @Override
-    public Short transform(NodeBackend<Node> backend, Node node, Map<String, String> configuration) throws IllegalArgumentException {
+    public Short transform(RDFBackend<Node> backend, Node node, Map<String, String> configuration) throws IllegalArgumentException {
         if(backend.isLiteral(node)) {
             return backend.decimalValue(node).shortValueExact();
         } else {

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/transformers/StringTransformer.java
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/transformers/StringTransformer.java b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/transformers/StringTransformer.java
index addb444..7f6e365 100644
--- a/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/transformers/StringTransformer.java
+++ b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/transformers/StringTransformer.java
@@ -17,7 +17,7 @@
  */
 package org.apache.marmotta.ldpath.model.transformers;
 
-import org.apache.marmotta.ldpath.api.backend.NodeBackend;
+import org.apache.marmotta.ldpath.api.backend.RDFBackend;
 import org.apache.marmotta.ldpath.api.transformers.NodeTransformer;
 
 import java.util.Map;
@@ -35,11 +35,13 @@ public class StringTransformer<Node> implements NodeTransformer<String,Node> {
      * the respective datatype, throws an IllegalArgumentException that needs to be caught by the class
      * carrying out the transformation.
      *
+     *
+     * @param backend
      * @param node
      * @return
      */
     @Override
-    public String transform(NodeBackend<Node> backend, Node node, Map<String, String> configuration) throws IllegalArgumentException {
+    public String transform(RDFBackend<Node> backend, Node node, Map<String, String> configuration) throws IllegalArgumentException {
         return backend.stringValue(node);
     }
 }

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/transformers/TimeTransformer.java
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/transformers/TimeTransformer.java b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/transformers/TimeTransformer.java
index 887c0eb..c6aeb48 100644
--- a/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/transformers/TimeTransformer.java
+++ b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/transformers/TimeTransformer.java
@@ -21,7 +21,7 @@ package org.apache.marmotta.ldpath.model.transformers;
 import java.util.Date;
 import java.util.Map;
 
-import org.apache.marmotta.ldpath.api.backend.NodeBackend;
+import org.apache.marmotta.ldpath.api.backend.RDFBackend;
 import org.apache.marmotta.ldpath.api.transformers.NodeTransformer;
 
 /**
@@ -36,11 +36,13 @@ public class TimeTransformer<Node> implements NodeTransformer<Date,Node> {
      * the respective datatype, throws an IllegalArgumentException that needs to be caught by the class
      * carrying out the transformation.
      *
+     *
+     * @param rdfBackend
      * @param node
      * @return
      */
     @Override
-    public Date transform(NodeBackend<Node> rdfBackend, Node node, Map<String, String> configuration) throws IllegalArgumentException {
+    public Date transform(RDFBackend<Node> rdfBackend, Node node, Map<String, String> configuration) throws IllegalArgumentException {
         if(rdfBackend.isLiteral(node)) {
             return rdfBackend.timeValue(node);
         } else {

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/util/Collections.java
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/util/Collections.java b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/util/Collections.java
index 8f2abea..651c771 100644
--- a/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/util/Collections.java
+++ b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/util/Collections.java
@@ -34,6 +34,7 @@ public class Collections {
      * @param lists
      * @return
      */
+    @SafeVarargs
     public static <T> List<T> concat(final Collection<T>... lists) {
         List<T> result = new ArrayList<T>();
         for(Collection<T> list : lists) {
@@ -46,6 +47,7 @@ public class Collections {
      * @param lists the array with the lists
      * @return the plain iterator over all elements of the lists
      */
+    @SafeVarargs
     public static <T> Iterator<T> iterator(final Collection<T>...lists){
         return iterator(0,lists);
     }
@@ -57,6 +59,7 @@ public class Collections {
      * @return the plain iterator over all elements of the lists starting from
      * index offset
      */
+    @SafeVarargs
     public static <T> Iterator<T> iterator(final int offset,final Collection<T>...lists){
         if(offset < 0){
             throw new IllegalArgumentException("The parsed Offest MUST NOT be < 0!");

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-core/src/main/javacc/at/newmedialab/ldpath/parser/rdfpath.jj
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-core/src/main/javacc/at/newmedialab/ldpath/parser/rdfpath.jj b/libraries/ldpath/ldpath-core/src/main/javacc/at/newmedialab/ldpath/parser/rdfpath.jj
index c91a6a9..bd71bb5 100644
--- a/libraries/ldpath/ldpath-core/src/main/javacc/at/newmedialab/ldpath/parser/rdfpath.jj
+++ b/libraries/ldpath/ldpath-core/src/main/javacc/at/newmedialab/ldpath/parser/rdfpath.jj
@@ -26,7 +26,7 @@ options
 //  DEBUG_LOOKAHEAD=true;
 }
 
-PARSER_BEGIN(RdfPathParser)
+PARSER_BEGIN(LdPathParser)
 package org.apache.marmotta.ldpath.parser;
 
 import org.apache.marmotta.ldpath.model.Constants;
@@ -47,6 +47,7 @@ import org.apache.marmotta.ldpath.model.transformers.*;
 
 
 import java.util.ArrayList;
+import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
 import java.util.Map.Entry;
@@ -64,12 +65,12 @@ import org.slf4j.LoggerFactory;
 
 
 @SuppressWarnings("all")
-public class RdfPathParser<Node> {
+public class LdPathParser<Node> {
 
         private enum Mode { RULE, SELECTOR, TEST, PROGRAM, PREFIX };
 
 
-        private static final Logger log = LoggerFactory.getLogger(RdfPathParser.class);
+        private static final Logger log = LoggerFactory.getLogger(LdPathParser.class);
 
         /**
          * A map mapping from namespace prefix to namespace URI
@@ -82,11 +83,11 @@ public class RdfPathParser<Node> {
 
         private Mode mode = Mode.PROGRAM;
 
-        public RdfPathParser(NodeBackend<Node> backend, Reader in) {
+        public LdPathParser(NodeBackend<Node> backend, Reader in) {
             this(backend,null,in);
         }
 
-        public RdfPathParser(NodeBackend<Node> backend, Configuration config, Reader in) {
+        public LdPathParser(NodeBackend<Node> backend, Configuration config, Reader in) {
             this(in);
             this.backend = backend;
             if(config == null) {
@@ -98,11 +99,11 @@ public class RdfPathParser<Node> {
             initialise();
         }
 
-        public RdfPathParser(NodeBackend<Node> backend, InputStream in) {
+        public LdPathParser(NodeBackend<Node> backend, InputStream in) {
             this(backend,null,in);
         }
 
-        public RdfPathParser(NodeBackend<Node> backend, Configuration config, InputStream in) {
+        public LdPathParser(NodeBackend<Node> backend, Configuration config, InputStream in) {
             this(in);
             this.backend = backend;
             if(config == null) {
@@ -114,11 +115,11 @@ public class RdfPathParser<Node> {
             initialise();
         }
 
-        public RdfPathParser(NodeBackend<Node> backend, InputStream in, String encoding) {
+        public LdPathParser(NodeBackend<Node> backend, InputStream in, String encoding) {
             this(backend,null,in,encoding);
         }
 
-        public RdfPathParser(NodeBackend<Node> backend, Configuration config, InputStream in, String encoding) {
+        public LdPathParser(NodeBackend<Node> backend, Configuration config, InputStream in, String encoding) {
             this(in,encoding);
             this.backend = backend;
             if(config == null) {
@@ -211,11 +212,16 @@ public class RdfPathParser<Node> {
             }
         }
 
+        public Node resolveURI(URI uri) {
            return backend.createURI(uri.toString());
+        }
 
-        public Node resolveResource(String uri) {
+        public Node resolveResource(String uri) throws ParseException {
             return backend.createURI(uri);
         }
 
+        public Node resolveResource(String prefix, String local) throws ParseException {
+            return resolveResource(resolveNamespace(prefix)+local);
        }
+
 
         public String resolveNamespace(String prefix) throws ParseException {
             String uri = namespaces.get(prefix);
@@ -242,6 +248,14 @@ public class RdfPathParser<Node> {
             }
         }
 
+        public NodeTransformer<?,Node> getTransformer(URI type) throws ParseException {
+            return getTransformer(type.toString());
+        }
+
+        public NodeTransformer<?,Node> getTransformer(Node node) throws ParseException {
+            return getTransformer(backend.stringValue(node));
+        }
+
         public NodeTransformer<?,Node> getTransformer(String uri) throws ParseException {
             if(xsdNodeTransformerMap.get(uri) != null) {
                 return xsdNodeTransformerMap.get(uri);
@@ -289,7 +303,7 @@ public class RdfPathParser<Node> {
 
 
         private Map<String, SelectorFunction<Node>> xsdNodeFunctionMap;
-    private Map<String, TestFunction<Node>> xsdNodeTestMap;
+        private Map<String, TestFunction<Node>> xsdNodeTestMap;
         private void initFunctionMappings() {
             Map<String, SelectorFunction<Node>> functionMap = new HashMap<String, SelectorFunction<Node>>();
 
@@ -333,7 +347,7 @@ public class RdfPathParser<Node> {
         }
 
 }
-PARSER_END(RdfPathParser)
+PARSER_END(LdPathParser)
 
 SKIP :
 {
@@ -374,20 +388,49 @@ MORE:
 }
 
 
+TOKEN : /* LDPATH */
+{
+  < COMMA:  "," >  |
+  < SCOLON: ";" >  |
+  < COLON:  ":" >  |
+  < DCOLON: "::" > |
+  < ASSIGN: "=" >  |
+  < K_PREFIX: "@prefix" > |
+  < K_FILTER: "@filter" > |
+  < K_BOOST:  "@boost" >  |
+  < K_GRAPH:  "@graph" >
+}
 TOKEN : /* OPERATORS */
 {
+    < SELF: "." >    |
 	< AND:  "&" >    |
 	< OR:   "|" >    |
+    < P_SEP:"/" >    |
+    < PLUS: "+" >    |
+    < STAR: "*" >    |
 	< NOT:  "!" >    |
+    < INVERSE: "^" > |
 	< IS:   "is" >   |
 	< IS_A: "is-a" > |
+    < FUNC: "fn:" >  |
   	< TYPE: "^^" >   |
   	< LANG: "@" >
 }
 
+TOKEN : /* BRACKETS */
+{
+  < B_RO: "(" > |
+  < B_RC: ")" > |
+  < B_SO: "[" > |
+  < B_SC: "]" > |
+  < B_CO: "{" > |
+  < B_CC: "}" > |
+  < B_XO: "<" > |
+  < B_XC: ">" > 
+}
 TOKEN :
 {
-    < URI: ["a"-"z","A"-"Z"](["a"-"z","A"-"Z","0"-"9","+","-","."])* "://"  (["a"-"z","A"-"Z","0"-"9",";","/","?",":","@","&","=","+","$",".","-","_","!","~","*","'","%"])+ ("#" (["a"-"z","A"-"Z","0"-"9",";","/","?",":","@","&","=","+","$",".","-","_","!","~","*","'","%"])*)? | "#" (["a"-"z","A"-"Z","0"-"9",";","/","?",":","@","&","=","+","$",".","-","_","!","~","*","'","%"])+> |
+    < URI: "<" (~[ ">","<", "\"", "{", "}", "^", "\\", "|", "`", "\u0000"-"\u0020"])+ ">" > |
     < IDENTIFIER: ["a"-"z","A"-"Z","0"-"9","_"](["a"-"z","A"-"Z","0"-"9","_","'","-", "."])* > |
     < #URICHAR: ["a"-"z","A"-"Z","0"-"9",";","/","?",":","@","&","=","+","$",".","-","_","!","~","*","'","%"] >
 }
@@ -415,9 +458,9 @@ Entry<String, String> Namespace() :
 }
 {
   ( 
-    "@prefix" id = <IDENTIFIER> ":" "<" uri = <URI> ">" (";")? {
+    <K_PREFIX> id = <IDENTIFIER> <COLON> uri = <URI> (<SCOLON> )? {
     }
-  ) { return new Namespace(id.image, uri.image); }
+  ) { return new Namespace(id.image, uri.image.substring(1,uri.image.length()-1)); }
 }
 
 Program Program() :
@@ -427,6 +470,7 @@ Program Program() :
     Map<String, String> nss = null;
     FieldMapping<?,Node> rule;
     NodeSelector<Node> boostSelector;
+    LinkedList<Node> graphs;
 }
 {
   (
@@ -439,15 +483,21 @@ Program Program() :
   )?
 
   (
-    "@filter" filter = NodeTest() ";" {
+    <K_GRAPH> graphs = UriList() <SCOLON> {
+      program.setGraphs(graphs);
+    }
+  )?
+
+  (
+    <K_FILTER> filter = NodeTest() <SCOLON> {
         program.setFilter(filter);
     }
   )?
 
   (
-    "@boost" boostSelector = Selector() ";" {
+    <K_BOOST> boostSelector = Selector() <SCOLON> {
     	NodeTransformer transformer = getTransformer(Program.DOCUMENT_BOOST_TYPE);
-		FieldMapping booster = new FieldMapping("@boost", Program.DOCUMENT_BOOST_TYPE, boostSelector, transformer, null);
+		FieldMapping booster = new FieldMapping("@boost", java.net.URI.create(Program.DOCUMENT_BOOST_TYPE), boostSelector, transformer, null);
 		program.setBooster(booster);  
     }
   )?
@@ -464,18 +514,32 @@ Program Program() :
   }
 }
 
+LinkedList<Node> UriList() :
+{
+    LinkedList<Node> rest = null;
+    URI uri;
+}
+{
+    uri = Uri() ( <COMMA> rest = UriList() )?
+    {
+      if (rest == null) rest = new LinkedList<Node>();
+      rest.addFirst(resolveURI(uri));
+      return rest;
+    }
+}
+
 FieldMapping Rule() :
 {
     FieldMapping<?,Node> rule;
     Token name;
-    String uri;
-    String type = null;
+    URI uri;
+    URI type = null;
     NodeSelector<Node> selector;
     NodeTransformer<?,Node> transformer;
     Map<String, String> conf = null;
 }
 {
-    name = <IDENTIFIER> "=" selector = Selector() ("::" type = Uri())? ("(" conf = FieldConfig() ")")? ";" {
+    name = <IDENTIFIER> <ASSIGN> selector = Selector() (<DCOLON> type = Uri())? (<B_RO> conf = FieldConfig() <B_RC>)? <SCOLON> {
         if(type != null) {
             transformer = getTransformer(type);
         } else {
@@ -487,7 +551,7 @@ FieldMapping Rule() :
         rule = new FieldMapping(name.image,type,selector,transformer, conf);
         return rule;
     }
-|   uri = Uri() "=" selector = Selector() ("::" type = Uri())? ("(" conf = FieldConfig() ")")? ";" {
+|   uri = Uri() <ASSIGN> selector = Selector() (<DCOLON> type = Uri())? (<B_RO> conf = FieldConfig() <B_RC>)? <SCOLON> {
         if(type != null) {
             transformer = getTransformer(type);
         } else {
@@ -499,7 +563,7 @@ FieldMapping Rule() :
         rule = new FieldMapping(uri,type,selector,transformer, conf);
         return rule;
     }
-|   selector = Selector() ("::" type = Uri())? ("(" conf = FieldConfig() ")")? (";")? {
+|   selector = Selector() (<DCOLON> type = Uri())? (<B_RO> conf = FieldConfig() <B_RC>)? (<SCOLON>)? {
         if(type != null) {
             transformer = getTransformer(type);
         } else {
@@ -531,7 +595,7 @@ Map<String,String> FieldConfig() : {
 	Map<String,String> more = null;
 }
 {
-	( key = <IDENTIFIER> "=" val = ConfVal() ("," more = FieldConfig() )? )? {
+	( key = <IDENTIFIER> <ASSIGN> val = ConfVal() ( <COMMA> more = FieldConfig() )? )? {
 		if (key == null || val == null) return null;
 		conf.put(key.image, val);
 		if (more != null) {
@@ -549,16 +613,16 @@ String ConfVal() : {
 |	id = <IDENTIFIER> { return id.image; }
 }
 
-String Uri() : {
+URI Uri() : {
     Token uri, prefix, localName;
 
 }
 {
-    "<" uri = <URI> ">" {
-       return uri.image;
+    uri = <URI> {
+       return java.net.URI.create(uri.image.substring(1,uri.image.length()-1));
     }
 |   prefix = <IDENTIFIER> ":" localName = <IDENTIFIER> {
-        return resolveNamespace(prefix.image)+localName.image;
+        return java.net.URI.create(resolveNamespace(prefix.image)+localName.image);
     }
 }
 
@@ -678,7 +742,7 @@ NodeSelector SelfSelector() :
 {
 }
 {
-	"." { return new SelfSelector(); }
+	<SELF> { return new SelfSelector(); }
 }
 
 NodeSelector GroupedSelector() :
@@ -687,9 +751,9 @@ NodeSelector GroupedSelector() :
 }
 {
     /* Other selector enclosed in braces */
-    "(" result = Selector() ")"
+    <B_RO> result = Selector() <B_RC>
     {
-        return result;
+        return new GroupedSelector(result);
     }
 
 }
@@ -700,12 +764,12 @@ RecursivePathSelector RecursivePathSelector() :
 	NodeSelector delegate        = null;
 }
 {
-	"(" delegate = Selector() ")" "+"
+	<B_RO> delegate = Selector() <B_RC> <PLUS>	
 	{
 		result = RecursivePathSelector.getPathSelectorPlused(delegate);
 		return result;
 	} |
-    "(" delegate = Selector() ")" "*"
+    <B_RO> delegate = Selector() <B_RC> <STAR>
     {
         result = RecursivePathSelector.getPathSelectorStared(delegate);
         return result;
@@ -719,7 +783,7 @@ PathSelector PathSelector() :
     NodeSelector right  = null;
 }
 {
-    left = AtomicOrTestingSelector() "/" right = AtomicOrTestingOrPathSelector()
+    left = AtomicOrTestingSelector() <P_SEP> right = AtomicOrTestingOrPathSelector()
     {
         result = new PathSelector(left,right);
         return result;
@@ -733,7 +797,7 @@ IntersectionSelector IntersectionSelector() :
     NodeSelector right  = null;
 }
 {
-    left = AtomicOrTestingOrPathSelector() "&" right = Selector()
+    left = AtomicOrTestingOrPathSelector() <AND> right = Selector()
     {
         result = new IntersectionSelector(left,right);
         return result;
@@ -747,7 +811,7 @@ UnionSelector UnionSelector() :
     NodeSelector right  = null;
 }
 {
-    left = AtomicOrTestingOrPathSelector() "|" right = Selector()
+    left = AtomicOrTestingOrPathSelector() <OR> right = Selector()
     {
         result = new UnionSelector(left,right);
         return result;
@@ -761,7 +825,7 @@ TestingSelector TestingSelector() :
     NodeTest test = null;
 }
 {
-    delegate = AtomicSelector() "[" test = NodeTest() "]" {
+    delegate = AtomicSelector() <B_SO> test = NodeTest() <B_SC> {
         result = new TestingSelector(delegate,test);
         return result;
     }
@@ -770,13 +834,11 @@ TestingSelector TestingSelector() :
 ReversePropertySelector ReversePropertySelector() :
 {
 	ReversePropertySelector result = null;
-	Node property;
-    String uri;
+	URI uri;
 }
 {
-	"^" uri = Uri() {
-        property = resolveResource(uri);
-        result   = new ReversePropertySelector(property);
+	<INVERSE> uri = Uri() {
+        result   = new ReversePropertySelector(resolveURI(uri));
         return result;
 	}
 }
@@ -784,13 +846,11 @@ ReversePropertySelector ReversePropertySelector() :
 PropertySelector PropertySelector() :
 {
     PropertySelector result = null;
-    Node property;
-    String uri;
+    URI uri;
 }
 {
     uri = Uri() {
-        property = resolveResource(uri);
-        result   = new PropertySelector(property);
+        result   = new PropertySelector(resolveURI(uri));
         return result;
     }
 }
@@ -800,7 +860,7 @@ WildcardSelector WildcardSelector() :
     WildcardSelector result = null;
 }
 {
-    "*" {
+    <STAR> {
         result = new WildcardSelector();
         return result;
     }
@@ -817,22 +877,22 @@ FunctionSelector FunctionSelector() :
 {
     /* Function-Calls without arguments can skip parenthesis */
     /* Does not work... why?
-    "fn:" fName = <IDENTIFIER> {
+    <FUNC> fName = <IDENTIFIER> {
            uri = namespaces.get("fn") + fName.image;
            result = new FunctionSelector(getFunction(uri),Collections.emptyList());
            return result;
     } | */
     /* Functions do not need to have arguments */
-    "fn:" fName = <IDENTIFIER> "(" ")" {
+    <FUNC> fName = <IDENTIFIER> <B_RO> <B_RC> {
            uri = namespaces.get("fn") + fName.image;
            result = new FunctionSelector(getFunction(uri),Collections.emptyList());
            return result;
     } |
     /* Sometimes arguments are required */
-    "fn:" fName = <IDENTIFIER> "("
+    <FUNC> fName = <IDENTIFIER> <B_RO>
             argument = Selector() { arguments.add(argument); }
-            ( "," argument = Selector() { arguments.add(argument); } )*
-    ")" {
+            ( <COMMA> argument = Selector() { arguments.add(argument); } )*
+    <B_RC> {
            uri = namespaces.get("fn") + fName.image;
            result = new FunctionSelector(getFunction(uri),arguments);
            return result;
@@ -876,7 +936,7 @@ NodeTest GroupedTest() :
     NodeTest delegate;
 }
 {
-    "(" delegate = NodeTest() ")" {
+    <B_RO> delegate = NodeTest() <B_RC> {
        return delegate;
     }
 }
@@ -889,7 +949,7 @@ NodeTest AtomicNodeTest() :
     (
         result = LiteralLanguageTest()
     |   result = LiteralTypeTest()
-    |   result = TypeTest()
+    |   result = IsATest()
     |   result = PathEqualityTest()
     |   result = FunctionTest()
     |   result = PathTest()
@@ -911,20 +971,20 @@ FunctionTest FunctionTest() :
   (    
     /* Function-Calls without arguments can skip parenthesis */
     /* Does not work... why?
-    "fn:" fName = <IDENTIFIER> {
+    <FUNC> fName = <IDENTIFIER> {
            uri = namespaces.get("fn") + fName.image;
            result = new FunctionSelector(getTestFunction(uri),Collections.emptyList());
     } | */
     /* Functions do not need to have arguments */
-    "fn:" fName = <IDENTIFIER> "(" ")" {
+    <FUNC> fName = <IDENTIFIER> <B_RO> <B_RC> {
            uri = namespaces.get("fn") + fName.image;
            result = new FunctionTest(getTestFunction(uri),Collections.emptyList());
     } |
     /* Sometimes arguments are required */
-    "fn:" fName = <IDENTIFIER> "("
+    <FUNC> fName = <IDENTIFIER> <B_RO>
             argument = Selector() { arguments.add(argument); }
-            ( "," argument = Selector() { arguments.add(argument); } )*
-    ")" {
+            ( <COMMA> argument = Selector() { arguments.add(argument); } )*
+    <B_RC> {
            uri = namespaces.get("fn") + fName.image;
            result = new FunctionTest(getTestFunction(uri),arguments);
     }
@@ -939,17 +999,17 @@ LiteralLanguageTest LiteralLanguageTest():
     Token lang;
 }
 {
-    "@" lang = <IDENTIFIER> {
+    <LANG> lang = <IDENTIFIER> {
         return new LiteralLanguageTest(lang.image);
     }
 }
 
 LiteralTypeTest LiteralTypeTest():
 {
-    String type;
+    URI type;
 }
 {
-    "^^" type = Uri() {
+    <TYPE> type = Uri() {
         return new LiteralTypeTest(type);
     }
 }
@@ -959,18 +1019,18 @@ NotTest NotTest() :
     NodeTest delegate;
 }
 {
-    "!" delegate = NodeTest() {
+    <NOT>  delegate = NodeTest() {
         return new NotTest(delegate);
     }
 }
 
-PathEqualityTest TypeTest() :
+IsATest IsATest() :
 {
     Node node;
 }
 {
     <IS_A> node = Node() {
-        return new PathEqualityTest(new PropertySelector(resolveResource("http://www.w3.org/1999/02/22-rdf-syntax-ns#type")), node);
+        return new IsATest(resolveResource("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"), node);
     }
 }
 
@@ -980,7 +1040,7 @@ AndTest AndTest():
     NodeTest left, right;
 }
 {
-    left = AtomicNodeTest() "&" right = NodeTest() {
+    left = AtomicNodeTest() <AND> right = NodeTest() {
         return new AndTest(left,right);
     }
 }
@@ -990,7 +1050,7 @@ OrTest OrTest():
     NodeTest left, right;
 }
 {
-    left = AtomicNodeTest() "|" right = NodeTest() {
+    left = AtomicNodeTest() <OR> right = NodeTest() {
         return new OrTest(left,right);
     }
 }
@@ -1001,7 +1061,7 @@ PathEqualityTest PathEqualityTest():
     Node node;
 }
 {
-    path = Selector() "is" node = Node() {
+    path = Selector() <IS> node = Node() {
         return new PathEqualityTest(path,node);
     }
 }
@@ -1009,21 +1069,17 @@ PathEqualityTest PathEqualityTest():
 
 Node Node():
 {
-    String uri, type = null;
+    URI uri, type = null;
     Token literal, language;
 }
 {
     uri = Uri() {
-        return resolveResource(uri);
+        return resolveURI(uri);
     }
-|   literal = <STRLIT>  ("^^" type = Uri() )? {
-        try {
-            return backend.createLiteral(literal.image.substring(1, literal.image.length()-1),null,type == null ? null : new URI(type));
-        } catch(java.net.URISyntaxException ex) {
-            throw new ParseException("could not parse type URI "+type+": "+ex.getMessage());
-	    }
+|   literal = <STRLIT>  (<TYPE> type = Uri() )? {
+        return backend.createLiteral(literal.image.substring(1, literal.image.length()-1),null,type);
     }
-|   literal = <STRLIT>  "@" language = <IDENTIFIER> {
+|   literal = <STRLIT>  <LANG> language = <IDENTIFIER> {
         return backend.createLiteral(literal.image.substring(1, literal.image.length()-1),new Locale(language.image),null);
     }
 }

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-core/src/test/java/org/apache/marmotta/ldpath/model/functions/BinaryNumericTestFunctionsTest.java
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-core/src/test/java/org/apache/marmotta/ldpath/model/functions/BinaryNumericTestFunctionsTest.java b/libraries/ldpath/ldpath-core/src/test/java/org/apache/marmotta/ldpath/model/functions/BinaryNumericTestFunctionsTest.java
index 5047873..948d5c4 100644
--- a/libraries/ldpath/ldpath-core/src/test/java/org/apache/marmotta/ldpath/model/functions/BinaryNumericTestFunctionsTest.java
+++ b/libraries/ldpath/ldpath-core/src/test/java/org/apache/marmotta/ldpath/model/functions/BinaryNumericTestFunctionsTest.java
@@ -29,7 +29,7 @@ import java.util.List;
 
 import org.apache.marmotta.ldpath.api.selectors.NodeSelector;
 import org.apache.marmotta.ldpath.parser.ParseException;
-import org.apache.marmotta.ldpath.parser.RdfPathParser;
+import org.apache.marmotta.ldpath.parser.LdPathParser;
 import org.apache.marmotta.ldpath.test.AbstractTestBase;
 import org.junit.Before;
 import org.junit.Test;
@@ -70,7 +70,7 @@ public class BinaryNumericTestFunctionsTest extends AbstractTestBase {
 
     @Before
     public void loadData() throws RepositoryException, RDFParseException, IOException {
-        super.loadData("test-data.n3", RDFFormat.N3);
+        super.loadData("/ldpath/test-data.n3", RDFFormat.N3);
     }
 
     @Test
@@ -96,7 +96,7 @@ public class BinaryNumericTestFunctionsTest extends AbstractTestBase {
         }
 
 
-        final RdfPathParser<Value> parser = createParserFromString("ex:hasItem[" + fkt + "(foo:left, foo:right)]");
+        final LdPathParser<Value> parser = createParserFromString("ex:hasItem[" + fkt + "(foo:left, foo:right)]");
         final NodeSelector<Value> sel = parser.parseSelector(NSS);
 
         final Collection<Value> result = sel.select(backend, start, null, null);

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-core/src/test/java/org/apache/marmotta/ldpath/model/functions/FunctionsTest.java
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-core/src/test/java/org/apache/marmotta/ldpath/model/functions/FunctionsTest.java b/libraries/ldpath/ldpath-core/src/test/java/org/apache/marmotta/ldpath/model/functions/FunctionsTest.java
index 5ee947e..7df1621 100644
--- a/libraries/ldpath/ldpath-core/src/test/java/org/apache/marmotta/ldpath/model/functions/FunctionsTest.java
+++ b/libraries/ldpath/ldpath-core/src/test/java/org/apache/marmotta/ldpath/model/functions/FunctionsTest.java
@@ -29,7 +29,7 @@ import java.util.Collection;
 import org.apache.marmotta.ldpath.api.selectors.NodeSelector;
 import org.apache.marmotta.ldpath.model.fields.FieldMapping;
 import org.apache.marmotta.ldpath.parser.ParseException;
-import org.apache.marmotta.ldpath.parser.RdfPathParser;
+import org.apache.marmotta.ldpath.parser.LdPathParser;
 import org.apache.marmotta.ldpath.test.AbstractTestBase;
 import org.hamcrest.CoreMatchers;
 import org.junit.Before;
@@ -47,13 +47,13 @@ public class FunctionsTest extends AbstractTestBase {
 
     @Before
     public void loadData() throws RepositoryException, RDFParseException, IOException {
-        loadData("test-data.n3", RDFFormat.N3);
+        loadData("/ldpath/test-data.n3", RDFFormat.N3);
     }
 
     @Test
     public void testConcat() throws ParseException {
 
-        RdfPathParser<Value> parser = createParserFromString("fn:concat(foo:title, \" \", foo:subtitle) :: xsd:string; ");
+        LdPathParser<Value> parser = createParserFromString("fn:concat(foo:title, \" \", foo:subtitle) :: xsd:string; ");
         final URI context = repository.getValueFactory().createURI("http://www.example.com/1");
 
         final FieldMapping<Object, Value> field = parser.parseRule(NSS);
@@ -67,7 +67,7 @@ public class FunctionsTest extends AbstractTestBase {
         final URI ctx1 = repository.getValueFactory().createURI("http://www.example.com/1");
         final URI ctx2 = repository.getValueFactory().createURI("http://www.example.com/2");
 
-        RdfPathParser<Value> parser = createParserFromString("fn:first(foo:not_valid, foo:title, foo:subtitle, foo:not_valid2) :: xsd:string; ");
+        LdPathParser<Value> parser = createParserFromString("fn:first(foo:not_valid, foo:title, foo:subtitle, foo:not_valid2) :: xsd:string; ");
         final FieldMapping<Object, Value> field = parser.parseRule(NSS);
 
         final Collection<Object> result = field.getValues(backend, ctx1);
@@ -84,7 +84,7 @@ public class FunctionsTest extends AbstractTestBase {
         final URI ctx1 = repository.getValueFactory().createURI("http://www.example.com/1");
         final URI ctx2 = repository.getValueFactory().createURI("http://www.example.com/2");
 
-        RdfPathParser<Value> parser = createParserFromString("fn:first(foo:i) :: xsd:int; ");
+        LdPathParser<Value> parser = createParserFromString("fn:first(foo:i) :: xsd:int; ");
         final FieldMapping<Object, Value> field = parser.parseRule(NSS);
 
         final Collection<Object> result = field.getValues(backend, ctx1);
@@ -101,7 +101,7 @@ public class FunctionsTest extends AbstractTestBase {
         final URI ctx1 = repository.getValueFactory().createURI("http://www.example.com/1");
         final URI ctx2 = repository.getValueFactory().createURI("http://www.example.com/2");
 
-        RdfPathParser<Value> parser = createParserFromString("fn:last(foo:not_valid, foo:title, foo:subtitle, foo:not_valid2) :: xsd:string; ");
+        LdPathParser<Value> parser = createParserFromString("fn:last(foo:not_valid, foo:title, foo:subtitle, foo:not_valid2) :: xsd:string; ");
         final FieldMapping<Object, Value> field = parser.parseRule(NSS);
 
         final Collection<Object> result = field.getValues(backend, ctx1);
@@ -118,7 +118,7 @@ public class FunctionsTest extends AbstractTestBase {
         final URI ctx1 = repository.getValueFactory().createURI("http://www.example.com/1");
         final URI ctx2 = repository.getValueFactory().createURI("http://www.example.com/2");
 
-        RdfPathParser<Value> parser = createParserFromString("fn:last(foo:i, ex:not_here) :: xsd:int; ");
+        LdPathParser<Value> parser = createParserFromString("fn:last(foo:i, ex:not_here) :: xsd:int; ");
         final FieldMapping<Object, Value> field = parser.parseRule(NSS);
 
         final Collection<Object> result = field.getValues(backend, ctx1);
@@ -136,14 +136,14 @@ public class FunctionsTest extends AbstractTestBase {
         final URI ex1 = repository.getValueFactory().createURI("http://www.example.com/1");
         final URI ex2 = repository.getValueFactory().createURI("http://www.example.com/2");
 
-        final RdfPathParser<Value> parser = createParserFromString("ex:hasItem[fn:eq(foo:i, foo:j)]");
+        final LdPathParser<Value> parser = createParserFromString("ex:hasItem[fn:eq(foo:i, foo:j)]");
         final NodeSelector<Value> sel = parser.parseSelector(NSS);
 
         final Collection<Value> result = sel.select(backend, start, null, null);
         assertEquals(1, result.size());
         assertThat(result, allOf(hasItem(ex2), not(hasItem(ex1))));
 
-        final RdfPathParser<Value> parseri = createParserFromString("ex:hasItem[! fn:eq(foo:i, foo:j)]");
+        final LdPathParser<Value> parseri = createParserFromString("ex:hasItem[! fn:eq(foo:i, foo:j)]");
         final NodeSelector<Value> seli = parseri.parseSelector(NSS);
 
         final Collection<Value> resulti = seli.select(backend, start, null, null);

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-core/src/test/java/org/apache/marmotta/ldpath/parser/EmptyTestingBackend.java
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-core/src/test/java/org/apache/marmotta/ldpath/parser/EmptyTestingBackend.java b/libraries/ldpath/ldpath-core/src/test/java/org/apache/marmotta/ldpath/parser/EmptyTestingBackend.java
index 65329f0..cf02c4c 100644
--- a/libraries/ldpath/ldpath-core/src/test/java/org/apache/marmotta/ldpath/parser/EmptyTestingBackend.java
+++ b/libraries/ldpath/ldpath-core/src/test/java/org/apache/marmotta/ldpath/parser/EmptyTestingBackend.java
@@ -1,13 +1,12 @@
-/**
- * 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
+/*
+ * 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
+ *      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,

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-core/src/test/java/org/apache/marmotta/ldpath/parser/ParserTest.java
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-core/src/test/java/org/apache/marmotta/ldpath/parser/ParserTest.java b/libraries/ldpath/ldpath-core/src/test/java/org/apache/marmotta/ldpath/parser/ParserTest.java
index f7bcbe8..6a7734d 100644
--- a/libraries/ldpath/ldpath-core/src/test/java/org/apache/marmotta/ldpath/parser/ParserTest.java
+++ b/libraries/ldpath/ldpath-core/src/test/java/org/apache/marmotta/ldpath/parser/ParserTest.java
@@ -1,13 +1,12 @@
-/**
- * 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
+/*
+ * 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
+ *      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,
@@ -20,6 +19,7 @@ package org.apache.marmotta.ldpath.parser;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertThat;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
@@ -32,11 +32,11 @@ import java.util.Map;
 
 import org.apache.commons.io.IOUtils;
 import org.apache.marmotta.ldpath.api.backend.NodeBackend;
+import org.apache.marmotta.ldpath.api.backend.RDFBackend;
 import org.apache.marmotta.ldpath.api.tests.NodeTest;
 import org.apache.marmotta.ldpath.api.transformers.NodeTransformer;
 import org.apache.marmotta.ldpath.model.programs.Program;
 import org.hamcrest.CoreMatchers;
-import org.junit.Assume;
 import org.junit.BeforeClass;
 import org.junit.Test;
 
@@ -46,12 +46,14 @@ public class ParserTest {
     private static NodeBackend<String> backend;
     private static final String NS_TEST = "http://example.com/";
     private static final String NS_FOO = "http://foo.com/some/path#";
+    private static final String NS_FOOBAR = "urn:uuid:1234";
 
     private static final Map<String, String> NAMESPACES;
     static {
         Map<String, String> ns = new HashMap<String, String>();
         ns.put("test", NS_TEST);
         ns.put("foo", NS_FOO);
+        ns.put("foobar", NS_FOOBAR);
         NAMESPACES = Collections.unmodifiableMap(ns);
     }
 
@@ -63,7 +65,7 @@ public class ParserTest {
 
     @Test
     public void testParseProgram() throws IOException {
-        RdfPathParser<String> parser = createParser("program.ldpath");
+        LdPathParser<String> parser = createParser("program.ldpath");
         try {
             Program<String> program = parser.parseProgram();
             assertNotNull(program.getField("path"));
@@ -83,7 +85,7 @@ public class ParserTest {
 
     @Test
     public void testParseTest() throws IOException {
-        RdfPathParser<String> parser = createParser("test.ldpath");
+        LdPathParser<String> parser = createParser("test.ldpath");
         try {
             NodeTest<String> test = parser.parseTest(NAMESPACES);
             assertNotNull(test);
@@ -95,27 +97,29 @@ public class ParserTest {
 
     @Test
     public void testParsePrefixes() throws IOException {
-        RdfPathParser<String> parser = createParser("namespaces.ldpath");
+        LdPathParser<String> parser = createParser("namespaces.ldpath");
         try {
             Map<String, String> prefixes = parser.parsePrefixes();
             assertTrue(prefixes.containsKey("test"));
             assertTrue(prefixes.containsKey("foo"));
+            assertTrue(prefixes.containsKey("foobar"));
             assertEquals(NS_TEST, prefixes.get("test"));
             assertEquals(NS_FOO, prefixes.get("foo"));
+            assertEquals(NS_FOOBAR, prefixes.get("foobar"));
         } catch (ParseException e) {
             assertFalse(e.getMessage(), true);
         }
     }
 
 
-    private RdfPathParser<String> createParser(String input) throws IOException {
-        final URL resource = ParserTest.class.getResource(input);
-        Assume.assumeThat("Could not load test input data '" + input + "'", resource, CoreMatchers.notNullValue());
+    private LdPathParser<String> createParser(String input) throws IOException {
+        final URL resource = ParserTest.class.getResource("/parse/"+input);
+        assertThat("Could not load test input data '" + input + "'", resource, CoreMatchers.notNullValue());
 
-        RdfPathParser<String> rdfPathParser = new RdfPathParser<String>(backend,new StringReader(IOUtils.toString(resource)));
+        LdPathParser<String> rdfPathParser = new LdPathParser<String>(backend,new StringReader(IOUtils.toString(resource)));
         rdfPathParser.registerTransformer(NS_TEST + "type", new NodeTransformer<String, String>() {
             @Override
-            public String transform(NodeBackend<String> backend, String node, Map<String,String> configuration)
+            public String transform(RDFBackend<String> backend, String node, Map<String,String> configuration)
                     throws IllegalArgumentException {
                 return node;
             }

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-core/src/test/java/org/apache/marmotta/ldpath/parser/ProgramTest.java
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-core/src/test/java/org/apache/marmotta/ldpath/parser/ProgramTest.java b/libraries/ldpath/ldpath-core/src/test/java/org/apache/marmotta/ldpath/parser/ProgramTest.java
new file mode 100644
index 0000000..0f74279
--- /dev/null
+++ b/libraries/ldpath/ldpath-core/src/test/java/org/apache/marmotta/ldpath/parser/ProgramTest.java
@@ -0,0 +1,78 @@
+/*
+ * 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.ldpath.parser;
+
+import static org.junit.Assert.assertThat;
+
+import java.io.IOException;
+import java.io.StringReader;
+import java.net.URL;
+import java.util.Map;
+
+import org.apache.commons.io.IOUtils;
+import org.apache.marmotta.ldpath.api.backend.RDFBackend;
+import org.apache.marmotta.ldpath.api.transformers.NodeTransformer;
+import org.apache.marmotta.ldpath.model.programs.Program;
+import org.hamcrest.CoreMatchers;
+import org.hamcrest.text.IsEqualIgnoringWhiteSpace;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+public class ProgramTest {
+    
+    private static StringTestingBackend backend;
+
+    private String expr;
+
+    private Program<String> program;
+
+    @BeforeClass
+    public static void beforeClass() {
+        backend = new StringTestingBackend();
+    }
+
+    
+    @Before
+    public void before() throws ParseException, IOException {
+        final URL resource = ParserTest.class.getResource("/parse/program.ldpath");
+        assertThat("Could not load test input data '/parse/program.ldpath'", resource, CoreMatchers.notNullValue());
+
+        expr = IOUtils.toString(resource);
+        
+        LdPathParser<String> rdfPathParser = new LdPathParser<String>(backend,new StringReader(expr));
+        rdfPathParser.registerTransformer("http://example.com/type", new NodeTransformer<String, String>() {
+            @Override
+            public String transform(RDFBackend<String> backend, String node, Map<String,String> configuration)
+                    throws IllegalArgumentException {
+                return node;
+            }
+        });
+
+        program = rdfPathParser.parseProgram();
+        
+        expr = expr.replaceAll("/\\*(?:.|[\\n\\r])*?\\*/", "");
+    }
+
+    @Test
+    public void testGetPathExpression() {
+        final String result = program.getPathExpression(backend);
+        Assert.assertThat(result, IsEqualIgnoringWhiteSpace.equalToIgnoringWhiteSpace(expr));
+    }
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-core/src/test/java/org/apache/marmotta/ldpath/parser/SelectorsTest.java
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-core/src/test/java/org/apache/marmotta/ldpath/parser/SelectorsTest.java b/libraries/ldpath/ldpath-core/src/test/java/org/apache/marmotta/ldpath/parser/SelectorsTest.java
new file mode 100644
index 0000000..f2a0327
--- /dev/null
+++ b/libraries/ldpath/ldpath-core/src/test/java/org/apache/marmotta/ldpath/parser/SelectorsTest.java
@@ -0,0 +1,100 @@
+/*
+ * 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.ldpath.parser;
+
+import java.io.StringReader;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+
+import org.apache.marmotta.ldpath.api.backend.NodeBackend;
+import org.apache.marmotta.ldpath.api.selectors.NodeSelector;
+import org.hamcrest.CoreMatchers;
+import org.hamcrest.text.IsEqualIgnoringWhiteSpace;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+import org.junit.runners.Parameterized.Parameter;
+import org.junit.runners.Parameterized.Parameters;
+
+@RunWith(Parameterized.class)
+public class SelectorsTest {
+
+    @Parameters(name = "{index}: {1}Selector")
+    public static List<String[]> testCases() {
+        return Arrays.asList(new String[][] {
+                {"*", "Wildcard"},
+                {"<http://www.example.com/>", "Property"},
+                {"<http://foo.bar> / <http://bar.foo>", "Path"},
+                {"<http://foo.bar> & <http://bar.foo>", "Intersection"},
+                {"<http://foo.bar> | <http://bar.foo>", "Union"},
+                {"<http://foo.bar>[<http://bar.foo>]", "Testing"},
+                {"(<http://www.example.com/>[@en])", "Grouped"},
+                {"(<http://www.example.com/>)*", "RecursivePath"},
+                {"(<http://www.example.com/>)+", "RecursivePath"},
+                {"^<http://www.example.com/>", "ReverseProperty"},
+                {"fn:count(\"foo\")", "Function"},
+                // Not implemented yet: {"^*", "ReverseProperty"},
+                {".", "Self"},
+                {"\"Hello World\"", "StringConstant"},
+                });
+    }
+    
+    @Parameter
+    public String expr;
+    
+    @Parameter(1)
+    public String name;
+
+    private NodeSelector<String> selector;
+    
+    private static NodeBackend<String> backend;
+
+    @BeforeClass
+    public static void beforeClass() {
+        backend = new StringTestingBackend();
+    }
+    
+    @Before
+    public void before() throws ParseException {
+        LdPathParser<String> rdfPathParser = new LdPathParser<String>(backend,new StringReader(expr));
+        selector = rdfPathParser.parseSelector(Collections.<String,String>emptyMap());
+    }
+    
+    @Test
+    public void testGetPathExpression() {
+        Assert.assertThat(selector.getPathExpression(backend), IsEqualIgnoringWhiteSpace.equalToIgnoringWhiteSpace(expr));
+    }
+    
+    @Test
+    public void testParseSelector() {
+        final String className = "org.apache.marmotta.ldpath.model.selectors." + name + "Selector";
+        try {
+            final Class<?> cls = Class.forName(className);
+            Assert.assertThat(selector, CoreMatchers.instanceOf(cls));
+        } catch (ClassNotFoundException e) {
+            Assert.fail("Could not load class: " + className);
+        }
+        
+    }
+    
+    
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-core/src/test/java/org/apache/marmotta/ldpath/parser/StringTestingBackend.java
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-core/src/test/java/org/apache/marmotta/ldpath/parser/StringTestingBackend.java b/libraries/ldpath/ldpath-core/src/test/java/org/apache/marmotta/ldpath/parser/StringTestingBackend.java
new file mode 100644
index 0000000..2af51ad
--- /dev/null
+++ b/libraries/ldpath/ldpath-core/src/test/java/org/apache/marmotta/ldpath/parser/StringTestingBackend.java
@@ -0,0 +1,98 @@
+/*
+ * 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.ldpath.parser;
+
+import java.net.URI;
+import java.util.Locale;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import org.apache.marmotta.ldpath.model.backend.AbstractBackend;
+
+public class StringTestingBackend extends AbstractBackend<String> {
+
+    private static final Pattern LANG_PATTERN = Pattern.compile("@(\\w+)"),
+            TYPE_PATTERN = Pattern.compile("\\^\\^([\\w:/.#%-]+)");
+    
+    @Override
+    public boolean isLiteral(String n) {
+        return n.startsWith("\"");
+    }
+
+    @Override
+    public boolean isURI(String n) {
+        return n.startsWith("<");
+    }
+
+    @Override
+    public boolean isBlank(String n) {
+        return n.startsWith("_");
+    }
+
+    @Override
+    public Locale getLiteralLanguage(String n) {
+        final Matcher m = LANG_PATTERN.matcher(n);
+        if (m.find()) {
+            return new Locale(m.group(1));
+        }
+        return null;
+    }
+
+    @Override
+    public URI getLiteralType(String n) {
+        final Matcher m = TYPE_PATTERN.matcher(n);
+        if (m.find()) {
+            return URI.create(m.group(1));
+        }
+        return null;
+    }
+
+    @Override
+    public String createLiteral(String content) {
+        return "\""+content+"\"";
+    }
+
+    @Override
+    public String createLiteral(String content, Locale language, URI type) {
+        StringBuilder sb = new StringBuilder('"');
+        sb.append(content).append('"');
+        if (language != null) {
+            sb.append("@").append(language.getLanguage());
+        }
+        if (type != null) {
+            sb.append("^^").append(type.toString());
+        }
+        return sb.toString();
+    }
+
+    @Override
+    public String createURI(String uri) {
+        return "<" + uri + ">";
+    }
+
+    @Override
+    public String stringValue(String node) {
+        if (node.startsWith("<")) {
+            return node.substring(1, node.length()-1);
+        } else if (node.startsWith("\"")) {
+            return node.substring(1, node.indexOf('"', 1));
+        } else
+            return node;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-core/src/test/java/org/apache/marmotta/ldpath/parser/TestsTest.java
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-core/src/test/java/org/apache/marmotta/ldpath/parser/TestsTest.java b/libraries/ldpath/ldpath-core/src/test/java/org/apache/marmotta/ldpath/parser/TestsTest.java
new file mode 100644
index 0000000..92f820e
--- /dev/null
+++ b/libraries/ldpath/ldpath-core/src/test/java/org/apache/marmotta/ldpath/parser/TestsTest.java
@@ -0,0 +1,95 @@
+/*
+ * 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.ldpath.parser;
+
+import java.io.StringReader;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+
+import org.apache.marmotta.ldpath.api.backend.NodeBackend;
+import org.apache.marmotta.ldpath.api.tests.NodeTest;
+import org.hamcrest.CoreMatchers;
+import org.hamcrest.text.IsEqualIgnoringWhiteSpace;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+import org.junit.runners.Parameterized.Parameter;
+import org.junit.runners.Parameterized.Parameters;
+
+@RunWith(Parameterized.class)
+public class TestsTest {
+
+    @Parameters(name = "{index}: {1}Test")
+    public static List<String[]> testCases() {
+        return Arrays.asList(new String[][] {
+                {"<http://foo.bar> & <http://bar.foo>", "And"},
+                {"fn:eq(\"1\", \"2\")", "Function"},
+                {"@en", "LiteralLanguage"},
+                {"^^<http://foo.bar>", "LiteralType"},
+                {"!@en", "Not"},
+                {"<http://foo.bar> | <http://bar.foo>", "Or"},
+                {"<http://www.example.com/> is <http://foo.bar>", "PathEquality"},
+                {"is-a <http://foo.bar>", "IsA"},
+                {"<http://www.example.com/>", "Path"},
+                });
+    }
+    
+    @Parameter
+    public String expr;
+    
+    @Parameter(1)
+    public String name;
+
+    private NodeTest<String> test;
+    
+    private static NodeBackend<String> backend;
+
+    @BeforeClass
+    public static void beforeClass() {
+        backend = new StringTestingBackend();
+    }
+    
+    @Before
+    public void before() throws ParseException {
+        LdPathParser<String> rdfPathParser = new LdPathParser<String>(backend,new StringReader(expr));
+        test = rdfPathParser.parseTest(Collections.<String,String>emptyMap());
+    }
+    
+    @Test
+    public void testGetPathExpression() {
+        Assert.assertThat(test.getPathExpression(backend), IsEqualIgnoringWhiteSpace.equalToIgnoringWhiteSpace(expr));
+    }
+    
+    @Test
+    public void testParseSelector() {
+        final String className = "org.apache.marmotta.ldpath.model.tests." + name + "Test";
+        try {
+            final Class<?> cls = Class.forName(className);
+            Assert.assertThat(test, CoreMatchers.instanceOf(cls));
+        } catch (ClassNotFoundException e) {
+            Assert.fail("Could not load class: " + className);
+        }
+        
+    }
+    
+    
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-core/src/test/java/org/apache/marmotta/ldpath/test/AbstractTestBase.java
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-core/src/test/java/org/apache/marmotta/ldpath/test/AbstractTestBase.java b/libraries/ldpath/ldpath-core/src/test/java/org/apache/marmotta/ldpath/test/AbstractTestBase.java
index 9152031..e1acd89 100644
--- a/libraries/ldpath/ldpath-core/src/test/java/org/apache/marmotta/ldpath/test/AbstractTestBase.java
+++ b/libraries/ldpath/ldpath-core/src/test/java/org/apache/marmotta/ldpath/test/AbstractTestBase.java
@@ -18,13 +18,27 @@
 package org.apache.marmotta.ldpath.test;
 
 
+import static org.hamcrest.CoreMatchers.notNullValue;
+import static org.junit.Assert.assertThat;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.StringReader;
+import java.net.URL;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.NoSuchElementException;
+
 import org.apache.marmotta.ldpath.api.selectors.NodeSelector;
 import org.apache.marmotta.ldpath.backend.sesame.SesameRepositoryBackend;
 import org.apache.marmotta.ldpath.model.fields.FieldMapping;
-import org.apache.marmotta.ldpath.parser.*;
+import org.apache.marmotta.ldpath.parser.ParseException;
+import org.apache.marmotta.ldpath.parser.LdPathParser;
 import org.hamcrest.CoreMatchers;
 import org.junit.After;
-import org.junit.Assume;
+import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Rule;
 import org.junit.rules.TestWatcher;
@@ -40,20 +54,6 @@ import org.openrdf.sail.memory.MemoryStore;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.StringReader;
-import java.net.URL;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.NoSuchElementException;
-
-import static org.hamcrest.CoreMatchers.notNullValue;
-import static org.junit.Assert.assertThat;
-import static org.junit.Assume.assumeThat;
-
 public abstract class AbstractTestBase {
     protected final static Map<String, String> NSS;
     static {
@@ -108,18 +108,18 @@ public abstract class AbstractTestBase {
     };
 
 
-    protected RdfPathParser<Value> createParserFromResource(String input) throws IOException {
+    protected LdPathParser<Value> createParserFromResource(String input) throws IOException {
         final URL resource = this.getClass().getResource(input);
-        assumeThat("Could not load test input data '" + input + "'", resource, CoreMatchers.notNullValue());
+        assertThat("Could not load test input data '" + input + "'", resource, CoreMatchers.notNullValue());
 
-        RdfPathParser<Value> parser = new RdfPathParser<Value>(backend, resource.openStream());
+        LdPathParser<Value> parser = new LdPathParser<Value>(backend, resource.openStream());
         assertThat("Could not parse ldPath", parser, CoreMatchers.notNullValue());
 
         return parser;
     }
 
-    protected RdfPathParser<Value> createParserFromString(String program) {
-        final RdfPathParser<Value> parser = new RdfPathParser<Value>(backend, new StringReader(program));
+    protected LdPathParser<Value> createParserFromString(String program) {
+        final LdPathParser<Value> parser = new LdPathParser<Value>(backend, new StringReader(program));
         assertThat("Could not parse ldPath", parser, CoreMatchers.notNullValue());
 
         return parser;
@@ -132,7 +132,7 @@ public abstract class AbstractTestBase {
     protected final void loadData(String datafile, RDFFormat format, String baseURI) throws RepositoryException, RDFParseException, IOException {
         // load demo data
         InputStream data = this.getClass().getResourceAsStream(datafile);
-        Assume.assumeThat("Could not load test-data: " + datafile, data, notNullValue(InputStream.class));
+        Assert.assertThat("Could not load test-data: " + datafile, data, notNullValue(InputStream.class));
 
         final SailRepositoryConnection con = repository.getConnection();
         try {
@@ -146,7 +146,7 @@ public abstract class AbstractTestBase {
     }
 
     protected Collection<Object> evaluateRule(final String ldPath, URI context) throws ParseException {
-        final RdfPathParser<Value> parser = createParserFromString(ldPath);
+        final LdPathParser<Value> parser = createParserFromString(ldPath);
         final FieldMapping<Object, Value> rule = parser.parseRule(NSS);
         final Collection<Object> values = rule.getValues(backend, context);
         return values;
@@ -166,7 +166,7 @@ public abstract class AbstractTestBase {
     }
 
     protected Collection<Value> evaluateSelector(final String ldPath, URI context) throws ParseException {
-        final RdfPathParser<Value> parser = createParserFromString(ldPath);
+        final LdPathParser<Value> parser = createParserFromString(ldPath);
         final NodeSelector<Value> sel = parser.parseSelector(NSS);
         final Collection<Value> nodes = sel.select(backend, context, null, null);
         return nodes;

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-core/src/test/resources/logback.xml
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-core/src/test/resources/logback.xml b/libraries/ldpath/ldpath-core/src/test/resources/logback.xml
index 1bfecff..16c98cd 100644
--- a/libraries/ldpath/ldpath-core/src/test/resources/logback.xml
+++ b/libraries/ldpath/ldpath-core/src/test/resources/logback.xml
@@ -21,6 +21,8 @@
             <pattern>%d{HH:mm:ss.SSS} %highlight(%level) %cyan(%logger{15}) - %m%n</pattern>
         </encoder>
     </appender>
+    
+    <logger name="org.apache.marmotta.ldpath.parser.DefaultConfiguration" level="WARN" />
     <root level="${root-level:-INFO}">
         <appender-ref ref="CONSOLE"/>
     </root>

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-core/src/test/resources/parse/namespaces.ldpath
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-core/src/test/resources/parse/namespaces.ldpath b/libraries/ldpath/ldpath-core/src/test/resources/parse/namespaces.ldpath
index 0f7c569..81a7def 100644
--- a/libraries/ldpath/ldpath-core/src/test/resources/parse/namespaces.ldpath
+++ b/libraries/ldpath/ldpath-core/src/test/resources/parse/namespaces.ldpath
@@ -17,4 +17,5 @@
 @prefix foo: <http://foo.com/some/path#> ;
 @prefix foaf: <http://xmlns.com/foaf/0.1/> ;
 @prefix test: <http://example.com/>
-@prefix dcterms: <http://purl.org/dc/terms/> ;
\ No newline at end of file
+@prefix dcterms: <http://purl.org/dc/terms/> ;
+@prefix foobar: <urn:uuid:1234> ;

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-core/src/test/resources/parse/program.ldpath
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-core/src/test/resources/parse/program.ldpath b/libraries/ldpath/ldpath-core/src/test/resources/parse/program.ldpath
index 5af4a0e..fc4fdc5 100644
--- a/libraries/ldpath/ldpath-core/src/test/resources/parse/program.ldpath
+++ b/libraries/ldpath/ldpath-core/src/test/resources/parse/program.ldpath
@@ -13,19 +13,25 @@
  *  See the License for the specific language governing permissions and
  *  limitations under the License.
  */
-@prefix test: <http://example.com/>;
+@prefix test: <http://example.com/> ;
 @prefix foo: <http://foo.com/some/path#> ;
 
+@graph test:context, foo:ctx, test:bar ;
+
 @filter test:type is foo:bar | test:p1 & is-a test:Case ;
 
 @boost foo:boost / ^test:boost ;
 
-path = test:p1 / test:p2 :: test:type;
-lang_test = test:p1[@en] :: test:type;
-type_test = foo:p2[^^test:int] :: test:type;
-int_s = (foo:go)* :: test:type;
-int_p = (foo:go)+ :: test:type;
+path = test:p1 / test:p2 :: test:type ;
+lang_test = test:p1[@en] :: test:type ;
+type_test = foo:p2[^^test:int] :: test:type ;
+int_s = (foo:go)* :: test:type ;
+int_p = (foo:go)+ :: test:type ;
+group = (test:p1 / test:p2) :: test:type ;
+
+inverse = ^test:incoming :: test:type ;
 
-inverse = ^test:incoming :: test:type;
+config = test:foo :: test:type(c1="true", c2="false", c3="1.234") ;
 
-config = test:foo :: test:type(c1=true, c2="false", c3="1.234");
\ No newline at end of file
+foo:bar = test:foo :: test:type ;
+<http://test/> = test:test :: test:type ;

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-functions-collections/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-functions-collections/pom.xml b/libraries/ldpath/ldpath-functions-collections/pom.xml
index e6ed175..ac7553a 100644
--- a/libraries/ldpath/ldpath-functions-collections/pom.xml
+++ b/libraries/ldpath/ldpath-functions-collections/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>
 
@@ -73,6 +73,27 @@
     </dependencies>
 
     <build>
+        <pluginManagement>
+            <plugins>
+                <plugin> <!-- generate JRebel Configuration -->
+                    <groupId>org.zeroturnaround</groupId>
+                    <artifactId>jrebel-maven-plugin</artifactId>
+                    <executions>
+                        <execution>
+                            <id>generate-rebel-xml</id>
+                            <phase>process-resources</phase>
+                            <goals>
+                                <goal>generate</goal>
+                            </goals>
+                        </execution>
+                    </executions>
+                    <configuration>
+                        <relativePath>../../../</relativePath>
+                        <rootPath>$${rebel.root}</rootPath>
+                    </configuration>
+                </plugin>
+            </plugins>
+        </pluginManagement>
         <plugins>
             <plugin>
                 <groupId>org.apache.felix</groupId>

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-functions-date/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-functions-date/pom.xml b/libraries/ldpath/ldpath-functions-date/pom.xml
index e990287..62e6fe7 100644
--- a/libraries/ldpath/ldpath-functions-date/pom.xml
+++ b/libraries/ldpath/ldpath-functions-date/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>
 
@@ -69,6 +69,27 @@
         </dependency>
     </dependencies>
     <build>
+        <pluginManagement>
+            <plugins>
+                <plugin> <!-- generate JRebel Configuration -->
+                    <groupId>org.zeroturnaround</groupId>
+                    <artifactId>jrebel-maven-plugin</artifactId>
+                    <executions>
+                        <execution>
+                            <id>generate-rebel-xml</id>
+                            <phase>process-resources</phase>
+                            <goals>
+                                <goal>generate</goal>
+                            </goals>
+                        </execution>
+                    </executions>
+                    <configuration>
+                        <relativePath>../../../</relativePath>
+                        <rootPath>$${rebel.root}</rootPath>
+                    </configuration>
+                </plugin>
+            </plugins>
+        </pluginManagement>
         <plugins>
             <plugin>
                 <groupId>org.apache.felix</groupId>

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-functions-date/src/test/java/org/apache/marmotta/ldpath/model/functions/date/DateFunctionsTest.java
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-functions-date/src/test/java/org/apache/marmotta/ldpath/model/functions/date/DateFunctionsTest.java b/libraries/ldpath/ldpath-functions-date/src/test/java/org/apache/marmotta/ldpath/model/functions/date/DateFunctionsTest.java
index 8470462..ea8c9e8 100644
--- a/libraries/ldpath/ldpath-functions-date/src/test/java/org/apache/marmotta/ldpath/model/functions/date/DateFunctionsTest.java
+++ b/libraries/ldpath/ldpath-functions-date/src/test/java/org/apache/marmotta/ldpath/model/functions/date/DateFunctionsTest.java
@@ -24,7 +24,7 @@ import java.util.Random;
 
 import org.apache.marmotta.ldpath.model.fields.FieldMapping;
 import org.apache.marmotta.ldpath.parser.ParseException;
-import org.apache.marmotta.ldpath.parser.RdfPathParser;
+import org.apache.marmotta.ldpath.parser.LdPathParser;
 import org.apache.marmotta.ldpath.test.AbstractTestBase;
 import org.junit.Assert;
 import org.junit.Before;
@@ -48,7 +48,7 @@ public class DateFunctionsTest extends AbstractTestBase {
     @Before
     public void loadData() throws RepositoryException, RDFParseException, IOException {
         final int delta = 60 * 60 * 24 * 365;
-        now = new Date();
+        now = new Date(1000*(System.currentTimeMillis() / 1000));
         first = new Date(now.getTime() - 1000l * delta);
 
         uri = repository.getValueFactory().createURI(NSS.get("ex") + now.getTime());
@@ -76,7 +76,7 @@ public class DateFunctionsTest extends AbstractTestBase {
 
     @Test
     public void testEarliest() throws ParseException {
-        final RdfPathParser<Value> parser = createParserFromString("fn:earliest(<" + prop.stringValue() + ">) :: xsd:dateTime");
+        final LdPathParser<Value> parser = createParserFromString("fn:earliest(<" + prop.stringValue() + ">) :: xsd:dateTime");
         final FieldMapping<Object, Value> rule = parser.parseRule(NSS);
         final Collection<Object> result = rule.getValues(backend, uri);
 
@@ -88,7 +88,7 @@ public class DateFunctionsTest extends AbstractTestBase {
 
     @Test
     public void testLatest() throws ParseException {
-        final RdfPathParser<Value> parser = createParserFromString("fn:latest(<" + prop.stringValue() + ">) :: xsd:dateTime");
+        final LdPathParser<Value> parser = createParserFromString("fn:latest(<" + prop.stringValue() + ">) :: xsd:dateTime");
         final FieldMapping<Object, Value> rule = parser.parseRule(NSS);
         final Collection<Object> result = rule.getValues(backend, uri);
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-functions-html/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-functions-html/pom.xml b/libraries/ldpath/ldpath-functions-html/pom.xml
index fd9fe94..dc031ad 100644
--- a/libraries/ldpath/ldpath-functions-html/pom.xml
+++ b/libraries/ldpath/ldpath-functions-html/pom.xml
@@ -19,7 +19,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>
     <modelVersion>4.0.0</modelVersion>
@@ -83,6 +83,27 @@
 
 
     <build>
+        <pluginManagement>
+            <plugins>
+                <plugin> <!-- generate JRebel Configuration -->
+                    <groupId>org.zeroturnaround</groupId>
+                    <artifactId>jrebel-maven-plugin</artifactId>
+                    <executions>
+                        <execution>
+                            <id>generate-rebel-xml</id>
+                            <phase>process-resources</phase>
+                            <goals>
+                                <goal>generate</goal>
+                            </goals>
+                        </execution>
+                    </executions>
+                    <configuration>
+                        <relativePath>../../../</relativePath>
+                        <rootPath>$${rebel.root}</rootPath>
+                    </configuration>
+                </plugin>
+            </plugins>
+        </pluginManagement>
         <plugins>
             <plugin>
                 <groupId>org.apache.felix</groupId>

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-functions-html/src/test/java/org/apache/marmotta/ldpath/model/functions/html/HtmlFunctionsTest.java
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-functions-html/src/test/java/org/apache/marmotta/ldpath/model/functions/html/HtmlFunctionsTest.java b/libraries/ldpath/ldpath-functions-html/src/test/java/org/apache/marmotta/ldpath/model/functions/html/HtmlFunctionsTest.java
index d663924..29f5426 100644
--- a/libraries/ldpath/ldpath-functions-html/src/test/java/org/apache/marmotta/ldpath/model/functions/html/HtmlFunctionsTest.java
+++ b/libraries/ldpath/ldpath-functions-html/src/test/java/org/apache/marmotta/ldpath/model/functions/html/HtmlFunctionsTest.java
@@ -27,7 +27,7 @@ import java.util.Collection;
 
 import org.apache.marmotta.ldpath.model.fields.FieldMapping;
 import org.apache.marmotta.ldpath.parser.ParseException;
-import org.apache.marmotta.ldpath.parser.RdfPathParser;
+import org.apache.marmotta.ldpath.parser.LdPathParser;
 import org.apache.marmotta.ldpath.test.AbstractTestBase;
 import org.hamcrest.CoreMatchers;
 import org.junit.Before;
@@ -50,7 +50,7 @@ public class HtmlFunctionsTest extends AbstractTestBase {
     public void testCleanHtmlFunction() throws ParseException {
         URI uri = repository.getValueFactory().createURI(NSS.get("ex") + "Simple");
 
-        final RdfPathParser<Value> parser = createParserFromString("fn:cleanHtml(foo:html) :: xsd:string");
+        final LdPathParser<Value> parser = createParserFromString("fn:cleanHtml(foo:html) :: xsd:string");
         final FieldMapping<Object, Value> rule = parser.parseRule(NSS);
 
         final Collection<Object> result = rule.getValues(backend, uri);
@@ -67,7 +67,7 @@ public class HtmlFunctionsTest extends AbstractTestBase {
     public void testCssSelectFunction() throws ParseException {
         URI uri = repository.getValueFactory().createURI(NSS.get("ex") + "Simple");
 
-        final RdfPathParser<Value> parser = createParserFromString("fn:css(\"p\", foo:html) :: xsd:string");
+        final LdPathParser<Value> parser = createParserFromString("fn:css(\"p\", foo:html) :: xsd:string");
         final FieldMapping<Object, Value> rule = parser.parseRule(NSS);
 
         final Collection<Object> result = rule.getValues(backend, uri);
@@ -79,7 +79,7 @@ public class HtmlFunctionsTest extends AbstractTestBase {
             assertThat("String end", s, CoreMatchers.endsWith("</p>"));
         }
 
-        final RdfPathParser<Value> parser2 = createParserFromString("fn:css(\"p#p2\", foo:html) :: xsd:string");
+        final LdPathParser<Value> parser2 = createParserFromString("fn:css(\"p#p2\", foo:html) :: xsd:string");
         final FieldMapping<Object, Value> rule2 = parser2.parseRule(NSS);
 
         final Collection<Object> result2 = rule2.getValues(backend, uri);

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-functions-math/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-functions-math/pom.xml b/libraries/ldpath/ldpath-functions-math/pom.xml
index 3a8ede8..333fbcc 100644
--- a/libraries/ldpath/ldpath-functions-math/pom.xml
+++ b/libraries/ldpath/ldpath-functions-math/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>
 
@@ -68,6 +68,27 @@
 
 
     <build>
+        <pluginManagement>
+            <plugins>
+                <plugin> <!-- generate JRebel Configuration -->
+                    <groupId>org.zeroturnaround</groupId>
+                    <artifactId>jrebel-maven-plugin</artifactId>
+                    <executions>
+                        <execution>
+                            <id>generate-rebel-xml</id>
+                            <phase>process-resources</phase>
+                            <goals>
+                                <goal>generate</goal>
+                            </goals>
+                        </execution>
+                    </executions>
+                    <configuration>
+                        <relativePath>../../../</relativePath>
+                        <rootPath>$${rebel.root}</rootPath>
+                    </configuration>
+                </plugin>
+            </plugins>
+        </pluginManagement>
         <plugins>
             <plugin>
                 <groupId>org.apache.felix</groupId>

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-functions-math/src/main/java/org/apache/marmotta/ldpath/model/functions/math/MaxFunction.java
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-functions-math/src/main/java/org/apache/marmotta/ldpath/model/functions/math/MaxFunction.java b/libraries/ldpath/ldpath-functions-math/src/main/java/org/apache/marmotta/ldpath/model/functions/math/MaxFunction.java
index a403303..252c268 100644
--- a/libraries/ldpath/ldpath-functions-math/src/main/java/org/apache/marmotta/ldpath/model/functions/math/MaxFunction.java
+++ b/libraries/ldpath/ldpath-functions-math/src/main/java/org/apache/marmotta/ldpath/model/functions/math/MaxFunction.java
@@ -46,7 +46,7 @@ public class MaxFunction<Node> extends MathFunction<Node> {
         return result;
     }
 
-    protected Node calc(NodeBackend<Node> backend, Collection<Node> arg) {
+    protected Node calc(RDFBackend<Node> backend, Collection<Node> arg) {
         /* MAX */
         double d = Double.MIN_VALUE;
         Node max = null;

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-functions-math/src/main/java/org/apache/marmotta/ldpath/model/functions/math/MinFunction.java
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-functions-math/src/main/java/org/apache/marmotta/ldpath/model/functions/math/MinFunction.java b/libraries/ldpath/ldpath-functions-math/src/main/java/org/apache/marmotta/ldpath/model/functions/math/MinFunction.java
index ada8303..c4fd8b0 100644
--- a/libraries/ldpath/ldpath-functions-math/src/main/java/org/apache/marmotta/ldpath/model/functions/math/MinFunction.java
+++ b/libraries/ldpath/ldpath-functions-math/src/main/java/org/apache/marmotta/ldpath/model/functions/math/MinFunction.java
@@ -47,7 +47,7 @@ public class MinFunction<Node> extends MathFunction<Node> {
         return result;
     }
 
-    protected Node calc(NodeBackend<Node> backend, Collection<Node> arg) {
+    protected Node calc(RDFBackend<Node> backend, Collection<Node> arg) {
         /* MIN */
         double d = Double.MAX_VALUE;
         Node min = null;

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-functions-math/src/main/java/org/apache/marmotta/ldpath/model/functions/math/RoundFunction.java
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-functions-math/src/main/java/org/apache/marmotta/ldpath/model/functions/math/RoundFunction.java b/libraries/ldpath/ldpath-functions-math/src/main/java/org/apache/marmotta/ldpath/model/functions/math/RoundFunction.java
index 9a18a8e..0675249 100644
--- a/libraries/ldpath/ldpath-functions-math/src/main/java/org/apache/marmotta/ldpath/model/functions/math/RoundFunction.java
+++ b/libraries/ldpath/ldpath-functions-math/src/main/java/org/apache/marmotta/ldpath/model/functions/math/RoundFunction.java
@@ -49,7 +49,7 @@ public class RoundFunction<Node> extends MathFunction<Node> {
         return result;
     }
 
-    protected Node calc(NodeBackend<Node> backend, Node node) {
+    protected Node calc(RDFBackend<Node> backend, Node node) {
         /* SUM */
         try {
             Double val = doubleTransformer.transform(backend, node, null);

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-functions-math/src/main/java/org/apache/marmotta/ldpath/model/functions/math/SumFunction.java
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-functions-math/src/main/java/org/apache/marmotta/ldpath/model/functions/math/SumFunction.java b/libraries/ldpath/ldpath-functions-math/src/main/java/org/apache/marmotta/ldpath/model/functions/math/SumFunction.java
index a78d68b..99d271f 100644
--- a/libraries/ldpath/ldpath-functions-math/src/main/java/org/apache/marmotta/ldpath/model/functions/math/SumFunction.java
+++ b/libraries/ldpath/ldpath-functions-math/src/main/java/org/apache/marmotta/ldpath/model/functions/math/SumFunction.java
@@ -46,7 +46,7 @@ public class SumFunction<Node> extends MathFunction<Node> {
         return result;
     }
 
-    protected Node calc(NodeBackend<Node> backend, Collection<Node> arg) {
+    protected Node calc(RDFBackend<Node> backend, Collection<Node> arg) {
         /* SUM */
         Double d = 0d;
         for (Node n : arg) {


[021/100] [abbrv] [partial] Reverting the erroneous merge by Sebastian according to the instructions in INFRA-6876

Posted by wi...@apache.org.
http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/kiwi/kiwi-sparql/src/main/java/org/apache/marmotta/kiwi/sparql/persistence/KiWiSparqlConnection.java
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-sparql/src/main/java/org/apache/marmotta/kiwi/sparql/persistence/KiWiSparqlConnection.java b/libraries/kiwi/kiwi-sparql/src/main/java/org/apache/marmotta/kiwi/sparql/persistence/KiWiSparqlConnection.java
new file mode 100644
index 0000000..61eedd2
--- /dev/null
+++ b/libraries/kiwi/kiwi-sparql/src/main/java/org/apache/marmotta/kiwi/sparql/persistence/KiWiSparqlConnection.java
@@ -0,0 +1,706 @@
+/*
+ * 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.kiwi.sparql.persistence;
+
+import com.google.common.base.Preconditions;
+import info.aduna.iteration.CloseableIteration;
+import info.aduna.iteration.CloseableIteratorIteration;
+import info.aduna.iteration.Iterations;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.marmotta.commons.sesame.model.Namespaces;
+import org.apache.marmotta.commons.util.DateUtils;
+import org.apache.marmotta.kiwi.model.rdf.KiWiNode;
+import org.apache.marmotta.kiwi.persistence.KiWiConnection;
+import org.apache.marmotta.kiwi.persistence.util.ResultSetIteration;
+import org.apache.marmotta.kiwi.persistence.util.ResultTransformerFunction;
+import org.apache.marmotta.kiwi.sail.KiWiValueFactory;
+import org.openrdf.model.BNode;
+import org.openrdf.model.Literal;
+import org.openrdf.model.URI;
+import org.openrdf.model.Value;
+import org.openrdf.query.Binding;
+import org.openrdf.query.BindingSet;
+import org.openrdf.query.algebra.*;
+import org.openrdf.query.impl.MapBindingSet;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.*;
+import java.util.concurrent.*;
+import java.util.regex.Pattern;
+
+/**
+ * Provide improved SPARQL support by evaluating certain common compley SPARQL constructs directly on the
+ * database (e.g. JOIN over pattern queries).
+ * <p/>
+ * Implemented using a decorator pattern (i.e. wrapping the KiWiConnection).
+ *
+ * @author Sebastian Schaffert (sschaffert@apache.org)
+ */
+public class KiWiSparqlConnection {
+
+    private static Logger log = LoggerFactory.getLogger(KiWiSparqlConnection.class);
+
+    private static DateFormat sqlDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.S");
+
+    private KiWiConnection parent;
+    private KiWiValueFactory valueFactory;
+
+    private ExecutorService executorService;
+
+    public KiWiSparqlConnection(KiWiConnection parent, KiWiValueFactory valueFactory) throws SQLException {
+        this.parent = parent;
+        this.valueFactory = valueFactory;
+
+        // interruptible queries run in a separate thread
+        this.executorService = Executors.newCachedThreadPool();
+    }
+
+    /**
+     * Evaluate a statement pattern join or filter on the database by translating it into an appropriate SQL statement.
+     * Copied and adapted from KiWiReasoningConnection.query()
+     * @param join
+     * @return
+     */
+    public CloseableIteration<BindingSet, SQLException> evaluateJoin(TupleExpr join, final BindingSet bindings) throws SQLException, InterruptedException {
+        Preconditions.checkArgument(join instanceof Join || join instanceof Filter || join instanceof StatementPattern);
+
+        // some definitions
+        String[] positions = new String[] {"subject","predicate","object","context"};
+
+        // collect all patterns in a list, using depth-first search over the join
+        List<StatementPattern> patterns = new ArrayList<StatementPattern>();
+        collectPatterns(join, patterns);
+
+        // associate a name with each pattern; the names are used in the database query to refer to the triple
+        // that matched this pattern and in the construction of variable names for the HQL query
+        int patternCount = 0;
+        final Map<StatementPattern,String> patternNames = new HashMap<StatementPattern, String>();
+        for(StatementPattern p : patterns) {
+            patternNames.put(p,"P"+ (++patternCount));
+        }
+
+        // find all variables occurring in the patterns and create a map to map them to
+        // field names in the database query; each variable will have one or several field names,
+        // one for each pattern it occurs in; field names are constructed automatically by a counter
+        // and the pattern name to ensure the name is a valid HQL identifier
+        int variableCount = 0;
+
+        // a map for the variable names; will look like { ?x -> "V1", ?y -> "V2", ... }
+        final Map<Var,String> variableNames = new HashMap<Var, String>();
+
+        // a map for mapping variables to field names; each variable might have one or more field names,
+        // depending on the number of patterns it occurs in; will look like
+        // { ?x -> ["P1_V1", "P2_V1"], ?y -> ["P2_V2"], ... }
+        Map<Var,List<String>> queryVariables = new HashMap<Var, List<String>>();
+        for(StatementPattern p : patterns) {
+            Var[] fields = new Var[] {
+                    p.getSubjectVar(),
+                    p.getPredicateVar(),
+                    p.getObjectVar(),
+                    p.getContextVar()
+            };
+            for(int i = 0; i<fields.length; i++) {
+                if(fields[i] != null && !fields[i].hasValue()) {
+                    Var v = fields[i];
+                    if(variableNames.get(v) == null) {
+                        variableNames.put(v,"V"+ (++variableCount));
+                        queryVariables.put(v,new LinkedList<String>());
+                    }
+                    String pName = patternNames.get(p);
+                    String vName = variableNames.get(v);
+                    queryVariables.get(v).add(pName + "_" + positions[i] + "_" + vName);
+                }
+            }
+        }
+
+        // build the select clause by projecting for each query variable the first name
+        StringBuilder selectClause = new StringBuilder();
+        final List<Var> selectVariables = new LinkedList<Var>();
+        for(Iterator<Var> it = queryVariables.keySet().iterator(); it.hasNext(); ) {
+            Var v = it.next();
+            String projectedName = variableNames.get(v);
+            String fromName = queryVariables.get(v).get(0);
+            selectClause.append(fromName);
+            selectClause.append(".id as ");
+            selectClause.append(projectedName);
+            if(it.hasNext()) {
+                selectClause.append(", ");
+            }
+            selectVariables.add(v);
+        }
+
+
+        // build the from-clause of the query; the from clause is constructed as follows:
+        // 1. for each pattern P, there will be a "KiWiTriple P" in the from clause
+        // 2. for each variable V in P occurring in
+        //    - subject, there will be a "inner join P.subject as P_S_V" or "left outer join P.subject as P_S_V",
+        //      depending on whether the "optional" parameter is false or true
+        //    - property, there will be a "inner join P.property as P_P_V" or "left outer join p.property as P_P_V"
+        //    - object, there will be a "inner join P.object as P_O_V" or "left outer join p.object as P_O_V"
+        //    - context, there will be a "inner join P.context as P_C_V" or "left outer join p.context as P_C_V"
+        StringBuilder fromClause = new StringBuilder();
+        for(Iterator<StatementPattern> it = patterns.iterator(); it.hasNext(); ) {
+            StatementPattern p = it.next();
+            String pName = patternNames.get(p);
+            fromClause.append("triples "+pName);
+
+            Var[] fields = new Var[] {
+                    p.getSubjectVar(),
+                    p.getPredicateVar(),
+                    p.getObjectVar(),
+                    p.getContextVar()
+            };
+            for(int i = 0; i<fields.length; i++) {
+                if(fields[i] != null && !fields[i].hasValue()) {
+                    String vName = variableNames.get(fields[i]);
+                    fromClause.append(" INNER JOIN nodes AS ");
+                    fromClause.append(pName + "_"+positions[i]+"_" + vName);
+                    fromClause.append(" ON " + pName + "." + positions[i] + " = ");
+                    fromClause.append(pName + "_"+positions[i]+"_" + vName + ".id ");
+                }
+            }
+
+            if(it.hasNext()) {
+                fromClause.append(",\n ");
+            }
+        }
+
+
+        // build the where clause as follows:
+        // 1. iterate over all patterns and for each resource and literal field in subject,
+        //    property, object, or context, and set a query condition according to the
+        //    nodes given in the pattern
+        // 2. for each variable that has more than one occurrences, add a join condition
+        // 3. for each variable in the initialBindings, add a condition to the where clause
+
+        // list of where conditions that will later be connected by AND
+        List<String> whereConditions = new LinkedList<String>();
+
+
+        // 1. iterate over all patterns and for each resource and literal field in subject,
+        //    property, object, or context, and set a query condition according to the
+        //    nodes given in the pattern
+        for(StatementPattern p : patterns) {
+            String pName = patternNames.get(p);
+            Var[] fields = new Var[] {
+                    p.getSubjectVar(),
+                    p.getPredicateVar(),
+                    p.getObjectVar(),
+                    p.getContextVar()
+            };
+            for(int i = 0; i<fields.length; i++) {
+                // find node id of the resource or literal field and use it in the where clause
+                // in this way we can avoid setting too many query parameters
+                Long nodeId = null;
+                if(fields[i] != null && fields[i].hasValue()) {
+                    Value v = valueFactory.convert(fields[i].getValue());
+                    if(v instanceof KiWiNode) {
+                        nodeId = ((KiWiNode) v).getId();
+                    } else {
+                        throw new IllegalArgumentException("the values in this query have not been created by the KiWi value factory");
+                    }
+
+                    if(nodeId != null) {
+                        String condition = pName+"."+positions[i]+" = " + nodeId;
+                        whereConditions.add(condition);
+                    }
+                }
+            }
+        }
+
+        // 2. for each variable that has more than one occurrences, add a join condition
+        for(Var v : queryVariables.keySet()) {
+            List<String> vNames = queryVariables.get(v);
+            for(int i = 1; i < vNames.size(); i++) {
+                String vName1 = vNames.get(i-1);
+                String vName2 = vNames.get(i);
+                whereConditions.add(vName1 + ".id = " + vName2 + ".id");
+            }
+        }
+
+        // 3. for each variable in the initialBindings, add a condition to the where clause setting it
+        //    to the node given as binding
+        if(bindings != null) {
+            for(String v : bindings.getBindingNames()) {
+                for(Map.Entry<Var,List<String>> entry : queryVariables.entrySet()) {
+                    if(entry.getKey().getName() != null && entry.getKey().getName().equals(v) &&
+                            entry.getValue() != null && entry.getValue().size() > 0) {
+                        List<String> vNames = entry.getValue();
+                        String vName = vNames.get(0);
+                        Value binding = valueFactory.convert(bindings.getValue(v));
+                        if(binding instanceof KiWiNode) {
+                            whereConditions.add(vName+".id = "+((KiWiNode)binding).getId());
+                        } else {
+                            throw new IllegalArgumentException("the values in this binding have not been created by the KiWi value factory");
+                        }
+                    }
+                }
+            }
+        }
+
+        // 4. for each pattern, ensure that the matched triple is not marked as deleted
+        for(StatementPattern p : patterns) {
+            String pName = patternNames.get(p);
+            whereConditions.add(pName+".deleted = false");
+        }
+
+
+        // 5. for each filter condition, add a statement to the where clause
+        List<ValueExpr> filters = new ArrayList<ValueExpr>();
+        collectFilters(join, filters);
+        for(ValueExpr expr : filters) {
+            whereConditions.add(evaluateExpression(expr,queryVariables, null));
+        }
+
+
+        // construct the where clause
+        StringBuilder whereClause = new StringBuilder();
+        for(Iterator<String> it = whereConditions.iterator(); it.hasNext(); ) {
+            whereClause.append(it.next());
+            whereClause.append("\n ");
+            if(it.hasNext()) {
+                whereClause.append("AND ");
+            }
+        }
+
+
+        // build the query string
+        String queryString =
+                "SELECT " + selectClause + "\n " +
+                        "FROM " + fromClause + "\n " +
+                        "WHERE " + whereClause;
+
+        log.debug("original SPARQL syntax tree:\n {}", join);
+        log.debug("constructed SQL query string:\n {}",queryString);
+        log.debug("SPARQL -> SQL variable mappings:\n {}", queryVariables);
+
+        final PreparedStatement queryStatement = parent.getJDBCConnection().prepareStatement(queryString);
+        if(parent.getDialect().isCursorSupported()) {
+            queryStatement.setFetchSize(parent.getConfiguration().getCursorSize());
+        }
+
+        Future<ResultSet> queryFuture =
+                executorService.submit(new Callable<ResultSet>() {
+                    @Override
+                    public ResultSet call() throws Exception {
+                        try {
+                            return queryStatement.executeQuery();
+                        } catch (SQLException ex) {
+                            if(Thread.interrupted()) {
+                                log.info("SQL query execution cancelled; not returning result (Thread={})", Thread.currentThread());
+                                throw new InterruptedException("SPARQL query execution cancelled");
+                            } else {
+                                throw ex;
+                            }
+                        }
+                    }
+                }
+                );
+
+        try {
+            ResultSet result = queryFuture.get();
+
+            ResultSetIteration<BindingSet> it = new ResultSetIteration<BindingSet>(result, true, new ResultTransformerFunction<BindingSet>() {
+                @Override
+                public BindingSet apply(ResultSet row) throws SQLException {
+                    MapBindingSet resultRow = new MapBindingSet();
+
+                    for(Var v : selectVariables) {
+                        resultRow.addBinding(v.getName(), parent.loadNodeById(row.getLong(variableNames.get(v))));
+                    }
+
+
+                    if(bindings != null) {
+                        for(Binding binding : bindings) {
+                            resultRow.addBinding(binding);
+                        }
+                    }
+                    return resultRow;
+                }
+            });
+
+            // materialize result to avoid having more than one result set open at the same time
+            return new CloseableIteratorIteration<BindingSet, SQLException>(Iterations.asList(it).iterator());
+        } catch (InterruptedException | CancellationException e) {
+            log.info("SPARQL query execution cancelled");
+            queryFuture.cancel(true);
+            queryStatement.cancel();
+            queryStatement.close();
+
+            throw new InterruptedException("SPARQL query execution cancelled");
+        } catch (ExecutionException e) {
+            log.error("error executing SPARQL query",e.getCause());
+            if(e.getCause() instanceof SQLException) {
+                throw (SQLException)e.getCause();
+            } else if(e.getCause() instanceof InterruptedException) {
+                throw (InterruptedException)e.getCause();
+            } else {
+                throw new SQLException("error executing SPARQL query",e);
+            }
+        }
+    }
+
+    private String evaluateExpression(ValueExpr expr, Map<Var, List<String>> queryVariables, OPTypes optype) {
+        if(expr instanceof And) {
+            return "(" + evaluateExpression(((And) expr).getLeftArg(), queryVariables, optype) + " AND " + evaluateExpression(((And) expr).getRightArg(),queryVariables, optype) + ")";
+        } else if(expr instanceof Or) {
+            return "(" + evaluateExpression(((Or) expr).getLeftArg(), queryVariables, optype) + " OR " + evaluateExpression(((Or) expr).getRightArg(),queryVariables, optype) + ")";
+        } else if(expr instanceof Not) {
+            return "NOT (" + evaluateExpression(((Not) expr).getArg(), queryVariables, optype)  + ")";
+        } else if(expr instanceof Str) {
+            Str str = (Str)expr;
+            // get value of argument and express it as string
+            if(str.getArg() instanceof Var) {
+                return queryVariables.get(str.getArg()).get(0) + ".svalue";
+            } else if(str.getArg() instanceof ValueConstant) {
+                return "'" + ((ValueConstant) str.getArg()).getValue().stringValue() + "'";
+            }
+        } else if(expr instanceof Label) {
+            Label str = (Label)expr;
+            // get value of argument and express it as string
+            if(str.getArg() instanceof Var) {
+                return queryVariables.get(str.getArg()).get(0) + ".svalue";
+            } else if(str.getArg() instanceof ValueConstant) {
+                return "'" + ((ValueConstant) str.getArg()).getValue().stringValue() + "'";
+            }
+        } else if(expr instanceof Lang) {
+            Lang lang = (Lang)expr;
+
+            if(lang.getArg() instanceof Var) {
+                return queryVariables.get(lang.getArg()).get(0) + ".lang";
+            }
+        } else if(expr instanceof Compare) {
+            Compare cmp = (Compare)expr;
+
+            OPTypes ot = determineOpType(cmp.getLeftArg(), cmp.getRightArg());
+
+            return evaluateExpression(cmp.getLeftArg(),queryVariables, ot) + getSQLOperator(cmp.getOperator()) + evaluateExpression(cmp.getRightArg(),queryVariables, ot);
+        } else if(expr instanceof MathExpr) {
+            MathExpr cmp = (MathExpr)expr;
+
+            OPTypes ot = determineOpType(cmp.getLeftArg(), cmp.getRightArg());
+
+            if(ot == OPTypes.STRING) {
+                if(cmp.getOperator() == MathExpr.MathOp.PLUS) {
+                    return parent.getDialect().getConcat(evaluateExpression(cmp.getLeftArg(),queryVariables, ot), evaluateExpression(cmp.getRightArg(),queryVariables, ot));
+                } else {
+                    throw new IllegalArgumentException("operation "+cmp.getOperator()+" is not supported on strings");
+                }
+            } else {
+                return evaluateExpression(cmp.getLeftArg(),queryVariables, ot) + getSQLOperator(cmp.getOperator()) + evaluateExpression(cmp.getRightArg(),queryVariables, ot);
+            }
+        } else if(expr instanceof Regex) {
+            Regex re = (Regex)expr;
+
+            return optimizeRegexp(evaluateExpression(re.getArg(),queryVariables, optype), evaluateExpression(re.getPatternArg(), queryVariables, OPTypes.STRING));
+        } else if(expr instanceof LangMatches) {
+            LangMatches lm = (LangMatches)expr;
+            String value = evaluateExpression(lm.getLeftArg(), queryVariables, optype);
+            ValueConstant pattern = (ValueConstant) lm.getRightArg();
+
+            if(pattern.getValue().stringValue().equals("*")) {
+                return value + " LIKE '%'";
+            } else if(pattern.getValue().stringValue().equals("")) {
+                return value + " IS NULL";
+            } else {
+                return "(" + value + " = '"+pattern.getValue().stringValue()+"' OR " + parent.getDialect().getILike(value, "'" + pattern.getValue().stringValue() + "-%' )");
+            }
+        } else if(expr instanceof IsResource) {
+            ValueExpr arg = ((UnaryValueOperator)expr).getArg();
+
+            // operator must be a variable or a constant
+            if(arg instanceof ValueConstant) {
+                return Boolean.toString(((ValueConstant) arg).getValue() instanceof URI || ((ValueConstant) arg).getValue() instanceof BNode);
+            } else if(arg instanceof Var) {
+                String var = queryVariables.get(arg).get(0);
+
+                return "(" + var + ".ntype = 'uri' OR " + var + ".ntype = 'bnode')";
+            }
+        } else if(expr instanceof IsURI) {
+            ValueExpr arg = ((UnaryValueOperator)expr).getArg();
+
+            // operator must be a variable or a constant
+            if(arg instanceof ValueConstant) {
+                return Boolean.toString(((ValueConstant) arg).getValue() instanceof URI);
+            } else if(arg instanceof Var) {
+                String var = queryVariables.get(arg).get(0);
+
+                return var + ".ntype = 'uri'";
+            }
+        } else if(expr instanceof IsBNode) {
+            ValueExpr arg = ((UnaryValueOperator)expr).getArg();
+
+            // operator must be a variable or a constant
+            if(arg instanceof ValueConstant) {
+                return Boolean.toString(((ValueConstant) arg).getValue() instanceof BNode);
+            } else if(arg instanceof Var) {
+                String var = queryVariables.get(arg).get(0);
+
+                return var + ".ntype = 'bnode'";
+            }
+        } else if(expr instanceof IsLiteral) {
+            ValueExpr arg = ((UnaryValueOperator)expr).getArg();
+
+            // operator must be a variable or a constant
+            if(arg instanceof ValueConstant) {
+                return Boolean.toString(((ValueConstant) arg).getValue() instanceof Literal);
+            } else if(arg instanceof Var) {
+                String var = queryVariables.get(arg).get(0);
+
+                return "(" + var + ".ntype = 'string' OR " + var + ".ntype = 'int' OR " + var + ".ntype = 'double'  OR " + var + ".ntype = 'date'  OR " + var + ".ntype = 'boolean')";
+            }
+        } else if(expr instanceof Var) {
+            String var = queryVariables.get(expr).get(0);
+
+            if(optype == null) {
+                return var + ".svalue";
+            } else {
+                switch (optype) {
+                    case STRING: return var + ".svalue";
+                    case INT:    return var + ".ivalue";
+                    case DOUBLE: return var + ".dvalue";
+                    case DATE:   return var + ".tvalue";
+                    case ANY:    return var + ".id";
+                }
+            }
+        } else if(expr instanceof ValueConstant) {
+            String val = ((ValueConstant) expr).getValue().stringValue();
+
+            if(optype == null) {
+                return "'" + val + "'";
+            } else {
+                switch (optype) {
+                    case STRING: return "'" + val + "'";
+                    case INT:    return ""  + Integer.parseInt(val);
+                    case DOUBLE: return ""  + Double.parseDouble(val);
+                    case DATE:   return "'" + sqlDateFormat.format(DateUtils.parseDate(val)) + "'";
+                    default: throw new IllegalArgumentException("unsupported value type: " + optype);
+                }
+            }
+        }
+
+
+        throw new IllegalArgumentException("unsupported value expression: "+expr);
+    }
+
+
+    /**
+     * Collect all statement patterns in a tuple expression in depth-first order. The tuple expression may only
+     * contain Join or StatementPattern expressions, otherwise an IllegalArgumentException is thrown.
+     * @param expr
+     * @param patterns
+     */
+    private void collectPatterns(TupleExpr expr, List<StatementPattern> patterns) {
+        if(expr instanceof Join) {
+            collectPatterns(((Join) expr).getLeftArg(), patterns);
+            collectPatterns(((Join) expr).getRightArg(), patterns);
+        } else if(expr instanceof Filter) {
+            collectPatterns(((Filter) expr).getArg(), patterns);
+        } else if(expr instanceof StatementPattern) {
+            patterns.add((StatementPattern)expr);
+        } else {
+            throw new IllegalArgumentException("the tuple expression was neither a join nor a statement pattern: "+expr);
+        }
+
+    }
+
+
+    /**
+     * Collect all filter conditions in a tuple expression in depth-first order. The tuple expression may only
+     * contain Join or StatementPattern expressions, otherwise an IllegalArgumentException is thrown.
+     * @param expr
+     * @param filters
+     */
+    private void collectFilters(TupleExpr expr, List<ValueExpr> filters) {
+        if(expr instanceof Join) {
+            collectFilters(((Join) expr).getLeftArg(), filters);
+            collectFilters(((Join) expr).getRightArg(), filters);
+        } else if(expr instanceof Filter) {
+            filters.add(((Filter) expr).getCondition());
+        } else if(expr instanceof StatementPattern) {
+            // do nothing
+        } else {
+            throw new IllegalArgumentException("the tuple expression was neither a join nor a statement pattern: "+expr);
+        }
+
+    }
+
+
+    private String getSQLOperator(Compare.CompareOp op) {
+        switch (op) {
+            case EQ: return " = ";
+            case GE: return " >= ";
+            case GT: return " > ";
+            case LE: return " <= ";
+            case LT: return " < ";
+            case NE: return " <> ";
+        }
+        throw new IllegalArgumentException("unsupported operator type for comparison: "+op);
+    }
+
+
+    private String getSQLOperator(MathExpr.MathOp op) {
+        switch (op) {
+            case PLUS: return " + ";
+            case MINUS: return " - ";
+            case DIVIDE: return " / ";
+            case MULTIPLY: return " / ";
+        }
+        throw new IllegalArgumentException("unsupported operator type for math expression: "+op);
+    }
+
+
+
+    private OPTypes determineOpType(ValueExpr expr) {
+        if(expr instanceof ValueConstant) {
+            if(((ValueConstant) expr).getValue() instanceof Literal) {
+                Literal l = (Literal)((ValueConstant) expr).getValue();
+                String type = l.getDatatype() != null ? l.getDatatype().stringValue() : null;
+
+                if(StringUtils.equals(Namespaces.NS_XSD + "double", type)
+                        || StringUtils.equals(Namespaces.NS_XSD + "float", type)
+                        || StringUtils.equals(Namespaces.NS_XSD + "decimal", type)) {
+                    return OPTypes.DOUBLE;
+                } else if(StringUtils.equals(Namespaces.NS_XSD + "integer", type)
+                        || StringUtils.equals(Namespaces.NS_XSD + "long", type)
+                        || StringUtils.equals(Namespaces.NS_XSD + "int", type)
+                        || StringUtils.equals(Namespaces.NS_XSD + "short", type)
+                        || StringUtils.equals(Namespaces.NS_XSD + "nonNegativeInteger", type)
+                        || StringUtils.equals(Namespaces.NS_XSD + "nonPositiveInteger", type)
+                        || StringUtils.equals(Namespaces.NS_XSD + "negativeInteger", type)
+                        || StringUtils.equals(Namespaces.NS_XSD + "positiveInteger", type)
+                        || StringUtils.equals(Namespaces.NS_XSD + "unsignedLong", type)
+                        || StringUtils.equals(Namespaces.NS_XSD + "unsignedShort", type)
+                        || StringUtils.equals(Namespaces.NS_XSD + "byte", type)
+                        || StringUtils.equals(Namespaces.NS_XSD + "unsignedByte", type)) {
+                    return OPTypes.INT;
+                } else if(StringUtils.equals(Namespaces.NS_XSD + "dateTime", type)
+                        || StringUtils.equals(Namespaces.NS_XSD + "date", type)
+                        || StringUtils.equals(Namespaces.NS_XSD + "time", type)) {
+                    return OPTypes.DATE;
+                } else {
+                    return OPTypes.STRING;
+                }
+            } else {
+                return OPTypes.STRING;
+            }
+        } else if(expr instanceof Str) {
+            return OPTypes.STRING;
+        } else if(expr instanceof Lang) {
+            return OPTypes.STRING;
+        } else if(expr instanceof LocalName) {
+            return OPTypes.STRING;
+        } else if(expr instanceof Label) {
+            return OPTypes.STRING;
+        } else if(expr instanceof MathExpr) {
+            return determineOpType(((MathExpr) expr).getLeftArg(), ((MathExpr) expr).getRightArg());
+        } else if(expr instanceof Var) {
+            return OPTypes.ANY;
+        } else {
+            throw new IllegalArgumentException("unsupported expression: "+expr);
+        }
+    }
+
+    private OPTypes determineOpType(ValueExpr expr1, ValueExpr expr2) {
+        OPTypes left  = determineOpType(expr1);
+        OPTypes right = determineOpType(expr2);
+
+        if(left == OPTypes.ANY) {
+            return right;
+        } else if(right == OPTypes.ANY) {
+            return left;
+        } else if(left == right) {
+            return left;
+        } else if( (left == OPTypes.INT && right == OPTypes.DOUBLE) || (left == OPTypes.DOUBLE && right == OPTypes.INT)) {
+            return OPTypes.DOUBLE;
+        } else if( (left == OPTypes.STRING) || (right == OPTypes.STRING)) {
+            return OPTypes.STRING;
+        } else {
+            throw new IllegalArgumentException("unsupported type coercion: " + left + " and " + right);
+        }
+    }
+
+
+    /**
+     * Test if the regular expression given in the pattern can be simplified to a LIKE SQL statement; these are
+     * considerably more efficient to evaluate in most databases, so in case we can simplify, we return a LIKE.
+     *
+     * @param value
+     * @param pattern
+     * @return
+     */
+    private String optimizeRegexp(String value, String pattern) {
+        String simplified = pattern;
+
+        // apply simplifications
+
+        // remove SQL quotes at beginning and end
+        simplified = simplified.replaceFirst("^'","");
+        simplified = simplified.replaceFirst("'$","");
+
+
+        // remove .* at beginning and end, they are the default anyways
+        simplified = simplified.replaceFirst("^\\.\\*","");
+        simplified = simplified.replaceFirst("\\.\\*$","");
+
+        // replace all occurrences of % with \% and _ with \_, as they are special characters in SQL
+        simplified = simplified.replaceAll("%","\\%");
+        simplified = simplified.replaceAll("_","\\_");
+
+        // if pattern now does not start with a ^, we put a "%" in front
+        if(!simplified.startsWith("^")) {
+            simplified = "%" + simplified;
+        } else {
+            simplified = simplified.substring(1);
+        }
+
+        // if pattern does not end with a "$", we put a "%" at the end
+        if(!simplified.endsWith("$")) {
+            simplified = simplified + "%";
+        } else {
+            simplified = simplified.substring(0,simplified.length()-2);
+        }
+
+        // replace all non-escaped occurrences of .* with %
+        simplified = simplified.replaceAll("(?<!\\\\)\\.\\*","%");
+
+        // replace all non-escaped occurrences of .+ with _%
+        simplified = simplified.replaceAll("(?<!\\\\)\\.\\+","_%");
+
+        // the pattern is not simplifiable if the simplification still contains unescaped regular expression constructs
+        Pattern notSimplifiable = Pattern.compile("(?<!\\\\)[\\.\\*\\+\\{\\}\\[\\]\\|]");
+
+        if(notSimplifiable.matcher(simplified).find()) {
+            return parent.getDialect().getRegexp(value, pattern);
+        } else {
+            return value + " LIKE '"+simplified+"'";
+        }
+
+    }
+
+
+    private static enum OPTypes {
+        STRING, DOUBLE, INT, DATE, ANY
+    }
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/kiwi/kiwi-sparql/src/main/java/org/apache/marmotta/kiwi/sparql/sail/KiWiSparqlSail.java
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-sparql/src/main/java/org/apache/marmotta/kiwi/sparql/sail/KiWiSparqlSail.java b/libraries/kiwi/kiwi-sparql/src/main/java/org/apache/marmotta/kiwi/sparql/sail/KiWiSparqlSail.java
new file mode 100644
index 0000000..eb1b810
--- /dev/null
+++ b/libraries/kiwi/kiwi-sparql/src/main/java/org/apache/marmotta/kiwi/sparql/sail/KiWiSparqlSail.java
@@ -0,0 +1,87 @@
+/*
+ * 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.kiwi.sparql.sail;
+
+import org.apache.marmotta.kiwi.sail.KiWiSailConnection;
+import org.apache.marmotta.kiwi.sail.KiWiStore;
+import org.apache.marmotta.kiwi.sparql.persistence.KiWiSparqlConnection;
+import org.openrdf.sail.*;
+import org.openrdf.sail.helpers.NotifyingSailWrapper;
+import org.openrdf.sail.helpers.SailConnectionWrapper;
+import org.openrdf.sail.helpers.SailWrapper;
+
+import java.sql.SQLException;
+
+/**
+ * Add file description here!
+ *
+ * @author Sebastian Schaffert (sschaffert@apache.org)
+ */
+public class KiWiSparqlSail extends NotifyingSailWrapper {
+
+    private KiWiStore parent;
+
+    public KiWiSparqlSail(NotifyingSail baseSail) {
+        super(baseSail);
+
+        this.parent = getRootSail(baseSail);
+
+    }
+
+    /**
+     * Get the root sail in the wrapped sail stack
+     * @param sail
+     * @return
+     */
+    private KiWiStore getRootSail(Sail sail) {
+        if(sail instanceof KiWiStore) {
+            return (KiWiStore) sail;
+        } else if(sail instanceof SailWrapper) {
+            return getRootSail(((SailWrapper) sail).getBaseSail());
+        } else {
+            throw new IllegalArgumentException("root sail is not a KiWiStore or could not be found");
+        }
+    }
+
+    /**
+     * Get the root connection in a wrapped sail connection stack
+     * @param connection
+     * @return
+     */
+    private KiWiSailConnection getRootConnection(SailConnection connection) {
+        if(connection instanceof KiWiSailConnection) {
+            return (KiWiSailConnection) connection;
+        } else if(connection instanceof SailConnectionWrapper) {
+            return getRootConnection(((SailConnectionWrapper) connection).getWrappedConnection());
+        } else {
+            throw new IllegalArgumentException("root connection is not a KiWiSailConnection or could not be found");
+        }
+    }
+
+    @Override
+    public NotifyingSailConnection getConnection() throws SailException {
+        NotifyingSailConnection connection = super.getConnection();
+        KiWiSailConnection root   = getRootConnection(connection);
+
+        try {
+            return new KiWiSparqlSailConnection(connection, new KiWiSparqlConnection(root.getDatabaseConnection(), root.getValueFactory()), root.getValueFactory());
+        } catch (SQLException e) {
+            throw new SailException(e);
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/kiwi/kiwi-sparql/src/main/java/org/apache/marmotta/kiwi/sparql/sail/KiWiSparqlSailConnection.java
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-sparql/src/main/java/org/apache/marmotta/kiwi/sparql/sail/KiWiSparqlSailConnection.java b/libraries/kiwi/kiwi-sparql/src/main/java/org/apache/marmotta/kiwi/sparql/sail/KiWiSparqlSailConnection.java
new file mode 100644
index 0000000..d92808f
--- /dev/null
+++ b/libraries/kiwi/kiwi-sparql/src/main/java/org/apache/marmotta/kiwi/sparql/sail/KiWiSparqlSailConnection.java
@@ -0,0 +1,97 @@
+/*
+ * 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.kiwi.sparql.sail;
+
+import info.aduna.iteration.CloseableIteration;
+import org.apache.marmotta.kiwi.sail.KiWiSailConnection;
+import org.apache.marmotta.kiwi.sail.KiWiValueFactory;
+import org.apache.marmotta.kiwi.sparql.evaluation.KiWiEvaluationStatistics;
+import org.apache.marmotta.kiwi.sparql.evaluation.KiWiEvaluationStrategyImpl;
+import org.apache.marmotta.kiwi.sparql.evaluation.KiWiTripleSource;
+import org.apache.marmotta.kiwi.sparql.persistence.KiWiSparqlConnection;
+import org.openrdf.model.ValueFactory;
+import org.openrdf.query.BindingSet;
+import org.openrdf.query.Dataset;
+import org.openrdf.query.QueryEvaluationException;
+import org.openrdf.query.algebra.QueryRoot;
+import org.openrdf.query.algebra.TupleExpr;
+import org.openrdf.query.algebra.evaluation.EvaluationStrategy;
+import org.openrdf.query.algebra.evaluation.impl.*;
+import org.openrdf.query.impl.EmptyBindingSet;
+import org.openrdf.sail.NotifyingSailConnection;
+import org.openrdf.sail.SailConnection;
+import org.openrdf.sail.SailException;
+import org.openrdf.sail.helpers.NotifyingSailConnectionWrapper;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Add file description here!
+ *
+ * @author Sebastian Schaffert (sschaffert@apache.org)
+ */
+public class KiWiSparqlSailConnection extends NotifyingSailConnectionWrapper {
+
+    private static Logger log = LoggerFactory.getLogger(KiWiSparqlSailConnection.class);
+
+    private KiWiSparqlConnection connection;
+    private KiWiValueFactory valueFactory;
+
+    public KiWiSparqlSailConnection(NotifyingSailConnection parent, KiWiSparqlConnection connection, KiWiValueFactory valueFactory) {
+        super(parent);
+        this.connection = connection;
+        this.valueFactory = valueFactory;
+    }
+
+    @Override
+    public CloseableIteration<? extends BindingSet, QueryEvaluationException> evaluate(TupleExpr tupleExpr, Dataset dataset, BindingSet bindings, boolean includeInferred) throws SailException {
+        // Clone the tuple expression to allow for more aggressive optimizations
+        tupleExpr = tupleExpr.clone();
+
+        if (!(tupleExpr instanceof QueryRoot)) {
+            // Add a dummy root node to the tuple expressions to allow the
+            // optimizers to modify the actual root node
+            tupleExpr = new QueryRoot(tupleExpr);
+        }
+
+        try {
+            KiWiTripleSource tripleSource = new KiWiTripleSource(this,valueFactory,includeInferred);
+            EvaluationStrategy strategy = new KiWiEvaluationStrategyImpl(tripleSource, dataset, connection);
+
+            new BindingAssigner().optimize(tupleExpr, dataset, bindings);
+            new ConstantOptimizer(strategy).optimize(tupleExpr, dataset, bindings);
+            new CompareOptimizer().optimize(tupleExpr, dataset, bindings);
+            new ConjunctiveConstraintSplitter().optimize(tupleExpr, dataset, bindings);
+            new DisjunctiveConstraintOptimizer().optimize(tupleExpr, dataset, bindings);
+            new SameTermFilterOptimizer().optimize(tupleExpr, dataset, bindings);
+            new QueryModelNormalizer().optimize(tupleExpr, dataset, bindings);
+            new QueryJoinOptimizer(new KiWiEvaluationStatistics()).optimize(tupleExpr, dataset, bindings);
+            new IterativeEvaluationOptimizer().optimize(tupleExpr, dataset, bindings);
+            new FilterOptimizer().optimize(tupleExpr, dataset, bindings);
+            new OrderLimitOptimizer().optimize(tupleExpr, dataset, bindings);
+
+            log.debug("evaluating SPARQL query:\n {}", tupleExpr);
+
+            return strategy.evaluate(tupleExpr, EmptyBindingSet.getInstance());
+
+        } catch (QueryEvaluationException e) {
+            throw new SailException(e.getMessage(),e);
+        }
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/kiwi/kiwi-sparql/src/main/java/org/apache/marmotta/kiwi/sparql/sqlmapper/JoinTable.java
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-sparql/src/main/java/org/apache/marmotta/kiwi/sparql/sqlmapper/JoinTable.java b/libraries/kiwi/kiwi-sparql/src/main/java/org/apache/marmotta/kiwi/sparql/sqlmapper/JoinTable.java
deleted file mode 100644
index c40fdca..0000000
--- a/libraries/kiwi/kiwi-sparql/src/main/java/org/apache/marmotta/kiwi/sparql/sqlmapper/JoinTable.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/**
- * 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.platform.sparql.services.evaluation.sql;
-
-import org.jooq.Condition;
-import org.jooq.Table;
-
-import java.util.HashSet;
-import java.util.Set;
-
-/**
- * Wrapper for representing information about a table to join with. Holds a reference to the table and a
- * list of conditions to be used as join conditions.
- * <p/>
- * Author: Sebastian Schaffert
- */
-public class JoinTable {
-
-    private Table table;
-
-    private Set<Condition> conditions;
-
-    // remember conditions referring to tables not created in the current statement; they will also be contained
-    // in conditions, this set is just for checking in special cases
-    private Set<Condition> backConditions;
-
-
-    public JoinTable(Table table) {
-        this.table = table;
-
-        conditions     = new HashSet<Condition>();
-        backConditions = new HashSet<Condition>();
-    }
-
-    public void setTable(Table table) {
-        this.table = table;
-    }
-
-    public Table getTable() {
-        return table;
-    }
-
-    public Set<Condition> getConditions() {
-        return conditions;
-    }
-
-    public void addCondition(Condition condition) {
-        conditions.add(condition);
-    }
-
-    public Set<Condition> getBackConditions() {
-        return backConditions;
-    }
-
-    public void addBackCondition(Condition condition) {
-        backConditions.add(condition);
-    }
-}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/kiwi/kiwi-sparql/src/main/java/org/apache/marmotta/kiwi/sparql/sqlmapper/LMFNativeEvaluationStrategy.java
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-sparql/src/main/java/org/apache/marmotta/kiwi/sparql/sqlmapper/LMFNativeEvaluationStrategy.java b/libraries/kiwi/kiwi-sparql/src/main/java/org/apache/marmotta/kiwi/sparql/sqlmapper/LMFNativeEvaluationStrategy.java
deleted file mode 100644
index 7135d9f..0000000
--- a/libraries/kiwi/kiwi-sparql/src/main/java/org/apache/marmotta/kiwi/sparql/sqlmapper/LMFNativeEvaluationStrategy.java
+++ /dev/null
@@ -1,479 +0,0 @@
-/**
- * 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.platform.sparql.services.evaluation.sql;
-
-import at.newmedialab.sesame.commons.model.LiteralCommons;
-import info.aduna.iteration.CloseableIteration;
-import org.apache.marmotta.platform.core.api.config.ConfigurationService;
-import org.apache.marmotta.platform.core.api.persistence.PersistenceService;
-import org.apache.marmotta.platform.core.api.triplestore.SesameService;
-import org.apache.marmotta.platform.core.events.DBInitialisationEvent;
-import org.apache.marmotta.platform.core.model.rdf.KiWiNode;
-import org.apache.marmotta.platform.core.services.sail.LMFEvaluationStrategy;
-import org.apache.commons.validator.routines.UrlValidator;
-import org.jooq.Cursor;
-import org.jooq.Record;
-import org.jooq.SQLDialect;
-import org.jooq.Select;
-import org.openrdf.model.URI;
-import org.openrdf.model.Value;
-import org.openrdf.model.impl.LiteralImpl;
-import org.openrdf.model.impl.URIImpl;
-import org.openrdf.query.BindingSet;
-import org.openrdf.query.QueryEvaluationException;
-import org.openrdf.query.algebra.TupleExpr;
-import org.openrdf.query.algebra.ValueExpr;
-import org.openrdf.query.algebra.evaluation.ValueExprEvaluationException;
-import org.openrdf.query.impl.MapBindingSet;
-import org.slf4j.Logger;
-
-import javax.annotation.PostConstruct;
-import javax.enterprise.context.ApplicationScoped;
-import javax.enterprise.event.Observes;
-import javax.inject.Inject;
-import javax.persistence.EntityManager;
-import java.sql.Connection;
-import java.sql.SQLException;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-/**
- * An implementation of a Sesame evaluation strategy that translates SPARQL queries into native SQL queries
- * on the LMF triple store for improved performance. This implementation is based on the jOOQ Java-to-SQL library
- * to achieve a certain level of database independence.
- *
- * TODO: this class should somehow move to the lmf-sparql package
- * <p/>
- * Author: Sebastian Schaffert
- */
-@ApplicationScoped
-public class LMFNativeEvaluationStrategy implements LMFEvaluationStrategy {
-
-    @Inject
-    private Logger log;
-
-    @Inject
-    private PersistenceService persistenceService;
-
-    @Inject
-    private ConfigurationService configurationService;
-
-
-    @Inject
-    private SesameService sesameService;
-
-
-    @PostConstruct
-    public void initialise() {
-        log.info("initialising LMF native query evaluation strategy (SPARQL -> SQL mapper)");
-
-    }
-
-
-    public void onDatabaseInitialisation(@Observes DBInitialisationEvent event) {
-        log.debug("Received DB-initialisation event, checking existance of SPARQL query indexes");
-
-        if(!"off".equals(configurationService.getStringConfiguration("database.mode")) && "native".equals(configurationService.getStringConfiguration("sparql.strategy"))) {
-            checkIndexes();
-        }
-    }
-
-
-    /**
-     * Depending on the database dialect, check for the existance of appropriate indexes to speed up
-     * typical SPARQL queries
-     */
-    private void checkIndexes() {
-        switch (getSQLDialect()) {
-            case POSTGRES:
-                log.info("SQL Dialect is PostgreSQL, creating advanced indexes");
-                createIndexesPostgres();
-                break;
-        }
-
-    }
-
-    private void createIndexesPostgres() {
-        Connection connection = persistenceService.getJDBCConnection();
-        try {
-            // index for language matches
-            String idx_sparql_lang = "create index idx_sparql_lang on kiwinode ( coalesce(locale,''));";
-            connection.createStatement().executeUpdate("drop index if exists idx_sparql_lang");
-            connection.createStatement().executeUpdate(idx_sparql_lang);
-
-            // index for string value matches
-            //String idx_sparql_content = "create index idx_sparql_content on kiwinode ( coalesce(content,uri,anonid,'') text_pattern_ops);";
-            String idx_sparql_content = "create index idx_sparql_content on kiwinode using hash( coalesce(content,uri,anonid,''));";
-            connection.createStatement().executeUpdate("drop index if exists idx_sparql_content");
-            connection.createStatement().executeUpdate(idx_sparql_content);
-
-            // index for combined URI/ID matches (typical join in triple patterns)
-            String idx_sparql_uri = "create unique index idx_sparql_uri on kiwinode (id, uri);";
-            connection.createStatement().executeUpdate("drop index if exists idx_sparql_uri");
-            connection.createStatement().executeUpdate(idx_sparql_uri);
-
-            if(!connection.getAutoCommit())
-                connection.commit();
-        } catch (SQLException e) {
-            log.error("Postgres: error while trying to create indexes!",e);
-        } finally {
-            try {
-                connection.close();
-            } catch (SQLException e) {
-                log.error("could not close SQL connection",e);
-            }
-        }
-
-    }
-
-    /**
-     * Return the SQL Dialect used in this LMF instance. Returns null for unknown dialects.
-     *
-     * @return
-     */
-    private SQLDialect getSQLDialect() {
-        String db_type = configurationService.getStringConfiguration("database.type","h2");
-
-        SQLDialect dialect = null;
-        if(db_type.equals("h2")) {
-            dialect = SQLDialect.H2;
-        } else if(db_type.equals("postgres")) {
-            dialect = SQLDialect.POSTGRES;
-        } else if(db_type.equals("oracle")) {
-            dialect = SQLDialect.ORACLE;
-        } else if(db_type.equals("mysql")) {
-            dialect = SQLDialect.MYSQL;
-        }
-        return dialect;
-    }
-
-    /**
-     * Get the unique identifier for the evaluation strategy (e.g. "sesame", "hql", "native")
-     *
-     * @return
-     */
-    @Override
-    public String getIdentifier() {
-        return "native";
-    }
-
-    /**
-     * Return true if this evaluation strategy is available for use. Evaluation strategies can e.g. disable
-     * themselves in case the underlying database system or persistence layer is not supported.
-     *
-     * @return
-     */
-    @Override
-    public boolean isEnabled() {
-        String db_type = configurationService.getStringConfiguration("database.type","h2");
-
-        return "h2".equals(db_type) || "postgres".equals(db_type) || "mysql".equals(db_type) || "oracle".equals(db_type);
-    }
-
-    /**
-     * Evaluates the tuple expression against the supplied triple source with the
-     * specified set of variable bindings as input.
-     *
-     * @param expr     The Tuple Expression to evaluate
-     * @param bindings The variables bindings to use for evaluating the expression, if
-     *                 applicable.
-     * @return A closeable iterator over the variable binding sets that match the
-     *         tuple expression.
-     */
-    @Override
-    public CloseableIteration<BindingSet, QueryEvaluationException> evaluate(final TupleExpr expr, final BindingSet bindings) throws QueryEvaluationException {
-
-
-        String db_type = configurationService.getStringConfiguration("database.type","h2");
-
-        SQLDialect dialect = null;
-        if(db_type.equals("h2")) {
-            dialect = SQLDialect.H2;
-        } else if(db_type.equals("postgres")) {
-            dialect = SQLDialect.POSTGRES;
-        } else if(db_type.equals("oracle")) {
-            dialect = SQLDialect.ORACLE;
-        } else if(db_type.equals("mysql")) {
-            dialect = SQLDialect.MYSQL;
-        }
-
-        SparqlToSQLMapper.CastType castType = SparqlToSQLMapper.CastType.STRICT;
-        String castCfg = configurationService.getStringConfiguration("sparql.native.casttype","strict");
-        if("strict".equals(castCfg)) {
-            castType = SparqlToSQLMapper.CastType.STRICT;
-        } else if("loose".equals(castCfg)) {
-            castType = SparqlToSQLMapper.CastType.LOOSE;
-        } else if("none".equals(castCfg)) {
-            castType = SparqlToSQLMapper.CastType.NONE;
-        }
-
-        if(dialect != null) {
-
-            // rearrange the SPARQL abstract syntax tree so things are more suitable for SQL
-
-            // no unions as subselects in joins, we move the joins inside the union instead
-            new UnionOptimizer().optimize(expr);
-
-            final Connection connection = persistenceService.getJDBCConnection();
-
-            try {
-                connection.setAutoCommit(false);
-
-                final SparqlToSQLMapper mapper = new SparqlToSQLMapper(connection,dialect,expr, castType);
-
-                final Select query =  mapper.getQuery();
-
-                if(log.isDebugEnabled() || configurationService.getBooleanConfiguration("sparql.native.logsql",true)) {
-                    log.info("SQL query from SPARQL transformation:\n{}", query.getSQL());
-                }
-
-
-                final EntityManager em = persistenceService.getEntityManager();
-
-                return new CloseableIteration<BindingSet, QueryEvaluationException>() {
-
-                    private Cursor cursor = query.fetchLazy(50);
-
-                    private UrlValidator urlValidator = new UrlValidator(UrlValidator.ALLOW_ALL_SCHEMES | UrlValidator.ALLOW_LOCAL_URLS);
-
-                    // in case we need to split one SQL query row into several SPARQL query rows, we do it by creating
-                    // a temporary iterator
-                    private Iterator<BindingSet> splitBindings = null;
-
-                    @Override
-                    public void close() throws QueryEvaluationException {
-                        if(!cursor.isClosed()) {
-                            cursor.close();
-                        }
-                        try {
-                            if(!connection.getAutoCommit()) {
-                                connection.commit();
-                            }
-                            connection.close();
-                        } catch (SQLException e) {
-                            log.error("SQL exception while closing JDBC connection",e);
-                        }
-                        em.close();
-                    }
-
-                    @Override
-                    public boolean hasNext() throws QueryEvaluationException {
-                        return (splitBindings !=null && splitBindings.hasNext()) || cursor.hasNext();
-                    }
-
-                    @Override
-                    public BindingSet next() throws QueryEvaluationException {
-                        if(splitBindings != null) {
-                            return splitBindings.next();
-                        } else {
-                            Record record = cursor.fetchOne();
-
-                            // check if the result contains multiple SPARQL bindings in a single row or
-                            // only one SPARQL row; we can do this by checking whether the first result starts
-                            // with _multi
-                            if(record.getField(0).getName().startsWith("_multi")) {
-                                log.info("transforming single-row SQL result into multi-row SPARQL result");
-                                List<BindingSet> results = new ArrayList<BindingSet>();
-                                for(int i=1; true; i++) {
-                                    MapBindingSet result = new MapBindingSet();
-                                    for(String var : mapper.getProjectedVariables()) {
-                                        if(var.startsWith("_multi") && var.endsWith("_"+i)) {
-                                            Long nodeId = record.getValue(var, Long.class);
-
-                                            if(nodeId != null) {
-                                                Value value = em.find(KiWiNode.class, nodeId);
-
-                                                result.addBinding(var.substring(var.indexOf('_',1)+1,var.lastIndexOf('_')),value);
-                                            }
-                                        }
-                                    }
-                                    for(Map.Entry<String,Class> ext : mapper.getExtensionVariables().entrySet()) {
-                                        String var = ext.getKey();
-                                        if(var.startsWith("_multi") && var.endsWith("_"+i)) {
-                                            Object val = record.getValue(ext.getKey(),ext.getValue());
-
-                                            // this is truly a hack: we check whether the string is a URI, and if yes create a URI resource...
-                                            // it would be better to carry over this information from the value constants
-                                            if(urlValidator.isValid(val.toString())) {
-                                                URI value = new URIImpl(val.toString());
-                                                result.addBinding(var.substring(var.indexOf('_',1)+1,var.lastIndexOf('_')),value);
-                                            } else {
-                                                String type = LiteralCommons.getXSDType(ext.getValue());
-
-                                                // we only create an in-memory representation of the value, the LMF methods
-                                                // would automatically persist it, so we create a Sesame value
-                                                Value value = new LiteralImpl(val.toString(),sesameService.getValueFactory().createURI(type));
-                                                result.addBinding(var.substring(var.indexOf('_',1)+1,var.lastIndexOf('_')),value);
-                                            }
-                                        }
-                                    }
-                                    if(result.size() == 0) {
-                                        break;
-                                    } else {
-                                        results.add(result);
-                                    }
-                                }
-                                em.clear();
-                                splitBindings = results.iterator();
-                                return splitBindings.next();
-                            } else {
-
-                                MapBindingSet result = new MapBindingSet();
-                                for(String var : mapper.getProjectedVariables()) {
-                                    Long nodeId = record.getValue(var, Long.class);
-
-                                    if(nodeId != null) {
-                                        Value value = em.find(KiWiNode.class, nodeId);
-                                        result.addBinding(var,value);
-                                    }
-                                }
-                                for(Map.Entry<String,Class> ext : mapper.getExtensionVariables().entrySet()) {
-                                    Object val = record.getValue(ext.getKey(),ext.getValue());
-
-                                    // this is truly a hack: we check whether the string is a URI, and if yes create a URI resource...
-                                    // it would be better to carry over this information from the value constants
-                                    if(urlValidator.isValid(val.toString())) {
-                                        URI value = new URIImpl(val.toString());
-                                        result.addBinding(ext.getKey(),value);
-                                    } else {
-                                        String type = LiteralCommons.getXSDType(ext.getValue());
-
-                                        // we only create an in-memory representation of the value, the LMF methods
-                                        // would automatically persist it, so we create a Sesame value
-                                        Value value = new LiteralImpl(val.toString(),sesameService.getValueFactory().createURI(type));
-                                        result.addBinding(ext.getKey(),value);
-                                    }
-                                }
-
-                                em.clear();
-
-                                return result;
-                            }
-                        }
-                    }
-
-                    @Override
-                    public void remove() throws QueryEvaluationException {
-                        throw new UnsupportedOperationException("removing not supported");
-                    }
-                };
-
-            } catch(Exception ex) {
-                log.error("exception while translating SPARQL query",ex);
-                log.error("abstract query tree was: {}",expr);
-                try {
-                    connection.close();
-                } catch (SQLException e) {
-                    log.error("error while trying to close JDBC connection",e);
-                }
-            }
-
-            throw new UnsupportedOperationException("not yet implemented");
-        }
-
-        throw new UnsupportedOperationException("the database "+db_type+" is not yet supported for SPARQL->SQL mapping");
-    }
-
-    /**
-     * Gets the value of this expression.
-     *
-     * @param bindings The variables bindings to use for evaluating the expression, if
-     *                 applicable.
-     * @return The Value that this expression evaluates to, or <tt>null</tt> if
-     *         the expression could not be evaluated.
-     */
-    @Override
-    public Value evaluate(ValueExpr expr, BindingSet bindings) throws ValueExprEvaluationException, QueryEvaluationException {
-        String db_type = configurationService.getStringConfiguration("database.type","h2");
- /*
-        SQLDialect dialect = null;
-        if(db_type.equals("h2")) {
-            dialect = SQLDialect.H2;
-        } else if(db_type.equals("postgres")) {
-            dialect = SQLDialect.POSTGRES;
-        } else if(db_type.equals("oracle")) {
-            dialect = SQLDialect.ORACLE;
-        } else if(db_type.equals("mysql")) {
-            dialect = SQLDialect.MYSQL;
-        }
-
-        SparqlToSQLMapper.CastType castType = SparqlToSQLMapper.CastType.STRICT;
-        String castCfg = configurationService.getStringConfiguration("sparql.native.casttype","strict");
-        if("strict".equals(castCfg)) {
-            castType = SparqlToSQLMapper.CastType.STRICT;
-        } else if("loose".equals(castCfg)) {
-            castType = SparqlToSQLMapper.CastType.LOOSE;
-        } else if("none".equals(castCfg)) {
-            castType = SparqlToSQLMapper.CastType.NONE;
-        }
-
-        if(dialect != null) {
-            final Connection connection = persistenceService.getJDBCConnection();
-
-            try {
-                final SparqlToSQLMapper mapper = new SparqlToSQLMapper(connection,dialect,expr,castType);
-
-                final Select query =  mapper.getQuery();
-
-                log.info("SQL query would be: {}", query.getSQL());
-
-
-                Object value = query.fetchOne(0);
-
-
-                connection.commit();
-                connection.close();
-
-                throw new UnsupportedOperationException("not yet implemented");
-            } catch (SQLException e) {
-                log.error("error while evaluating SQL query",e);
-            } finally {
-                try {
-                    connection.close();
-                } catch (SQLException e) {
-                    log.error("error while trying to close JDBC connection",e);
-                }
-            }
-
-        }
-*/
-        throw new UnsupportedOperationException("the database "+db_type+" is not yet supported for SPARQL->SQL mapping");
-    }
-
-    /**
-     * Evaluates the boolean expression on the supplied TripleSource object.
-     *
-     * @param bindings The variables bindings to use for evaluating the expression, if
-     *                 applicable.
-     * @return The result of the evaluation.
-     * @throws org.openrdf.query.algebra.evaluation.ValueExprEvaluationException
-     *          If the value expression could not be evaluated, for example when
-     *          comparing two incompatible operands. When thrown, the result of
-     *          the boolean expression is neither <tt>true</tt> nor
-     *          <tt>false</tt>, but unknown.
-     */
-    @Override
-    public boolean isTrue(ValueExpr expr, BindingSet bindings) throws ValueExprEvaluationException, QueryEvaluationException {
-        return false;  //To change body of implemented methods use File | Settings | File Templates.
-    }
-
-
-
-}


[056/100] [abbrv] git commit: add constructor to buildinfo plugin

Posted by wi...@apache.org.
add constructor to buildinfo plugin


Project: http://git-wip-us.apache.org/repos/asf/marmotta/repo
Commit: http://git-wip-us.apache.org/repos/asf/marmotta/commit/85a5993f
Tree: http://git-wip-us.apache.org/repos/asf/marmotta/tree/85a5993f
Diff: http://git-wip-us.apache.org/repos/asf/marmotta/diff/85a5993f

Branch: refs/heads/ldp
Commit: 85a5993f6d17d2169de81e642959bbb188097880
Parents: 89fe9d4
Author: Sebastian Schaffert <ss...@apache.org>
Authored: Tue Apr 8 10:58:30 2014 +0200
Committer: Sebastian Schaffert <ss...@apache.org>
Committed: Tue Apr 8 10:58:30 2014 +0200

----------------------------------------------------------------------
 .../maven/plugins/buildinfo/BuildInfoMojo.java  | 23 +++++++++-----------
 1 file changed, 10 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/marmotta/blob/85a5993f/build/plugins/buildinfo-maven-plugin/src/main/java/org/apache/marmotta/maven/plugins/buildinfo/BuildInfoMojo.java
----------------------------------------------------------------------
diff --git a/build/plugins/buildinfo-maven-plugin/src/main/java/org/apache/marmotta/maven/plugins/buildinfo/BuildInfoMojo.java b/build/plugins/buildinfo-maven-plugin/src/main/java/org/apache/marmotta/maven/plugins/buildinfo/BuildInfoMojo.java
index 9f374c1..4b7e23f 100644
--- a/build/plugins/buildinfo-maven-plugin/src/main/java/org/apache/marmotta/maven/plugins/buildinfo/BuildInfoMojo.java
+++ b/build/plugins/buildinfo-maven-plugin/src/main/java/org/apache/marmotta/maven/plugins/buildinfo/BuildInfoMojo.java
@@ -17,19 +17,6 @@
  */
 package org.apache.marmotta.maven.plugins.buildinfo;
 
-import java.io.BufferedWriter;
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.OutputStreamWriter;
-import java.io.Writer;
-import java.net.UnknownHostException;
-import java.util.HashMap;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.ServiceLoader;
-
 import org.apache.commons.io.IOUtils;
 import org.apache.maven.model.Build;
 import org.apache.maven.plugin.AbstractMojo;
@@ -37,6 +24,13 @@ import org.apache.maven.plugin.MojoExecutionException;
 import org.apache.maven.plugin.MojoFailureException;
 import org.apache.maven.project.MavenProject;
 
+import java.io.*;
+import java.net.UnknownHostException;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.ServiceLoader;
+
 /**
  * Date: 13.05.2011
  * Time: 12:00:00
@@ -75,6 +69,9 @@ public class BuildInfoMojo extends AbstractMojo {
      */
     private List<String> systemProperties;
 
+    public BuildInfoMojo() {
+    }
+
     public void execute() throws MojoExecutionException, MojoFailureException {
         Map<String, String> map = new HashMap<String, String>();
 


[047/100] [abbrv] [partial] Reverting the erroneous merge by Sebastian according to the instructions in INFRA-6876

Posted by wi...@apache.org.
http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/marmotta-commons/src/ext/java/javolution/util/function/MultiVariable.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-commons/src/ext/java/javolution/util/function/MultiVariable.java b/commons/marmotta-commons/src/ext/java/javolution/util/function/MultiVariable.java
new file mode 100644
index 0000000..c38f4d8
--- /dev/null
+++ b/commons/marmotta-commons/src/ext/java/javolution/util/function/MultiVariable.java
@@ -0,0 +1,54 @@
+/*
+ * 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.util.function;
+
+/**
+ * <p> An object holding multiple variables; typically used to create 
+ *     {@link Function multi-parameters functions}.</p>
+ * 
+ * <p> Multi-variables may represent an unbounded number of variables.
+ *     [code]
+ *     MultiVariable<Double, MultiVariable<Integer, Boolean>> tertiaryVariable
+ *         = new MultiVariable(2.3, new MultiVariable(57, true));
+ *     [/code].</p>
+ * 
+ * @param <L> the type of the variable on the left.
+ * @param <R> the type of the variable on the right.
+ * 
+ * @author  <a href="mailto:jean-marie@dautelle.com">Jean-Marie Dautelle</a>
+ * @version 6.0, July 21, 2013
+ */
+public class MultiVariable<L, R> {
+
+    private final L left;
+    private final R right;
+
+    /**
+     * Returns a multi-variable holding the specified objects (possibly 
+     * multi-variables themselves). 
+     */
+    public MultiVariable(L left, R right) {
+        this.left = left;
+        this.right = right;
+    }
+
+    /**
+     * Returns the variable on the left.
+     */
+    public L getLeft() {
+        return left;
+    }
+
+    /**
+     * Returns the variable on the right.
+     */
+    public R getRight() {
+        return right;
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/marmotta-commons/src/ext/java/javolution/util/function/Predicate.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-commons/src/ext/java/javolution/util/function/Predicate.java b/commons/marmotta-commons/src/ext/java/javolution/util/function/Predicate.java
new file mode 100644
index 0000000..e2c5803
--- /dev/null
+++ b/commons/marmotta-commons/src/ext/java/javolution/util/function/Predicate.java
@@ -0,0 +1,32 @@
+/*
+ * 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.util.function;
+
+/**
+ * <p> A function which states or affirms the attribute or quality of something.</p>
+ * 
+ * <p> Note: In future version this interface may derive from 
+ *           {@code Function<P, Boolean>}.</p>
+
+ * @param <T> The type of input object to test.
+ *           
+ * @see <a href="http://en.wikipedia.org/wiki/Predicate_(mathematical_logic)">
+ * Wikipedia: Predicate<a>    
+ *                  
+ * @author  <a href="mailto:jean-marie@dautelle.com">Jean-Marie Dautelle</a>
+ * @version 6.0, July 21, 2013
+ */
+public interface Predicate<T> {
+
+    /**
+     * Tests the specified value.
+     */
+    boolean test(T param);
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/marmotta-commons/src/ext/java/javolution/util/function/Reducer.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-commons/src/ext/java/javolution/util/function/Reducer.java b/commons/marmotta-commons/src/ext/java/javolution/util/function/Reducer.java
new file mode 100644
index 0000000..73b3e44
--- /dev/null
+++ b/commons/marmotta-commons/src/ext/java/javolution/util/function/Reducer.java
@@ -0,0 +1,26 @@
+/*
+ * 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.util.function;
+
+import java.util.Collection;
+
+
+/**
+ * <p> An operator upon multiple elements of a collection yielding a result 
+ *     of that collection type.</p>
+ * 
+ * @param <E> The type of elements in the collection operated upon.
+ * 
+ * @author  <a href="mailto:jean-marie@dautelle.com">Jean-Marie Dautelle</a>
+ * @version 6.0, July 21, 2013
+ * @see     Reducers
+ */
+public interface Reducer<E> extends Consumer<Collection<E>>, Supplier<E> {
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/marmotta-commons/src/ext/java/javolution/util/function/Reducers.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-commons/src/ext/java/javolution/util/function/Reducers.java b/commons/marmotta-commons/src/ext/java/javolution/util/function/Reducers.java
new file mode 100644
index 0000000..020c44e
--- /dev/null
+++ b/commons/marmotta-commons/src/ext/java/javolution/util/function/Reducers.java
@@ -0,0 +1,229 @@
+/*
+ * 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.util.function;
+
+import javolution.lang.Parallelizable;
+import javolution.lang.Realtime;
+import javolution.util.FastCollection;
+
+import java.util.Collection;
+import java.util.Comparator;
+import java.util.Iterator;
+import java.util.concurrent.atomic.AtomicInteger;
+import java.util.concurrent.atomic.AtomicReference;
+
+import static javolution.lang.Realtime.Limit.LINEAR;
+
+/**
+ * <p> A set of useful {@link Reducer reducers} of collection elements.</p>
+ *     
+ * @author  <a href="mailto:jean-marie@dautelle.com">Jean-Marie Dautelle</a>
+ * @version 6.0, July 21, 2013
+ * @see     FastCollection#reduce(Reducer)
+ */
+public class Reducers {
+
+    // Utility class, no default constructor.
+    private Reducers() {}
+
+    /**
+     * Returns any non-null element of the specified type. 
+     * This reducer stops iterating as soon as an element with the matching 
+     * type is found.
+     */
+    @Parallelizable
+    @Realtime(limit = LINEAR)
+    public static <E> Reducer<E> any(Class<? extends E> type) {
+        return new AnyReducer<E>(type);
+    }
+
+    private static class AnyReducer<E> implements Reducer<E>  {
+        private final Class<? extends E> type;
+        private volatile E found;
+        
+        public AnyReducer(Class<? extends E> type) {
+            this.type = type;
+        }
+
+        @Override
+        public void accept(Collection<E> param) {
+            Iterator<E> it = param.iterator();
+            while (it.hasNext() && (found == null)) {
+                E e = it.next();
+                if (type.isInstance(e)) {
+                    found = e;
+                    break;
+                }
+            }
+        }
+
+        @Override
+        public E get() {
+            return found;
+        }
+    }
+
+    /**
+     * Returns the greatest element of a collection according to the 
+     * specified comparator (returns {@code null} if the collection is empty).
+     */
+    @Parallelizable(mutexFree = true, comment = "Internal use of AtomicReference")
+    @Realtime(limit = LINEAR)
+    public static <E> Reducer<E> max(Comparator<? super E> comparator) {
+        return new MaxReducer<E>(comparator);
+    }
+
+    private static class MaxReducer<E> implements Reducer<E> {
+        private final Comparator<? super E> cmp;
+        private final AtomicReference<E> max = new AtomicReference<E>(null);
+
+        public MaxReducer(Comparator<? super E> cmp) {
+            this.cmp = cmp;
+        }
+
+        @Override
+        public void accept(Collection<E> param) {
+            Iterator<E> it = param.iterator();
+            while (it.hasNext()) {
+                E e = it.next();
+                E read = max.get();
+                while ((read == null) || (cmp.compare(e, read) > 0)) {
+                    if (max.compareAndSet(read, e)) break;
+                    read = max.get();
+                }
+            }
+        }
+
+        @Override
+        public E get() {
+            return max.get();
+        }
+    }
+
+    /**
+     * Returns the smallest element of a collection according to the collection
+     * comparator (returns {@code null} if the collection is empty).
+     */
+    @Parallelizable(mutexFree = true, comment = "Internal use of AtomicReference")
+    @Realtime(limit = LINEAR)
+    public static <E> Reducer<E> min(Comparator<? super E> comparator) {
+        return new MinReducer<E>(comparator);
+    }
+
+    private static class MinReducer<E> implements Reducer<E> {
+        private final Comparator<? super E> cmp;
+        private final AtomicReference<E> min = new AtomicReference<E>(null);
+
+        public MinReducer(Comparator<? super E> cmp) {
+            this.cmp = cmp;
+        }
+
+        @Override
+        public void accept(Collection<E> param) {
+            Iterator<E> it = param.iterator();
+            while (it.hasNext()) {
+                E e = it.next();
+                E read = min.get();
+                while ((read == null) || (cmp.compare(e, read) < 0)) {
+                    if (min.compareAndSet(read, e)) break;
+                    read = min.get();
+                }
+            }
+        }
+
+        @Override
+        public E get() {
+            return min.get();
+        }
+    }
+
+    /**
+    * Conditional 'and' operator (returns {@code true} if the collection is 
+    * empty). This operator stops iterating as soon as a {@code false} value
+    * is found.
+    */
+    @Parallelizable
+    @Realtime(limit = LINEAR)
+    public static Reducer<Boolean> and() {
+        return new AndReducer();
+    }
+
+    private static class AndReducer implements Reducer<Boolean> {
+        volatile boolean result = true;
+
+        @Override
+        public void accept(Collection<Boolean> param) {
+            Iterator<Boolean> it = param.iterator();
+            while (result && it.hasNext()) {
+                if (!it.next()) result = false;
+            }
+        }
+
+        @Override
+        public Boolean get() {
+            return result;
+        }
+    }
+
+    /**
+    * Conditional 'or' operator (returns {@code false} if the collection is 
+    * empty). This operator stops iterating as soon as a {@code true} value
+    * is found.
+     */
+    @Parallelizable
+    @Realtime(limit = LINEAR)
+    public static Reducer<Boolean> or() {
+        return new OrReducer();
+    }
+
+    private static class OrReducer implements Reducer<Boolean> {
+        volatile boolean result = false;
+
+        @Override
+        public void accept(Collection<Boolean> param) {
+            Iterator<Boolean> it = param.iterator();
+            while (!result && it.hasNext()) {
+                if (!it.next()) result = true;
+            }
+        }
+
+        @Override
+        public Boolean get() {
+            return result;
+        }
+    }
+
+    /**
+     * Returns the sum of the specified integers value (returns {@code 0} 
+     * if the collection is empty).
+     */
+    @Parallelizable(comment = "Internal use of AtomicInteger")
+    @Realtime(limit = LINEAR)
+    public static Reducer<Integer> sum() {
+        return new SumReducer();
+    }
+
+    private static class SumReducer implements Reducer<Integer> {
+        private final AtomicInteger sum = new AtomicInteger(0);
+
+        @Override
+        public void accept(Collection<Integer> param) {
+            Iterator<Integer> it = param.iterator();
+            while (it.hasNext()) {
+                sum.getAndAdd(it.next().intValue());
+            }
+        }
+
+        @Override
+        public Integer get() {
+            return sum.get();
+        }
+    }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/marmotta-commons/src/ext/java/javolution/util/function/Splittable.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-commons/src/ext/java/javolution/util/function/Splittable.java b/commons/marmotta-commons/src/ext/java/javolution/util/function/Splittable.java
new file mode 100644
index 0000000..4ad3d5d
--- /dev/null
+++ b/commons/marmotta-commons/src/ext/java/javolution/util/function/Splittable.java
@@ -0,0 +1,53 @@
+/*
+ * 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.util.function;
+
+
+/**
+ * An object which can be divided in distinct parts and on which the same 
+ * action may be performed on the parts rather than the whole. 
+ *  
+ * @author <a href="mailto:jean-marie@dautelle.com">Jean-Marie Dautelle</a>
+ * @version 6.0, July 21, 2013
+ */
+public interface Splittable<T> {
+
+    /** 
+     * Executes a read-only action on the specified part of this object.
+     *       
+     * @param action the read-only action.
+     * @param part this object or a part of it.
+     * @throws UnsupportedOperationException if the action tries to update the 
+     *         specified part.
+     */
+    void perform(Consumer<T> action, T part);
+
+    /** 
+     * Returns {@code n} distinct parts of this object. 
+     * This method may return an array of size less than {@code n}
+     * (e.g. an array of size one if this object cannot split).
+     *   
+     * @param n the number of parts.
+     * @param threadsafe {@code true} if the returned parts can be updated 
+     *        concurrently;  {@code false} otherwise. 
+     * @return the distinct parts (or views) for this object.
+     * @throws IllegalArgumentException if {@code n < 1}
+     */
+    T[] split(int n, boolean threadsafe);
+
+    /** 
+     * Executes an update action on the specified part of this object. 
+     * Any change to the part is reflected in the whole (this object). 
+     *       
+     * @param action the action authorized to update this object part.
+     * @param part this object or a part of it.
+     */
+    void update(Consumer<T> action, T part);
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/marmotta-commons/src/ext/java/javolution/util/function/Supplier.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-commons/src/ext/java/javolution/util/function/Supplier.java b/commons/marmotta-commons/src/ext/java/javolution/util/function/Supplier.java
new file mode 100644
index 0000000..984549a
--- /dev/null
+++ b/commons/marmotta-commons/src/ext/java/javolution/util/function/Supplier.java
@@ -0,0 +1,30 @@
+/*
+ * 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.util.function;
+
+/**
+ * <p> A function which does not take any argument and returns instances
+ *      of a particular class.</p>
+ *                  
+ * <p> Note: In future version this interface may derive from 
+ *           {@code Function<Void, R>}.</p>
+ *           
+ * @param <T> The type of result this supplier returns.
+ * 
+ * @author  <a href="mailto:jean-marie@dautelle.com">Jean-Marie Dautelle</a>
+ * @version 6.0, July 21, 2013
+ */
+public interface Supplier<T> {
+
+    /**
+     * Returns an object.
+     */
+    T get();
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/marmotta-commons/src/ext/java/javolution/util/function/package-info.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-commons/src/ext/java/javolution/util/function/package-info.java b/commons/marmotta-commons/src/ext/java/javolution/util/function/package-info.java
new file mode 100644
index 0000000..4501ea9
--- /dev/null
+++ b/commons/marmotta-commons/src/ext/java/javolution/util/function/package-info.java
@@ -0,0 +1,25 @@
+/**
+<p> Basic functions for lambda expressions and method references.</p>
+    Most often, functions do not have a state and can be called concurrently, 
+    as indicated by the annotation {@link javolution.lang.Parallelizable Parallelizable}.</p>
+    
+<p> Functions may take an arbitrary number of arguments through the use of 
+    {@link javolution.util.function.MultiVariable multi-variables}
+    or no argument at all using the standard {@link java.lang.Void} class.  
+[code]
+// Function populating a list of integer and returning void.
+Function<MultiVariable<List<Integer>, Integer>, Void> fill = new Function<>() {
+   public Void apply(MultiVariable<List<Integer>, Integer> params) {
+       List<Integer> list = params.getLeft();
+       for (int i = 0, n = params.getRight(); i < n; i++) {
+          list.add(i);
+       }
+       return null;
+   }
+};
+FastTable<Integer> list = new FastTable<Integer>();
+fill.apply(new MultiVariable(list, 100)); // Populates with numbers [0 .. 100[
+[/code]</p>
+ */
+package javolution.util.function;
+

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/marmotta-commons/src/ext/java/javolution/util/internal/ReadWriteLockImpl.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-commons/src/ext/java/javolution/util/internal/ReadWriteLockImpl.java b/commons/marmotta-commons/src/ext/java/javolution/util/internal/ReadWriteLockImpl.java
new file mode 100644
index 0000000..e4a464e
--- /dev/null
+++ b/commons/marmotta-commons/src/ext/java/javolution/util/internal/ReadWriteLockImpl.java
@@ -0,0 +1,138 @@
+/*
+ * 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.util.internal;
+
+import java.io.Serializable;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.locks.Condition;
+import java.util.concurrent.locks.Lock;
+import java.util.concurrent.locks.ReadWriteLock;
+
+/**
+ * Simple and efficient read/write lock implementation giving 
+ * preferences to writers. Acquiring a write lock then a read lock is 
+ * supported. Writers may acquire a read lock after having the write lock
+ * but the reverse would result in deadlock.
+ */
+public final class ReadWriteLockImpl implements ReadWriteLock, Serializable {
+    
+    /** Read-Lock Implementation. */
+    public final class ReadLock implements Lock, Serializable {
+        private static final long serialVersionUID = 0x600L; // Version.
+
+        @Override
+        public void lock() {
+            try {
+                lockInterruptibly();
+            } catch (java.lang.InterruptedException e) {}
+        }
+
+        @Override
+        public void lockInterruptibly() throws InterruptedException {
+            synchronized (ReadWriteLockImpl.this) {
+                if (writerThread == Thread.currentThread()) return; // Current thread has the writer lock.
+                while ((writerThread != null) || (waitingWriters != 0)) {
+                    ReadWriteLockImpl.this.wait();
+                }
+                givenLocks++;
+            }
+        }
+
+        @Override
+        public Condition newCondition() {
+            throw new UnsupportedOperationException();
+        }
+
+        @Override
+        public boolean tryLock() {
+            throw new UnsupportedOperationException();
+        }
+
+        @Override
+        public boolean tryLock(long time, TimeUnit unit)
+                throws InterruptedException {
+            throw new UnsupportedOperationException();
+        }
+
+        @Override
+        public void unlock() {
+            synchronized (ReadWriteLockImpl.this) {
+                if (writerThread == Thread.currentThread()) return; // Itself is the writing thread.
+                assert (givenLocks > 0);
+                givenLocks--;
+                ReadWriteLockImpl.this.notifyAll();
+            }
+        }
+    }
+
+    /** Write-Lock Implementation. */
+    public final class WriteLock implements Lock, Serializable {
+        private static final long serialVersionUID = 0x600L; // Version.
+
+        @Override
+        public void lock() {
+            try {
+                lockInterruptibly();
+            } catch (java.lang.InterruptedException e) {}
+        }
+
+        @Override
+        public void lockInterruptibly() throws InterruptedException {
+            synchronized (ReadWriteLockImpl.this) {
+                waitingWriters++;
+                while (givenLocks != 0) {
+                    ReadWriteLockImpl.this.wait();
+                }
+                waitingWriters--;
+                writerThread = Thread.currentThread();
+            }
+        }
+
+        @Override
+        public Condition newCondition() {
+            throw new UnsupportedOperationException();
+        }
+
+        @Override
+        public boolean tryLock() {
+            throw new UnsupportedOperationException();
+        }
+
+        @Override
+        public boolean tryLock(long time, TimeUnit unit)
+                throws InterruptedException {
+            throw new UnsupportedOperationException();
+        }
+
+        @Override
+        public void unlock() {
+            synchronized (ReadWriteLockImpl.this) {
+                writerThread = null;
+                ReadWriteLockImpl.this.notifyAll();
+            }
+        }
+    }
+
+    private static final long serialVersionUID = 0x600L; // Version.
+    public final ReadLock readLock = new ReadLock();
+    public final WriteLock writeLock = new WriteLock();
+    private transient int givenLocks;
+    private transient int waitingWriters;
+    private transient Thread writerThread;
+
+    @Override
+    public ReadLock readLock() {
+        return readLock;
+    }
+
+    @Override
+    public WriteLock writeLock() {
+        return writeLock;
+    }
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/marmotta-commons/src/ext/java/javolution/util/internal/collection/AtomicCollectionImpl.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-commons/src/ext/java/javolution/util/internal/collection/AtomicCollectionImpl.java b/commons/marmotta-commons/src/ext/java/javolution/util/internal/collection/AtomicCollectionImpl.java
new file mode 100644
index 0000000..a76ce38
--- /dev/null
+++ b/commons/marmotta-commons/src/ext/java/javolution/util/internal/collection/AtomicCollectionImpl.java
@@ -0,0 +1,194 @@
+/*
+ * 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.util.internal.collection;
+
+import javolution.util.function.Consumer;
+import javolution.util.function.Equality;
+import javolution.util.service.CollectionService;
+
+import java.util.Collection;
+import java.util.Iterator;
+
+/**
+ * An atomic view over a collection (copy-on-write).
+ */
+public class AtomicCollectionImpl<E> extends CollectionView<E> {
+
+    /** Thread-Safe Iterator. */
+    private class IteratorImpl implements Iterator<E> {
+        private E current;
+        private final Iterator<E> targetIterator;
+
+        public IteratorImpl() {
+            targetIterator = targetView().iterator();
+        }
+
+        @Override
+        public boolean hasNext() {
+            return targetIterator.hasNext();
+        }
+
+        @Override
+        public E next() {
+            current = targetIterator.next();
+            return current;
+        }
+
+        @Override
+        public void remove() {
+            if (current == null) throw new IllegalStateException();
+            AtomicCollectionImpl.this.remove(current);
+            current = null;
+        }
+    }
+
+    private static final long serialVersionUID = 0x600L; // Version.
+    protected volatile CollectionService<E> immutable; // The copy used by readers.
+    protected transient Thread updatingThread; // The thread executing an update.
+
+    public AtomicCollectionImpl(CollectionService<E> target) {
+        super(target);
+        this.immutable = cloneTarget();
+    }
+
+    @Override
+    public synchronized boolean add(E element) {
+        boolean changed = target().add(element);
+        if (changed && !updateInProgress()) immutable = cloneTarget();
+        return changed;
+    }
+
+    @Override
+    public synchronized boolean addAll(Collection<? extends E> c) {
+        boolean changed = target().addAll(c);
+        if (changed && !updateInProgress()) immutable = cloneTarget();
+        return changed;
+    }
+
+    @Override
+    public synchronized void clear() {
+        clear();
+        if (!updateInProgress()) {
+            immutable = cloneTarget();
+        }
+    }
+
+    @Override
+    public synchronized AtomicCollectionImpl<E> clone() { // Synchronized required since working with real target.
+        AtomicCollectionImpl<E> copy = (AtomicCollectionImpl<E>) super.clone();
+        copy.updatingThread = null;
+        return copy;
+    }
+
+    @Override
+    public Equality<? super E> comparator() {
+        return immutable.comparator();
+    }
+
+    @Override
+    public boolean contains(Object o) {
+        return targetView().contains(o);
+    }
+
+    @Override
+    public boolean containsAll(Collection<?> c) {
+        return targetView().containsAll(c);
+    }
+
+    @Override
+    public boolean equals(Object o) {
+        return targetView().equals(o);
+    }
+
+    @Override
+    public int hashCode() {
+        return targetView().hashCode();
+    }
+
+    @Override
+    public boolean isEmpty() {
+        return targetView().isEmpty();
+    }
+
+    @Override
+    public Iterator<E> iterator() {
+        return new IteratorImpl();
+    }
+
+    @Override
+    public synchronized boolean remove(Object o) {
+        boolean changed = target().remove(o);
+        if (changed && !updateInProgress()) immutable = cloneTarget();
+        return changed;
+    }
+
+    @Override
+    public synchronized boolean removeAll(Collection<?> c) {
+        boolean changed = target().removeAll(c);
+        if (changed && !updateInProgress()) immutable = cloneTarget();
+        return changed;
+    }
+
+    @Override
+    public synchronized boolean retainAll(Collection<?> c) {
+        boolean changed = target().retainAll(c);
+        if (changed && !updateInProgress()) immutable = cloneTarget();
+        return changed;
+    }
+
+    @Override
+    public int size() {
+        return targetView().size();
+    }
+
+    @Override
+    public Object[] toArray() {
+        return targetView().toArray();
+    }
+
+    @Override
+    public <T> T[] toArray(T[] a) {
+        return targetView().toArray(a);
+    }
+
+    @Override
+    public synchronized void update(Consumer<CollectionService<E>> action,
+            CollectionService<E> view) {
+        updatingThread = Thread.currentThread(); // Update in progress.
+        try {
+            target().update(action, view); // No copy performed.
+        } finally {
+            updatingThread = null;
+            immutable = cloneTarget(); // One single copy !
+        }
+    }
+
+    /** Returns a clone copy of target. */
+    protected CollectionService<E> cloneTarget() {
+        try {
+            return target().clone();
+        } catch (CloneNotSupportedException e) {
+            throw new Error("Cannot happen since target is Cloneable.");
+        }
+    }
+
+    /** Returns either the immutable target or the actual target if updating 
+     *  thread. */
+    protected CollectionService<E> targetView() {
+        return ((updatingThread == null) || (updatingThread != Thread.currentThread()))
+                ? immutable : target();
+    }
+
+    /** Indicates if the current thread is doing an atomic update. */
+    protected final boolean updateInProgress() {
+        return updatingThread == Thread.currentThread();
+
+    }
+}
+

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/marmotta-commons/src/ext/java/javolution/util/internal/collection/CollectionView.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-commons/src/ext/java/javolution/util/internal/collection/CollectionView.java b/commons/marmotta-commons/src/ext/java/javolution/util/internal/collection/CollectionView.java
new file mode 100644
index 0000000..a2ed55b
--- /dev/null
+++ b/commons/marmotta-commons/src/ext/java/javolution/util/internal/collection/CollectionView.java
@@ -0,0 +1,268 @@
+/*
+ * 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.util.internal.collection;
+
+import javolution.util.FastCollection;
+import javolution.util.function.Consumer;
+import javolution.util.function.Equalities;
+import javolution.util.function.Equality;
+import javolution.util.service.CollectionService;
+
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+
+/**
+ * Collection view implementation; can be used as root class for implementations 
+ * if target is {@code null}.
+ * When possible sub-classes should forward to the actual target for the methods
+ * clear, remove, contains, size and isEmpty rather than using the default 
+ * implementation.
+ */
+public abstract class CollectionView<E> extends FastCollection<E> implements CollectionService<E> {
+//public abstract class CollectionView<E> implements CollectionService<E> {
+
+    private static final long serialVersionUID = 0x600L; // Version.
+    private CollectionService<E> target;
+
+    /**
+     * The view constructor or root class constructor if target is {@code null}.
+     */
+    public CollectionView(CollectionService<E> target) {
+        this.target = target;
+    }
+
+    @Override
+    public abstract boolean add(E element);
+
+    @Override
+    public boolean addAll(Collection<? extends E> c) {
+        boolean changed = false;
+        Iterator<? extends E> it = c.iterator();
+        while (it.hasNext()) {
+            if (add(it.next())) changed = true;
+        }
+        return changed;
+    }
+
+    @Override
+    public void clear() {
+        Iterator<? extends E> it = iterator();
+        while (it.hasNext()) {
+            it.next();
+            it.remove();
+        }
+    }
+
+    @SuppressWarnings("unchecked")
+    @Override
+    public CollectionView<E> clone() {
+        try {
+            CollectionView<E> copy = (CollectionView<E>) super.clone();
+            if (target != null) { // Not a root class.
+                copy.target = target.clone();
+            }
+            return copy;
+        } catch (CloneNotSupportedException e) {
+            throw new Error("Should not happen since target is cloneable");
+        }
+    }
+
+    @Override
+    public abstract Equality<? super E> comparator();
+
+    @Override
+    @SuppressWarnings("unchecked")
+    public boolean contains(Object obj) {
+        Iterator<? extends E> it = iterator();
+        Equality<Object> cmp = (Equality<Object>) comparator();
+        while (it.hasNext()) {
+            if (cmp.areEqual(obj, it.next())) return true;
+        }
+        return false;
+    }
+
+    @Override
+    public boolean containsAll(Collection<?> c) {
+        for (Object e : c) {
+            if (!contains(e)) return false;
+        }
+        return true;
+    }
+
+    @SuppressWarnings("unchecked")
+    @Override
+    public boolean equals(Object o) {
+        // Follow Collection.equals specification if this comparator is standard.        
+        if (this == o) return true;
+        // Check comparators consistency.
+        if (o instanceof CollectionService) {
+            if (!comparator().equals(((CollectionService<E>) o).comparator())) return false; // Different comparators.
+        } else {
+            if (!comparator().equals(Equalities.STANDARD)) return false;
+        }
+        // Collection.equals contract.
+        if (this instanceof Set) {
+            if (!(o instanceof Set)) return false;
+            Set<E> set = (Set<E>) o;
+            return (size() == set.size()) && containsAll(set);
+        } else if (this instanceof List) {
+            if (!(o instanceof List)) return false;
+            List<E> list = (List<E>) o;
+            if (size() != list.size()) return false; // Short-cut.
+            Equality<? super E> cmp = comparator();
+            Iterator<E> it1 = this.iterator();
+            Iterator<E> it2 = list.iterator();
+            while (it1.hasNext()) {
+                if (!it2.hasNext()) return false;
+                if (!cmp.areEqual(it1.next(), it2.next())) return false;
+            }
+            if (it2.hasNext()) return false;
+            return true;
+        } else {
+            return false;
+        }
+    }
+
+    @Override
+    public int hashCode() {
+        // Follow Collection.equals specification if this comparator is standard.        
+        Equality<? super E> cmp = comparator();
+        Iterator<E> it = this.iterator();
+        int hash = 0;
+        if (this instanceof Set) {
+            while (it.hasNext()) {
+                hash += cmp.hashCodeOf(it.next());
+            }
+        } else if (this instanceof List) {
+            while (it.hasNext()) {
+                hash += 31 * hash + cmp.hashCodeOf(it.next());
+            }
+        } else {
+            hash = super.hashCode();
+        }
+        return hash;
+    }
+
+    @Override
+    public boolean isEmpty() {
+        return !iterator().hasNext();
+    }
+
+    @Override
+    public abstract Iterator<E> iterator();
+
+    @Override
+    public void perform(Consumer<CollectionService<E>> action, CollectionService<E> view) {
+        if (target == null) {
+            action.accept(view);
+        } else {
+            target.perform(action, view);
+        }
+    }
+
+    @Override
+    @SuppressWarnings("unchecked")
+    public boolean remove(Object obj) {
+        Iterator<? extends E> it = iterator();
+        Equality<Object> cmp = (Equality<Object>) comparator();
+        while (it.hasNext()) {
+            if (cmp.areEqual(obj, it.next())) {
+                it.remove();
+                return true;
+            }
+        }
+        return false;
+    }
+    
+    @Override
+    public boolean removeAll(Collection<?> c) {
+        boolean changed = false;
+        Iterator<? extends E> it = iterator();
+        while (it.hasNext()) {
+            if (c.contains(it.next())) {
+                it.remove();
+                changed = true;
+            }
+        }
+        return changed;
+    }
+
+    @Override
+    public boolean retainAll(Collection<?> c) {
+        boolean changed = false;
+        Iterator<? extends E> it = iterator();
+        while (it.hasNext()) {
+            if (!c.contains(it.next())) {
+                it.remove();
+                changed = true;
+            }
+        }
+        return changed;
+    }
+
+    @Override
+    public int size() {
+        int count = 0;
+        Iterator<? extends E> it = iterator();
+        while (it.hasNext()) {
+            count++;
+            it.next();
+        }
+        return count;
+    }
+
+    @SuppressWarnings("unchecked")
+    @Override
+    public CollectionService<E>[] split(int n, boolean updateable) { 
+        return new CollectionService[] { this }; // Split not supported.
+    }
+
+    @Override
+    public Object[] toArray() {
+        return toArray(new Object[size()]);
+    }
+
+    @Override
+    @SuppressWarnings("unchecked")
+    public <T> T[] toArray(T[] a) {
+        final int size = size();
+        final T[] result = (size <= a.length) ? a
+                : (T[]) java.lang.reflect.Array.newInstance(a.getClass()
+                        .getComponentType(), size);
+        int i = 0;
+        Iterator<E> it = iterator();
+        while (it.hasNext()) {
+            result[i++] = (T) it.next();
+        }
+        if (result.length > size) {
+            result[size] = null; // As per Collection contract.
+        }
+        return result;
+    }
+
+    @Override
+    public void update(Consumer<CollectionService<E>> action, CollectionService<E> view) {
+        if (target == null) {
+            action.accept(view);
+        } else {
+            target.perform(action, view);
+        }
+    }
+    
+    protected CollectionService<E> service() {
+        return this;
+    }
+    
+    /** Returns the actual target */
+    protected CollectionService<E> target() {
+        return target;
+    }
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/marmotta-commons/src/ext/java/javolution/util/internal/collection/DistinctCollectionImpl.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-commons/src/ext/java/javolution/util/internal/collection/DistinctCollectionImpl.java b/commons/marmotta-commons/src/ext/java/javolution/util/internal/collection/DistinctCollectionImpl.java
new file mode 100644
index 0000000..404e76e
--- /dev/null
+++ b/commons/marmotta-commons/src/ext/java/javolution/util/internal/collection/DistinctCollectionImpl.java
@@ -0,0 +1,102 @@
+/*
+ * 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.util.internal.collection;
+
+import javolution.util.FastSet;
+import javolution.util.function.Equality;
+import javolution.util.service.CollectionService;
+
+import java.util.Iterator;
+
+/**
+ * A view which does not iterate twice over the same elements.
+ */
+public class DistinctCollectionImpl<E> extends CollectionView<E> {
+
+    /** Peeking ahead iterator. */
+    private class IteratorImpl implements Iterator<E> {
+
+        private boolean ahead; 
+        private final FastSet<E> iterated = new FastSet<E>(comparator());
+        private E next;
+        private final Iterator<E> targetIterator = target().iterator();
+
+        @Override
+        public boolean hasNext() {
+            if (ahead) return true;
+            while (targetIterator.hasNext()) {
+                next = targetIterator.next();
+                if (!iterated.contains(next)) {
+                    ahead = true;
+                    return true;
+                }
+            }
+            return false;
+        }
+
+        @Override
+        public E next() {
+            hasNext(); // Moves ahead.
+            ahead = false;
+            return next;
+        }
+
+        @Override
+        public void remove() {
+            targetIterator.remove();
+        }
+    }
+
+    private static final long serialVersionUID = 0x600L; // Version.
+
+    public DistinctCollectionImpl(CollectionService<E> target) {
+        super(target);
+    }
+
+    @Override
+    public boolean add(E element) {
+        if (target().contains(element)) return false;
+        return target().add(element);
+    }
+
+    @Override
+    public void clear() {
+        target().clear();
+    }
+
+    @Override
+    public Equality<? super E> comparator() {
+        return target().comparator();
+    }
+
+    @Override
+    public boolean contains(Object o) {
+        return target().contains(o);
+    }
+
+    @Override
+    public boolean isEmpty() {
+        return target().isEmpty();
+    }
+
+    @Override
+    public Iterator<E> iterator() {
+        return new IteratorImpl();
+    }
+
+    @Override
+    public boolean remove(Object o) { // Remove all instances.
+        boolean changed = false;
+        while (true) {
+            if (!remove(o)) return changed;
+            changed = true;
+        }
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/marmotta-commons/src/ext/java/javolution/util/internal/collection/FilteredCollectionImpl.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-commons/src/ext/java/javolution/util/internal/collection/FilteredCollectionImpl.java b/commons/marmotta-commons/src/ext/java/javolution/util/internal/collection/FilteredCollectionImpl.java
new file mode 100644
index 0000000..e64f4c5
--- /dev/null
+++ b/commons/marmotta-commons/src/ext/java/javolution/util/internal/collection/FilteredCollectionImpl.java
@@ -0,0 +1,111 @@
+/*
+ * 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.util.internal.collection;
+
+import javolution.util.function.Equality;
+import javolution.util.function.Predicate;
+import javolution.util.service.CollectionService;
+
+import java.util.Iterator;
+
+/**
+ * A filtered view over a collection.
+ */
+public class FilteredCollectionImpl<E> extends CollectionView<E> {
+
+    /** Peeking ahead iterator. */
+    private class IteratorImpl implements Iterator<E> {
+
+        private boolean ahead; // Indicates if the iterator is ahead (on next element)
+        private final Predicate<? super E> filter;
+        private E next;
+        private final Iterator<E> targetIterator;
+
+        public IteratorImpl(Predicate<? super E> filter) {
+            this.filter = filter;
+            targetIterator = target().iterator();
+        }
+
+        @Override
+        public boolean hasNext() {
+            if (ahead) return true;
+            while (targetIterator.hasNext()) {
+                next = targetIterator.next();
+                if (filter.test(next)) {
+                    ahead = true;
+                    return true;
+                }
+            }
+            return false;
+        }
+
+        @Override
+        public E next() {
+            hasNext(); // Moves ahead.
+            ahead = false;
+            return next;
+        }
+
+        @Override
+        public void remove() {
+            targetIterator.remove();
+        }
+    }
+
+    private static final long serialVersionUID = 0x600L; // Version.
+    protected final Predicate<? super E> filter;
+
+    public FilteredCollectionImpl(CollectionService<E> target,
+            Predicate<? super E> filter) {
+        super(target);
+        this.filter = filter;
+    }
+
+    @Override
+    public boolean add(E element) {
+        if (!filter.test(element)) return false;
+        return target().add(element);
+    }
+
+    @Override
+    public Equality<? super E> comparator() {
+        return target().comparator();
+    }
+
+    @SuppressWarnings("unchecked")
+    @Override
+    public boolean contains(Object o) {
+        if (!filter.test((E) o)) return false;
+        return target().contains(o);
+    }
+
+    @Override
+    public Iterator<E> iterator() {
+        return new IteratorImpl(filter);
+    }
+
+    @SuppressWarnings("unchecked")
+    @Override
+    public boolean remove(Object o) {
+        if (!filter.test((E) o)) return false;
+        return target().remove(o);
+    }
+    
+    @SuppressWarnings("unchecked")
+    @Override
+    public CollectionService<E>[] split(int n, boolean updateable) {
+        CollectionService<E>[] subTargets = target().split(n, updateable);
+        CollectionService<E>[] result = new CollectionService[subTargets.length];
+        for (int i = 0; i < subTargets.length; i++) {
+            result[i] = new FilteredCollectionImpl<E>(subTargets[i], filter);
+        }
+        return result;
+    }
+    
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/marmotta-commons/src/ext/java/javolution/util/internal/collection/MappedCollectionImpl.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-commons/src/ext/java/javolution/util/internal/collection/MappedCollectionImpl.java b/commons/marmotta-commons/src/ext/java/javolution/util/internal/collection/MappedCollectionImpl.java
new file mode 100644
index 0000000..114bba4
--- /dev/null
+++ b/commons/marmotta-commons/src/ext/java/javolution/util/internal/collection/MappedCollectionImpl.java
@@ -0,0 +1,101 @@
+/*
+ * 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.util.internal.collection;
+
+import javolution.util.function.Equalities;
+import javolution.util.function.Equality;
+import javolution.util.function.Function;
+import javolution.util.service.CollectionService;
+
+import java.util.Iterator;
+
+/**
+ * A mapped view over a collection.
+ */
+public class MappedCollectionImpl<E, R> extends CollectionView<R> {
+
+    /** Mapping iterator. */
+    private class IteratorImpl implements Iterator<R> {
+        private final Iterator<E> targetIterator;
+
+        @SuppressWarnings("unchecked")
+        public IteratorImpl() {
+            targetIterator = (Iterator<E>) target().iterator();
+        }
+
+        @Override
+        public boolean hasNext() {
+            return targetIterator.hasNext();
+        }
+
+        @Override
+        public R next() {
+            return function.apply(targetIterator.next());
+        }
+
+        @Override
+        public void remove() {
+            targetIterator.remove();
+        }
+
+    }
+
+    private static final long serialVersionUID = 0x600L; // Version.
+    protected final Function<? super E, ? extends R> function;
+
+    @SuppressWarnings("unchecked")
+    public MappedCollectionImpl(CollectionService<E> target,
+            Function<? super E, ? extends R> function) {
+        super((CollectionService<R>) target); // Beware target is of type <E>
+        this.function = function;
+    }
+
+    @Override
+    public boolean add(R element) {
+        throw new UnsupportedOperationException(
+                "New elements cannot be added to mapped views");
+    }
+
+    @Override
+    public void clear() {
+        target().clear();
+    }
+
+    @Override
+    public Equality<? super R> comparator() {
+        return Equalities.STANDARD;
+    }
+
+    @Override
+    public boolean isEmpty() {
+        return target().isEmpty();
+    }
+
+    @Override
+    public Iterator<R> iterator() {
+        return new IteratorImpl();
+    }
+    
+    @Override
+    public int size() {
+        return target().size();
+    }
+    
+    @SuppressWarnings("unchecked")
+    @Override
+    public CollectionService<R>[] split(int n, boolean updateable) {
+        CollectionService<E>[] subTargets = (CollectionService<E>[]) target().split(n, updateable);
+        CollectionService<R>[] result = new CollectionService[subTargets.length];
+        for (int i = 0; i < subTargets.length; i++) {
+            result[i] = new MappedCollectionImpl<E, R>(subTargets[i], function);
+        }
+        return result;
+    }
+        
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/marmotta-commons/src/ext/java/javolution/util/internal/collection/ReversedCollectionImpl.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-commons/src/ext/java/javolution/util/internal/collection/ReversedCollectionImpl.java b/commons/marmotta-commons/src/ext/java/javolution/util/internal/collection/ReversedCollectionImpl.java
new file mode 100644
index 0000000..edb5b1d
--- /dev/null
+++ b/commons/marmotta-commons/src/ext/java/javolution/util/internal/collection/ReversedCollectionImpl.java
@@ -0,0 +1,98 @@
+/*
+ * 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.util.internal.collection;
+
+import javolution.util.function.Equality;
+import javolution.util.service.CollectionService;
+
+import java.util.Iterator;
+
+/**
+ * A reversed view over a collection.
+ */
+public class ReversedCollectionImpl<E> extends CollectionView<E> {
+
+    /** Reversing Iterator. */
+    private class IteratorImpl implements Iterator<E> {
+
+        @SuppressWarnings("unchecked")
+        private final E[] elements = (E[]) new Object[size()];
+        private int index = 0;
+ 
+        public IteratorImpl() {
+            Iterator<E> it = target().iterator();
+            while (it.hasNext() && (index < elements.length)) {
+                elements[index++] = it.next();
+            }
+        }
+
+        @Override
+        public boolean hasNext() {
+            return index > 0;
+        }
+
+        @Override
+        public E next() {
+            return elements[--index];
+        }
+
+        @Override
+        public void remove() {
+            target().remove(elements[index]);
+        }
+
+    }
+
+    private static final long serialVersionUID = 0x600L; // Version.
+
+    public ReversedCollectionImpl(CollectionService<E> target) {
+        super(target);
+    }
+
+    @Override
+    public boolean add(E e) {
+        return target().add(e);
+    }
+
+    @Override
+    public void clear() {
+        target().clear();
+    }
+
+    @Override
+    public Equality<? super E> comparator() {
+        return target().comparator();
+    }
+
+    @Override
+    public boolean contains(Object obj) {
+        return target().contains(obj);
+    }
+
+    @Override
+    public boolean isEmpty() {
+        return target().isEmpty();
+    }
+
+    @Override
+    public Iterator<E> iterator() {
+        return new IteratorImpl();
+    }
+
+    @Override
+    public boolean remove(Object obj) {
+        return target().remove(obj);
+    }
+
+    @Override
+    public int size() {
+        return target().size();
+    }
+    
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/marmotta-commons/src/ext/java/javolution/util/internal/collection/SequentialCollectionImpl.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-commons/src/ext/java/javolution/util/internal/collection/SequentialCollectionImpl.java b/commons/marmotta-commons/src/ext/java/javolution/util/internal/collection/SequentialCollectionImpl.java
new file mode 100644
index 0000000..0623bfe
--- /dev/null
+++ b/commons/marmotta-commons/src/ext/java/javolution/util/internal/collection/SequentialCollectionImpl.java
@@ -0,0 +1,83 @@
+/*
+ * 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.util.internal.collection;
+
+import javolution.util.function.Consumer;
+import javolution.util.function.Equality;
+import javolution.util.service.CollectionService;
+
+import java.util.Iterator;
+
+/**
+ * A sequential view over a collection.
+ */
+public class SequentialCollectionImpl<E> extends CollectionView<E> {
+
+    private static final long serialVersionUID = 0x600L; // Version.
+
+    public SequentialCollectionImpl(CollectionService<E> target) {
+        super(target);
+    }
+
+    @Override
+    public boolean add(E e) {
+        return target().add(e);
+    }
+
+    @Override
+    public void clear() {
+        target().clear();
+    }
+    
+    @Override
+    public Equality<? super E> comparator() {
+        return target().comparator();
+    }
+
+    @Override
+    public boolean contains(Object obj) {
+        return target().contains(obj);
+    }
+
+    @Override
+    public boolean isEmpty() {
+        return target().isEmpty();
+    }
+
+    @Override
+    public Iterator<E> iterator() {
+        return target().iterator();
+    }
+    
+    @Override
+    public void perform(Consumer<CollectionService<E>> action, CollectionService<E> view) {
+        action.accept(view); // Executes immediately.
+    }
+
+    @Override
+    public boolean remove(Object obj) {
+        return target().remove(obj);
+    }
+
+    @Override
+    public int size() {
+        return target().size();
+   }
+
+    @Override
+    public CollectionService<E>[] split(int n, boolean threadsafe) {
+        return target().split(n, threadsafe); // Forwards.
+    }
+
+    @Override
+    public void update(Consumer<CollectionService<E>> action, CollectionService<E> view) {
+        action.accept(view); // Executes immediately.
+    }
+    
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/marmotta-commons/src/ext/java/javolution/util/internal/collection/SharedCollectionImpl.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-commons/src/ext/java/javolution/util/internal/collection/SharedCollectionImpl.java b/commons/marmotta-commons/src/ext/java/javolution/util/internal/collection/SharedCollectionImpl.java
new file mode 100644
index 0000000..689fa5c
--- /dev/null
+++ b/commons/marmotta-commons/src/ext/java/javolution/util/internal/collection/SharedCollectionImpl.java
@@ -0,0 +1,270 @@
+/*
+ * 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.util.internal.collection;
+
+import javolution.util.function.Consumer;
+import javolution.util.function.Equality;
+import javolution.util.internal.ReadWriteLockImpl;
+import javolution.util.service.CollectionService;
+
+import java.util.Collection;
+import java.util.Iterator;
+
+/**
+ * A shared view over a collection (reads-write locks). 
+ */
+public class SharedCollectionImpl<E> extends CollectionView<E> {
+
+    /** Thread-Safe Iterator. */
+    private class IteratorImpl implements Iterator<E> { // Thread-Safe.
+        private E next;
+        private final Iterator<E> targetIterator;
+
+        public IteratorImpl() {
+            lock.readLock.lock();
+            try {
+                targetIterator = cloneTarget().iterator(); // Copy.
+            } finally {
+                lock.readLock.unlock();
+            }
+        }
+
+        @Override
+        public boolean hasNext() {
+            return targetIterator.hasNext();
+        }
+
+        @Override
+        public E next() {
+            next = targetIterator.next();
+            return next;
+        }
+
+        @Override
+        public void remove() {
+            if (next == null) throw new IllegalStateException();
+            SharedCollectionImpl.this.remove(next);
+            next = null;
+        }
+    }
+
+    private static final long serialVersionUID = 0x600L; // Version.
+    protected ReadWriteLockImpl lock;
+
+    public SharedCollectionImpl(CollectionService<E> target) {
+        this(target, new ReadWriteLockImpl());
+    }
+
+    public SharedCollectionImpl(CollectionService<E> target,
+            ReadWriteLockImpl lock) {
+        super(target);
+        this.lock = lock;
+    }
+
+    @Override
+    public boolean add(E element) {
+        lock.writeLock.lock();
+        try {
+            return target().add(element);
+        } finally {
+            lock.writeLock.unlock();
+        }
+    }
+
+    @Override
+    public boolean addAll(Collection<? extends E> c) {
+        lock.writeLock.lock();
+        try {
+            return target().addAll(c);
+        } finally {
+            lock.writeLock.unlock();
+        }
+    }
+
+    @Override
+    public void clear() {
+        lock.writeLock.lock();
+        try {
+            target().clear();
+        } finally {
+            lock.writeLock.unlock();
+        }
+    }
+
+    @Override
+    public SharedCollectionImpl<E> clone() {
+        lock.readLock.lock();
+        try {
+            SharedCollectionImpl<E> copy = (SharedCollectionImpl<E>) super
+                    .clone();
+            copy.lock = new ReadWriteLockImpl(); // No need to share the same lock.
+            return copy;
+        } finally {
+            lock.readLock.unlock();
+        }
+    }
+
+    @Override
+    public Equality<? super E> comparator() {
+        return target().comparator();
+    }
+
+    @Override
+    public boolean contains(Object o) {
+        lock.readLock.lock();
+        try {
+            return target().contains(o);
+        } finally {
+            lock.readLock.unlock();
+        }
+    }
+
+    @Override
+    public boolean containsAll(Collection<?> c) {
+        lock.readLock.lock();
+        try {
+            return target().containsAll(c);
+        } finally {
+            lock.readLock.unlock();
+        }
+    }
+
+    @Override
+    public boolean equals(Object o) {
+        lock.readLock.lock();
+        try {
+            return target().equals(o);
+        } finally {
+            lock.readLock.unlock();
+        }
+    }
+
+    @Override
+    public int hashCode() {
+        lock.readLock.lock();
+        try {
+            return target().hashCode();
+        } finally {
+            lock.readLock.unlock();
+        }
+    }
+
+    @Override
+    public boolean isEmpty() {
+        lock.readLock.lock();
+        try {
+            return target().isEmpty();
+        } finally {
+            lock.readLock.unlock();
+        }
+    }
+
+    @Override
+    public Iterator<E> iterator() {
+        return new IteratorImpl();
+    }
+
+    @Override
+    public void perform(Consumer<CollectionService<E>> action,
+            CollectionService<E> view) {
+        lock.readLock.lock();
+        try {
+            target().perform(action, view);
+        } finally {
+            lock.readLock.unlock();
+        }
+    }
+
+    @Override
+    public boolean remove(Object o) {
+        lock.writeLock.lock();
+        try {
+            return target().remove(o);
+        } finally {
+            lock.writeLock.unlock();
+        }
+    }
+
+    @Override
+    public boolean removeAll(Collection<?> c) {
+        lock.writeLock.lock();
+        try {
+            return target().removeAll(c);
+        } finally {
+            lock.writeLock.unlock();
+        }
+    }
+
+    @Override
+    public boolean retainAll(Collection<?> c) {
+        lock.writeLock.lock();
+        try {
+            return target().retainAll(c);
+        } finally {
+            lock.writeLock.unlock();
+        }
+    }
+
+    @Override
+    public int size() {
+        lock.readLock.lock();
+        try {
+            return target().size();
+        } finally {
+            lock.readLock.unlock();
+        }
+    }
+
+    @SuppressWarnings("unchecked")
+    @Override
+    public CollectionService<E>[] split(int n, boolean updateable) {
+        CollectionService<E>[] tmp;
+        lock.readLock.lock();
+        try {
+            tmp = target().split(n, updateable); 
+        } finally {
+            lock.readLock.unlock();
+        }
+        CollectionService<E>[] result = new CollectionService[tmp.length];
+        for (int i = 0; i < tmp.length; i++) {
+            result[i] = new SharedCollectionImpl<E>(tmp[i], lock); // Shares the same locks.
+        }
+        return result;
+    }
+
+    @Override
+    public Object[] toArray() {
+        lock.readLock.lock();
+        try {
+            return target().toArray();
+        } finally {
+            lock.readLock.unlock();
+        }
+    }
+
+    @Override
+    public <T> T[] toArray(T[] a) {
+        lock.readLock.lock();
+        try {
+            return target().toArray(a);
+        } finally {
+            lock.readLock.unlock();
+        }
+    }
+
+    /** Returns a clone copy of target. */
+    protected CollectionService<E> cloneTarget() {
+        try {
+            return target().clone();
+        } catch (CloneNotSupportedException e) {
+            throw new Error("Cannot happen since target is Cloneable.");
+        }
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/marmotta-commons/src/ext/java/javolution/util/internal/collection/SortedCollectionImpl.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-commons/src/ext/java/javolution/util/internal/collection/SortedCollectionImpl.java b/commons/marmotta-commons/src/ext/java/javolution/util/internal/collection/SortedCollectionImpl.java
new file mode 100644
index 0000000..9c04c9c
--- /dev/null
+++ b/commons/marmotta-commons/src/ext/java/javolution/util/internal/collection/SortedCollectionImpl.java
@@ -0,0 +1,109 @@
+/*
+ * 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.util.internal.collection;
+
+import javolution.util.FastTable;
+import javolution.util.function.Equality;
+import javolution.util.internal.comparator.WrapperComparatorImpl;
+import javolution.util.service.CollectionService;
+
+import java.util.Comparator;
+import java.util.Iterator;
+
+/**
+ * A sorted view over a collection.
+ */
+public class SortedCollectionImpl<E> extends CollectionView<E>  {
+
+    /** Sorting Iterator. */
+    private class IteratorImpl implements Iterator<E> {
+        private final Iterator<E> iterator;
+        private E next;
+        
+        public IteratorImpl() {
+            FastTable<E> sorted = new FastTable<E>(comparator);
+            Iterator<E> it = target().iterator();            
+            while (it.hasNext()) {
+                sorted.add(it.next());
+            }
+            sorted.sort();
+            iterator = sorted.iterator();
+        }
+        
+        @Override
+        public boolean hasNext() {
+            return iterator.hasNext();
+        }
+
+        @Override
+        public E next() {
+            next = iterator.next();
+            return next;
+        }
+
+        @Override
+        public void remove() {
+            if (next == null) throw new IllegalStateException();
+            target().remove(next);
+            next = null;
+        }
+
+    }
+   
+    private static final long serialVersionUID = 0x600L; // Version.    
+    protected final Equality<E> comparator;
+
+    @SuppressWarnings("unchecked")
+    public SortedCollectionImpl(CollectionService<E> target, Comparator<? super E> comparator) {
+        super(target);
+        this.comparator = (comparator instanceof Equality) ?
+                (Equality<E>) comparator : new WrapperComparatorImpl<E>(comparator);
+    }
+
+    @Override
+    public boolean add(E e) {
+        return target().add(e);
+    }
+
+    @Override
+    public void clear() {
+        target().clear();
+    }
+
+    @Override
+    public Equality<? super E> comparator() {
+        return comparator;
+    }
+
+    @Override
+    public boolean contains(Object obj) {
+        return target().contains(obj);
+    }
+
+    @Override
+    public boolean isEmpty() {
+        return target().isEmpty();
+    }
+
+    @Override
+    public Iterator<E> iterator() {
+        return new IteratorImpl();
+    }
+
+    @Override
+    public boolean remove(Object obj) {
+        return target().remove(obj);
+    }
+
+    @Override
+    public int size() {
+        return target().size();
+    }
+    
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/marmotta-commons/src/ext/java/javolution/util/internal/collection/UnmodifiableCollectionImpl.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-commons/src/ext/java/javolution/util/internal/collection/UnmodifiableCollectionImpl.java b/commons/marmotta-commons/src/ext/java/javolution/util/internal/collection/UnmodifiableCollectionImpl.java
new file mode 100644
index 0000000..be13365
--- /dev/null
+++ b/commons/marmotta-commons/src/ext/java/javolution/util/internal/collection/UnmodifiableCollectionImpl.java
@@ -0,0 +1,98 @@
+/*
+ * 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.util.internal.collection;
+
+import javolution.util.function.Equality;
+import javolution.util.service.CollectionService;
+
+import java.util.Iterator;
+
+/**
+ * An unmodifiable view over a collection.
+ */
+public class UnmodifiableCollectionImpl<E> extends CollectionView<E> {
+
+    /** Read-Only Iterator. */
+    private class IteratorImpl implements Iterator<E> {
+        private final Iterator<E> targetIterator = target().iterator();
+
+        @Override
+        public boolean hasNext() {
+            return targetIterator.hasNext();
+        }
+
+        @Override
+        public E next() {
+            return targetIterator.next();
+        }
+
+        @Override
+        public void remove() {
+            throw new UnsupportedOperationException("Read-Only Collection.");
+        }
+    }
+    
+    private static final long serialVersionUID = 0x600L; // Version.
+
+    public UnmodifiableCollectionImpl(CollectionService<E> target) {
+        super(target);
+    }
+
+    @Override
+    public boolean add(E element) {
+        throw new UnsupportedOperationException("Read-Only Collection.");
+    }
+
+    @Override
+    public void clear() {
+        throw new UnsupportedOperationException("Read-Only Collection.");
+    }
+
+    @Override
+    public Equality<? super E> comparator() {
+        return target().comparator();
+    }
+
+    @Override
+    public boolean contains(Object obj) {
+        return target().contains(obj);
+    }
+
+    @Override
+    public boolean isEmpty() {
+        return target().isEmpty();
+    }
+
+    @Override
+    public Iterator<E> iterator() {
+        return new IteratorImpl();
+   }
+
+    @Override
+    public boolean remove(Object o) {
+        throw new UnsupportedOperationException("Read-Only Collection.");
+    }
+
+    @Override
+    public int size() {
+        return target().size();
+    }
+
+    @SuppressWarnings("unchecked")
+    @Override
+    public CollectionService<E>[] split(int n, boolean updateable) {
+        CollectionService<E>[] subTargets = target().split(n, updateable);
+        CollectionService<E>[] result = new CollectionService[subTargets.length];
+        for (int i = 0; i < subTargets.length; i++) {
+            result[i] = new UnmodifiableCollectionImpl<E>(subTargets[i]);
+        }
+        return result;
+    }
+    
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/marmotta-commons/src/ext/java/javolution/util/internal/comparator/ArrayComparatorImpl.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-commons/src/ext/java/javolution/util/internal/comparator/ArrayComparatorImpl.java b/commons/marmotta-commons/src/ext/java/javolution/util/internal/comparator/ArrayComparatorImpl.java
new file mode 100644
index 0000000..fc1afbf
--- /dev/null
+++ b/commons/marmotta-commons/src/ext/java/javolution/util/internal/comparator/ArrayComparatorImpl.java
@@ -0,0 +1,72 @@
+/*
+ * 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.util.internal.comparator;
+
+import java.util.Arrays;
+
+/**
+ * The array comparator implementation.
+ */
+public class ArrayComparatorImpl extends StandardComparatorImpl<Object> {
+
+    private static final long serialVersionUID = 4134048629840904441L;
+
+    @Override
+    public boolean areEqual(Object array1, Object array2) {
+        if (array1 == array2)
+            return true;
+        if ((array1 == null) || (array2 == null))
+            return false;
+        if (array1 instanceof Object[] && array2 instanceof Object[])
+            return Arrays.deepEquals((Object[]) array1, (Object[]) array2);
+        if (array1 instanceof byte[] && array2 instanceof byte[])
+            return Arrays.equals((byte[]) array1, (byte[]) array2);
+        if (array1 instanceof short[] && array2 instanceof short[])
+            return Arrays.equals((short[]) array1, (short[]) array2);
+        if (array1 instanceof int[] && array2 instanceof int[])
+            return Arrays.equals((int[]) array1, (int[]) array2);
+        if (array1 instanceof long[] && array2 instanceof long[])
+            return Arrays.equals((long[]) array1, (long[]) array2);
+        if (array1 instanceof char[] && array2 instanceof char[])
+            return Arrays.equals((char[]) array1, (char[]) array2);
+        if (array1 instanceof float[] && array2 instanceof float[])
+            return Arrays.equals((float[]) array1, (float[]) array2);
+        if (array1 instanceof double[] && array2 instanceof double[])
+            return Arrays.equals((double[]) array1, (double[]) array2);
+        if (array1 instanceof boolean[] && array2 instanceof boolean[])
+            return Arrays.equals((boolean[]) array1, (boolean[]) array2);
+        return array1.equals(array2);
+    }
+
+    @Override
+    public int hashCodeOf(Object array) {
+        if (array instanceof Object[])
+            return Arrays.deepHashCode((Object[]) array);
+        if (array instanceof byte[])
+            return Arrays.hashCode((byte[]) array);
+        if (array instanceof short[])
+            return Arrays.hashCode((short[]) array);
+        if (array instanceof int[])
+            return Arrays.hashCode((int[]) array);
+        if (array instanceof long[])
+            return Arrays.hashCode((long[]) array);
+        if (array instanceof char[])
+            return Arrays.hashCode((char[]) array);
+        if (array instanceof float[])
+            return Arrays.hashCode((float[]) array);
+        if (array instanceof double[])
+            return Arrays.hashCode((double[]) array);
+        if (array instanceof boolean[])
+            return Arrays.hashCode((boolean[]) array);
+        if (array != null)
+            return array.hashCode();
+        return 0;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/marmotta-commons/src/ext/java/javolution/util/internal/comparator/IdentityComparatorImpl.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-commons/src/ext/java/javolution/util/internal/comparator/IdentityComparatorImpl.java b/commons/marmotta-commons/src/ext/java/javolution/util/internal/comparator/IdentityComparatorImpl.java
new file mode 100644
index 0000000..bbc94ea
--- /dev/null
+++ b/commons/marmotta-commons/src/ext/java/javolution/util/internal/comparator/IdentityComparatorImpl.java
@@ -0,0 +1,42 @@
+/*
+ * 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.util.internal.comparator;
+
+import javolution.util.function.Equality;
+
+/**
+ * The identity comparator implementation.
+ */
+public class IdentityComparatorImpl<E> implements Equality<E> {
+
+    private static final long serialVersionUID = 6576306094743751922L;
+
+    @Override
+    public boolean areEqual(E e1, E e2) {
+        return e1 == e2;
+    }
+
+    @Override
+    public int compare(E left, E right) {
+        if (left == right)
+            return 0;
+        if (left == null)
+            return -1;
+        if (right == null)
+            return 1;
+
+        // Empirical comparison.
+        return (hashCodeOf(left) < hashCodeOf(right)) ? -1 : 1;
+    }
+
+    @Override
+    public int hashCodeOf(E obj) {
+        return System.identityHashCode(obj);
+    }
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/marmotta-commons/src/ext/java/javolution/util/internal/comparator/LexicalCaseInsensitiveComparatorImpl.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-commons/src/ext/java/javolution/util/internal/comparator/LexicalCaseInsensitiveComparatorImpl.java b/commons/marmotta-commons/src/ext/java/javolution/util/internal/comparator/LexicalCaseInsensitiveComparatorImpl.java
new file mode 100644
index 0000000..c391d6e
--- /dev/null
+++ b/commons/marmotta-commons/src/ext/java/javolution/util/internal/comparator/LexicalCaseInsensitiveComparatorImpl.java
@@ -0,0 +1,73 @@
+/*
+ * 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.util.internal.comparator;
+
+import javolution.util.function.Equality;
+
+/**
+ * The case insensitive lexical comparator implementation.
+ */
+public class LexicalCaseInsensitiveComparatorImpl implements
+        Equality<CharSequence> {
+
+    private static final long serialVersionUID = -1046672327934410697L;
+
+    // Converts to upper case.
+    private static char up(char c) {
+        return Character.toUpperCase(c);
+    }
+
+    @Override
+    public boolean areEqual(CharSequence csq1, CharSequence csq2) {
+        if (csq1 == csq2)
+            return true;
+        if ((csq1 == null) || (csq2 == null))
+            return false;
+        if ((csq1 instanceof String) && (csq2 instanceof String)) // Optimization.
+            return ((String) csq1).equalsIgnoreCase((String) csq2);
+        int n = csq1.length();
+        if (csq2.length() != n)
+            return false;
+        for (int i = 0; i < n;) {
+            if (up(csq1.charAt(i)) != up(csq2.charAt(i++)))
+                return false;
+        }
+        return true;
+    }
+
+    @Override
+    public int compare(CharSequence left, CharSequence right) {
+        if (left == null)
+            return -1;
+        if (right == null)
+            return 1;
+        if ((left instanceof String) && (right instanceof String)) // Optimization.
+            return ((String) left).compareToIgnoreCase((String) right);
+        int i = 0;
+        int n = Math.min(left.length(), right.length());
+        while (n-- != 0) {
+            char c1 = up(left.charAt(i));
+            char c2 = up(right.charAt(i++));
+            if (c1 != c2)
+                return c1 - c2;
+        }
+        return left.length() - right.length();
+    }
+
+    @Override
+    public int hashCodeOf(CharSequence csq) {
+        if (csq == null)
+            return 0;
+        int h = 0;
+        for (int i = 0, n = csq.length(); i < n;) {
+            h = 31 * h + up(csq.charAt(i++));
+        }
+        return h;
+    }
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/marmotta-commons/src/ext/java/javolution/util/internal/comparator/LexicalComparatorImpl.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-commons/src/ext/java/javolution/util/internal/comparator/LexicalComparatorImpl.java b/commons/marmotta-commons/src/ext/java/javolution/util/internal/comparator/LexicalComparatorImpl.java
new file mode 100644
index 0000000..9516331
--- /dev/null
+++ b/commons/marmotta-commons/src/ext/java/javolution/util/internal/comparator/LexicalComparatorImpl.java
@@ -0,0 +1,76 @@
+/*
+ * 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.util.internal.comparator;
+
+import javolution.lang.MathLib;
+import javolution.util.function.Equality;
+
+/**
+ * The lexical comparator implementation (optimized for String).
+ */
+public class LexicalComparatorImpl implements Equality<CharSequence> {
+
+    private static final long serialVersionUID = 7904852144917623728L;
+
+    @Override
+    public boolean areEqual(CharSequence csq1, CharSequence csq2) {
+        if (csq1 == csq2)
+            return true;
+        if ((csq1 == null) || (csq2 == null))
+            return false;
+        if (csq1 instanceof String) { // Optimization.
+            if (csq2 instanceof String)
+                return csq1.equals(csq2);
+            return ((String) csq1).contentEquals(csq2);
+        } else if (csq2 instanceof String) { return ((String) csq2)
+                .contentEquals(csq1); }
+
+        // None of the CharSequence is a String. 
+        int n = csq1.length();
+        if (csq2.length() != n)
+            return false;
+        for (int i = 0; i < n;) {
+            if (csq1.charAt(i) != csq2.charAt(i++))
+                return false;
+        }
+        return true;
+    }
+
+    @Override
+    public int compare(CharSequence left, CharSequence right) {
+        if (left == null)
+            return -1;
+        if (right == null)
+            return 1;
+        if ((left instanceof String) && (right instanceof String)) // Optimization.
+            return ((String) left).compareTo((String) right);
+        int i = 0;
+        int n = MathLib.min(left.length(), right.length());
+        while (n-- != 0) {
+            char c1 = left.charAt(i);
+            char c2 = right.charAt(i++);
+            if (c1 != c2)
+                return c1 - c2;
+        }
+        return left.length() - right.length();
+    }
+
+    @Override
+    public int hashCodeOf(CharSequence csq) {
+        if (csq == null)
+            return 0;
+        if (csq instanceof String) // Optimization.
+            return csq.hashCode();
+        int h = 0;
+        for (int i = 0, n = csq.length(); i < n;) {
+            h = 31 * h + csq.charAt(i++);
+        }
+        return h;
+    }
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/marmotta-commons/src/ext/java/javolution/util/internal/comparator/LexicalFastComparatorImpl.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-commons/src/ext/java/javolution/util/internal/comparator/LexicalFastComparatorImpl.java b/commons/marmotta-commons/src/ext/java/javolution/util/internal/comparator/LexicalFastComparatorImpl.java
new file mode 100644
index 0000000..885bb22
--- /dev/null
+++ b/commons/marmotta-commons/src/ext/java/javolution/util/internal/comparator/LexicalFastComparatorImpl.java
@@ -0,0 +1,30 @@
+/*
+ * 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.util.internal.comparator;
+
+/**
+ * The high-performance lexical comparator.
+ */
+public class LexicalFastComparatorImpl extends LexicalComparatorImpl {
+
+    private static final long serialVersionUID = -1449702752185594025L;
+
+    @Override
+    public int hashCodeOf(CharSequence csq) {
+        if (csq == null)
+            return 0;
+        int n = csq.length();
+        if (n == 0)
+            return 0;
+        // Hash based on 5 characters only.
+        return csq.charAt(0) + csq.charAt(n - 1) * 31 + csq.charAt(n >> 1)
+                * 1009 + csq.charAt(n >> 2) * 27583
+                + csq.charAt(n - 1 - (n >> 2)) * 73408859;
+    }
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/marmotta-commons/src/ext/java/javolution/util/internal/comparator/StandardComparatorImpl.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-commons/src/ext/java/javolution/util/internal/comparator/StandardComparatorImpl.java b/commons/marmotta-commons/src/ext/java/javolution/util/internal/comparator/StandardComparatorImpl.java
new file mode 100644
index 0000000..c92f98a
--- /dev/null
+++ b/commons/marmotta-commons/src/ext/java/javolution/util/internal/comparator/StandardComparatorImpl.java
@@ -0,0 +1,48 @@
+/*
+ * 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.util.internal.comparator;
+
+import javolution.util.function.Equality;
+
+/**
+ * The standard comparator implementation.
+ */
+public class StandardComparatorImpl<E> implements Equality<E> {
+
+    private static final long serialVersionUID = -615690677813206151L;
+
+    @Override
+    public boolean areEqual(E e1, E e2) {
+        return (e1 == e2) || (e1 != null && e1.equals(e2));
+    }
+
+    @SuppressWarnings("unchecked")
+    @Override
+    public int compare(E left, E right) {
+        if (left == right)
+            return 0;
+        if (left == null)
+            return -1;
+        if (right == null)
+            return 1;
+        if (left instanceof Comparable)
+            return ((Comparable<E>) left).compareTo(right);
+
+        // Empirical method (consistent with equals).
+        if (left.equals(right))
+            return 0;
+        return left.hashCode() < right.hashCode() ? -1 : 1;
+    }
+
+    @Override
+    public int hashCodeOf(E e) {
+        return (e == null) ? 0 : e.hashCode();
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/marmotta-commons/src/ext/java/javolution/util/internal/comparator/WrapperComparatorImpl.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-commons/src/ext/java/javolution/util/internal/comparator/WrapperComparatorImpl.java b/commons/marmotta-commons/src/ext/java/javolution/util/internal/comparator/WrapperComparatorImpl.java
new file mode 100644
index 0000000..e5f0b51
--- /dev/null
+++ b/commons/marmotta-commons/src/ext/java/javolution/util/internal/comparator/WrapperComparatorImpl.java
@@ -0,0 +1,52 @@
+/*
+ * 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.util.internal.comparator;
+
+import javolution.util.function.Equality;
+
+import java.util.Comparator;
+
+/**
+ * A comparator service wrapping a {@ link Comparator}, since 
+ * consistency with hashcode cannot be maintained. The hashcode
+ * calculation method throws UnsupportedOperationException. 
+ */
+public final class WrapperComparatorImpl<E> implements Equality<E> {
+
+    private static final long serialVersionUID = 8775282553794347279L;
+    private final Comparator<? super E> comparator;
+
+    public WrapperComparatorImpl(Comparator<? super E> comparator) {
+        this.comparator = comparator;
+    }
+
+    @Override
+    public boolean areEqual(E e1, E e2) {
+        return (e1 == e2) || (e1 != null && (comparator.compare(e1, e2) == 0));
+    }
+
+    @Override
+    public int compare(E left, E right) {
+        if (left == right)
+            return 0;
+        if (left == null)
+            return -1;
+        if (right == null)
+            return 1;
+        return comparator.compare(left, right);
+    }
+
+    @Override
+    public int hashCodeOf(E obj) {
+        throw new UnsupportedOperationException(
+                "Standard comparator (java.util.Comparator) cannot be used for "
+                        + "hashcode calculations; please use a coherent equality comparator "
+                        + "instead (e.g. javolution.util.function.Equality).");
+    }
+}


[049/100] [abbrv] [partial] Reverting the erroneous merge by Sebastian according to the instructions in INFRA-6876

Posted by wi...@apache.org.
http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/marmotta-commons/src/ext/java/javolution/lang/MathLib.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-commons/src/ext/java/javolution/lang/MathLib.java b/commons/marmotta-commons/src/ext/java/javolution/lang/MathLib.java
new file mode 100644
index 0000000..331d516
--- /dev/null
+++ b/commons/marmotta-commons/src/ext/java/javolution/lang/MathLib.java
@@ -0,0 +1,1471 @@
+/*
+ * 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 utility class providing a {@link Realtime} implementation of 
+ *     the math library.</p> 
+ * 
+ * @author  <a href="mailto:jean-marie@dautelle.com">Jean-Marie Dautelle</a>
+ * @version 4.2, January 6, 2007
+ */
+@Realtime
+public final class MathLib {
+
+    /**
+     * Default constructor.
+     */
+    private MathLib() {}
+
+    /**
+     * Returns the number of bits in the minimal two's-complement representation
+     * of the specified <code>int</code>, excluding a sign bit.
+     * For positive <code>int</code>, this is equivalent to the number of bits
+     * in the ordinary binary representation. For negative <code>int</code>,
+     * it is equivalent to the number of bits of the positive value 
+     * <code>-(i + 1)</code>.
+     * 
+     * @param i the <code>int</code> value for which the bit length is returned.
+     * @return the bit length of <code>i</code>.
+     */
+    public static int bitLength(int i) {
+        if (i < 0)
+            i = -++i;
+        return (i < 1 << 16) ? (i < 1 << 8) ? BIT_LENGTH[i]
+                : BIT_LENGTH[i >>> 8] + 8
+                : (i < 1 << 24) ? BIT_LENGTH[i >>> 16] + 16
+                        : BIT_LENGTH[i >>> 24] + 24;
+    }
+
+    private static final byte[] BIT_LENGTH = { 0, 1, 2, 2, 3, 3, 3, 3, 4, 4, 4,
+            4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6,
+            6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
+            6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+            7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+            7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+            7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
+            8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
+            8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
+            8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
+            8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
+            8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
+            8, 8, 8 };
+
+    /**
+     * Returns the number of bits in the minimal two's-complement representation
+     * of the specified <code>long</code>, excluding a sign bit.
+     * For positive <code>long</code>, this is equivalent to the number of bits
+     * in the ordinary binary representation. For negative <code>long</code>,
+     * it is equivalent to the number of bits of the positive value 
+     * <code>-(l + 1)</code>.
+     * 
+     * @param l the <code>long</code> value for which the bit length is returned.
+     * @return the bit length of <code>l</code>.
+     */
+    public static int bitLength(long l) {
+        int i = (int) (l >> 32);
+        if (i > 0)
+            return (i < 1 << 16) ? (i < 1 << 8) ? BIT_LENGTH[i] + 32
+                    : BIT_LENGTH[i >>> 8] + 40
+                    : (i < 1 << 24) ? BIT_LENGTH[i >>> 16] + 48
+                            : BIT_LENGTH[i >>> 24] + 56;
+        if (i < 0)
+            return bitLength(-++l);
+        i = (int) l;
+        return (i < 0) ? 32 : (i < 1 << 16) ? (i < 1 << 8) ? BIT_LENGTH[i]
+                : BIT_LENGTH[i >>> 8] + 8
+                : (i < 1 << 24) ? BIT_LENGTH[i >>> 16] + 16
+                        : BIT_LENGTH[i >>> 24] + 24;
+    }
+
+    /**
+     * Returns the number of one-bits in the two's complement binary
+     * representation of the specified <code>long</code> value. 
+     * This function is sometimes referred to as the <i>population count</i>.
+     *
+     * @param longValue the <code>long</code> value.
+     * @return the number of one-bits in the two's complement binary
+     *         representation of the specified <code>longValue</code>.
+     */
+    public static int bitCount(long longValue) {
+        longValue = longValue - ((longValue >>> 1) & 0x5555555555555555L);
+        longValue = (longValue & 0x3333333333333333L)
+                + ((longValue >>> 2) & 0x3333333333333333L);
+        longValue = (longValue + (longValue >>> 4)) & 0x0f0f0f0f0f0f0f0fL;
+        longValue = longValue + (longValue >>> 8);
+        longValue = longValue + (longValue >>> 16);
+        longValue = longValue + (longValue >>> 32);
+        return (int) longValue & 0x7f;
+    }
+
+    /**
+     * Returns the number of zero bits preceding the highest-order
+     * ("leftmost") one-bit in the two's complement binary representation
+     * of the specified <code>long</code> value. Returns 64 if the specifed
+     *  value is zero.
+     * 
+     * @param longValue the <code>long</code> value.
+     * @return the number of leading zero bits.
+     */
+    public static int numberOfLeadingZeros(long longValue) {
+        // From Hacker's Delight
+        if (longValue == 0)
+            return 64;
+        int n = 1;
+        int x = (int)(longValue >>> 32);
+        if (x == 0) { n += 32; x = (int)longValue; }
+        if (x >>> 16 == 0) { n += 16; x <<= 16; }
+        if (x >>> 24 == 0) { n +=  8; x <<=  8; }
+        if (x >>> 28 == 0) { n +=  4; x <<=  4; }
+        if (x >>> 30 == 0) { n +=  2; x <<=  2; }
+        n -= x >>> 31;
+        return n;
+    }
+
+    /**
+     * Returns the number of zero bits following the lowest-order ("rightmost")
+     * one-bit in the two's complement binary representation of the specified
+     * <code>long</code> value. Returns 64 if the specifed value is zero.
+     *
+     * @param longValue the <code>long</code> value.
+     * @return the number of trailing zero bits.
+     */
+    public static int numberOfTrailingZeros(long longValue) {
+        // From Hacker's Delight
+        int x, y;
+        if (longValue == 0) return 64;
+        int n = 63;
+        y = (int)longValue; if (y != 0) { n = n -32; x = y; } else x = (int)(longValue>>>32);
+        y = x <<16; if (y != 0) { n = n -16; x = y; }
+        y = x << 8; if (y != 0) { n = n - 8; x = y; }
+        y = x << 4; if (y != 0) { n = n - 4; x = y; }
+        y = x << 2; if (y != 0) { n = n - 2; x = y; }
+        return n - ((x << 1) >>> 31);
+      }
+
+    /**
+     * Returns the number of digits of the decimal representation of the 
+     * specified <code>int</code> value, excluding the sign character if any.
+     * 
+     * @param i the <code>int</code> value for which the digit length is returned.
+     * @return <code>String.valueOf(i).length()</code> for zero or positive values;
+     *         <code>String.valueOf(i).length() - 1</code> for negative values.
+     */
+    public static int digitLength(int i) {
+        if (i >= 0)
+            return (i >= 100000) ? (i >= 10000000) ? (i >= 1000000000) ? 10
+                    : (i >= 100000000) ? 9 : 8 : (i >= 1000000) ? 7 : 6
+                    : (i >= 100) ? (i >= 10000) ? 5 : (i >= 1000) ? 4 : 3
+                            : (i >= 10) ? 2 : 1;
+        if (i == Integer.MIN_VALUE)
+            return 10; // "2147483648".length()
+        return digitLength(-i); // No overflow possible.
+    }
+
+    /**
+     * Returns the number of digits of the decimal representation of the 
+     * the specified <code>long</code>, excluding the sign character if any.
+     * 
+     * @param l the <code>long</code> value for which the digit length is returned.
+     * @return <code>String.valueOf(l).length()</code> for zero or positive values;
+     *         <code>String.valueOf(l).length() - 1</code> for negative values.
+     */
+    public static int digitLength(long l) {
+        if (l >= 0)
+            return (l <= Integer.MAX_VALUE) ? digitLength((int) l)
+                    : // At least 10 digits or more.
+                    (l >= 100000000000000L) ? (l >= 10000000000000000L) ? (l >= 1000000000000000000L) ? 19
+                            : (l >= 100000000000000000L) ? 18 : 17
+                            : (l >= 1000000000000000L) ? 16 : 15
+                            : (l >= 100000000000L) ? (l >= 10000000000000L) ? 14
+                                    : (l >= 1000000000000L) ? 13 : 12
+                                    : (l >= 10000000000L) ? 11 : 10;
+        if (l == Long.MIN_VALUE)
+            return 19; // "9223372036854775808".length()
+        return digitLength(-l);
+    }
+
+    /**
+     * Returns the closest <code>double</code> representation of the
+     * specified <code>long</code> number multiplied by a power of two.
+     *
+     * @param m the <code>long</code> multiplier.
+     * @param n the power of two exponent.
+     * @return <code>m * 2<sup>n</sup></code>.
+     */
+    public static double toDoublePow2(long m, int n) {
+        if (m == 0)
+            return 0.0;
+        if (m == Long.MIN_VALUE)
+            return toDoublePow2(Long.MIN_VALUE >> 1, n + 1);
+        if (m < 0)
+            return -toDoublePow2(-m, n);
+        int bitLength = MathLib.bitLength(m);
+        int shift = bitLength - 53;
+        long exp = 1023L + 52 + n + shift; // Use long to avoid overflow.
+        if (exp >= 0x7FF)
+            return Double.POSITIVE_INFINITY;
+        if (exp <= 0) { // Degenerated number (subnormal, assume 0 for bit 52)
+            if (exp <= -54)
+                return 0.0;
+            return toDoublePow2(m, n + 54) / 18014398509481984L; // 2^54 Exact.
+        }
+        // Normal number.
+        long bits = (shift > 0) ? (m >> shift) + ((m >> (shift - 1)) & 1) : // Rounding.
+                m << -shift;
+        if (((bits >> 52) != 1) && (++exp >= 0x7FF))
+            return Double.POSITIVE_INFINITY;
+        bits &= 0x000fffffffffffffL; // Clears MSB (bit 52)
+        bits |= exp << 52;
+        return Double.longBitsToDouble(bits);
+    }
+
+    /**/
+
+    /**
+     * Returns the closest <code>double</code> representation of the
+     * specified <code>long</code> number multiplied by a power of ten.
+     *
+     * @param m the <code>long</code> multiplier.
+     * @param n the power of ten exponent.
+     * @return <code>multiplier * 10<sup>n</sup></code>.
+     **/
+    public static double toDoublePow10(long m, int n) {
+        if (m == 0)
+            return 0.0;
+        if (m == Long.MIN_VALUE)
+            return toDoublePow10(Long.MIN_VALUE / 10, n + 1);
+        if (m < 0)
+            return -toDoublePow10(-m, n);
+        if (n >= 0) { // Positive power.
+            if (n > 308)
+                return Double.POSITIVE_INFINITY;
+            // Works with 4 x 32 bits registers (x3:x2:x1:x0)
+            long x0 = 0; // 32 bits.
+            long x1 = 0; // 32 bits.
+            long x2 = m & MASK_32; // 32 bits.
+            long x3 = m >>> 32; // 32 bits.
+            int pow2 = 0;
+            while (n != 0) {
+                int i = (n >= POW5_INT.length) ? POW5_INT.length - 1 : n;
+                int coef = POW5_INT[i]; // 31 bits max.
+
+                if (((int) x0) != 0)
+                    x0 *= coef; // 63 bits max.
+                if (((int) x1) != 0)
+                    x1 *= coef; // 63 bits max.
+                x2 *= coef; // 63 bits max.
+                x3 *= coef; // 63 bits max.
+
+                x1 += x0 >>> 32;
+                x0 &= MASK_32;
+
+                x2 += x1 >>> 32;
+                x1 &= MASK_32;
+
+                x3 += x2 >>> 32;
+                x2 &= MASK_32;
+
+                // Adjusts powers.
+                pow2 += i;
+                n -= i;
+
+                // Normalizes (x3 should be 32 bits max).
+                long carry = x3 >>> 32;
+                if (carry != 0) { // Shift.
+                    x0 = x1;
+                    x1 = x2;
+                    x2 = x3 & MASK_32;
+                    x3 = carry;
+                    pow2 += 32;
+                }
+            }
+
+            // Merges registers to a 63 bits mantissa.
+            int shift = 31 - MathLib.bitLength(x3); // -1..30
+            pow2 -= shift;
+            long mantissa = (shift < 0) ? (x3 << 31) | (x2 >>> 1) : // x3 is 32 bits.
+                    (((x3 << 32) | x2) << shift) | (x1 >>> (32 - shift));
+            return toDoublePow2(mantissa, pow2);
+
+        } else { // n < 0
+            if (n < -324 - 20)
+                return 0.0;
+
+            // Works with x1:x0 126 bits register.
+            long x1 = m; // 63 bits.
+            long x0 = 0; // 63 bits.
+            int pow2 = 0;
+            while (true) {
+
+                // Normalizes x1:x0
+                int shift = 63 - MathLib.bitLength(x1);
+                x1 <<= shift;
+                x1 |= x0 >>> (63 - shift);
+                x0 = (x0 << shift) & MASK_63;
+                pow2 -= shift;
+
+                // Checks if division has to be performed.
+                if (n == 0)
+                    break; // Done.
+
+                // Retrieves power of 5 divisor.
+                int i = (-n >= POW5_INT.length) ? POW5_INT.length - 1 : -n;
+                int divisor = POW5_INT[i];
+
+                // Performs the division (126 bits by 31 bits).
+                long wh = (x1 >>> 32);
+                long qh = wh / divisor;
+                long r = wh - qh * divisor;
+                long wl = (r << 32) | (x1 & MASK_32);
+                long ql = wl / divisor;
+                r = wl - ql * divisor;
+                x1 = (qh << 32) | ql;
+
+                wh = (r << 31) | (x0 >>> 32);
+                qh = wh / divisor;
+                r = wh - qh * divisor;
+                wl = (r << 32) | (x0 & MASK_32);
+                ql = wl / divisor;
+                x0 = (qh << 32) | ql;
+
+                // Adjusts powers.
+                n += i;
+                pow2 -= i;
+            }
+            return toDoublePow2(x1, pow2);
+        }
+    }
+
+    private static final long MASK_63 = 0x7FFFFFFFFFFFFFFFL;
+
+    private static final long MASK_32 = 0xFFFFFFFFL;
+
+    private static final int[] POW5_INT = { 1, 5, 25, 125, 625, 3125, 15625,
+            78125, 390625, 1953125, 9765625, 48828125, 244140625, 1220703125 };
+
+    /**/
+
+    /**
+     * Returns the closest <code>long</code> representation of the
+     * specified <code>double</code> number multiplied by a power of two.
+     *
+     * @param d the <code>double</code> multiplier.
+     * @param n the power of two exponent.
+     * @return <code>d * 2<sup>n</sup></code>
+     * @throws ArithmeticException if the conversion cannot be performed
+     *         (NaN, Infinity or overflow).
+     **/
+    public static long toLongPow2(double d, int n) {
+        long bits = Double.doubleToLongBits(d);
+        boolean isNegative = (bits >> 63) != 0;
+        int exp = ((int) (bits >> 52)) & 0x7FF;
+        long m = bits & 0x000fffffffffffffL;
+        if (exp == 0x7FF)
+            throw new ArithmeticException(
+                    "Cannot convert to long (Infinity or NaN)");
+        if (exp == 0) {
+            if (m == 0)
+                return 0L;
+            return toLongPow2(d * 18014398509481984L, n - 54); // 2^54 Exact.
+        }
+        m |= 0x0010000000000000L; // Sets MSB (bit 52)
+        long shift = exp - 1023L - 52 + n; // Use long to avoid overflow.
+        if (shift <= -64)
+            return 0L;
+        if (shift >= 11)
+            throw new ArithmeticException("Cannot convert to long (overflow)");
+        m = (shift >= 0) ? m << shift : (m >> -shift)
+                + ((m >> -(shift + 1)) & 1); // Rounding.
+        return isNegative ? -m : m;
+    }
+
+    /**/
+
+    /**
+     * Returns the closest <code>long</code> representation of the
+     * specified <code>double</code> number multiplied by a power of ten.
+     *
+     * @param d the <code>double</code> multiplier.
+     * @param n the power of two exponent.
+     * @return <code>d * 10<sup>n</sup></code>.
+     */
+    public static long toLongPow10(double d, int n) {
+        long bits = Double.doubleToLongBits(d);
+        boolean isNegative = (bits >> 63) != 0;
+        int exp = ((int) (bits >> 52)) & 0x7FF;
+        long m = bits & 0x000fffffffffffffL;
+        if (exp == 0x7FF)
+            throw new ArithmeticException(
+                    "Cannot convert to long (Infinity or NaN)");
+        if (exp == 0) {
+            if (m == 0)
+                return 0L;
+            return toLongPow10(d * 1E16, n - 16);
+        }
+        m |= 0x0010000000000000L; // Sets MSB (bit 52)
+        int pow2 = exp - 1023 - 52;
+        // Retrieves 63 bits m with n == 0.
+        if (n >= 0) {
+            // Works with 4 x 32 bits registers (x3:x2:x1:x0)
+            long x0 = 0; // 32 bits.
+            long x1 = 0; // 32 bits.
+            long x2 = m & MASK_32; // 32 bits.
+            long x3 = m >>> 32; // 32 bits.
+            while (n != 0) {
+                int i = (n >= POW5_INT.length) ? POW5_INT.length - 1 : n;
+                int coef = POW5_INT[i]; // 31 bits max.
+
+                if (((int) x0) != 0)
+                    x0 *= coef; // 63 bits max.
+                if (((int) x1) != 0)
+                    x1 *= coef; // 63 bits max.
+                x2 *= coef; // 63 bits max.
+                x3 *= coef; // 63 bits max.
+
+                x1 += x0 >>> 32;
+                x0 &= MASK_32;
+
+                x2 += x1 >>> 32;
+                x1 &= MASK_32;
+
+                x3 += x2 >>> 32;
+                x2 &= MASK_32;
+
+                // Adjusts powers.
+                pow2 += i;
+                n -= i;
+
+                // Normalizes (x3 should be 32 bits max).
+                long carry = x3 >>> 32;
+                if (carry != 0) { // Shift.
+                    x0 = x1;
+                    x1 = x2;
+                    x2 = x3 & MASK_32;
+                    x3 = carry;
+                    pow2 += 32;
+                }
+            }
+
+            // Merges registers to a 63 bits mantissa.
+            int shift = 31 - MathLib.bitLength(x3); // -1..30
+            pow2 -= shift;
+            m = (shift < 0) ? (x3 << 31) | (x2 >>> 1) : // x3 is 32 bits.
+                    (((x3 << 32) | x2) << shift) | (x1 >>> (32 - shift));
+
+        } else { // n < 0
+
+            // Works with x1:x0 126 bits register.
+            long x1 = m; // 63 bits.
+            long x0 = 0; // 63 bits.
+            while (true) {
+
+                // Normalizes x1:x0
+                int shift = 63 - MathLib.bitLength(x1);
+                x1 <<= shift;
+                x1 |= x0 >>> (63 - shift);
+                x0 = (x0 << shift) & MASK_63;
+                pow2 -= shift;
+
+                // Checks if division has to be performed.
+                if (n == 0)
+                    break; // Done.
+
+                // Retrieves power of 5 divisor.
+                int i = (-n >= POW5_INT.length) ? POW5_INT.length - 1 : -n;
+                int divisor = POW5_INT[i];
+
+                // Performs the division (126 bits by 31 bits).
+                long wh = (x1 >>> 32);
+                long qh = wh / divisor;
+                long r = wh - qh * divisor;
+                long wl = (r << 32) | (x1 & MASK_32);
+                long ql = wl / divisor;
+                r = wl - ql * divisor;
+                x1 = (qh << 32) | ql;
+
+                wh = (r << 31) | (x0 >>> 32);
+                qh = wh / divisor;
+                r = wh - qh * divisor;
+                wl = (r << 32) | (x0 & MASK_32);
+                ql = wl / divisor;
+                x0 = (qh << 32) | ql;
+
+                // Adjusts powers.
+                n += i;
+                pow2 -= i;
+            }
+            m = x1;
+        }
+        if (pow2 > 0)
+            throw new ArithmeticException("Overflow");
+        if (pow2 < -63)
+            return 0;
+        m = (m >> -pow2) + ((m >> -(pow2 + 1)) & 1); // Rounding.
+        return isNegative ? -m : m;
+    }
+
+    /**/
+
+    /**
+     * Returns the largest power of 2 that is less than or equal to the
+     * the specified positive value.
+     *
+     * @param d the <code>double</code> number.
+     * @return <code>floor(Log2(abs(d)))</code>
+     * @throws ArithmeticException if <code>d &lt;= 0<code> or <code>d</code>
+     *         is <code>NaN</code> or <code>Infinity</code>.
+     **/
+    public static int floorLog2(double d) {
+        if (d <= 0)
+            throw new ArithmeticException("Negative number or zero");
+        long bits = Double.doubleToLongBits(d);
+        int exp = ((int) (bits >> 52)) & 0x7FF;
+        if (exp == 0x7FF)
+            throw new ArithmeticException("Infinity or NaN");
+        if (exp == 0)
+            return floorLog2(d * 18014398509481984L) - 54; // 2^54 Exact.       
+        return exp - 1023;
+    }
+
+    /**/
+
+    /**
+     * Returns the largest power of 10 that is less than or equal to the
+     * the specified positive value.
+     *
+     * @param d the <code>double</code> number.
+     * @return <code>floor(Log10(abs(d)))</code>
+     * @throws ArithmeticException if <code>d &lt;= 0<code> or <code>d</code>
+     *         is <code>NaN</code> or <code>Infinity</code>.
+     **/
+    public static int floorLog10(double d) {
+        int guess = (int) (LOG2_DIV_LOG10 * MathLib.floorLog2(d));
+        double pow10 = MathLib.toDoublePow10(1, guess);
+        if ((pow10 <= d) && (pow10 * 10 > d))
+            return guess;
+        if (pow10 > d)
+            return guess - 1;
+        return guess + 1;
+    }
+
+    private static final double LOG2_DIV_LOG10 = 0.3010299956639811952137388947;
+
+    /**
+     * The natural logarithm.
+     **/
+    public static final double E = 2.71828182845904523536028747135266;
+
+    /**
+     * The ratio of the circumference of a circle to its diameter.
+     **/
+    public static final double PI = 3.1415926535897932384626433832795;
+
+    /**
+     * Half the ratio of the circumference of a circle to its diameter.
+     **/
+    public static final double HALF_PI = 1.5707963267948966192313216916398;
+
+    /**
+     * Twice the ratio of the circumference of a circle to its diameter.
+     **/
+    public static final double TWO_PI = 6.283185307179586476925286766559;
+
+    /**
+     * Four time the ratio of the circumference of a circle to its diameter.
+     **/
+    public static final double FOUR_PI = 12.566370614359172953850573533118;
+
+    /**
+     * Holds {@link #PI} * {@link #PI}.
+     **/
+    public static final double PI_SQUARE = 9.8696044010893586188344909998762;
+
+    /**
+     * The natural logarithm of two.
+     **/
+    public static final double LOG2 = 0.69314718055994530941723212145818;
+
+    /**
+     * The natural logarithm of ten.
+     **/
+    public static final double LOG10 = 2.3025850929940456840179914546844;
+
+    /**
+     * The square root of two.
+     **/
+    public static final double SQRT2 = 1.4142135623730950488016887242097;
+
+    /**
+     * Not-A-Number.
+     **/
+    public static final double NaN = 0.0 / 0.0;
+
+    /**
+     * Infinity.
+     **/
+    public static final double Infinity = 1.0 / 0.0;
+
+    /**/
+    /**
+     * Converts an angle in degrees to radians.
+     *
+     * @param degrees the angle in degrees.
+     * @return the specified angle in radians.
+     **/
+    public static double toRadians(double degrees) {
+        return degrees * (PI / 180.0);
+    }
+
+    /**/
+
+    /**
+     * Converts an angle in radians to degrees.
+     *
+     * @param radians the angle in radians.
+     * @return the specified angle in degrees.
+     **/
+    public static double toDegrees(double radians) {
+        return radians * (180.0 / PI);
+    }
+
+    /**/
+
+    /**
+     * Returns the positive square root of the specified value.
+     * 
+     * @param x the value.
+     * @return <code>java.lang.Math.sqrt(x)</code>
+     **/
+    public static double sqrt(double x) {
+        return Math.sqrt(x); // CLDC 1.1
+    }
+
+    /**/
+
+    /**
+     * Returns the remainder of the division of the specified two arguments.
+     *
+     * @param x the dividend.
+     * @param y the divisor.
+     * @return <code>x - round(x / y) * y</code>
+     **/
+    public static double rem(double x, double y) {
+        double tmp = x / y;
+        if (MathLib.abs(tmp) <= Long.MAX_VALUE)
+            return x - MathLib.round(tmp) * y;
+        else
+            return NaN;
+    }
+
+    /**/
+
+    /**
+     * Returns the smallest (closest to negative infinity) 
+     * <code>double</code> value that is not less than the argument and is 
+     * equal to a mathematical integer.
+     *
+     * @param x the value.
+     * @return <code>java.lang.Math.ceil(x)</code>
+     **/
+    public static double ceil(double x) {
+        return Math.ceil(x); // CLDC 1.1
+    }
+
+    /**/
+
+    /**
+     * Returns the largest (closest to positive infinity) 
+     * <code>double</code> value that is not greater than the argument and 
+     * is equal to a mathematical integer.
+     *
+     * @param x the value.
+     * @return <code>java.lang.Math.ceil(x)</code>
+     **/
+    public static double floor(double x) {
+        return Math.floor(x); // CLDC 1.1
+    }
+
+    /**/
+
+    /**
+     * Returns the trigonometric sine of the specified angle in radians.
+     * 
+     * @param radians the angle in radians.
+     * @return <code>java.lang.Math.sin(radians)</code>
+     **/
+    public static double sin(double radians) {
+        return Math.sin(radians); // CLDC 1.1
+    }
+
+    /**/
+
+    /**
+     * Returns the trigonometric cosine of the specified angle in radians.
+     * 
+     * @param radians the angle in radians.
+     * @return <code>java.lang.Math.cos(radians)</code>
+     **/
+    public static double cos(double radians) {
+        return Math.cos(radians); // CLDC 1.1
+    }
+
+    /**/
+
+    /**
+     * Returns the trigonometric tangent of the specified angle in radians.
+     * 
+     * @param radians the angle in radians.
+     * @return <code>java.lang.Math.tan(radians)</code>
+     **/
+    public static double tan(double radians) {
+        return Math.tan(radians); // CLDC 1.1
+    }
+
+    /**/
+
+    /**
+     * Returns the arc sine of the specified value, 
+     * in the range of -<i>pi</i>/2 through <i>pi</i>/2. 
+     *
+     * @param x the value whose arc sine is to be returned.
+     * @return the arc sine in radians for the specified value.
+     **/
+    public static double asin(double x) {
+        if (x < -1.0 || x > 1.0)
+            return MathLib.NaN;
+        if (x == -1.0)
+            return -HALF_PI;
+        if (x == 1.0)
+            return HALF_PI;
+        return MathLib.atan(x / MathLib.sqrt(1.0 - x * x));
+    }
+
+    /**/
+
+    /**
+     * Returns the arc cosine of the specified value,
+     * in the range of 0.0 through <i>pi</i>. 
+     *
+     * @param x the value whose arc cosine is to be returned.
+     * @return the arc cosine in radians for the specified value.
+     **/
+    public static double acos(double x) {
+        return HALF_PI - MathLib.asin(x);
+    }
+
+    /**/
+
+    /**
+     * Returns the arc tangent of the specified value,
+     * in the range of -<i>pi</i>/2 through <i>pi</i>/2.  
+     *
+     * @param x the value whose arc tangent is to be returned.
+     * @return the arc tangent in radians for the specified value.
+     * @see <a href="http://mathworld.wolfram.com/InverseTangent.html">
+     *      Inverse Tangent -- from MathWorld</a> 
+     **/
+    public static double atan(double x) {
+        return MathLib._atan(x);
+    }
+
+    /**/
+
+    /**
+     * Returns the angle theta such that
+     * <code>(x == cos(theta)) && (y == sin(theta))</code>. 
+     *
+     * @param y the y value.
+     * @param x the x value.
+     * @return the angle theta in radians.
+     * @see <a href="http://en.wikipedia.org/wiki/Atan2">Wikipedia: Atan2</a>
+     **/
+    public static double atan2(double y, double x) {
+        // From Wikipedia.
+        if (x > 0) return MathLib.atan(y / x);
+        if ((y >= 0) && (x < 0)) return MathLib.atan(y / x) + PI;
+        if ((y < 0) && (x < 0)) return MathLib.atan(y / x) - PI;
+        if ((y > 0) && (x == 0)) return PI / 2;
+        if ((y < 0) && (x == 0)) return -PI / 2;
+        return Double.NaN; // ((y == 0) && (x == 0)) 
+    }
+
+    /**/
+
+    /**
+     * Returns the hyperbolic sine of x.
+     * 
+     * @param x the value for which the hyperbolic sine is calculated.
+     * @return <code>(exp(x) - exp(-x)) / 2</code>
+     **/
+    public static double sinh(double x) {
+        return (MathLib.exp(x) - MathLib.exp(-x)) * 0.5;
+    }
+
+    /**/
+
+    /**
+     * Returns the hyperbolic cosine of x.
+     * 
+     * @param x the value for which the hyperbolic cosine is calculated.
+     * @return <code>(exp(x) + exp(-x)) / 2</code>
+     **/
+    public static double cosh(double x) {
+        return (MathLib.exp(x) + MathLib.exp(-x)) * 0.5;
+    }
+
+    /**/
+
+    /**
+     * Returns the hyperbolic tangent of x.
+     * 
+     * @param x the value for which the hyperbolic tangent is calculated.
+     * @return <code>(exp(2 * x) - 1) / (exp(2 * x) + 1)</code>
+     **/
+    public static double tanh(double x) {
+        return (MathLib.exp(2 * x) - 1) / (MathLib.exp(2 * x) + 1);
+    }
+
+    /**/
+
+    /**
+     * Returns <i>{@link #E e}</i> raised to the specified power.
+     *
+     * @param x the exponent.
+     * @return <code><i>e</i><sup>x</sup></code>
+     * @see <a href="http://mathworld.wolfram.com/ExponentialFunction.html">
+     *      Exponential Function -- from MathWorld</a> 
+     **/
+    public static double exp(double x) {
+        return MathLib._ieee754_exp(x);
+    }
+
+    /**/
+
+    /**
+     * Returns the natural logarithm (base <i>{@link #E e}</i>) of the specified
+     * value.
+     *
+     * @param x the value greater than <code>0.0</code>.
+     * @return the value y such as <code><i>e</i><sup>y</sup> == x</code>
+     **/
+    public static double log(double x) {
+        return MathLib._ieee754_log(x);
+    }
+
+    /**/
+
+    /**
+     * Returns the decimal logarithm of the specified value.
+     *
+     * @param x the value greater than <code>0.0</code>.
+     * @return the value y such as <code>10<sup>y</sup> == x</code>
+     **/
+    public static double log10(double x) {
+        return log(x) * INV_LOG10;
+    }
+
+    private static double INV_LOG10 = 0.43429448190325182765112891891661;
+
+    /**
+     * Returns the value of the first argument raised to the power of the
+     * second argument. 
+     *
+     * @param x the base.
+     * @param y the exponent.
+     * @return <code>x<sup>y</sup></code>
+     **/
+    public static double pow(double x, double y) {
+        // Use close approximation (+/- LSB)
+        if ((x < 0) && (y == (int) y))
+            return (((int) y) & 1) == 0 ? pow(-x, y) : -pow(-x, y);
+        return MathLib.exp(y * MathLib.log(x));
+    }
+
+    /**
+     * Returns the closest <code>int</code> to the specified argument. 
+     *
+     * @param f the <code>float</code> value to be rounded to a <code>int</code>
+     * @return the nearest <code>int</code> value.
+     **/
+    public static int round(float f) {
+        return (int) floor(f + 0.5f);
+    }
+
+    /**/
+
+    /**
+     * Returns the closest <code>long</code> to the specified argument. 
+     *
+     * @param d the <code>double</code> value to be rounded to a 
+     *        <code>long</code>
+     * @return the nearest <code>long</code> value.
+     **/
+    public static long round(double d) {
+        return (long) floor(d + 0.5d);
+    }
+
+    /**
+     * Returns the absolute value of the specified <code>int</code> argument.
+     *
+     * @param i the <code>int</code> value.
+     * @return <code>i</code> or <code>-i</code>
+     */
+    public static int abs(int i) {
+        return (i < 0) ? -i : i;
+    }
+
+    /**
+     * Returns the absolute value of the specified <code>long</code> argument.
+     *
+     * @param l the <code>long</code> value.
+     * @return <code>l</code> or <code>-l</code>
+     */
+    public static long abs(long l) {
+        return (l < 0) ? -l : l;
+    }
+
+    /**
+     * Returns the absolute value of the specified <code>float</code> argument.
+     *
+     * @param f the <code>float</code> value.
+     * @return <code>f</code> or <code>-f</code>
+     **/
+    public static float abs(float f) {
+        return (f < 0) ? -f : f;
+    }
+
+    /**
+     * Returns the absolute value of the specified <code>double</code> argument.
+     *
+     * @param d the <code>double</code> value.
+     * @return <code>d</code> or <code>-d</code>
+     **/
+    public static double abs(double d) {
+        return (d < 0) ? -d : d;
+    }
+
+    /**/
+
+    /**
+     * Returns the greater of two <code>int</code> values. 
+     *
+     * @param x the first value.
+     * @param y the second value.
+     * @return the larger of <code>x</code> and <code>y</code>.
+     */
+    public static int max(int x, int y) {
+        return (x >= y) ? x : y;
+    }
+
+    /**
+     * Returns the greater of two <code>long</code> values. 
+     *
+     * @param x the first value.
+     * @param y the second value.
+     * @return the larger of <code>x</code> and <code>y</code>.
+     */
+    public static long max(long x, long y) {
+        return (x >= y) ? x : y;
+    }
+
+    /**
+     * Returns the greater of two <code>float</code> values. 
+     *
+     * @param x the first value.
+     * @param y the second value.
+     * @return the larger of <code>x</code> and <code>y</code>.
+     **/
+    public static float max(float x, float y) {
+        return (x >= y) ? x : y;
+    }
+
+    /**
+     * Returns the greater of two <code>double</code> values. 
+     *
+     * @param x the first value.
+     * @param y the second value.
+     * @return the larger of <code>x</code> and <code>y</code>.
+     **/
+    public static double max(double x, double y) {
+        return (x >= y) ? x : y;
+    }
+
+    /**/
+
+    /**
+     * Returns the smaller of two <code>int</code> values. 
+     *
+     * @param x the first value.
+     * @param y the second value.
+     * @return the smaller of <code>x</code> and <code>y</code>.
+     */
+    public static int min(int x, int y) {
+        return (x < y) ? x : y;
+    }
+
+    /**
+     * Returns the smaller of two <code>long</code> values. 
+     *
+     * @param x the first value.
+     * @param y the second value.
+     * @return the smaller of <code>x</code> and <code>y</code>.
+     */
+    public static long min(long x, long y) {
+        return (x < y) ? x : y;
+    }
+
+    /**
+     * Returns the smaller of two <code>float</code> values. 
+     *
+     * @param x the first value.
+     * @param y the second value.
+     * @return the smaller of <code>x</code> and <code>y</code>.
+     **/
+    public static float min(float x, float y) {
+        return (x < y) ? x : y;
+    }
+
+    /**/
+
+    /**
+     * Returns the smaller of two <code>double</code> values. 
+     *
+     * @param x the first value.
+     * @param y the second value.
+     * @return the smaller of <code>x</code> and <code>y</code>.
+     **/
+    public static double min(double x, double y) {
+        return (x < y) ? x : y;
+    }
+
+    ////////////////////////////////////////////////////////////////////////////
+    /* @(#)s_atan.c 1.3 95/01/18 */
+    /*
+     * ====================================================
+     * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
+     *
+     * Developed at SunSoft, a Sun Microsystems, Inc. business.
+     * Permission to use, copy, modify, and distribute this
+     * software is freely granted, provided that this notice 
+     * is preserved.
+     * ====================================================
+     *
+     */
+
+    /* atan(x)
+     * Method
+     *   1. Reduce x to positive by atan(x) = -atan(-x).
+     *   2. According to the integer k=4t+0.25 chopped, t=x, the argument
+     *      is further reduced to one of the following intervals and the
+     *      arctangent of t is evaluated by the corresponding formula:
+     *
+     *      [0,7/16]      atan(x) = t-t^3*(a1+t^2*(a2+...(a10+t^2*a11)...)
+     *      [7/16,11/16]  atan(x) = atan(1/2) + atan( (t-0.5)/(1+t/2) )
+     *      [11/16.19/16] atan(x) = atan( 1 ) + atan( (t-1)/(1+t) )
+     *      [19/16,39/16] atan(x) = atan(3/2) + atan( (t-1.5)/(1+1.5t) )
+     *      [39/16,INF]   atan(x) = atan(INF) + atan( -1/t )
+     *
+     * Constants:
+     * The hexadecimal values are the intended ones for the following 
+     * constants. The decimal values may be used, provided that the 
+     * compiler will convert from decimal to binary accurately enough 
+     * to produce the hexadecimal values shown.
+     */
+    static final double atanhi[] = { 4.63647609000806093515e-01, // atan(0.5)hi 0x3FDDAC67, 0x0561BB4F
+            7.85398163397448278999e-01, // atan(1.0)hi 0x3FE921FB, 0x54442D18 
+            9.82793723247329054082e-01, // atan(1.5)hi 0x3FEF730B, 0xD281F69B 
+            1.57079632679489655800e+00, // atan(inf)hi 0x3FF921FB, 0x54442D18 
+    };
+
+    static final double atanlo[] = { 2.26987774529616870924e-17, // atan(0.5)lo 0x3C7A2B7F, 0x222F65E2
+            3.06161699786838301793e-17, // atan(1.0)lo 0x3C81A626, 0x33145C07
+            1.39033110312309984516e-17, // atan(1.5)lo 0x3C700788, 0x7AF0CBBD
+            6.12323399573676603587e-17, // atan(inf)lo 0x3C91A626, 0x33145C07 
+    };
+
+    static final double aT[] = { 3.33333333333329318027e-01, // 0x3FD55555, 0x5555550D
+            -1.99999999998764832476e-01, // 0xBFC99999, 0x9998EBC4 
+            1.42857142725034663711e-01, // 0x3FC24924, 0x920083FF 
+            -1.11111104054623557880e-01, // 0xBFBC71C6, 0xFE231671 
+            9.09088713343650656196e-02, // 0x3FB745CD, 0xC54C206E 
+            -7.69187620504482999495e-02, // 0xBFB3B0F2, 0xAF749A6D 
+            6.66107313738753120669e-02, // 0x3FB10D66, 0xA0D03D51 
+            -5.83357013379057348645e-02, // 0xBFADDE2D, 0x52DEFD9A 
+            4.97687799461593236017e-02, // 0x3FA97B4B, 0x24760DEB 
+            -3.65315727442169155270e-02, // 0xBFA2B444, 0x2C6A6C2F 
+            1.62858201153657823623e-02, // 0x3F90AD3A, 0xE322DA11 
+    };
+
+    static final double one = 1.0, huge = 1.0e300;
+
+    static double _atan(double x) {
+        double w, s1, s2, z;
+        int ix, hx, id;
+        long xBits = Double.doubleToLongBits(x);
+        int __HIx = (int) (xBits >> 32);
+        int __LOx = (int) xBits;
+
+        hx = __HIx;
+        ix = hx & 0x7fffffff;
+        if (ix >= 0x44100000) { // if |x| >= 2^66 
+            if (ix > 0x7ff00000 || (ix == 0x7ff00000 && (__LOx != 0)))
+                return x + x; // NaN
+            if (hx > 0)
+                return atanhi[3] + atanlo[3];
+            else
+                return -atanhi[3] - atanlo[3];
+        }
+        if (ix < 0x3fdc0000) { // |x| < 0.4375
+            if (ix < 0x3e200000) // |x| < 2^-29
+                if (huge + x > one)
+                    return x;
+            id = -1;
+        } else {
+            x = MathLib.abs(x);
+            if (ix < 0x3ff30000) // |x| < 1.1875
+                if (ix < 0x3fe60000) { // 7/16 <=|x|<11/16
+                    id = 0;
+                    x = (2.0 * x - one) / (2.0 + x);
+                } else { // 11/16<=|x|< 19/16
+                    id = 1;
+                    x = (x - one) / (x + one);
+                }
+            else if (ix < 0x40038000) { // |x| < 2.4375
+                id = 2;
+                x = (x - 1.5) / (one + 1.5 * x);
+            } else { // 2.4375 <= |x| < 2^66
+                id = 3;
+                x = -1.0 / x;
+            }
+        }
+        // end of argument reduction
+        z = x * x;
+        w = z * z;
+        // break sum from i=0 to 10 aT[i]z**(i+1) into odd and even poly
+        s1 = z
+                * (aT[0] + w
+                        * (aT[2] + w
+                                * (aT[4] + w
+                                        * (aT[6] + w * (aT[8] + w * aT[10])))));
+        s2 = w * (aT[1] + w * (aT[3] + w * (aT[5] + w * (aT[7] + w * aT[9]))));
+        if (id < 0)
+            return x - x * (s1 + s2);
+        else {
+            z = atanhi[id] - ((x * (s1 + s2) - atanlo[id]) - x);
+            return (hx < 0) ? -z : z;
+        }
+    }
+
+    /**/
+    ////////////////////////////////////////////////////////////////////////////
+    /* @(#)e_log.c 1.3 95/01/18 */
+    /*
+     * ====================================================
+     * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
+     *
+     * Developed at SunSoft, a Sun Microsystems, Inc. business.
+     * Permission to use, copy, modify, and distribute this
+     * software is freely granted, provided that this notice 
+     * is preserved.
+     * ====================================================
+     */
+
+    /* __ieee754_log(x)
+     * Return the logrithm of x
+     *
+     * Method :                  
+     *   1. Argument Reduction: find k and f such that 
+     *			x = 2^k * (1+f), 
+     *	   where  sqrt(2)/2 < 1+f < sqrt(2) .
+     *
+     *   2. Approximation of log(1+f).
+     *	Let s = f/(2+f) ; based on log(1+f) = log(1+s) - log(1-s)
+     *		 = 2s + 2/3 s**3 + 2/5 s**5 + .....,
+     *	     	 = 2s + s*R
+     *      We use a special Reme algorithm on [0,0.1716] to generate 
+     * 	a polynomial of degree 14 to approximate R The maximum error 
+     *	of this polynomial approximation is bounded by 2**-58.45. In
+     *	other words,
+     *		        2      4      6      8      10      12      14
+     *	    R(z) ~ Lg1*s +Lg2*s +Lg3*s +Lg4*s +Lg5*s  +Lg6*s  +Lg7*s
+     *  	(the values of Lg1 to Lg7 are listed in the program)
+     *	and
+     *	    |      2          14          |     -58.45
+     *	    | Lg1*s +...+Lg7*s    -  R(z) | <= 2 
+     *	    |                             |
+     *	Note that 2s = f - s*f = f - hfsq + s*hfsq, where hfsq = f*f/2.
+     *	In order to guarantee error in log below 1ulp, we compute log
+     *	by
+     *		log(1+f) = f - s*(f - R)	(if f is not too large)
+     *		log(1+f) = f - (hfsq - s*(hfsq+R)).	(better accuracy)
+     *	
+     *	3. Finally,  log(x) = k*ln2 + log(1+f).  
+     *			    = k*ln2_hi+(f-(hfsq-(s*(hfsq+R)+k*ln2_lo)))
+     *	   Here ln2 is split into two floating point number: 
+     *			ln2_hi + ln2_lo,
+     *	   where n*ln2_hi is always exact for |n| < 2000.
+     *
+     * Special cases:
+     *	log(x) is NaN with signal if x < 0 (including -INF) ; 
+     *	log(+INF) is +INF; log(0) is -INF with signal;
+     *	log(NaN) is that NaN with no signal.
+     *
+     * Accuracy:
+     *	according to an error analysis, the error is always less than
+     *	1 ulp (unit in the last place).
+     *
+     * Constants:
+     * The hexadecimal values are the intended ones for the following 
+     * constants. The decimal values may be used, provided that the 
+     * compiler will convert from decimal to binary accurately enough 
+     * to produce the hexadecimal values shown.
+     */
+    static final double ln2_hi = 6.93147180369123816490e-01, // 3fe62e42 fee00000
+            ln2_lo = 1.90821492927058770002e-10, // 3dea39ef 35793c76
+            two54 = 1.80143985094819840000e+16, // 43500000 00000000
+            Lg1 = 6.666666666666735130e-01, // 3FE55555 55555593
+            Lg2 = 3.999999999940941908e-01, // 3FD99999 9997FA04
+            Lg3 = 2.857142874366239149e-01, // 3FD24924 94229359
+            Lg4 = 2.222219843214978396e-01, // 3FCC71C5 1D8E78AF
+            Lg5 = 1.818357216161805012e-01, // 3FC74664 96CB03DE
+            Lg6 = 1.531383769920937332e-01, // 3FC39A09 D078C69F
+            Lg7 = 1.479819860511658591e-01; // 3FC2F112 DF3E5244
+
+    static final double zero = 0.0;
+
+    static double _ieee754_log(double x) {
+        double hfsq, f, s, z, R, w, t1, t2, dk;
+        int k, hx, i, j;
+        int lx; // unsigned 
+
+        long xBits = Double.doubleToLongBits(x);
+        hx = (int) (xBits >> 32);
+        lx = (int) xBits;
+
+        k = 0;
+        if (hx < 0x00100000) { // x < 2**-1022 
+            if (((hx & 0x7fffffff) | lx) == 0)
+                return -two54 / zero; // log(+-0)=-inf
+            if (hx < 0)
+                return (x - x) / zero; // log(-#) = NaN
+            k -= 54;
+            x *= two54; // subnormal number, scale up x
+            xBits = Double.doubleToLongBits(x);
+            hx = (int) (xBits >> 32); // high word of x
+        }
+        if (hx >= 0x7ff00000)
+            return x + x;
+        k += (hx >> 20) - 1023;
+        hx &= 0x000fffff;
+        i = (hx + 0x95f64) & 0x100000;
+        xBits = Double.doubleToLongBits(x);
+        int HIx = hx | (i ^ 0x3ff00000); // normalize x or x/2
+        xBits = ((HIx & 0xFFFFFFFFL) << 32) | (xBits & 0xFFFFFFFFL);
+        x = Double.longBitsToDouble(xBits);
+        k += (i >> 20);
+        f = x - 1.0;
+        if ((0x000fffff & (2 + hx)) < 3) { // |f| < 2**-20
+            if (f == zero)
+                if (k == 0)
+                    return zero;
+                else {
+                    dk = (double) k;
+                    return dk * ln2_hi + dk * ln2_lo;
+                }
+            R = f * f * (0.5 - 0.33333333333333333 * f);
+            if (k == 0)
+                return f - R;
+            else {
+                dk = (double) k;
+                return dk * ln2_hi - ((R - dk * ln2_lo) - f);
+            }
+        }
+        s = f / (2.0 + f);
+        dk = (double) k;
+        z = s * s;
+        i = hx - 0x6147a;
+        w = z * z;
+        j = 0x6b851 - hx;
+        t1 = w * (Lg2 + w * (Lg4 + w * Lg6));
+        t2 = z * (Lg1 + w * (Lg3 + w * (Lg5 + w * Lg7)));
+        i |= j;
+        R = t2 + t1;
+        if (i > 0) {
+            hfsq = 0.5 * f * f;
+            if (k == 0)
+                return f - (hfsq - s * (hfsq + R));
+            else
+                return dk * ln2_hi
+                        - ((hfsq - (s * (hfsq + R) + dk * ln2_lo)) - f);
+        } else if (k == 0)
+            return f - s * (f - R);
+        else
+            return dk * ln2_hi - ((s * (f - R) - dk * ln2_lo) - f);
+    }
+
+    /**/
+    ////////////////////////////////////////////////////////////////////////////
+    /* @(#)e_exp.c 1.6 04/04/22 */
+    /*
+     * ====================================================
+     * Copyright (C) 2004 by Sun Microsystems, Inc. All rights reserved.
+     *
+     * Permission to use, copy, modify, and distribute this
+     * software is freely granted, provided that this notice 
+     * is preserved.
+     * ====================================================
+     */
+
+    /* __ieee754_exp(x)
+     * Returns the exponential of x.
+     *
+     * Method
+     *   1. Argument reduction:
+     *      Reduce x to an r so that |r| <= 0.5*ln2 ~ 0.34658.
+     *	Given x, find r and integer k such that
+     *
+     *               x = k*ln2 + r,  |r| <= 0.5*ln2.  
+     *
+     *      Here r will be represented as r = hi-lo for better 
+     *	accuracy.
+     *
+     *   2. Approximation of exp(r) by a special rational function on
+     *	the interval [0,0.34658]:
+     *	Write
+     *	    R(r**2) = r*(exp(r)+1)/(exp(r)-1) = 2 + r*r/6 - r**4/360 + ...
+     *      We use a special Remes algorithm on [0,0.34658] to generate 
+     * 	a polynomial of degree 5 to approximate R. The maximum error 
+     *	of this polynomial approximation is bounded by 2**-59. In
+     *	other words,
+     *	    R(z) ~ 2.0 + P1*z + P2*z**2 + P3*z**3 + P4*z**4 + P5*z**5
+     *  	(where z=r*r, and the values of P1 to P5 are listed below)
+     *	and
+     *	    |                  5          |     -59
+     *	    | 2.0+P1*z+...+P5*z   -  R(z) | <= 2 
+     *	    |                             |
+     *	The computation of exp(r) thus becomes
+     *                             2*r
+     *		exp(r) = 1 + -------
+     *		              R - r
+     *                                 r*R1(r)	
+     *		       = 1 + r + ----------- (for better accuracy)
+     *		                  2 - R1(r)
+     *	where
+     *			         2       4             10
+     *		R1(r) = r - (P1*r  + P2*r  + ... + P5*r   ).
+     *	
+     *   3. Scale back to obtain exp(x):
+     *	From step 1, we have
+     *	   exp(x) = 2^k * exp(r)
+     *
+     * Special cases:
+     *	exp(INF) is INF, exp(NaN) is NaN;
+     *	exp(-INF) is 0, and
+     *	for finite argument, only exp(0)=1 is exact.
+     *
+     * Accuracy:
+     *	according to an error analysis, the error is always less than
+     *	1 ulp (unit in the last place).
+     *
+     * Misc. info.
+     *	For IEEE double 
+     *	    if x >  7.09782712893383973096e+02 then exp(x) overflow
+     *	    if x < -7.45133219101941108420e+02 then exp(x) underflow
+     *
+     * Constants:
+     * The hexadecimal values are the intended ones for the following 
+     * constants. The decimal values may be used, provided that the 
+     * compiler will convert from decimal to binary accurately enough
+     * to produce the hexadecimal values shown.
+     */
+    static final double halF[] = { 0.5, -0.5, },
+            twom1000 = 9.33263618503218878990e-302, // 2**-1000=0x01700000,0
+            o_threshold = 7.09782712893383973096e+02, // 0x40862E42, 0xFEFA39EF
+            u_threshold = -7.45133219101941108420e+02, // 0xc0874910, 0xD52D3051
+            ln2HI[] = { 6.93147180369123816490e-01, // 0x3fe62e42, 0xfee00000
+                    -6.93147180369123816490e-01, },// 0xbfe62e42, 0xfee00000
+            ln2LO[] = { 1.90821492927058770002e-10, // 0x3dea39ef, 0x35793c76
+                    -1.90821492927058770002e-10, },// 0xbdea39ef, 0x35793c76
+            invln2 = 1.44269504088896338700e+00, // 0x3ff71547, 0x652b82fe
+            P1 = 1.66666666666666019037e-01, // 0x3FC55555, 0x5555553E
+            P2 = -2.77777777770155933842e-03, // 0xBF66C16C, 0x16BEBD93
+            P3 = 6.61375632143793436117e-05, // 0x3F11566A, 0xAF25DE2C
+            P4 = -1.65339022054652515390e-06, // 0xBEBBBD41, 0xC5D26BF1
+            P5 = 4.13813679705723846039e-08; // 0x3E663769, 0x72BEA4D0
+
+    static double _ieee754_exp(double x) // default IEEE double exp
+    {
+        double y, hi = 0, lo = 0, c, t;
+        int k = 0, xsb;
+        int hx; // Unsigned.
+        long xBits = Double.doubleToLongBits(x);
+        int __HIx = (int) (xBits >> 32);
+        int __LOx = (int) xBits;
+
+        hx = __HIx; // high word of x
+        xsb = (hx >> 31) & 1; // sign bit of x
+        hx &= 0x7fffffff; // high word of |x|
+
+        // filter out non-finite argument
+        if (hx >= 0x40862E42) { // if |x|>=709.78...
+            if (hx >= 0x7ff00000)
+                if (((hx & 0xfffff) | __LOx) != 0)
+                    return x + x; // NaN
+                else
+                    return (xsb == 0) ? x : 0.0;
+            if (x > o_threshold)
+                return huge * huge; // overflow
+            if (x < u_threshold)
+                return twom1000 * twom1000; // underflow
+        }
+
+        // argument reduction
+        if (hx > 0x3fd62e42) { // if  |x| > 0.5 ln2 
+            if (hx < 0x3FF0A2B2) { // and |x| < 1.5 ln2
+                hi = x - ln2HI[xsb];
+                lo = ln2LO[xsb];
+                k = 1 - xsb - xsb;
+            } else {
+                k = (int) (invln2 * x + halF[xsb]);
+                t = k;
+                hi = x - t * ln2HI[0]; // t*ln2HI is exact here
+                lo = t * ln2LO[0];
+            }
+            x = hi - lo;
+        } else if (hx < 0x3e300000) { // when |x|<2**-28
+            if (huge + x > one)
+                return one + x;// trigger inexact
+        } else
+            k = 0;
+
+        // x is now in primary range
+        t = x * x;
+        c = x - t * (P1 + t * (P2 + t * (P3 + t * (P4 + t * P5))));
+        if (k == 0)
+            return one - ((x * c) / (c - 2.0) - x);
+        else
+            y = one - ((lo - (x * c) / (2.0 - c)) - hi);
+        long yBits = Double.doubleToLongBits(y);
+        int __HIy = (int) (yBits >> 32);
+        if (k >= -1021) {
+            __HIy += (k << 20); // add k to y's exponent
+            yBits = ((__HIy & 0xFFFFFFFFL) << 32) | (yBits & 0xFFFFFFFFL);
+            y = Double.longBitsToDouble(yBits);
+            return y;
+        } else {
+            __HIy += ((k + 1000) << 20);// add k to y's exponent 
+            yBits = ((__HIy & 0xFFFFFFFFL) << 32) | (yBits & 0xFFFFFFFFL);
+            y = Double.longBitsToDouble(yBits);
+            return y * twom1000;
+        }
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/marmotta-commons/src/ext/java/javolution/lang/Parallelizable.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-commons/src/ext/java/javolution/lang/Parallelizable.java b/commons/marmotta-commons/src/ext/java/javolution/lang/Parallelizable.java
new file mode 100644
index 0000000..0c1001a
--- /dev/null
+++ b/commons/marmotta-commons/src/ext/java/javolution/lang/Parallelizable.java
@@ -0,0 +1,73 @@
+/*
+ * 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;
+
+import java.lang.annotation.*;
+
+/**
+ * <p> Indicates that a class, a method or a field can be used by multiple 
+ *     threads concurrently and whether or not it is 
+ *     {@link Parallelizable#mutexFree() mutex-free} (not blocking).</p>
+ * 
+ * [code]
+ * public class Operators {
+ *    @Parallelizable
+ *    public static final Reducer<Object> ANY = new Reducer<Object>() { ... }
+ *    
+ *    @Parallelizable(mutexFree = false, comment="Internal use of synchronization")
+ *    public static final Reducer<Object> MAX = new Reducer<Object>() { ... }
+ *    
+ *    @Parallelizable(mutexFree = false, comment="Internal use of synchronization")
+ *    public static final Reducer<Object> MIN = new Reducer<Object>() { ... }
+ *    
+ *    @Parallelizable
+ *    public static final Reducer<Boolean> AND = new Reducer<Boolean>() { ... }
+ *    
+ *    @Parallelizable
+ *    public static final Reducer<Boolean> OR = new Reducer<Boolean>() { ... }
+ *    
+ *    @Parallelizable(comment="Internal use of AtomicInteger")
+ *    public static final Reducer<Integer> SUM = new Reducer<Integer>() { ... }
+ * }[/code]
+ *  
+ * <p> Classes with no internal fields or {@link javolution.lang.Immutable 
+ *     Immutable} are usually parallelizable and mutex-free.</p>
+ *
+ * @author  <a href="mailto:jean-marie@dautelle.com">Jean-Marie Dautelle</a>
+ * @version 6.0, July 21, 2013
+ * @see <a href="http://en.wikipedia.org/wiki/Mutual_exclusion">Wikipedia: Mutual Exclusion</a>
+ */
+@Documented
+@Inherited
+@Target({ ElementType.TYPE, ElementType.FIELD, ElementType.METHOD })
+@Retention(RetentionPolicy.RUNTIME)
+public @interface Parallelizable {
+
+    /**
+     * Indicates if this element can safely be used concurrently 
+     * (default {@code true}).
+     */
+    boolean value() default true;
+
+    /**
+     * Indicates if this element does not use any form of mutex to 
+     * access shared resources (default {@code true}). To avoid 
+     * <a href="http://en.wikipedia.org/wiki/Priority_inversion">
+     * priority inversion</a> and possibly unbounded response times,
+     * a real-time VM (with priority inheritance) is recommended
+     * when using {@link Realtime real-time} elements which are not mutex-free.
+     */
+    boolean mutexFree() default true;
+
+    /**
+     * Provides additional information (default {@code ""}).
+     */
+    String comment() default "";
+
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/marmotta-commons/src/ext/java/javolution/lang/Realtime.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-commons/src/ext/java/javolution/lang/Realtime.java b/commons/marmotta-commons/src/ext/java/javolution/lang/Realtime.java
new file mode 100644
index 0000000..0b7a24a
--- /dev/null
+++ b/commons/marmotta-commons/src/ext/java/javolution/lang/Realtime.java
@@ -0,0 +1,113 @@
+/*
+ * 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;
+
+import java.lang.annotation.*;
+
+/**
+ * <p> Indicates if an element has a bounded  
+ *     <a href="http://en.wikipedia.org/wiki/Worst-case_execution_time">
+ *     worst-case execution time</a>. The {@link #limit limit} behavior
+ *     of the execution time with the input size may be specified (if no limit 
+ *     specified the worst case execution time is assumed to be constant).</p>
+ *     
+ * [code]
+ * public class Equalities {
+ *     @Realtime(limit = UNKNOWN)
+ *     public static final Equality<Object> STANDARD = new StandardComparatorImpl<Object>();
+ *     
+ *     @Realtime(limit = CONSTANT)
+ *     public static final Equality<Object> IDENTITY = new IdentityComparatorImpl<Object>();
+ *     
+ *     @Realtime(limit = LINEAR)
+ *     public static final Equality<Object> ARRAY = new ArrayComparatorImpl();
+ *     
+ *     @Realtime(limit = LINEAR)
+ *     public static final Equality<CharSequence> LEXICAL = new LexicalComparatorImpl();
+ * }[/code]      
+ *     
+ * <p> Analysis tools / compilers may produce warnings if program elements 
+ *     use or override elements with incompatible real-time characteristics.</p>
+ *     
+ * <p> Note: For multi-cores systems, if a real-time element is {@link  Parallelizable}
+ *     but not {@link  Parallelizable#mutexFree() mutex-free}, response 
+ *     time even for high priority threads may be unbounded due to 
+ *     <a href="http://en.wikipedia.org/wiki/Priority_inversion">priority 
+ *     inversion</a>. This is no longer the case when running on real-time 
+ *     VMs due to their support for priority inheritance.</p>
+ *          
+ * @author  <a href="mailto:jean-marie@dautelle.com">Jean-Marie Dautelle</a>
+ * @version 6.0, July 21, 2013
+ * @see <a href="http://en.wikipedia.org/wiki/Real-time_computing">Real-Time Computing</a>
+ */
+@Documented
+@Inherited
+@Target({ ElementType.TYPE, ElementType.FIELD, ElementType.METHOD,
+        ElementType.CONSTRUCTOR })
+@Retention(RetentionPolicy.RUNTIME)
+public @interface Realtime {
+
+    /**
+     * Indicates if this element has a bounded worst-case execution time
+     * (default {@code true}).
+     */
+    boolean value() default true;
+
+    /**
+     * Returns the limit behavior for the worst-case execution time
+     * (default {@link Limit#CONSTANT}).
+     */
+    Limit limit() default Limit.CONSTANT;
+
+    /**
+     * Provides additional information (default {@code ""}).
+     */
+    String comment() default "";
+
+    /**
+     * Identifies the limit behavior for the worst case execution time.
+     */
+    public enum Limit {
+
+        /**
+         * The worst case execution time is constant.
+         */
+        CONSTANT,
+
+        /**
+         * The worst case execution time is bounded in <i>O(log(n))</i> 
+         * with <i>n</i> characteristic of the current size of the inputs.
+         */
+        LOG_N,
+
+        /**
+         * The worst case execution time is bounded in <i>O(n)</i> 
+         * with <i>n</i> characteristic of the current size of the inputs.
+         */
+        LINEAR,
+
+        /**
+         * The worst case execution time is bounded in <i>O(n log(n))</i> 
+         * with <i>n</i> characteristic of the current size of the inputs.
+         */
+        N_LOG_N,
+
+        /**
+         * The worst case execution time is bounded in <i>O(n²)</i> 
+         * with <i>n</i> characteristic of the current size of the inputs.
+         */
+        N_SQUARE,
+
+        /**
+         * The limit behavior of the worst case execution time is unknown
+         * or unspecified.
+         */
+        UNKNOWN,
+    }
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/marmotta-commons/src/ext/java/javolution/lang/ValueType.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-commons/src/ext/java/javolution/lang/ValueType.java b/commons/marmotta-commons/src/ext/java/javolution/lang/ValueType.java
new file mode 100644
index 0000000..d26cb01
--- /dev/null
+++ b/commons/marmotta-commons/src/ext/java/javolution/lang/ValueType.java
@@ -0,0 +1,71 @@
+/*
+ * Javolution - Java(TM) Solution for Real-Time and Embedded Systems
+ * Copyright (C) 2007 - 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 {@link Immutable immutable} object which can be manipulated by value; 
+ *     a JVM implementation may allocate instances of this class on the stack.</p>
+ *     
+ * <p> {@link ValueType ValueType} extends {@link Immutable} with the additional
+ *     constraint that its value is itself (the {@link #value value} method 
+ *     returns {@code this}).
+ * [code]
+ * public final class Complex implements ValueType<Complex> { // Complex is immutable.
+ *     public class Variable implements Immutable<Complex> { // Variable has immutable value.
+ *         private Variable() {} // Do not provide access outside.
+ *         public Variable add(Complex that) {
+ *              real += that.real;
+ *              imaginary += that.imaginary;
+ *              return this;
+ *         }
+ *         @Override
+ *         public Complex value() { return new Complex(real, imaginary); }
+ *     }
+ *     private double real, imaginary;
+ *     public Complex(double real, double imaginary) {
+ *         this.real = real;
+ *         this.imaginary = imaginary;
+ *     }
+ *     public Complex plus(Complex that) { 
+ *         return new Complex(this.real + that.real, this.imaginary + this.imaginary);
+ *     }
+ *     @Override
+ *     public Complex value() { return this; } // As per ValueType contract.
+ *     public Variable newVariable() { return new Complex(real, imaginary).new Variable(); }
+ * }
+ * // Calculates the sum of an array of complex values. 
+ * Complex[] values = ...;
+ * 
+ * // Standard calculations (stresses GC due to the high number of objects allocated).
+ * Complex sum = Complex.ZERO;
+ * for (Complex c : values) sum = sum.plus(c);
+ * 
+ * // Using variables, 2-3x faster and almost no garbage generated !
+ * Complex.Variable sum = Complex.ZERO.newVariable();
+ * for (Complex c : values) sum.add(c); 
+ * [/code]</p>
+ *      
+ * <p> <b>Note:</b> "Stack" allocation is not the only optimization that a VM 
+ *     can do on {@link ValueType}. The VM might decide not to perform any 
+ *     allocation at all and store values directly in registers.</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.
+ */
+public interface ValueType<T> extends Immutable<T> { 
+    
+    /**
+     * Returns {@code this}.
+     */
+    @Override
+    T value();
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/marmotta-commons/src/ext/java/javolution/lang/package-info.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-commons/src/ext/java/javolution/lang/package-info.java b/commons/marmotta-commons/src/ext/java/javolution/lang/package-info.java
new file mode 100644
index 0000000..0e2643e
--- /dev/null
+++ b/commons/marmotta-commons/src/ext/java/javolution/lang/package-info.java
@@ -0,0 +1,5 @@
+/**
+<p> Fundamental classes, interfaces and annotations. </p>
+ */
+package javolution.lang;
+


[013/100] [abbrv] [partial] Reverting the erroneous merge by Sebastian according to the instructions in INFRA-6876

Posted by wi...@apache.org.
http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldcache/ldcache-backend-kiwi/src/main/resources/org/apache/marmotta/kiwi/persistence/h2/create_ldcache_tables.sql
----------------------------------------------------------------------
diff --git a/libraries/ldcache/ldcache-backend-kiwi/src/main/resources/org/apache/marmotta/kiwi/persistence/h2/create_ldcache_tables.sql b/libraries/ldcache/ldcache-backend-kiwi/src/main/resources/org/apache/marmotta/kiwi/persistence/h2/create_ldcache_tables.sql
index 05a4b7c..08b2276 100644
--- a/libraries/ldcache/ldcache-backend-kiwi/src/main/resources/org/apache/marmotta/kiwi/persistence/h2/create_ldcache_tables.sql
+++ b/libraries/ldcache/ldcache-backend-kiwi/src/main/resources/org/apache/marmotta/kiwi/persistence/h2/create_ldcache_tables.sql
@@ -20,6 +20,7 @@ CREATE TABLE ldcache_entries (
   expires_at   timestamp  NOT NULL,
   resource_id  bigint     NOT NULL REFERENCES nodes(id),
   update_count int        NOT NULL DEFAULT 0,
+  triple_count int        NOT NULL DEFAULT 0,
   PRIMARY KEY(id)
 );
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldcache/ldcache-backend-kiwi/src/main/resources/org/apache/marmotta/kiwi/persistence/h2/statements.properties
----------------------------------------------------------------------
diff --git a/libraries/ldcache/ldcache-backend-kiwi/src/main/resources/org/apache/marmotta/kiwi/persistence/h2/statements.properties b/libraries/ldcache/ldcache-backend-kiwi/src/main/resources/org/apache/marmotta/kiwi/persistence/h2/statements.properties
index 8abd8c1..e8af848 100644
--- a/libraries/ldcache/ldcache-backend-kiwi/src/main/resources/org/apache/marmotta/kiwi/persistence/h2/statements.properties
+++ b/libraries/ldcache/ldcache-backend-kiwi/src/main/resources/org/apache/marmotta/kiwi/persistence/h2/statements.properties
@@ -19,13 +19,13 @@
 # get sequence numbers
 seq.ldcache           = SELECT nextval('seq_ldcache')
 
-load.entry_by_id      = SELECT id,retrieved_at,expires_at,resource_id,update_count FROM ldcache_entries WHERE id = ?
-load.entry_by_uri     = SELECT E.id,retrieved_at,expires_at,resource_id,update_count FROM ldcache_entries E, nodes N WHERE e.resource_id = N.id AND N.ntype = 'uri' and N.svalue = ?
+load.entry_by_id      = SELECT id,retrieved_at,expires_at,resource_id,update_count,triple_count FROM ldcache_entries WHERE id = ?
+load.entry_by_uri     = SELECT E.id,retrieved_at,expires_at,resource_id,update_count,triple_count FROM ldcache_entries E, nodes N WHERE e.resource_id = N.id AND N.ntype = 'uri' and N.svalue = ?
 
 # store ldcache entry information
-store.entry           = INSERT INTO ldcache_entries (id,retrieved_at,expires_at,resource_id,update_count) VALUES (?,?,?,?,?)
+store.entry           = INSERT INTO ldcache_entries (id,retrieved_at,expires_at,resource_id,update_count,triple_count) VALUES (?,?,?,?,?,?)
 delete.entry          = DELETE FROM ldcache_entries WHERE id = ?
 delete.entry_by_uri   = DELETE FROM ldcache_entries WHERE resource_id IN (SELECT id FROM nodes WHERE ntype='uri' AND svalue = ?)
 
-query.entries_expired = SELECT id,retrieved_at,expires_at,resource_id,update_count FROM ldcache_entries WHERE expires_at < now() ORDER BY retrieved_at ASC
-query.entries_all     = SELECT id,retrieved_at,expires_at,resource_id,update_count FROM ldcache_entries ORDER BY retrieved_at ASC
+query.entries_expired = SELECT id,retrieved_at,expires_at,resource_id,update_count,triple_count FROM ldcache_entries WHERE expires_at < now() ORDER BY retrieved_at ASC
+query.entries_all     = SELECT id,retrieved_at,expires_at,resource_id,update_count,triple_count FROM ldcache_entries ORDER BY retrieved_at ASC

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldcache/ldcache-backend-kiwi/src/main/resources/org/apache/marmotta/kiwi/persistence/h2/upgrade_ldcache_001_002.sql
----------------------------------------------------------------------
diff --git a/libraries/ldcache/ldcache-backend-kiwi/src/main/resources/org/apache/marmotta/kiwi/persistence/h2/upgrade_ldcache_001_002.sql b/libraries/ldcache/ldcache-backend-kiwi/src/main/resources/org/apache/marmotta/kiwi/persistence/h2/upgrade_ldcache_001_002.sql
new file mode 100644
index 0000000..d9b9966
--- /dev/null
+++ b/libraries/ldcache/ldcache-backend-kiwi/src/main/resources/org/apache/marmotta/kiwi/persistence/h2/upgrade_ldcache_001_002.sql
@@ -0,0 +1,19 @@
+-- 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.
+
+ALTER TABLE ldcache_entries ADD COLUMN triple_count int NOT NULL DEFAULT 0;
+UPDATE
+  ldcache_entries
+SET triple_count = (SELECT count(*) as numTriples FROM triples WHERE subject = ldcache_entries.resource_id and deleted = false)
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldcache/ldcache-backend-kiwi/src/main/resources/org/apache/marmotta/kiwi/persistence/mysql/create_ldcache_tables.sql
----------------------------------------------------------------------
diff --git a/libraries/ldcache/ldcache-backend-kiwi/src/main/resources/org/apache/marmotta/kiwi/persistence/mysql/create_ldcache_tables.sql b/libraries/ldcache/ldcache-backend-kiwi/src/main/resources/org/apache/marmotta/kiwi/persistence/mysql/create_ldcache_tables.sql
index c9d6e3b..b1717af 100644
--- a/libraries/ldcache/ldcache-backend-kiwi/src/main/resources/org/apache/marmotta/kiwi/persistence/mysql/create_ldcache_tables.sql
+++ b/libraries/ldcache/ldcache-backend-kiwi/src/main/resources/org/apache/marmotta/kiwi/persistence/mysql/create_ldcache_tables.sql
@@ -21,6 +21,7 @@ CREATE TABLE ldcache_entries (
   expires_at   timestamp  NOT NULL,
   resource_id  bigint     NOT NULL REFERENCES nodes(id),
   update_count int        NOT NULL DEFAULT 0,
+  triple_count int        NOT NULL DEFAULT 0,
   PRIMARY KEY(id)
 );
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldcache/ldcache-backend-kiwi/src/main/resources/org/apache/marmotta/kiwi/persistence/mysql/statements.properties
----------------------------------------------------------------------
diff --git a/libraries/ldcache/ldcache-backend-kiwi/src/main/resources/org/apache/marmotta/kiwi/persistence/mysql/statements.properties b/libraries/ldcache/ldcache-backend-kiwi/src/main/resources/org/apache/marmotta/kiwi/persistence/mysql/statements.properties
index 6a0ee54..95faac7 100644
--- a/libraries/ldcache/ldcache-backend-kiwi/src/main/resources/org/apache/marmotta/kiwi/persistence/mysql/statements.properties
+++ b/libraries/ldcache/ldcache-backend-kiwi/src/main/resources/org/apache/marmotta/kiwi/persistence/mysql/statements.properties
@@ -19,14 +19,15 @@
 # get sequence numbers
 seq.ldcache.prep         = UPDATE seq_ldcache SET id=LAST_INSERT_ID(id+1);
 seq.ldcache              = SELECT LAST_INSERT_ID();
+seq.ldcache.set          = UPDATE seq_ldcache SET id=?;
 
-load.entry_by_id      = SELECT id,retrieved_at,expires_at,resource_id,update_count FROM ldcache_entries WHERE id = ?
-load.entry_by_uri     = SELECT E.id,retrieved_at,expires_at,resource_id,update_count FROM ldcache_entries E, nodes N WHERE e.resource_id = N.id AND N.ntype = 'uri' and N.svalue = ?
+load.entry_by_id      = SELECT id,retrieved_at,expires_at,resource_id,update_count,triple_count FROM ldcache_entries WHERE id = ?
+load.entry_by_uri     = SELECT E.id,retrieved_at,expires_at,resource_id,update_count,triple_count FROM ldcache_entries E, nodes N WHERE e.resource_id = N.id AND N.ntype = 'uri' and N.svalue = ?
 
 # store ldcache entry information
-store.entry           = INSERT INTO ldcache_entries (id,retrieved_at,expires_at,resource_id,update_count) VALUES (?,?,?,?,?)
+store.entry           = INSERT INTO ldcache_entries (id,retrieved_at,expires_at,resource_id,update_count,triple_count) VALUES (?,?,?,?,?,?)
 delete.entry          = DELETE FROM ldcache_entries WHERE id = ?
 delete.entry_by_uri   = DELETE FROM ldcache_entries WHERE resource_id IN (SELECT id FROM nodes WHERE ntype='uri' AND svalue = ?)
 
-query.entries_expired = SELECT id,retrieved_at,expires_at,resource_id,update_count FROM ldcache_entries WHERE expires_at < now() ORDER BY retrieved_at ASC
-query.entries_all     = SELECT id,retrieved_at,expires_at,resource_id,update_count FROM ldcache_entries ORDER BY retrieved_at ASC
+query.entries_expired = SELECT id,retrieved_at,expires_at,resource_id,update_count,triple_count FROM ldcache_entries WHERE expires_at < now() ORDER BY retrieved_at ASC
+query.entries_all     = SELECT id,retrieved_at,expires_at,resource_id,update_count,triple_count FROM ldcache_entries ORDER BY retrieved_at ASC

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldcache/ldcache-backend-kiwi/src/main/resources/org/apache/marmotta/kiwi/persistence/mysql/upgrade_ldcache_001_002.sql
----------------------------------------------------------------------
diff --git a/libraries/ldcache/ldcache-backend-kiwi/src/main/resources/org/apache/marmotta/kiwi/persistence/mysql/upgrade_ldcache_001_002.sql b/libraries/ldcache/ldcache-backend-kiwi/src/main/resources/org/apache/marmotta/kiwi/persistence/mysql/upgrade_ldcache_001_002.sql
new file mode 100644
index 0000000..d9b9966
--- /dev/null
+++ b/libraries/ldcache/ldcache-backend-kiwi/src/main/resources/org/apache/marmotta/kiwi/persistence/mysql/upgrade_ldcache_001_002.sql
@@ -0,0 +1,19 @@
+-- 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.
+
+ALTER TABLE ldcache_entries ADD COLUMN triple_count int NOT NULL DEFAULT 0;
+UPDATE
+  ldcache_entries
+SET triple_count = (SELECT count(*) as numTriples FROM triples WHERE subject = ldcache_entries.resource_id and deleted = false)
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldcache/ldcache-backend-kiwi/src/main/resources/org/apache/marmotta/kiwi/persistence/pgsql/create_ldcache_tables.sql
----------------------------------------------------------------------
diff --git a/libraries/ldcache/ldcache-backend-kiwi/src/main/resources/org/apache/marmotta/kiwi/persistence/pgsql/create_ldcache_tables.sql b/libraries/ldcache/ldcache-backend-kiwi/src/main/resources/org/apache/marmotta/kiwi/persistence/pgsql/create_ldcache_tables.sql
index 05a4b7c..08b2276 100644
--- a/libraries/ldcache/ldcache-backend-kiwi/src/main/resources/org/apache/marmotta/kiwi/persistence/pgsql/create_ldcache_tables.sql
+++ b/libraries/ldcache/ldcache-backend-kiwi/src/main/resources/org/apache/marmotta/kiwi/persistence/pgsql/create_ldcache_tables.sql
@@ -20,6 +20,7 @@ CREATE TABLE ldcache_entries (
   expires_at   timestamp  NOT NULL,
   resource_id  bigint     NOT NULL REFERENCES nodes(id),
   update_count int        NOT NULL DEFAULT 0,
+  triple_count int        NOT NULL DEFAULT 0,
   PRIMARY KEY(id)
 );
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldcache/ldcache-backend-kiwi/src/main/resources/org/apache/marmotta/kiwi/persistence/pgsql/statements.properties
----------------------------------------------------------------------
diff --git a/libraries/ldcache/ldcache-backend-kiwi/src/main/resources/org/apache/marmotta/kiwi/persistence/pgsql/statements.properties b/libraries/ldcache/ldcache-backend-kiwi/src/main/resources/org/apache/marmotta/kiwi/persistence/pgsql/statements.properties
index 8abd8c1..d6cbb1f 100644
--- a/libraries/ldcache/ldcache-backend-kiwi/src/main/resources/org/apache/marmotta/kiwi/persistence/pgsql/statements.properties
+++ b/libraries/ldcache/ldcache-backend-kiwi/src/main/resources/org/apache/marmotta/kiwi/persistence/pgsql/statements.properties
@@ -18,14 +18,15 @@
 
 # get sequence numbers
 seq.ldcache           = SELECT nextval('seq_ldcache')
+seq.ldcache.set       = SELECT setval('seq_ldcache',?)
 
-load.entry_by_id      = SELECT id,retrieved_at,expires_at,resource_id,update_count FROM ldcache_entries WHERE id = ?
-load.entry_by_uri     = SELECT E.id,retrieved_at,expires_at,resource_id,update_count FROM ldcache_entries E, nodes N WHERE e.resource_id = N.id AND N.ntype = 'uri' and N.svalue = ?
+load.entry_by_id      = SELECT id,retrieved_at,expires_at,resource_id,update_count,triple_count FROM ldcache_entries WHERE id = ?
+load.entry_by_uri     = SELECT E.id,retrieved_at,expires_at,resource_id,update_count,triple_count FROM ldcache_entries E, nodes N WHERE e.resource_id = N.id AND N.ntype = 'uri' and N.svalue = ?
 
 # store ldcache entry information
-store.entry           = INSERT INTO ldcache_entries (id,retrieved_at,expires_at,resource_id,update_count) VALUES (?,?,?,?,?)
+store.entry           = INSERT INTO ldcache_entries (id,retrieved_at,expires_at,resource_id,update_count,triple_count) VALUES (?,?,?,?,?,?)
 delete.entry          = DELETE FROM ldcache_entries WHERE id = ?
 delete.entry_by_uri   = DELETE FROM ldcache_entries WHERE resource_id IN (SELECT id FROM nodes WHERE ntype='uri' AND svalue = ?)
 
-query.entries_expired = SELECT id,retrieved_at,expires_at,resource_id,update_count FROM ldcache_entries WHERE expires_at < now() ORDER BY retrieved_at ASC
-query.entries_all     = SELECT id,retrieved_at,expires_at,resource_id,update_count FROM ldcache_entries ORDER BY retrieved_at ASC
+query.entries_expired = SELECT id,retrieved_at,expires_at,resource_id,update_count,triple_count FROM ldcache_entries WHERE expires_at < now() ORDER BY retrieved_at ASC
+query.entries_all     = SELECT id,retrieved_at,expires_at,resource_id,update_count,triple_count FROM ldcache_entries ORDER BY retrieved_at ASC

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldcache/ldcache-backend-kiwi/src/main/resources/org/apache/marmotta/kiwi/persistence/pgsql/upgrade_ldcache_001_002.sql
----------------------------------------------------------------------
diff --git a/libraries/ldcache/ldcache-backend-kiwi/src/main/resources/org/apache/marmotta/kiwi/persistence/pgsql/upgrade_ldcache_001_002.sql b/libraries/ldcache/ldcache-backend-kiwi/src/main/resources/org/apache/marmotta/kiwi/persistence/pgsql/upgrade_ldcache_001_002.sql
new file mode 100644
index 0000000..d9b9966
--- /dev/null
+++ b/libraries/ldcache/ldcache-backend-kiwi/src/main/resources/org/apache/marmotta/kiwi/persistence/pgsql/upgrade_ldcache_001_002.sql
@@ -0,0 +1,19 @@
+-- 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.
+
+ALTER TABLE ldcache_entries ADD COLUMN triple_count int NOT NULL DEFAULT 0;
+UPDATE
+  ldcache_entries
+SET triple_count = (SELECT count(*) as numTriples FROM triples WHERE subject = ldcache_entries.resource_id and deleted = false)
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldcache/ldcache-backend-kiwi/src/test/java/org/apache/marmotta/ldcache/backend/kiwi/test/LDCacheBackendTest.java
----------------------------------------------------------------------
diff --git a/libraries/ldcache/ldcache-backend-kiwi/src/test/java/org/apache/marmotta/ldcache/backend/kiwi/test/LDCacheBackendTest.java b/libraries/ldcache/ldcache-backend-kiwi/src/test/java/org/apache/marmotta/ldcache/backend/kiwi/test/LDCacheBackendTest.java
index bfd12c9..e0ab3e8 100644
--- a/libraries/ldcache/ldcache-backend-kiwi/src/test/java/org/apache/marmotta/ldcache/backend/kiwi/test/LDCacheBackendTest.java
+++ b/libraries/ldcache/ldcache-backend-kiwi/src/test/java/org/apache/marmotta/ldcache/backend/kiwi/test/LDCacheBackendTest.java
@@ -18,7 +18,7 @@
 package org.apache.marmotta.ldcache.backend.kiwi.test;
 
 import info.aduna.iteration.CloseableIteration;
-import org.apache.commons.lang.RandomStringUtils;
+import org.apache.commons.lang3.RandomStringUtils;
 import org.apache.marmotta.kiwi.persistence.KiWiDialect;
 import org.apache.marmotta.kiwi.persistence.h2.H2Dialect;
 import org.apache.marmotta.kiwi.persistence.mysql.MySQLDialect;
@@ -249,9 +249,12 @@ public class LDCacheBackendTest {
             entry1.setLastRetrieved(new Date());
             entry1.setUpdateCount(1);
             entry1.setResource(subject1);
+            entry1.setTripleCount(1);
             con.addCacheEntry(subject1, entry1);
             con.commit();
 
+            Assert.assertTrue(backend.isCached(subject1.stringValue()));
+            Assert.assertFalse(backend.isCached(subject2.stringValue()));
             Assert.assertEquals(1,asList(backend.listCacheEntries()).size());
             Assert.assertEquals(0,asList(backend.listExpiredEntries()).size());
 
@@ -261,10 +264,13 @@ public class LDCacheBackendTest {
             entry2.setLastRetrieved(new Date());
             entry2.setUpdateCount(1);
             entry2.setResource(subject2);
+            entry2.setTripleCount(1);
             con.addCacheEntry(subject2,entry2);
 
             con.commit();
 
+            Assert.assertTrue(backend.isCached(subject1.stringValue()));
+            Assert.assertTrue(backend.isCached(subject2.stringValue()));
             Assert.assertEquals(2,asList(backend.listCacheEntries()).size());
             Assert.assertEquals(1,asList(backend.listExpiredEntries()).size());
 
@@ -272,6 +278,8 @@ public class LDCacheBackendTest {
             con.removeCacheEntry(subject1);
             con.commit();
 
+            Assert.assertFalse(backend.isCached(subject1.stringValue()));
+            Assert.assertTrue(backend.isCached(subject2.stringValue()));
             Assert.assertEquals(1,asList(backend.listCacheEntries()).size());
             Assert.assertEquals(1,asList(backend.listExpiredEntries()).size());
         } catch(RepositoryException ex) {

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldcache/ldcache-backend-kiwi/src/test/java/org/apache/marmotta/ldcache/backend/kiwi/test/LDCachePersistenceTest.java
----------------------------------------------------------------------
diff --git a/libraries/ldcache/ldcache-backend-kiwi/src/test/java/org/apache/marmotta/ldcache/backend/kiwi/test/LDCachePersistenceTest.java b/libraries/ldcache/ldcache-backend-kiwi/src/test/java/org/apache/marmotta/ldcache/backend/kiwi/test/LDCachePersistenceTest.java
index c25f166..d066405 100644
--- a/libraries/ldcache/ldcache-backend-kiwi/src/test/java/org/apache/marmotta/ldcache/backend/kiwi/test/LDCachePersistenceTest.java
+++ b/libraries/ldcache/ldcache-backend-kiwi/src/test/java/org/apache/marmotta/ldcache/backend/kiwi/test/LDCachePersistenceTest.java
@@ -18,7 +18,7 @@
 package org.apache.marmotta.ldcache.backend.kiwi.test;
 
 import info.aduna.iteration.CloseableIteration;
-import org.apache.commons.lang.RandomStringUtils;
+import org.apache.commons.lang3.RandomStringUtils;
 import org.apache.marmotta.kiwi.model.rdf.KiWiUriResource;
 import org.apache.marmotta.kiwi.persistence.KiWiDialect;
 import org.apache.marmotta.kiwi.persistence.KiWiPersistence;
@@ -136,6 +136,7 @@ public class LDCachePersistenceTest {
     @Before
     public void initDatabase() throws SQLException {
         persistence = new KiWiPersistence("test",jdbcUrl,jdbcUser,jdbcPass,dialect);
+        persistence.initialise();
         persistence.initDatabase();
 
         vpersistence = new LDCachingKiWiPersistence(persistence);
@@ -170,7 +171,7 @@ public class LDCachePersistenceTest {
         LDCachingKiWiPersistenceConnection connection = vpersistence.getConnection();
         try {
             Assert.assertThat(connection.getDatabaseTables(), hasItems("ldcache_entries"));
-            Assert.assertEquals(1, connection.getDatabaseVersion());
+            Assert.assertEquals(2, connection.getDatabaseVersion());
 
             connection.commit();
         } finally {
@@ -193,6 +194,7 @@ public class LDCachePersistenceTest {
             entry1.setLastRetrieved(new Date());
             entry1.setUpdateCount(1);
             entry1.setResource(subject1);
+            entry1.setTripleCount(1);
             connection.storeCacheEntry(entry1);
 
             connection.commit();
@@ -205,6 +207,7 @@ public class LDCachePersistenceTest {
             entry2.setLastRetrieved(new Date());
             entry2.setUpdateCount(1);
             entry2.setResource(subject2);
+            entry2.setTripleCount(1);
             connection.storeCacheEntry(entry2);
 
             connection.commit();
@@ -252,6 +255,7 @@ public class LDCachePersistenceTest {
             entry1.setLastRetrieved(new Date());
             entry1.setUpdateCount(1);
             entry1.setResource(subject1);
+            entry1.setTripleCount(1);
             connection.storeCacheEntry(entry1);
 
             KiWiCacheEntry entry2 = new KiWiCacheEntry();
@@ -259,6 +263,7 @@ public class LDCachePersistenceTest {
             entry2.setLastRetrieved(new Date());
             entry2.setUpdateCount(1);
             entry2.setResource(subject2);
+            entry2.setTripleCount(1);
             connection.storeCacheEntry(entry2);
 
             connection.commit();

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldcache/ldcache-backend-mapdb/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldcache/ldcache-backend-mapdb/pom.xml b/libraries/ldcache/ldcache-backend-mapdb/pom.xml
index ea83c15..2b66c90 100644
--- a/libraries/ldcache/ldcache-backend-mapdb/pom.xml
+++ b/libraries/ldcache/ldcache-backend-mapdb/pom.xml
@@ -23,7 +23,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</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldcache/ldcache-core/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldcache/ldcache-core/pom.xml b/libraries/ldcache/ldcache-core/pom.xml
index 801f422..6b2c713 100644
--- a/libraries/ldcache/ldcache-core/pom.xml
+++ b/libraries/ldcache/ldcache-core/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>
 
@@ -29,6 +29,27 @@
     <name>LDCache: Core Library</name>
 
     <build>
+        <pluginManagement>
+            <plugins>
+                <plugin> <!-- generate JRebel Configuration -->
+                    <groupId>org.zeroturnaround</groupId>
+                    <artifactId>jrebel-maven-plugin</artifactId>
+                    <executions>
+                        <execution>
+                            <id>generate-rebel-xml</id>
+                            <phase>process-resources</phase>
+                            <goals>
+                                <goal>generate</goal>
+                            </goals>
+                        </execution>
+                    </executions>
+                    <configuration>
+                        <relativePath>../../../</relativePath>
+                        <rootPath>$${rebel.root}</rootPath>
+                    </configuration>
+                </plugin>
+            </plugins>
+        </pluginManagement>
         <plugins>
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
@@ -77,8 +98,8 @@
             <artifactId>marmotta-commons</artifactId>
         </dependency>
         <dependency>
-            <groupId>commons-lang</groupId>
-            <artifactId>commons-lang</artifactId>
+            <groupId>org.apache.commons</groupId>
+            <artifactId>commons-lang3</artifactId>
         </dependency>
 
         <!-- LDClient -->
@@ -152,7 +173,7 @@
             <scope>test</scope>
         </dependency>
         <dependency>
-            <groupId>org.jumpmind.symmetric.jdbc</groupId>
+            <groupId>org.postgresql</groupId>
             <artifactId>postgresql</artifactId>
             <scope>test</scope>
         </dependency>

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldcache/ldcache-core/src/main/java/org/apache/marmotta/ldcache/services/LDCache.java
----------------------------------------------------------------------
diff --git a/libraries/ldcache/ldcache-core/src/main/java/org/apache/marmotta/ldcache/services/LDCache.java b/libraries/ldcache/ldcache-core/src/main/java/org/apache/marmotta/ldcache/services/LDCache.java
index 89ee13b..d28a571 100644
--- a/libraries/ldcache/ldcache-core/src/main/java/org/apache/marmotta/ldcache/services/LDCache.java
+++ b/libraries/ldcache/ldcache-core/src/main/java/org/apache/marmotta/ldcache/services/LDCache.java
@@ -18,6 +18,7 @@
 package org.apache.marmotta.ldcache.services;
 
 import info.aduna.iteration.CloseableIteration;
+import org.apache.marmotta.commons.locking.ObjectLocks;
 import org.apache.marmotta.ldcache.api.LDCachingBackend;
 import org.apache.marmotta.ldcache.api.LDCachingConnection;
 import org.apache.marmotta.ldcache.api.LDCachingService;
@@ -27,7 +28,6 @@ import org.apache.marmotta.ldclient.api.ldclient.LDClientService;
 import org.apache.marmotta.ldclient.exception.DataRetrievalException;
 import org.apache.marmotta.ldclient.model.ClientResponse;
 import org.apache.marmotta.ldclient.services.ldclient.LDClient;
-import org.openrdf.model.Resource;
 import org.openrdf.model.Statement;
 import org.openrdf.model.URI;
 import org.openrdf.repository.RepositoryConnection;
@@ -37,8 +37,6 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import java.util.Date;
-import java.util.HashMap;
-import java.util.concurrent.locks.ReentrantLock;
 import java.util.concurrent.locks.ReentrantReadWriteLock;
 
 /**
@@ -54,7 +52,7 @@ public class LDCache implements LDCachingService {
 
 
     // lock a resource while refreshing it so that not several threads trigger a refresh at the same time
-    private HashMap<Resource,ReentrantLock> resourceLocks;
+    private ObjectLocks resourceLocks;
 
     private LDClientService  ldclient;
 
@@ -73,7 +71,7 @@ public class LDCache implements LDCachingService {
     public LDCache(CacheConfiguration config, LDCachingBackend backend) {
         log.info("Linked Data Caching Service initialising ...");
 
-        this.resourceLocks = new HashMap<Resource, ReentrantLock>();
+        this.resourceLocks = new ObjectLocks();
         this.backend  = backend;
         this.ldclient = new LDClient(config.getClientConfiguration());
         this.config   = config;
@@ -127,6 +125,31 @@ public class LDCache implements LDCachingService {
         return backend.listExpiredEntries();
     }
 
+
+    /**
+     * Return true if the resource is a cached resource.
+     *
+     * @param resourceUri
+     * @return
+     * @throws RepositoryException
+     */
+    public boolean isCached(String resourceUri) throws RepositoryException {
+        // if there is no cache entry, then return false in any case
+        if(!backend.isCached(resourceUri)) {
+            return false;
+        } else {
+            // else list all cached triples - if there are none, the resource is not cached (e.g. blacklist or no LD resource)
+            RepositoryConnection con = backend.getCacheConnection(resourceUri);
+            try {
+                con.begin();
+                return con.hasStatement(con.getValueFactory().createURI(resourceUri), null, null, false);
+            } finally {
+                con.commit();
+                con.close();
+            }
+        }
+    }
+
     /**
      * Manually expire the caching information for the given resource. The resource will be
      * re-retrieved upon the next access.
@@ -182,7 +205,7 @@ public class LDCache implements LDCachingService {
      */
     @Override
     public void refreshResource(URI resource, boolean forceRefresh) {
-        final ReentrantLock lock = lockResource(resource);
+        resourceLocks.lock(resource.stringValue());
         try {
             LDCachingConnection cacheConnection = backend.getCacheConnection(resource.stringValue());
             CacheEntry entry = null;
@@ -225,7 +248,7 @@ public class LDCache implements LDCachingService {
 
                         cacheConnection1.remove(subject, null, null);
 
-
+                        int count = 0;
                         RepositoryResult<Statement> triples = respConnection.getStatements(null,null,null,true);
                         while(triples.hasNext()) {
                             Statement triple = triples.next();
@@ -234,6 +257,7 @@ public class LDCache implements LDCachingService {
                             } catch (RuntimeException ex) {
                                 log.warn("not adding triple {}: an exception occurred ({})",triple,ex.getMessage());
                             }
+                            count++;
                         }
                         triples.close();
                         respConnection.close();
@@ -247,6 +271,7 @@ public class LDCache implements LDCachingService {
                         } else {
                             newEntry.setUpdateCount(1);
                         }
+                        newEntry.setTripleCount(count);
 
                         cacheConnection1.removeCacheEntry(resource);
                         cacheConnection1.addCacheEntry(resource, newEntry);
@@ -270,6 +295,7 @@ public class LDCache implements LDCachingService {
                 } else {
                     newEntry.setUpdateCount(1);
                 }
+                newEntry.setTripleCount(0);
 
                 LDCachingConnection cacheConnection2 = backend.getCacheConnection(resource.stringValue());
                 cacheConnection2.begin();
@@ -293,7 +319,7 @@ public class LDCache implements LDCachingService {
         } catch (RepositoryException e) {
             log.error("repository exception while obtaining cache connection",e);
         } finally {
-            unlockResource(resource, lock);
+            resourceLocks.unlock(resource.stringValue());
         }
 
     }
@@ -390,38 +416,4 @@ public class LDCache implements LDCachingService {
     public LDClientService getLDClient() {
         return ldclient;
     }
-
-    private ReentrantLock lockResource(final URI resource) {
-        ReentrantLock lock;
-        synchronized (resourceLocks) {
-            lock = resourceLocks.get(resource);
-            if(lock == null) {
-                lock = new ReentrantLock();
-                resourceLocks.put(resource,lock);
-            }
-        }
-        lock.lock();
-        return lock;
-    }
-
-    private void unlockResource(final URI resource, final ReentrantLock lock) {
-        synchronized (resourceLocks) {
-            // lock = resourceLocks.get(resource);
-            if (lock != null) {
-                if (!lock.hasQueuedThreads()) {
-                    resourceLocks.remove(resource);
-                }
-            }
-        }
-        if (lock != null) {
-            try {
-                lock.unlock();
-            } catch (IllegalMonitorStateException e) {
-                log.error("Could not release lock for {} (Thread: {}, Lock: {})", resource, Thread.currentThread().getName(), lock.toString() );
-                throw e;
-            }
-
-        }
-    }
-
 }

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldcache/ldcache-core/src/test/java/org/apache/marmotta/ldcache/services/test/LDCacheKiWiTest.java
----------------------------------------------------------------------
diff --git a/libraries/ldcache/ldcache-core/src/test/java/org/apache/marmotta/ldcache/services/test/LDCacheKiWiTest.java b/libraries/ldcache/ldcache-core/src/test/java/org/apache/marmotta/ldcache/services/test/LDCacheKiWiTest.java
index be5d789..b22b600 100644
--- a/libraries/ldcache/ldcache-core/src/test/java/org/apache/marmotta/ldcache/services/test/LDCacheKiWiTest.java
+++ b/libraries/ldcache/ldcache-core/src/test/java/org/apache/marmotta/ldcache/services/test/LDCacheKiWiTest.java
@@ -274,6 +274,11 @@ public class LDCacheKiWiTest {
                 Thread.sleep(1000);
             } catch (InterruptedException e) {
             }
+        } else {
+            try {
+                Thread.sleep(100);
+            } catch (InterruptedException e) {
+            }
         }
     }
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldcache/ldcache-core/src/test/java/org/apache/marmotta/ldcache/services/test/dummy/DummyProvider.java
----------------------------------------------------------------------
diff --git a/libraries/ldcache/ldcache-core/src/test/java/org/apache/marmotta/ldcache/services/test/dummy/DummyProvider.java b/libraries/ldcache/ldcache-core/src/test/java/org/apache/marmotta/ldcache/services/test/dummy/DummyProvider.java
index ca1b451..4b6f92a 100644
--- a/libraries/ldcache/ldcache-core/src/test/java/org/apache/marmotta/ldcache/services/test/dummy/DummyProvider.java
+++ b/libraries/ldcache/ldcache-core/src/test/java/org/apache/marmotta/ldcache/services/test/dummy/DummyProvider.java
@@ -69,7 +69,7 @@ public class DummyProvider implements DataProvider {
                 con.close();
             }
 
-            ClientResponse response = new ClientResponse(triples);
+            ClientResponse response = new ClientResponse(200, triples);
 
             return response;
         } catch (RepositoryException e) {

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldcache/ldcache-sail-generic/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldcache/ldcache-sail-generic/pom.xml b/libraries/ldcache/ldcache-sail-generic/pom.xml
index 6e72dbd..8ed617e 100644
--- a/libraries/ldcache/ldcache-sail-generic/pom.xml
+++ b/libraries/ldcache/ldcache-sail-generic/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>
 
@@ -33,6 +33,30 @@
         on demand when needed. Can be wrapped around other Sesame SAILs.
     </description>
 
+    <build>
+        <pluginManagement>
+            <plugins>
+                <plugin> <!-- generate JRebel Configuration -->
+                    <groupId>org.zeroturnaround</groupId>
+                    <artifactId>jrebel-maven-plugin</artifactId>
+                    <executions>
+                        <execution>
+                            <id>generate-rebel-xml</id>
+                            <phase>process-resources</phase>
+                            <goals>
+                                <goal>generate</goal>
+                            </goals>
+                        </execution>
+                    </executions>
+                    <configuration>
+                        <relativePath>../../../</relativePath>
+                        <rootPath>$${rebel.root}</rootPath>
+                    </configuration>
+                </plugin>
+            </plugins>
+        </pluginManagement>
+    </build>
+
     <dependencies>
         <dependency>
             <groupId>org.openrdf.sesame</groupId>

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldcache/ldcache-sail-generic/src/test/java/org/apache/marmotta/ldcache/sail/test/dummy/DummyProvider.java
----------------------------------------------------------------------
diff --git a/libraries/ldcache/ldcache-sail-generic/src/test/java/org/apache/marmotta/ldcache/sail/test/dummy/DummyProvider.java b/libraries/ldcache/ldcache-sail-generic/src/test/java/org/apache/marmotta/ldcache/sail/test/dummy/DummyProvider.java
index cd58e55..15f3d81 100644
--- a/libraries/ldcache/ldcache-sail-generic/src/test/java/org/apache/marmotta/ldcache/sail/test/dummy/DummyProvider.java
+++ b/libraries/ldcache/ldcache-sail-generic/src/test/java/org/apache/marmotta/ldcache/sail/test/dummy/DummyProvider.java
@@ -69,7 +69,7 @@ public class DummyProvider implements DataProvider {
                 con.close();
             }
 
-            ClientResponse response = new ClientResponse(triples);
+            ClientResponse response = new ClientResponse(200, triples);
 
             return response;
         } catch (RepositoryException e) {

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldcache/ldcache-sail-kiwi/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldcache/ldcache-sail-kiwi/pom.xml b/libraries/ldcache/ldcache-sail-kiwi/pom.xml
index 6a875af..8c755ea 100644
--- a/libraries/ldcache/ldcache-sail-kiwi/pom.xml
+++ b/libraries/ldcache/ldcache-sail-kiwi/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>
 
@@ -35,6 +35,27 @@
 
 
     <build>
+        <pluginManagement>
+            <plugins>
+                <plugin> <!-- generate JRebel Configuration -->
+                    <groupId>org.zeroturnaround</groupId>
+                    <artifactId>jrebel-maven-plugin</artifactId>
+                    <executions>
+                        <execution>
+                            <id>generate-rebel-xml</id>
+                            <phase>process-resources</phase>
+                            <goals>
+                                <goal>generate</goal>
+                            </goals>
+                        </execution>
+                    </executions>
+                    <configuration>
+                        <relativePath>../../../</relativePath>
+                        <rootPath>$${rebel.root}</rootPath>
+                    </configuration>
+                </plugin>
+            </plugins>
+        </pluginManagement>
         <plugins>
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
@@ -99,8 +120,8 @@
             <artifactId>sesame-filter</artifactId>
         </dependency>
         <dependency>
-            <groupId>commons-lang</groupId>
-            <artifactId>commons-lang</artifactId>
+            <groupId>org.apache.commons</groupId>
+            <artifactId>commons-lang3</artifactId>
         </dependency>
 
         <!-- LDClient -->
@@ -173,7 +194,7 @@
             <scope>test</scope>
         </dependency>
         <dependency>
-            <groupId>org.jumpmind.symmetric.jdbc</groupId>
+            <groupId>org.postgresql</groupId>
             <artifactId>postgresql</artifactId>
             <scope>test</scope>
         </dependency>

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldcache/ldcache-sail-kiwi/src/test/java/org/apache/marmotta/ldcache/sail/test/KiWiLinkedDataSailOfflineTest.java
----------------------------------------------------------------------
diff --git a/libraries/ldcache/ldcache-sail-kiwi/src/test/java/org/apache/marmotta/ldcache/sail/test/KiWiLinkedDataSailOfflineTest.java b/libraries/ldcache/ldcache-sail-kiwi/src/test/java/org/apache/marmotta/ldcache/sail/test/KiWiLinkedDataSailOfflineTest.java
index 20501b4..8b2de31 100644
--- a/libraries/ldcache/ldcache-sail-kiwi/src/test/java/org/apache/marmotta/ldcache/sail/test/KiWiLinkedDataSailOfflineTest.java
+++ b/libraries/ldcache/ldcache-sail-kiwi/src/test/java/org/apache/marmotta/ldcache/sail/test/KiWiLinkedDataSailOfflineTest.java
@@ -47,6 +47,7 @@ import java.util.ArrayList;
 import java.util.List;
 
 import static org.hamcrest.CoreMatchers.allOf;
+import static org.hamcrest.CoreMatchers.hasItems;
 import static org.hamcrest.Matchers.hasProperty;
 import static org.hamcrest.Matchers.hasToString;
 
@@ -182,9 +183,9 @@ public class KiWiLinkedDataSailOfflineTest {
             List<Statement> list1 = asList(con.getStatements(con.getValueFactory().createURI(uri1), null, null, true));
 
             Assert.assertEquals(3,list1.size());
-            Assert.assertThat(list1, allOf(
-                    CoreMatchers.<Statement>hasItem(hasProperty("object", hasToString("\"Value 1\"^^xsd:string"))),
-                    CoreMatchers.<Statement>hasItem(hasProperty("object", hasToString("\"Value X\"^^xsd:string")))
+            Assert.assertThat(list1, CoreMatchers.<Statement>hasItems(
+                    hasProperty("object", hasToString("\"Value 1\"^^xsd:string")),
+                    hasProperty("object", hasToString("\"Value X\"^^xsd:string"))
             ));
 
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldcache/ldcache-sail-kiwi/src/test/java/org/apache/marmotta/ldcache/sail/test/dummy/DummyProvider.java
----------------------------------------------------------------------
diff --git a/libraries/ldcache/ldcache-sail-kiwi/src/test/java/org/apache/marmotta/ldcache/sail/test/dummy/DummyProvider.java b/libraries/ldcache/ldcache-sail-kiwi/src/test/java/org/apache/marmotta/ldcache/sail/test/dummy/DummyProvider.java
index cd58e55..15f3d81 100644
--- a/libraries/ldcache/ldcache-sail-kiwi/src/test/java/org/apache/marmotta/ldcache/sail/test/dummy/DummyProvider.java
+++ b/libraries/ldcache/ldcache-sail-kiwi/src/test/java/org/apache/marmotta/ldcache/sail/test/dummy/DummyProvider.java
@@ -69,7 +69,7 @@ public class DummyProvider implements DataProvider {
                 con.close();
             }
 
-            ClientResponse response = new ClientResponse(triples);
+            ClientResponse response = new ClientResponse(200, triples);
 
             return response;
         } catch (RepositoryException e) {

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldcache/ldcache-sail-kiwi/src/test/resources/org/apache/marmotta/ldcache/sail/test/dummy/resource1.ttl
----------------------------------------------------------------------
diff --git a/libraries/ldcache/ldcache-sail-kiwi/src/test/resources/org/apache/marmotta/ldcache/sail/test/dummy/resource1.ttl b/libraries/ldcache/ldcache-sail-kiwi/src/test/resources/org/apache/marmotta/ldcache/sail/test/dummy/resource1.ttl
index 1e6b487..6d9e0cd 100644
--- a/libraries/ldcache/ldcache-sail-kiwi/src/test/resources/org/apache/marmotta/ldcache/sail/test/dummy/resource1.ttl
+++ b/libraries/ldcache/ldcache-sail-kiwi/src/test/resources/org/apache/marmotta/ldcache/sail/test/dummy/resource1.ttl
@@ -16,6 +16,6 @@
 # limitations under the License.
 #
 @prefix ex: <http://remote/> .
-ex:resource1 ex:property1 "Value 1" ;
+ex:resource1 ex:property1 "Value 1"^^xsd:string ;
              ex:property2 ex:resource2 ;
-             ex:property3 "Value X" .
\ No newline at end of file
+             ex:property3 "Value X"^^xsd:string .
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldcache/ldcache-sail-kiwi/src/test/resources/org/apache/marmotta/ldcache/sail/test/dummy/resource2.ttl
----------------------------------------------------------------------
diff --git a/libraries/ldcache/ldcache-sail-kiwi/src/test/resources/org/apache/marmotta/ldcache/sail/test/dummy/resource2.ttl b/libraries/ldcache/ldcache-sail-kiwi/src/test/resources/org/apache/marmotta/ldcache/sail/test/dummy/resource2.ttl
index 56e2544..b91edff 100644
--- a/libraries/ldcache/ldcache-sail-kiwi/src/test/resources/org/apache/marmotta/ldcache/sail/test/dummy/resource2.ttl
+++ b/libraries/ldcache/ldcache-sail-kiwi/src/test/resources/org/apache/marmotta/ldcache/sail/test/dummy/resource2.ttl
@@ -16,5 +16,5 @@
 # limitations under the License.
 #
 @prefix ex: <http://remote/> .
-ex:resource2 ex:property1 "Value 2" ;
+ex:resource2 ex:property1 "Value 2"^^xsd:string ;
              ex:property2 ex:resource3 .
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldcache/ldcache-sail-kiwi/src/test/resources/org/apache/marmotta/ldcache/sail/test/dummy/resource3.ttl
----------------------------------------------------------------------
diff --git a/libraries/ldcache/ldcache-sail-kiwi/src/test/resources/org/apache/marmotta/ldcache/sail/test/dummy/resource3.ttl b/libraries/ldcache/ldcache-sail-kiwi/src/test/resources/org/apache/marmotta/ldcache/sail/test/dummy/resource3.ttl
index 7d16a7d..2e4ab86 100644
--- a/libraries/ldcache/ldcache-sail-kiwi/src/test/resources/org/apache/marmotta/ldcache/sail/test/dummy/resource3.ttl
+++ b/libraries/ldcache/ldcache-sail-kiwi/src/test/resources/org/apache/marmotta/ldcache/sail/test/dummy/resource3.ttl
@@ -16,5 +16,5 @@
 # limitations under the License.
 #
 @prefix ex: <http://remote/> .
-ex:resource3 ex:property1 "Value 3" ;
-             ex:property3 "Value 4" .
\ No newline at end of file
+ex:resource3 ex:property1 "Value 3"^^xsd:string ;
+             ex:property3 "Value 4"^^xsd:string .
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldcache/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldcache/pom.xml b/libraries/ldcache/pom.xml
index b7d126d..26dee79 100644
--- a/libraries/ldcache/pom.xml
+++ b/libraries/ldcache/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/marmotta/blob/582abb5b/libraries/ldclient/ldclient-api/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldclient/ldclient-api/pom.xml b/libraries/ldclient/ldclient-api/pom.xml
index fc5786f..6873d92 100644
--- a/libraries/ldclient/ldclient-api/pom.xml
+++ b/libraries/ldclient/ldclient-api/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>
 
@@ -59,8 +59,8 @@
             <artifactId>sesame-sail-memory</artifactId>
         </dependency>
         <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>

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldclient/ldclient-api/src/main/java/org/apache/marmotta/ldclient/api/endpoint/Endpoint.java
----------------------------------------------------------------------
diff --git a/libraries/ldclient/ldclient-api/src/main/java/org/apache/marmotta/ldclient/api/endpoint/Endpoint.java b/libraries/ldclient/ldclient-api/src/main/java/org/apache/marmotta/ldclient/api/endpoint/Endpoint.java
index d4b77a3..16759d8 100644
--- a/libraries/ldclient/ldclient-api/src/main/java/org/apache/marmotta/ldclient/api/endpoint/Endpoint.java
+++ b/libraries/ldclient/ldclient-api/src/main/java/org/apache/marmotta/ldclient/api/endpoint/Endpoint.java
@@ -139,17 +139,18 @@ public class Endpoint implements Comparable<Endpoint> {
     private Map<String,String> properties;
 
     public Endpoint() {
+        this.active = true;
+        this.contentTypes = new HashSet<ContentType>();
+        this.properties = new HashMap<String, String>();    	
     }
 
     public Endpoint(String name, String type, String uriPattern, String endpointUrl, Long defaultExpiry) {
+    	this();
         this.name = name;
         this.type = type;
         this.uriPattern = uriPattern;
         this.endpointUrl = endpointUrl;
-        this.contentTypes = new HashSet<ContentType>();
         this.defaultExpiry = defaultExpiry;
-        this.active = true;
-        this.properties = new HashMap<String, String>();
     }
 
     public Endpoint(String name, String type, String uriPattern, String endpointUrl, String contentType, Long defaultExpiry) {

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldclient/ldclient-api/src/main/java/org/apache/marmotta/ldclient/model/ClientResponse.java
----------------------------------------------------------------------
diff --git a/libraries/ldclient/ldclient-api/src/main/java/org/apache/marmotta/ldclient/model/ClientResponse.java b/libraries/ldclient/ldclient-api/src/main/java/org/apache/marmotta/ldclient/model/ClientResponse.java
index bf3c29f..70ebf48 100644
--- a/libraries/ldclient/ldclient-api/src/main/java/org/apache/marmotta/ldclient/model/ClientResponse.java
+++ b/libraries/ldclient/ldclient-api/src/main/java/org/apache/marmotta/ldclient/model/ClientResponse.java
@@ -17,7 +17,7 @@
  */
 package org.apache.marmotta.ldclient.model;
 
-import org.apache.commons.lang.time.DateUtils;
+import org.apache.commons.lang3.time.DateUtils;
 import org.openrdf.repository.Repository;
 
 import java.util.Date;
@@ -30,15 +30,27 @@ import java.util.Date;
  */
 public class ClientResponse {
 
+	private static final int DEFAULT_HTTP_CODE = 200;
+	
     private static final int DEFAULT_EXPIRATION_IN_DAYS = 7;
 
+    /**
+     * The HTTP status code returned by the client
+     */
+    private int httpStatus;
+
     private Repository triples;
 
     private Date expires;
-
+    
     public ClientResponse(Repository triples) {
+    	this(DEFAULT_HTTP_CODE, triples);
+    }
+
+    public ClientResponse(int httpStatus, Repository triples) {
         this.triples = triples;
         this.expires = DateUtils.addDays(new Date(), DEFAULT_EXPIRATION_IN_DAYS);
+        this.httpStatus = httpStatus;
     }
 
     public Repository getTriples() {
@@ -57,4 +69,11 @@ public class ClientResponse {
         this.expires = new Date(expires.getTime());
     }
 
+    public int getHttpStatus() {
+        return httpStatus;
+    }
+
+    public void setHttpStatus(int httpStatus) {
+        this.httpStatus = httpStatus;
+    }
 }

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldclient/ldclient-core/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldclient/ldclient-core/pom.xml b/libraries/ldclient/ldclient-core/pom.xml
index 6e80e58..de02401 100644
--- a/libraries/ldclient/ldclient-core/pom.xml
+++ b/libraries/ldclient/ldclient-core/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>
 
@@ -73,8 +73,8 @@
             <artifactId>marmotta-commons</artifactId>
         </dependency>
         <dependency>
-            <groupId>commons-lang</groupId>
-            <artifactId>commons-lang</artifactId>
+            <groupId>org.apache.commons</groupId>
+            <artifactId>commons-lang3</artifactId>
         </dependency>
 
         <!-- logging -->

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldclient/ldclient-core/src/main/java/org/apache/marmotta/ldclient/services/ldclient/LDClient.java
----------------------------------------------------------------------
diff --git a/libraries/ldclient/ldclient-core/src/main/java/org/apache/marmotta/ldclient/services/ldclient/LDClient.java b/libraries/ldclient/ldclient-core/src/main/java/org/apache/marmotta/ldclient/services/ldclient/LDClient.java
index 7fe6a9c..13f2421 100644
--- a/libraries/ldclient/ldclient-core/src/main/java/org/apache/marmotta/ldclient/services/ldclient/LDClient.java
+++ b/libraries/ldclient/ldclient-core/src/main/java/org/apache/marmotta/ldclient/services/ldclient/LDClient.java
@@ -17,7 +17,6 @@
  */
 package org.apache.marmotta.ldclient.services.ldclient;
 
-import org.apache.commons.lang.NotImplementedException;
 import org.apache.http.Header;
 import org.apache.http.HttpRequest;
 import org.apache.http.HttpResponse;
@@ -161,7 +160,7 @@ public final class LDClient implements LDClientService {
                 return false;
             }
         } else {
-            throw new NotImplementedException("protocol not supportted");
+            throw new UnsupportedOperationException("protocol not supportted");
         }
         
         /*

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldclient/ldclient-core/src/main/java/org/apache/marmotta/ldclient/services/provider/AbstractHttpProvider.java
----------------------------------------------------------------------
diff --git a/libraries/ldclient/ldclient-core/src/main/java/org/apache/marmotta/ldclient/services/provider/AbstractHttpProvider.java b/libraries/ldclient/ldclient-core/src/main/java/org/apache/marmotta/ldclient/services/provider/AbstractHttpProvider.java
index 175baa5..ef89751 100644
--- a/libraries/ldclient/ldclient-core/src/main/java/org/apache/marmotta/ldclient/services/provider/AbstractHttpProvider.java
+++ b/libraries/ldclient/ldclient-core/src/main/java/org/apache/marmotta/ldclient/services/provider/AbstractHttpProvider.java
@@ -60,6 +60,7 @@ import static org.apache.marmotta.commons.http.LMFHttpUtils.parseContentType;
  */
 public abstract class AbstractHttpProvider implements DataProvider {
 
+    public static final int RETRY_AFTER = 60;
     private static Logger log = LoggerFactory.getLogger(AbstractHttpProvider.class);
 
     /**
@@ -175,7 +176,7 @@ public abstract class AbstractHttpProvider implements DataProvider {
                 con.close();
             }
 
-            ClientResponse result = new ClientResponse(handler.triples);
+            ClientResponse result = new ClientResponse(handler.httpStatus, handler.triples);
             result.setExpires(expiresDate);
             return result;
         } catch (RepositoryException e) {
@@ -228,6 +229,8 @@ public abstract class AbstractHttpProvider implements DataProvider {
 
         private final String resource;
 
+        private int httpStatus;
+
         public ResponseHandler(String resource, Endpoint endpoint) throws RepositoryException {
             this.resource = resource;
             this.endpoint = endpoint;
@@ -244,13 +247,15 @@ public abstract class AbstractHttpProvider implements DataProvider {
             	final HttpEntity entity = response.getEntity();
             	if (entity == null)
             		throw new IOException("no content returned by Linked Data resource " + resource);
-            	
+
 	            if (!isValidContentType(entity.getContentType().getValue().split(";")[0], endpoint)) {
 	                // FIXME: here was get.abort()
 	            	throw new IOException("invalid content returned by Linked Data resource " + resource + ": "
 	            			+ entity.getContentType().getValue());
 	            }
 
+                this.httpStatus = response.getStatusLine().getStatusCode();
+
                 if (entity != null) {
                     String parseContentType = "application/rdf+xml";
                     if (endpoint != null && "SPARQL".equals(endpoint.getType())) {
@@ -282,8 +287,23 @@ public abstract class AbstractHttpProvider implements DataProvider {
                     } finally {
                         in.close();
                     }
-                } 
+                }
                 EntityUtils.consume(entity);
+            } else if(response.getStatusLine().getStatusCode() == 500 || response.getStatusLine().getStatusCode() == 503  || response.getStatusLine().getStatusCode() == 504) {
+                this.httpStatus = response.getStatusLine().getStatusCode();
+
+                Header retry = response.getFirstHeader("Retry-After");
+                if(retry != null) {
+                    try {
+                        int duration = Integer.parseInt(retry.getValue());
+                        expiresDate = new Date(System.currentTimeMillis() + duration*1000);
+                    } catch(NumberFormatException ex) {
+                        log.debug("error parsing Retry-After: header");
+                    }
+                } else {
+                    expiresDate = new Date(System.currentTimeMillis() + RETRY_AFTER *1000);
+                }
+
             } else {
                 log.error("the HTTP request failed (status: {})", response.getStatusLine());
                 throw new ClientProtocolException("the HTTP request failed (status: " + response.getStatusLine() + ")");

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldclient/ldclient-core/src/main/java/org/apache/marmotta/ldclient/services/provider/BlockingProvider.java
----------------------------------------------------------------------
diff --git a/libraries/ldclient/ldclient-core/src/main/java/org/apache/marmotta/ldclient/services/provider/BlockingProvider.java b/libraries/ldclient/ldclient-core/src/main/java/org/apache/marmotta/ldclient/services/provider/BlockingProvider.java
index feec3f4..ae75d59 100644
--- a/libraries/ldclient/ldclient-core/src/main/java/org/apache/marmotta/ldclient/services/provider/BlockingProvider.java
+++ b/libraries/ldclient/ldclient-core/src/main/java/org/apache/marmotta/ldclient/services/provider/BlockingProvider.java
@@ -87,7 +87,7 @@ public class BlockingProvider implements DataProvider {
         long defaultExpires = client.getClientConfiguration().getDefaultExpiry();
         Date expiresDate = new Date(System.currentTimeMillis() + defaultExpires * 1000);
 
-        ClientResponse result = new ClientResponse(empty_repository);
+        ClientResponse result = new ClientResponse(200, empty_repository);
         result.setExpires(expiresDate);
         return result;
     }

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldclient/ldclient-core/src/test/java/org/apache/marmotta/ldclient/test/TestLDClientTest.java
----------------------------------------------------------------------
diff --git a/libraries/ldclient/ldclient-core/src/test/java/org/apache/marmotta/ldclient/test/TestLDClientTest.java b/libraries/ldclient/ldclient-core/src/test/java/org/apache/marmotta/ldclient/test/TestLDClientTest.java
index 2cf0a4f..4570c08 100644
--- a/libraries/ldclient/ldclient-core/src/test/java/org/apache/marmotta/ldclient/test/TestLDClientTest.java
+++ b/libraries/ldclient/ldclient-core/src/test/java/org/apache/marmotta/ldclient/test/TestLDClientTest.java
@@ -30,6 +30,8 @@ import org.junit.runner.Description;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import java.net.URI;
+
 public class TestLDClientTest {
 
     private TestLDClient client;
@@ -67,7 +69,7 @@ public class TestLDClientTest {
 
     @Test(expected = DataRetrievalException.class)
     public void testLocalhostInvalidPort() throws Exception {
-        client.retrieveResource("http://127.1.2.3:-1/");
+        client.retrieveResource("http://127.1.2.3:66000/");
         Assert.fail();
     }
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldclient/ldclient-provider-facebook/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldclient/ldclient-provider-facebook/pom.xml b/libraries/ldclient/ldclient-provider-facebook/pom.xml
index 7b044f3..e1526d5 100644
--- a/libraries/ldclient/ldclient-provider-facebook/pom.xml
+++ b/libraries/ldclient/ldclient-provider-facebook/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/marmotta/blob/582abb5b/libraries/ldclient/ldclient-provider-facebook/src/main/java/org/apache/marmotta/ldclient/provider/facebook/FacebookGraphProvider.java
----------------------------------------------------------------------
diff --git a/libraries/ldclient/ldclient-provider-facebook/src/main/java/org/apache/marmotta/ldclient/provider/facebook/FacebookGraphProvider.java b/libraries/ldclient/ldclient-provider-facebook/src/main/java/org/apache/marmotta/ldclient/provider/facebook/FacebookGraphProvider.java
index c7fb128..e9d606a 100644
--- a/libraries/ldclient/ldclient-provider-facebook/src/main/java/org/apache/marmotta/ldclient/provider/facebook/FacebookGraphProvider.java
+++ b/libraries/ldclient/ldclient-provider-facebook/src/main/java/org/apache/marmotta/ldclient/provider/facebook/FacebookGraphProvider.java
@@ -22,12 +22,9 @@ import org.apache.http.HttpEntity;
 import org.apache.http.HttpResponse;
 import org.apache.http.client.ClientProtocolException;
 import org.apache.http.client.methods.HttpGet;
-import org.apache.http.client.utils.URIUtils;
 import org.apache.http.impl.cookie.DateParseException;
 import org.apache.http.impl.cookie.DateUtils;
 import org.apache.http.util.EntityUtils;
-import org.apache.marmotta.commons.collections.CollectionUtils;
-import org.apache.marmotta.commons.http.ContentType;
 import org.apache.marmotta.commons.http.UriUtil;
 import org.apache.marmotta.commons.vocabulary.DCTERMS;
 import org.apache.marmotta.commons.vocabulary.FOAF;
@@ -37,7 +34,6 @@ import org.apache.marmotta.ldclient.api.ldclient.LDClientService;
 import org.apache.marmotta.ldclient.api.provider.DataProvider;
 import org.apache.marmotta.ldclient.exception.DataRetrievalException;
 import org.apache.marmotta.ldclient.model.ClientResponse;
-import org.apache.marmotta.ldclient.services.provider.AbstractHttpProvider;
 import org.codehaus.jackson.JsonParseException;
 import org.codehaus.jackson.map.JsonMappingException;
 import org.codehaus.jackson.map.ObjectMapper;
@@ -60,8 +56,6 @@ import java.util.*;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
-import static org.apache.marmotta.commons.http.LMFHttpUtils.parseContentType;
-
 /**
  * A provider that accesses objects exposed by the Facebook Graph API (in JSON format). The provider will map the
  * properties of Facebook Objects to RDF and tries choosing the most appropriate RDF types and vocabularies. The base
@@ -76,6 +70,7 @@ public class FacebookGraphProvider implements DataProvider {
 
 
     private static final Pattern pattern = Pattern.compile("http://www\\.facebook\\.com/([^/]+/)*([^/]+)");
+    public static final int RETRY_AFTER = 60;
 
     private static Logger log = LoggerFactory.getLogger(FacebookGraphProvider.class);
 
@@ -406,7 +401,7 @@ public class FacebookGraphProvider implements DataProvider {
                 con.close();
             }
 
-            ClientResponse result = new ClientResponse(handler.triples);
+            ClientResponse result = new ClientResponse(200, handler.triples);
             result.setExpires(expiresDate);
             return result;
         } catch (RepositoryException e) {
@@ -439,6 +434,8 @@ public class FacebookGraphProvider implements DataProvider {
 
         private final String resource;
 
+        private int httpStatus;
+
         // language tag to use for literals
         public String language;
 
@@ -459,6 +456,7 @@ public class FacebookGraphProvider implements DataProvider {
                 if (entity == null)
                     throw new IOException("no content returned by Linked Data resource " + resource);
 
+                this.httpStatus = response.getStatusLine().getStatusCode();
 
                 if (entity != null) {
                     InputStream in = entity.getContent();
@@ -486,6 +484,21 @@ public class FacebookGraphProvider implements DataProvider {
                     }
                 }
                 EntityUtils.consume(entity);
+            } else if(response.getStatusLine().getStatusCode() == 500 || response.getStatusLine().getStatusCode() == 503  || response.getStatusLine().getStatusCode() == 504) {
+                this.httpStatus = response.getStatusLine().getStatusCode();
+
+                Header retry = response.getFirstHeader("Retry-After");
+                if(retry != null) {
+                    try {
+                        int duration = Integer.parseInt(retry.getValue());
+                        expiresDate = new Date(System.currentTimeMillis() + duration*1000);
+                    } catch(NumberFormatException ex) {
+                        log.debug("error parsing Retry-After: header");
+                    }
+                } else {
+                    expiresDate = new Date(System.currentTimeMillis() + RETRY_AFTER *1000);
+                }
+
             } else {
                 log.error("the HTTP request failed (status: {})", response.getStatusLine());
                 throw new ClientProtocolException("the HTTP request failed (status: " + response.getStatusLine() + ")");

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldclient/ldclient-provider-html/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldclient/ldclient-provider-html/pom.xml b/libraries/ldclient/ldclient-provider-html/pom.xml
index efa9821..8b4a77d 100644
--- a/libraries/ldclient/ldclient-provider-html/pom.xml
+++ b/libraries/ldclient/ldclient-provider-html/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/marmotta/blob/582abb5b/libraries/ldclient/ldclient-provider-html/src/main/java/org/apache/marmotta/ldclient/provider/html/mapping/CssDateLiteralMapper.java
----------------------------------------------------------------------
diff --git a/libraries/ldclient/ldclient-provider-html/src/main/java/org/apache/marmotta/ldclient/provider/html/mapping/CssDateLiteralMapper.java b/libraries/ldclient/ldclient-provider-html/src/main/java/org/apache/marmotta/ldclient/provider/html/mapping/CssDateLiteralMapper.java
index bbc2b3b..001fb80 100644
--- a/libraries/ldclient/ldclient-provider-html/src/main/java/org/apache/marmotta/ldclient/provider/html/mapping/CssDateLiteralMapper.java
+++ b/libraries/ldclient/ldclient-provider-html/src/main/java/org/apache/marmotta/ldclient/provider/html/mapping/CssDateLiteralMapper.java
@@ -62,7 +62,7 @@ public class CssDateLiteralMapper extends CssTextLiteralMapper {
 
     @Override
     public List<Value> map(String resourceUri, Element elem, ValueFactory factory) {
-        final String value = elem.text().trim();
+        final String value = cleanValue(elem.text());
         Date date = parseDate(value);
 
         final String dateString;

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldclient/ldclient-provider-html/src/main/java/org/apache/marmotta/ldclient/provider/html/mapping/CssLiteralAttrMapper.java
----------------------------------------------------------------------
diff --git a/libraries/ldclient/ldclient-provider-html/src/main/java/org/apache/marmotta/ldclient/provider/html/mapping/CssLiteralAttrMapper.java b/libraries/ldclient/ldclient-provider-html/src/main/java/org/apache/marmotta/ldclient/provider/html/mapping/CssLiteralAttrMapper.java
index 29ded1d..5cf91af 100644
--- a/libraries/ldclient/ldclient-provider-html/src/main/java/org/apache/marmotta/ldclient/provider/html/mapping/CssLiteralAttrMapper.java
+++ b/libraries/ldclient/ldclient-provider-html/src/main/java/org/apache/marmotta/ldclient/provider/html/mapping/CssLiteralAttrMapper.java
@@ -18,7 +18,7 @@
 package org.apache.marmotta.ldclient.provider.html.mapping;
 
 import org.apache.marmotta.commons.sesame.model.Namespaces;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.jsoup.nodes.Element;
 import org.openrdf.model.Value;
 import org.openrdf.model.ValueFactory;

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldclient/ldclient-provider-html/src/main/java/org/apache/marmotta/ldclient/provider/html/mapping/CssTextLiteralMapper.java
----------------------------------------------------------------------
diff --git a/libraries/ldclient/ldclient-provider-html/src/main/java/org/apache/marmotta/ldclient/provider/html/mapping/CssTextLiteralMapper.java b/libraries/ldclient/ldclient-provider-html/src/main/java/org/apache/marmotta/ldclient/provider/html/mapping/CssTextLiteralMapper.java
index 886307c..e3e9ac4 100644
--- a/libraries/ldclient/ldclient-provider-html/src/main/java/org/apache/marmotta/ldclient/provider/html/mapping/CssTextLiteralMapper.java
+++ b/libraries/ldclient/ldclient-provider-html/src/main/java/org/apache/marmotta/ldclient/provider/html/mapping/CssTextLiteralMapper.java
@@ -17,7 +17,7 @@
  */
 package org.apache.marmotta.ldclient.provider.html.mapping;
 
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.apache.marmotta.commons.sesame.model.Namespaces;
 import org.jsoup.nodes.Element;
 import org.openrdf.model.Value;

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldclient/ldclient-provider-ldap/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldclient/ldclient-provider-ldap/pom.xml b/libraries/ldclient/ldclient-provider-ldap/pom.xml
index 4736c8f..539209e 100644
--- a/libraries/ldclient/ldclient-provider-ldap/pom.xml
+++ b/libraries/ldclient/ldclient-provider-ldap/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/marmotta/blob/582abb5b/libraries/ldclient/ldclient-provider-ldap/src/main/java/org/apache/marmotta/ldclient/provider/ldap/LdapFoafProvider.java
----------------------------------------------------------------------
diff --git a/libraries/ldclient/ldclient-provider-ldap/src/main/java/org/apache/marmotta/ldclient/provider/ldap/LdapFoafProvider.java b/libraries/ldclient/ldclient-provider-ldap/src/main/java/org/apache/marmotta/ldclient/provider/ldap/LdapFoafProvider.java
index e0ade1b..3873391 100644
--- a/libraries/ldclient/ldclient-provider-ldap/src/main/java/org/apache/marmotta/ldclient/provider/ldap/LdapFoafProvider.java
+++ b/libraries/ldclient/ldclient-provider-ldap/src/main/java/org/apache/marmotta/ldclient/provider/ldap/LdapFoafProvider.java
@@ -184,7 +184,7 @@ public class LdapFoafProvider implements DataProvider {
 
                 }
 
-                final ClientResponse resp = new ClientResponse(rep);
+                final ClientResponse resp = new ClientResponse(200, rep);
                 resp.setExpires(new Date());
                 return resp;
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldclient/ldclient-provider-mediawiki/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldclient/ldclient-provider-mediawiki/pom.xml b/libraries/ldclient/ldclient-provider-mediawiki/pom.xml
index a97c354..c2d2d9f 100644
--- a/libraries/ldclient/ldclient-provider-mediawiki/pom.xml
+++ b/libraries/ldclient/ldclient-provider-mediawiki/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/marmotta/blob/582abb5b/libraries/ldclient/ldclient-provider-mediawiki/src/main/java/org/apache/marmotta/ldclient/provider/mediawiki/MediawikiProvider.java
----------------------------------------------------------------------
diff --git a/libraries/ldclient/ldclient-provider-mediawiki/src/main/java/org/apache/marmotta/ldclient/provider/mediawiki/MediawikiProvider.java b/libraries/ldclient/ldclient-provider-mediawiki/src/main/java/org/apache/marmotta/ldclient/provider/mediawiki/MediawikiProvider.java
index d9e4a06..7c23d37 100644
--- a/libraries/ldclient/ldclient-provider-mediawiki/src/main/java/org/apache/marmotta/ldclient/provider/mediawiki/MediawikiProvider.java
+++ b/libraries/ldclient/ldclient-provider-mediawiki/src/main/java/org/apache/marmotta/ldclient/provider/mediawiki/MediawikiProvider.java
@@ -72,7 +72,7 @@ public class MediawikiProvider extends AbstractHttpProvider {
     private static Logger        log                  = LoggerFactory.getLogger(MediawikiProvider.class);
 
     private static final Pattern COLON_PREFIX_PATTERN = Pattern.compile("^[^:]*:");
-    private static final Pattern REDIRECT_PATTERN     = Pattern.compile("^#REDIRECT\\s+\\[\\[([^#\\]]*)(#.*)?\\]\\]",
+    private static final Pattern REDIRECT_PATTERN     = Pattern.compile("^#REDIRECT\\s*\\[\\[([^#\\]]*)(#.*)?\\]\\]",
             Pattern.CASE_INSENSITIVE);
     private static final int     MAX_TITLES_PER_QUERY = 50;
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldclient/ldclient-provider-phpbb/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldclient/ldclient-provider-phpbb/pom.xml b/libraries/ldclient/ldclient-provider-phpbb/pom.xml
index c67862f..6719feb 100644
--- a/libraries/ldclient/ldclient-provider-phpbb/pom.xml
+++ b/libraries/ldclient/ldclient-provider-phpbb/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/marmotta/blob/582abb5b/libraries/ldclient/ldclient-provider-rdf/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldclient/ldclient-provider-rdf/pom.xml b/libraries/ldclient/ldclient-provider-rdf/pom.xml
index 3f81d0b..fd75822 100644
--- a/libraries/ldclient/ldclient-provider-rdf/pom.xml
+++ b/libraries/ldclient/ldclient-provider-rdf/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>
 
@@ -45,6 +45,10 @@
 
         <dependency>
             <groupId>org.openrdf.sesame</groupId>
+            <artifactId>sesame-rio-rdfjson</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.openrdf.sesame</groupId>
             <artifactId>sesame-rio-rdfxml</artifactId>
         </dependency>
         <dependency>
@@ -56,12 +60,8 @@
             <artifactId>sesame-rio-n3</artifactId>
         </dependency>
         <dependency>
-            <groupId>org.apache.marmotta</groupId>
-            <artifactId>sesame-tools-rio-jsonld</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.marmotta</groupId>
-            <artifactId>sesame-tools-rio-rdfjson</artifactId>
+            <groupId>com.github.jsonld-java</groupId>
+            <artifactId>jsonld-java-sesame</artifactId>
         </dependency>
 
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldclient/ldclient-provider-rdf/src/main/java/org/apache/marmotta/ldclient/provider/rdf/SPARQLProvider.java
----------------------------------------------------------------------
diff --git a/libraries/ldclient/ldclient-provider-rdf/src/main/java/org/apache/marmotta/ldclient/provider/rdf/SPARQLProvider.java b/libraries/ldclient/ldclient-provider-rdf/src/main/java/org/apache/marmotta/ldclient/provider/rdf/SPARQLProvider.java
index 929b59e..cc39f14 100644
--- a/libraries/ldclient/ldclient-provider-rdf/src/main/java/org/apache/marmotta/ldclient/provider/rdf/SPARQLProvider.java
+++ b/libraries/ldclient/ldclient-provider-rdf/src/main/java/org/apache/marmotta/ldclient/provider/rdf/SPARQLProvider.java
@@ -24,6 +24,7 @@ import org.apache.marmotta.ldclient.services.provider.AbstractHttpProvider;
 import org.openrdf.model.URI;
 import org.openrdf.model.Value;
 import org.openrdf.query.BindingSet;
+import org.openrdf.query.QueryResultHandlerException;
 import org.openrdf.query.TupleQueryResultHandler;
 import org.openrdf.query.TupleQueryResultHandlerException;
 import org.openrdf.query.resultio.QueryResultIO;
@@ -151,9 +152,14 @@ public class SPARQLProvider extends AbstractHttpProvider {
                         public void endQueryResult() throws TupleQueryResultHandlerException   {
                             try {
                                 con.commit();
-                                con.close();
                             } catch (RepositoryException e) {
-                                throw new TupleQueryResultHandlerException("error while closing repository connection",e);
+                                throw new TupleQueryResultHandlerException("error while committing repository connection",e);
+                            } finally {
+                                try {
+                                    con.close();
+                                } catch(RepositoryException e) {
+                                    throw new TupleQueryResultHandlerException("error while closing repository connection",e);
+                                }
                             }
                         }
 
@@ -173,6 +179,19 @@ public class SPARQLProvider extends AbstractHttpProvider {
                                 throw new TupleQueryResultHandlerException("error while adding triple to repository connection",e);
                             }
                         }
+
+						@Override
+						public void handleBoolean(boolean bool	) throws QueryResultHandlerException {
+							// TODO Auto-generated method stub
+							
+						}
+
+						@Override
+						public void handleLinks(List<String> links) throws QueryResultHandlerException {
+							// TODO Auto-generated method stub
+							
+						}
+						
                     },
                     triples.getValueFactory());
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldclient/ldclient-provider-rdf/src/test/java/org/apache/marmotta/ldclient/test/rdf/TestStanbolProvider.java
----------------------------------------------------------------------
diff --git a/libraries/ldclient/ldclient-provider-rdf/src/test/java/org/apache/marmotta/ldclient/test/rdf/TestStanbolProvider.java b/libraries/ldclient/ldclient-provider-rdf/src/test/java/org/apache/marmotta/ldclient/test/rdf/TestStanbolProvider.java
index 11a83a4..9df1cd7 100644
--- a/libraries/ldclient/ldclient-provider-rdf/src/test/java/org/apache/marmotta/ldclient/test/rdf/TestStanbolProvider.java
+++ b/libraries/ldclient/ldclient-provider-rdf/src/test/java/org/apache/marmotta/ldclient/test/rdf/TestStanbolProvider.java
@@ -25,6 +25,7 @@ import org.apache.marmotta.ldclient.model.ClientResponse;
 import org.apache.marmotta.ldclient.services.ldclient.LDClient;
 import org.apache.marmotta.ldclient.test.helper.TestLDClient;
 import org.junit.Assert;
+import org.junit.Assume;
 import org.junit.Test;
 import org.openrdf.query.BooleanQuery;
 import org.openrdf.query.QueryLanguage;
@@ -53,6 +54,8 @@ public class TestStanbolProvider {
 
         LDClientService ldclient = new TestLDClient(new LDClient(config));
 
+        Assume.assumeTrue(ldclient.ping("http://dev.iks-project.eu:8080/"));
+
         String uriBerlin = "http://dbpedia.org/resource/Berlin";
         ClientResponse respBerlin = ldclient.retrieveResource(uriBerlin);
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldclient/ldclient-provider-rdfa/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldclient/ldclient-provider-rdfa/pom.xml b/libraries/ldclient/ldclient-provider-rdfa/pom.xml
index eb1e264..8dcd4b3 100644
--- a/libraries/ldclient/ldclient-provider-rdfa/pom.xml
+++ b/libraries/ldclient/ldclient-provider-rdfa/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/marmotta/blob/582abb5b/libraries/ldclient/ldclient-provider-vimeo/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldclient/ldclient-provider-vimeo/pom.xml b/libraries/ldclient/ldclient-provider-vimeo/pom.xml
index 541bd79..d1e38fa 100644
--- a/libraries/ldclient/ldclient-provider-vimeo/pom.xml
+++ b/libraries/ldclient/ldclient-provider-vimeo/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/marmotta/blob/582abb5b/libraries/ldclient/ldclient-provider-xml/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldclient/ldclient-provider-xml/pom.xml b/libraries/ldclient/ldclient-provider-xml/pom.xml
index 0ff9206..12ebc32 100644
--- a/libraries/ldclient/ldclient-provider-xml/pom.xml
+++ b/libraries/ldclient/ldclient-provider-xml/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/marmotta/blob/582abb5b/libraries/ldclient/ldclient-provider-youtube/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldclient/ldclient-provider-youtube/pom.xml b/libraries/ldclient/ldclient-provider-youtube/pom.xml
index 062ce27..43ebc06 100644
--- a/libraries/ldclient/ldclient-provider-youtube/pom.xml
+++ b/libraries/ldclient/ldclient-provider-youtube/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/marmotta/blob/582abb5b/libraries/ldclient/ldclient-provider-youtube/src/main/java/org/apache/marmotta/ldclient/provider/youtube/YoutubeVideoPagesProvider.java
----------------------------------------------------------------------
diff --git a/libraries/ldclient/ldclient-provider-youtube/src/main/java/org/apache/marmotta/ldclient/provider/youtube/YoutubeVideoPagesProvider.java b/libraries/ldclient/ldclient-provider-youtube/src/main/java/org/apache/marmotta/ldclient/provider/youtube/YoutubeVideoPagesProvider.java
index 65c9c13..7258510 100644
--- a/libraries/ldclient/ldclient-provider-youtube/src/main/java/org/apache/marmotta/ldclient/provider/youtube/YoutubeVideoPagesProvider.java
+++ b/libraries/ldclient/ldclient-provider-youtube/src/main/java/org/apache/marmotta/ldclient/provider/youtube/YoutubeVideoPagesProvider.java
@@ -17,8 +17,8 @@
  */
 package org.apache.marmotta.ldclient.provider.youtube;
 
-import org.apache.commons.lang.StringUtils;
-import org.apache.commons.lang.time.DateUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.commons.lang3.time.DateUtils;
 import org.apache.http.NameValuePair;
 import org.apache.http.client.utils.URLEncodedUtils;
 import org.apache.marmotta.ldclient.api.endpoint.Endpoint;
@@ -122,7 +122,7 @@ public class YoutubeVideoPagesProvider implements DataProvider {
                 log.error(msg);
                 throw new RuntimeException(msg, e);
             }
-            ClientResponse clientResponse = new ClientResponse(triples);
+            ClientResponse clientResponse = new ClientResponse(200, triples);
             clientResponse.setExpires(DateUtils.addYears(new Date(), 10));
             return clientResponse;
         }

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldclient/ldclient-provider-youtube/src/main/java/org/apache/marmotta/ldclient/provider/youtube/YoutubeVideoProvider.java
----------------------------------------------------------------------
diff --git a/libraries/ldclient/ldclient-provider-youtube/src/main/java/org/apache/marmotta/ldclient/provider/youtube/YoutubeVideoProvider.java b/libraries/ldclient/ldclient-provider-youtube/src/main/java/org/apache/marmotta/ldclient/provider/youtube/YoutubeVideoProvider.java
index 086ae18..702aba3 100644
--- a/libraries/ldclient/ldclient-provider-youtube/src/main/java/org/apache/marmotta/ldclient/provider/youtube/YoutubeVideoProvider.java
+++ b/libraries/ldclient/ldclient-provider-youtube/src/main/java/org/apache/marmotta/ldclient/provider/youtube/YoutubeVideoProvider.java
@@ -19,7 +19,7 @@ package org.apache.marmotta.ldclient.provider.youtube;
 
 import org.apache.marmotta.commons.sesame.model.Namespaces;
 import com.google.common.collect.ImmutableList;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.apache.marmotta.ldclient.api.endpoint.Endpoint;
 import org.apache.marmotta.ldclient.api.provider.DataProvider;
 import org.apache.marmotta.ldclient.provider.xml.AbstractXMLDataProvider;


[071/100] [abbrv] git commit: Removed "DISCLAIMER.txt" from assembly of ldpath-package, we are not incubating any more!

Posted by wi...@apache.org.
Removed "DISCLAIMER.txt" from assembly of ldpath-package, we are not incubating any more!


Project: http://git-wip-us.apache.org/repos/asf/marmotta/repo
Commit: http://git-wip-us.apache.org/repos/asf/marmotta/commit/bc775f75
Tree: http://git-wip-us.apache.org/repos/asf/marmotta/tree/bc775f75
Diff: http://git-wip-us.apache.org/repos/asf/marmotta/diff/bc775f75

Branch: refs/heads/ldp
Commit: bc775f754e970a6c632f92dde5f47fcd0d17924d
Parents: 76ea6b5
Author: Jakob Frank <ja...@apache.org>
Authored: Wed Apr 9 09:41:50 2014 +0200
Committer: Jakob Frank <ja...@apache.org>
Committed: Wed Apr 9 09:41:50 2014 +0200

----------------------------------------------------------------------
 libraries/ldpath/ldpath-backend-linkeddata/assembly.xml | 6 ------
 1 file changed, 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/marmotta/blob/bc775f75/libraries/ldpath/ldpath-backend-linkeddata/assembly.xml
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-backend-linkeddata/assembly.xml b/libraries/ldpath/ldpath-backend-linkeddata/assembly.xml
index e4b854f..f32b78f 100644
--- a/libraries/ldpath/ldpath-backend-linkeddata/assembly.xml
+++ b/libraries/ldpath/ldpath-backend-linkeddata/assembly.xml
@@ -47,12 +47,6 @@
             <fileMode>0644</fileMode>
         </file>
         <file>
-            <source>${project.basedir}/../../../DISCLAIMER.txt</source>
-            <outputDirectory>/</outputDirectory>
-            <fileMode>0644</fileMode>
-            <filtered>true</filtered>
-        </file>
-        <file>
             <source>${project.build.directory}/ldpath-${project.version}.jar</source>
             <outputDirectory>/</outputDirectory>
             <fileMode>0644</fileMode>


[046/100] [abbrv] [partial] Reverting the erroneous merge by Sebastian according to the instructions in INFRA-6876

Posted by wi...@apache.org.
http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/marmotta-commons/src/ext/java/javolution/util/internal/map/AtomicMapImpl.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-commons/src/ext/java/javolution/util/internal/map/AtomicMapImpl.java b/commons/marmotta-commons/src/ext/java/javolution/util/internal/map/AtomicMapImpl.java
new file mode 100644
index 0000000..3c097ee
--- /dev/null
+++ b/commons/marmotta-commons/src/ext/java/javolution/util/internal/map/AtomicMapImpl.java
@@ -0,0 +1,192 @@
+/*
+ * 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.util.internal.map;
+
+import javolution.util.function.Consumer;
+import javolution.util.function.Equality;
+import javolution.util.service.MapService;
+
+import java.util.Iterator;
+import java.util.Map;
+
+/**
+ * An atomic view over a map  (copy-on-write).
+ */
+public class AtomicMapImpl<K, V> extends MapView<K, V> {
+
+    /** Thread-Safe Iterator. */
+    private class IteratorImpl implements Iterator<Entry<K, V>> {
+        private Entry<K, V> current;
+        private final Iterator<Entry<K, V>> targetIterator = targetView().iterator();
+
+        @Override
+        public boolean hasNext() {
+            return targetIterator.hasNext();
+        }
+
+        @Override
+        public Entry<K, V> next() {
+            current = targetIterator.next();
+            return current;
+        }
+
+        @Override
+        public void remove() {
+            if (current == null) throw new IllegalStateException();
+            AtomicMapImpl.this.remove(current.getKey());
+            current = null;
+        }
+    }
+
+    private static final long serialVersionUID = 0x600L; // Version.
+    protected volatile MapService<K, V> immutable; // The copy used by readers.
+    protected transient Thread updatingThread; // The thread executing an update.
+
+    public AtomicMapImpl(MapService<K, V> target) {
+        super(target);
+        this.immutable = cloneTarget();
+    }
+
+    @Override
+    public synchronized void clear() {
+        clear();
+        if (!updateInProgress()) {
+            immutable = cloneTarget();
+        }
+    }
+
+    @Override
+    public synchronized AtomicMapImpl<K, V> clone() {
+        AtomicMapImpl<K, V> copy = (AtomicMapImpl<K, V>) super.clone();
+        copy.updatingThread = null;
+        return copy;
+    }
+
+    @Override
+    public boolean containsKey(Object key) {
+        return targetView().containsKey(key);
+    }
+
+    @Override
+    public boolean containsValue(Object value) {
+        return targetView().containsValue(value);
+    }
+
+    @Override
+    public V get(Object key) {
+        return targetView().get(key);
+    }
+
+    @Override
+    public boolean isEmpty() {
+        return targetView().isEmpty();
+    }
+
+    @Override
+    public Iterator<Entry<K, V>> iterator() {
+        return new IteratorImpl();
+    }
+
+    @Override
+    public Equality<? super K> keyComparator() {
+        return targetView().keyComparator();
+    }
+
+    @Override
+    public synchronized V put(K key, V value) {
+        V v = target().put(key, value);
+        if (!updateInProgress()) immutable = cloneTarget();
+        return v;
+    }
+
+    @Override
+    public synchronized void putAll(Map<? extends K, ? extends V> m) {
+        target().putAll(m);
+        if (!updateInProgress()) immutable = cloneTarget();
+    }
+
+    @Override
+    public synchronized V putIfAbsent(K key, V value) {
+        V v = target().putIfAbsent(key, value);
+        if (!updateInProgress()) immutable = cloneTarget();
+        return v;
+    }
+
+    @Override
+    public synchronized V remove(Object key) {
+        V v = target().remove(key);
+        if (!updateInProgress()) immutable = cloneTarget();
+        return v;
+    }
+
+    @Override
+    public synchronized boolean remove(Object key, Object value) {
+        boolean changed = target().remove(key, value);
+        if (changed && !updateInProgress()) immutable = cloneTarget();
+        return changed;
+    }
+
+    @Override
+    public synchronized V replace(K key, V value) {
+        V v = target().replace(key, value);
+        if (!updateInProgress()) immutable = cloneTarget();
+        return v;
+    }
+
+    @Override
+    public synchronized boolean replace(K key, V oldValue, V newValue) {
+        boolean changed = target().replace(key, oldValue, newValue);
+        if (changed && !updateInProgress()) immutable = cloneTarget();
+        return changed;
+    }
+
+    @Override
+    public int size() {
+        return targetView().size();
+    }
+
+    @Override
+    public synchronized void update(Consumer<MapService<K, V>> action,
+            MapService<K, V> view) {
+        updatingThread = Thread.currentThread(); // Update in progress.
+        try {
+            target().update(action, view); // No copy performed.
+        } finally {
+            updatingThread = null;
+            immutable = cloneTarget(); // One single copy !
+        }
+    }
+
+    @Override
+    public Equality<? super V> valueComparator() {
+        return targetView().valueComparator();
+    }
+
+    /** Returns a clone copy of target. */
+    protected MapService<K, V> cloneTarget() {
+        try {
+            return target().clone();
+        } catch (CloneNotSupportedException e) {
+            throw new Error("Cannot happen since target is Cloneable.");
+        }
+    }
+
+    /** Returns either the immutable target or the actual target if updating 
+     *  thread. */
+    protected MapService<K, V> targetView() {
+        return ((updatingThread == null) || (updatingThread != Thread.currentThread()))
+                ? immutable : target();
+    }
+
+
+    /** Indicates if the current thread is doing an atomic update. */
+    protected final boolean updateInProgress() {
+        return updatingThread == Thread.currentThread();
+    }
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/marmotta-commons/src/ext/java/javolution/util/internal/map/FastMapImpl.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-commons/src/ext/java/javolution/util/internal/map/FastMapImpl.java b/commons/marmotta-commons/src/ext/java/javolution/util/internal/map/FastMapImpl.java
new file mode 100644
index 0000000..8e13e89
--- /dev/null
+++ b/commons/marmotta-commons/src/ext/java/javolution/util/internal/map/FastMapImpl.java
@@ -0,0 +1,250 @@
+/*
+ * 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.util.internal.map;
+
+import javolution.util.function.Equality;
+
+import java.util.Iterator;
+import java.util.NoSuchElementException;
+
+/**
+ * The default {@link javolution.util.FastMap FastMap} implementation 
+ * based on {@link FractalMapImpl fractal maps}. 
+ * This implementation ensures that no more than 3/4 of the map capacity is
+ * ever wasted.
+ */
+public class FastMapImpl<K, V> extends MapView<K, V> {
+
+    private static final long serialVersionUID = 0x600L; // Version.
+    transient MapEntryImpl<K, V> firstEntry = null;
+    transient FractalMapImpl fractal = new FractalMapImpl();
+    transient MapEntryImpl<K, V> freeEntry = new MapEntryImpl<K, V>();
+    final Equality<? super K> keyComparator;
+    transient MapEntryImpl<K, V> lastEntry = null;
+    transient int size;
+    final Equality<? super V> valueComparator;
+
+    public FastMapImpl(Equality<? super K> keyComparator,
+            final Equality<? super V> valueComparator) {
+        super(null); // Root.
+        this.keyComparator = keyComparator;
+        this.valueComparator = valueComparator;
+    }
+
+    @Override
+    public void clear() {
+        firstEntry = null;
+        lastEntry = null;
+        fractal = new FractalMapImpl();
+        size = 0;
+    }
+
+    @Override
+    public FastMapImpl<K, V> clone() { // Makes a copy.
+        FastMapImpl<K, V> copy = new FastMapImpl<K, V>(keyComparator(),
+                valueComparator());
+        copy.putAll(this);
+        return copy;
+    }
+
+    @SuppressWarnings("unchecked")
+    @Override
+    public boolean containsKey(Object key) {
+        return fractal.getEntry(key, keyComparator.hashCodeOf((K) key), keyComparator) != null;
+    }
+
+    @SuppressWarnings("unchecked")
+    @Override
+    public V get(Object key) {
+        MapEntryImpl<K, V> entry = fractal.getEntry(key,
+                keyComparator.hashCodeOf((K) key), keyComparator);
+        if (entry == null) return null;
+        return entry.value;
+    }
+
+    @Override
+    public Iterator<Entry<K, V>> iterator() {
+        return new Iterator<Entry<K, V>>() {
+            MapEntryImpl<K, V> current;
+            MapEntryImpl<K, V> next = firstEntry;
+
+            @Override
+            public boolean hasNext() {
+                return (next != null);
+            }
+
+            @Override
+            public java.util.Map.Entry<K, V> next() {
+                if (next == null) throw new NoSuchElementException();
+                current = next;
+                next = next.next;
+                return current;
+            }
+
+            @Override
+            public void remove() {
+                if (current == null) throw new IllegalStateException();
+                fractal.removeEntry(current.key, current.hash, keyComparator);
+                detachEntry(current); // Entry is not referenced anymore and will be gc.
+                size--;
+            }
+        };
+
+    }
+
+    @Override
+    public Equality<? super K> keyComparator() {
+        return keyComparator;
+    }
+
+    @SuppressWarnings("unchecked")
+    @Override
+    public V put(K key, V value) {
+        int hash = keyComparator.hashCodeOf(key);
+        MapEntryImpl<K, V> tmp = fractal.addEntry(freeEntry, key, hash, keyComparator);
+        if (tmp == freeEntry) { // New entry.
+            freeEntry = new MapEntryImpl<K, V>();
+            attachEntry(tmp);
+            size++;
+            tmp.value = value;
+            return null;
+        } else { // Existing entry.
+            V oldValue = (V) tmp.value;
+            tmp.value = value;
+            return oldValue;
+        }
+    }
+
+    @SuppressWarnings("unchecked")
+    @Override
+    public V putIfAbsent(K key, V value) {
+        int hash = keyComparator.hashCodeOf(key);
+        MapEntryImpl<K, V> tmp = fractal.addEntry(freeEntry, key, hash, keyComparator);
+        if (tmp == freeEntry) { // New entry.
+            freeEntry = new MapEntryImpl<K, V>();
+            attachEntry(tmp);
+            size++;
+            tmp.value = value;
+            return null;
+        } else { // Existing entry.
+            return (V) tmp.value;
+        }
+    }
+
+    @SuppressWarnings("unchecked")
+    @Override
+    public V remove(Object key) {
+        MapEntryImpl<K, V> entry = fractal.removeEntry(key,
+                keyComparator.hashCodeOf((K) key), keyComparator);
+        if (entry == null) return null;
+        detachEntry(entry); // Entry is not referenced anymore and will be gc.
+        size--;
+        return entry.value;
+    }
+
+    @SuppressWarnings("unchecked")
+    @Override
+    public boolean remove(Object key, Object value) {
+        int hash = keyComparator.hashCodeOf((K) key);
+        MapEntryImpl<K, V> entry = fractal.getEntry(key, hash, keyComparator);
+        if (entry == null) return false;
+        if (!valueComparator.areEqual((V) entry.value, (V) value)) return false;
+        fractal.removeEntry(key, hash, keyComparator);
+        detachEntry(entry); // Entry is not referenced anymore and will be gc.
+        size--;
+        return true;
+    }
+
+    @SuppressWarnings("unchecked")
+    @Override
+    public V replace(K key, V value) {
+        MapEntryImpl<K, V> entry = fractal.getEntry(key,
+                keyComparator.hashCodeOf(key), keyComparator);
+        if (entry == null) return null;
+        V oldValue = entry.value;
+        entry.value = value;
+        return oldValue;
+    }
+
+    @SuppressWarnings("unchecked")
+    @Override
+    public boolean replace(K key, V oldValue, V newValue) {
+        MapEntryImpl<K, V> entry = fractal.getEntry(key,
+                keyComparator.hashCodeOf(key), keyComparator);
+        if (entry == null) return false;
+        if (!valueComparator.areEqual(entry.value, oldValue)) return false;
+        entry.value = newValue;
+        return true;
+    }
+
+    @Override
+    public int size() {
+        return size;
+    }
+
+    @Override
+    public Equality<? super V> valueComparator() {
+        return valueComparator;
+    }
+
+    private void attachEntry(MapEntryImpl<K, V> entry) {
+        if (lastEntry != null) {
+            lastEntry.next = entry;
+            entry.previous = lastEntry;
+        }
+        lastEntry = entry;
+        if (firstEntry == null) {
+            firstEntry = entry;
+        }
+    }
+
+    private void detachEntry(MapEntryImpl<K, V> entry) {
+        if (entry == firstEntry) {
+            firstEntry = entry.next;
+        }
+        if (entry == lastEntry) {
+            lastEntry = entry.previous;
+        }
+        MapEntryImpl<K, V> previous = entry.previous;
+        MapEntryImpl<K, V> next = entry.next;
+        if (previous != null) {
+            previous.next = next;
+        }
+        if (next != null) {
+            next.previous = previous;
+        }
+    }
+
+    /** For serialization support */
+    @SuppressWarnings("unchecked")
+    private void readObject(java.io.ObjectInputStream s)
+            throws java.io.IOException, ClassNotFoundException {
+        s.defaultReadObject(); // Deserialize comparator.
+        fractal = new FractalMapImpl();
+        freeEntry = new MapEntryImpl<K, V>();
+        int n = s.readInt();
+        for (int i = 0; i < n; i++) {
+            put((K) s.readObject(), (V) s.readObject());
+        }
+    }
+
+    /** For serialization support */
+    private void writeObject(java.io.ObjectOutputStream s)
+            throws java.io.IOException {
+        s.defaultWriteObject(); // Serialize comparators.
+        s.writeInt(size);
+        Iterator<Entry<K, V>> it = iterator();
+        while (it.hasNext()) {
+            Entry<K, V> e = it.next();
+            s.writeObject(e.getKey());
+            s.writeObject(e.getValue());
+        }
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/marmotta-commons/src/ext/java/javolution/util/internal/map/FractalMapImpl.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-commons/src/ext/java/javolution/util/internal/map/FractalMapImpl.java b/commons/marmotta-commons/src/ext/java/javolution/util/internal/map/FractalMapImpl.java
new file mode 100644
index 0000000..7159b41
--- /dev/null
+++ b/commons/marmotta-commons/src/ext/java/javolution/util/internal/map/FractalMapImpl.java
@@ -0,0 +1,121 @@
+/*
+ * 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.util.internal.map;
+
+import javolution.util.function.Equality;
+
+/**
+ * A fractal-based map with rehash performed only on limited size maps.
+ * It is based on a fractal structure with self-similar patterns at any scale
+ * (maps holding submaps). At each depth only a part of the hashcode is used
+ * starting by the last bits. 
+ */
+@SuppressWarnings("rawtypes")
+final class FractalMapImpl {
+
+    static final int EMPTINESS_LEVEL = 2; // Can be 1 (load factor 0.5), 2 (load factor 0.25) or any greater value.
+    static final int INITIAL_BLOCK_CAPACITY = 2 << EMPTINESS_LEVEL;
+    static final int SHIFT = 10; // Number of hashcode bits per depth. 
+    //private static final int MAX_BLOCK_CAPACITY = 1 << SHIFT;
+    private int count; // Number of entries different from null in this block.
+    private MapEntryImpl[] entries = new MapEntryImpl[INITIAL_BLOCK_CAPACITY]; // Entries value can be a sub-map.
+    private final int shift; // Zero if base map.
+
+    public FractalMapImpl() {
+        this.shift = 0;
+    }
+
+    public FractalMapImpl(int shift) {
+        this.shift = shift;
+    }
+
+    /** Adds the specified entry if not already present; returns 
+     *  either the specified entry or an existing entry for the specified key. **/
+    @SuppressWarnings("unchecked")
+    public MapEntryImpl addEntry(MapEntryImpl newEntry, Object key, int hash, Equality comparator) {
+        int i = indexOfKey(key, hash, comparator);
+        MapEntryImpl entry = entries[i];
+        if (entry != null) return entry; // Entry exists
+        entries[i] = newEntry;
+        newEntry.key = key;
+        newEntry.hash = hash;
+        // Check if we need to resize.
+        if ((++count << EMPTINESS_LEVEL) > entries.length) {
+            resize(entries.length << 1);
+        }
+        return newEntry;
+    }
+
+    public void clear() {
+        entries = new MapEntryImpl[INITIAL_BLOCK_CAPACITY];
+        count = 0;
+    }
+
+    /** Returns null if no entry with specified key */
+    public MapEntryImpl getEntry(Object key, int hash, Equality comparator) {
+        return entries[indexOfKey(key, hash, comparator)];
+    }
+
+    /** Returns the entry removed or null if none. */
+    public MapEntryImpl removeEntry(Object key, int hash, Equality comparator) {
+        int i = indexOfKey(key, hash, comparator);
+        MapEntryImpl oldEntry = entries[i];
+        if (oldEntry == null) return null; // Entry does not exist.
+        entries[i] = null;
+        // Since we have made a hole, adjacent keys might have to shift.
+        for (;;) {
+            // We use a step of 1 (improve caching through memory locality).
+            i = (i + 1) & (entries.length - 1);
+            MapEntryImpl entry = entries[i];
+            if (entry == null) break; // Done.
+            int correctIndex = indexOfKey(entry.key, entry.hash, comparator);
+            if (correctIndex != i) { // Misplaced.
+                entries[correctIndex] = entries[i];
+                entries[i] = null;
+            }
+        }
+        // Check if we need to resize.
+        if (((--count << (EMPTINESS_LEVEL + 1)) <= entries.length)
+                && (entries.length > INITIAL_BLOCK_CAPACITY)) {
+            resize(entries.length >> 1);
+        }
+        return oldEntry;
+    }
+
+    /** Returns the index of the specified key in the map 
+       (points to a null key if key not present). */
+    private int indexOfKey(Object key, int hash, Equality comparator) {
+        int mask = entries.length - 1;
+        int i = (hash >> shift) & mask;
+        while (true) {
+            MapEntryImpl entry = entries[i];
+            if (entry == null) return i;
+            if ((entry.hash == hash) && comparator.areEqual(key,entry.key)) return i;
+            i = (i + 1) & mask;
+        }
+    }
+
+    // The capacity is a power of two such as: 
+    //    (count * 2**EMPTINESS_LEVEL) <=  capacity < (count * 2**(EMPTINESS_LEVEL+1))
+    // TODO: Use submaps if max capacity reached.
+    private void resize(int newCapacity) {
+        MapEntryImpl[] newEntries = new MapEntryImpl[newCapacity];
+        int newMask = newEntries.length - 1;
+        for (int i = 0, n = entries.length; i < n; i++) {
+            MapEntryImpl entry = entries[i];
+            if (entry == null) continue;
+            int newIndex = entry.hash & newMask;
+            while (newEntries[newIndex] != null) { // Find empty slot.
+                newIndex = (newIndex + 1) & newMask;
+            }
+            newEntries[newIndex] = entry;
+        }
+        entries = newEntries;
+    }
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/marmotta-commons/src/ext/java/javolution/util/internal/map/MapEntryImpl.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-commons/src/ext/java/javolution/util/internal/map/MapEntryImpl.java b/commons/marmotta-commons/src/ext/java/javolution/util/internal/map/MapEntryImpl.java
new file mode 100644
index 0000000..2eddac9
--- /dev/null
+++ b/commons/marmotta-commons/src/ext/java/javolution/util/internal/map/MapEntryImpl.java
@@ -0,0 +1,46 @@
+/*
+ * 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.util.internal.map;
+
+import java.util.Map;
+
+/**
+ * The hash map entry implementation (not serializable).
+ */
+public final class MapEntryImpl<K, V> implements Map.Entry<K, V> {
+
+    int hash;
+    K key;
+    MapEntryImpl<K, V> next;
+    MapEntryImpl<K, V> previous;
+    V value;
+
+    @Override
+    public K getKey() {
+        return key;
+    }
+
+    @Override
+    public V getValue() {
+        return value;
+    }
+
+    @Override
+    public V setValue(V value) {
+        V oldValue = this.value;
+        this.value = value;
+        return oldValue;
+    }
+
+    @Override
+    public String toString() {
+        return key + "=" + value;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/marmotta-commons/src/ext/java/javolution/util/internal/map/MapView.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-commons/src/ext/java/javolution/util/internal/map/MapView.java b/commons/marmotta-commons/src/ext/java/javolution/util/internal/map/MapView.java
new file mode 100644
index 0000000..f957c55
--- /dev/null
+++ b/commons/marmotta-commons/src/ext/java/javolution/util/internal/map/MapView.java
@@ -0,0 +1,363 @@
+/*
+ * 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.util.internal.map;
+
+import javolution.util.function.Consumer;
+import javolution.util.function.Equality;
+import javolution.util.function.Function;
+import javolution.util.internal.collection.MappedCollectionImpl;
+import javolution.util.internal.set.MappedSetImpl;
+import javolution.util.internal.set.SetView;
+import javolution.util.service.CollectionService;
+import javolution.util.service.MapService;
+import javolution.util.service.SetService;
+
+import java.io.Serializable;
+import java.util.Iterator;
+import java.util.Map;
+
+/**
+ * Map view implementation; can be used as root class for implementations 
+ * if target is {@code null}.
+ * When possible sub-classes should forward to the actual target for the methods
+ * isEmpty, size and clear rather than using the default implementation.
+ */
+public abstract class MapView<K, V> implements MapService<K, V> {
+
+    /**
+     * Entry comparator. Entries are considered equals if they have the same 
+     * keys regardless of their associated values.
+     */
+    protected class EntryComparator implements Equality<Entry<K,V>>, Serializable {
+        private static final long serialVersionUID = MapView.serialVersionUID;
+
+        public EntryComparator() {
+        }
+
+        @Override
+        public boolean areEqual(Entry<K, V> left, Entry<K, V> right) {
+            return keyComparator().areEqual(left.getKey(),
+                    right.getKey());
+        }
+
+        @Override
+        public int compare(Entry<K, V> left, Entry<K, V> right) {
+            return keyComparator().compare(left.getKey(),
+                    right.getKey());
+        }
+
+        @Override
+        public int hashCodeOf(Entry<K, V> e) {
+            return keyComparator().hashCodeOf(e.getKey());
+        }     
+    }
+    
+    /** Entry Set View */
+    protected class EntrySet extends SetView<Entry<K, V>> {
+        private static final long serialVersionUID = MapView.serialVersionUID;
+        public EntrySet() {
+            super(null); // Actual target is the outer map. 
+        }
+
+        @Override
+        public boolean add(Entry<K, V> entry) {
+            put(entry.getKey(), entry.getValue());
+            return true;
+        }
+
+        @Override
+        public Equality<? super Entry<K, V>> comparator() {
+            return new EntryComparator();
+        }
+
+        @SuppressWarnings("unchecked")
+        @Override
+        public boolean contains(Object obj) {
+            if (obj instanceof Entry) {
+                Entry<K, V> e = (Entry<K, V>) obj;
+                return contains(e.getKey());
+            }
+            return false;
+        }
+
+        @Override
+        public boolean isEmpty() {
+            return MapView.this.isEmpty();
+        }
+
+        @Override
+        public Iterator<Entry<K, V>> iterator() {
+            return MapView.this.iterator();
+        }
+
+        @Override
+        public void perform(
+                final Consumer<CollectionService<Entry<K, V>>> action,
+                final CollectionService<Entry<K, V>> view) {
+            Consumer<MapService<K, V>> mapAction = new Consumer<MapService<K, V>>() {
+                @Override
+                public void accept(MapService<K, V> param) {
+                    action.accept(view);
+                }
+            };
+            MapView.this.perform(mapAction, MapView.this);
+        }
+
+        @Override
+        @SuppressWarnings("unchecked")
+        public boolean remove(Object obj) {
+            if (obj instanceof Entry) {
+                Entry<K, V> e = (Entry<K, V>) obj;
+                if (!contains(e.getKey())) return false;
+                MapView.this.remove(e.getKey());
+                return true;
+            }
+            return false;
+        }
+
+        @Override
+        public int size() {
+            return MapView.this.size();
+        }
+
+        @Override
+        public void update(
+                final Consumer<CollectionService<Entry<K, V>>> action,
+                final CollectionService<Entry<K, V>> view) {
+            Consumer<MapService<K, V>> mapAction = new Consumer<MapService<K, V>>() {
+                @Override
+                public void accept(MapService<K, V> param) {
+                    action.accept(view);
+                }
+            };
+            MapView.this.update(mapAction, MapView.this);
+        }
+    }
+
+    /** Entry to key mapping function */
+    class EntryToKey implements Function<Entry<K, V>, K>, Serializable {
+        private static final long serialVersionUID = MapView.serialVersionUID;
+        @Override
+        public K apply(java.util.Map.Entry<K, V> param) {
+            return param.getKey();
+        }        
+    }
+    
+    /** Key Set View */
+    protected class KeySet extends MappedSetImpl<Entry<K, V>, K> {
+        private static final long serialVersionUID = MapView.serialVersionUID;
+
+        public KeySet() {
+            super(entrySet(), new EntryToKey());
+        }
+
+        @Override
+        public boolean add(K key) { // Supports adding new key with null value.
+            if (containsKey(key)) return false;
+            put(key, null);
+            return true;
+        }
+
+        @Override
+        public Equality<? super K> comparator() {
+            return keyComparator();
+        }
+
+        @SuppressWarnings("unchecked")
+        @Override
+        public boolean contains(Object obj) {
+            return containsKey((K) obj);
+        }
+
+        @SuppressWarnings("unchecked")
+        @Override
+        public boolean remove(Object obj) {
+            if (!containsKey((K) obj)) return false;
+            MapView.this.remove((K) obj);
+            return true;
+        }
+    }
+
+    /** Values View */
+    protected class Values extends MappedCollectionImpl<Entry<K, V>, V> {
+        private static final long serialVersionUID = MapView.serialVersionUID;
+
+        public Values() {
+            super(entrySet(), new Function<Entry<K, V>, V>() {
+                @Override
+                public V apply(Map.Entry<K, V> e) {
+                    return e.getValue();
+                }
+            });
+        }
+
+        @Override
+        public Equality<? super V> comparator() {
+            return valueComparator();
+        }
+    }
+
+    private static final long serialVersionUID = 0x600L; // Version.
+    private MapService<K, V> target;
+
+    /**
+     * The view constructor or root class constructor if target is {@code null}.
+     */
+    public MapView(MapService<K, V> target) {
+        this.target = target;
+    }
+
+    @Override
+    public void clear() {
+        Iterator<Entry<K, V>> it = iterator();
+        while (it.hasNext()) {
+            it.remove();
+        }
+    }
+
+    @SuppressWarnings("unchecked")
+    @Override
+    public MapView<K, V> clone() {
+        try {
+            MapView<K, V> copy = (MapView<K, V>) super.clone();
+            if (target != null) { // Not a root class.
+                copy.target = target.clone();
+            }
+            return copy;
+        } catch (CloneNotSupportedException e) {
+            throw new Error("Should not happen since target is cloneable");
+        }
+    }
+
+    @Override
+    public abstract boolean containsKey(Object key);
+
+    @Override
+    public boolean containsValue(Object value) {
+        return values().contains(value);
+    }
+
+    @Override
+    public SetService<Entry<K, V>> entrySet() {
+        return new EntrySet();
+    }
+
+    @Override
+    public abstract V get(Object key);
+
+    @Override
+    public boolean isEmpty() {
+        return !iterator().hasNext();
+    }
+
+    @Override
+    public abstract Iterator<Entry<K, V>> iterator();
+
+    @Override
+    public abstract Equality<? super K> keyComparator();
+
+    @Override
+    public SetService<K> keySet() {
+        return new KeySet();
+    }
+
+    @Override
+    public void perform(Consumer<MapService<K, V>> action, MapService<K, V> view) {
+        if (target == null) {
+            action.accept(view);
+        } else {
+            target.perform(action, view);
+        }
+    }
+
+    @Override
+    public abstract V put(K key, V value);
+
+    @SuppressWarnings("unchecked")
+    @Override
+    public void putAll(Map<? extends K, ? extends V> m) {
+        Iterator<?> it = m.entrySet().iterator();
+        while (it.hasNext()) {
+            Entry<K, V> e = (Entry<K, V>) it.next();
+            put(e.getKey(), e.getValue());
+        }
+    }
+
+    @Override
+    public V putIfAbsent(K key, V value) {
+        if (!containsKey(key)) return put(key, value);
+        else return get(key);
+    }
+
+    @Override
+    public abstract V remove(Object key);
+
+    @Override
+    public boolean remove(Object key, Object value) {
+        if (containsKey(key) && get(key).equals(value)) {
+            remove(key);
+            return true;
+        } else return false;
+    }
+
+    @Override
+    public V replace(K key, V value) {
+        if (containsKey(key)) {
+            return put(key, value);
+        } else return null;
+    }
+
+    @Override
+    public boolean replace(K key, V oldValue, V newValue) {
+        if (containsKey(key) && get(key).equals(oldValue)) {
+            put(key, newValue);
+            return true;
+        } else return false;
+    }
+
+    @Override
+    public int size() {
+        int count = 0;
+        Iterator<Entry<K, V>> it = iterator();
+        while (it.hasNext()) {
+            count++;
+            it.next();
+        }
+        return count;
+    }
+
+    @SuppressWarnings("unchecked")
+    @Override
+    public MapService<K, V>[] split(int n, boolean threadsafe) {
+        return new MapService[] { this }; // Splits not supported.
+    }
+
+    @Override
+    public void update(Consumer<MapService<K, V>> action, MapService<K, V> view) {
+        if (target == null) {
+            action.accept(view);
+        } else {
+            target.update(action, view);
+        }
+    }
+
+    @Override
+    public abstract Equality<? super V> valueComparator();
+
+    @Override
+    public CollectionService<V> values() {
+        return new Values();
+    }
+
+    /** Returns the actual target */
+    protected MapService<K, V> target() {
+        return target;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/marmotta-commons/src/ext/java/javolution/util/internal/map/SequentialMapImpl.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-commons/src/ext/java/javolution/util/internal/map/SequentialMapImpl.java b/commons/marmotta-commons/src/ext/java/javolution/util/internal/map/SequentialMapImpl.java
new file mode 100644
index 0000000..86b9f40
--- /dev/null
+++ b/commons/marmotta-commons/src/ext/java/javolution/util/internal/map/SequentialMapImpl.java
@@ -0,0 +1,93 @@
+/*
+ * 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.util.internal.map;
+
+import javolution.util.function.Consumer;
+import javolution.util.function.Equality;
+import javolution.util.service.MapService;
+
+import java.util.Iterator;
+
+/**
+ * A sequential view over a map.
+ */
+public class SequentialMapImpl<K, V> extends MapView<K, V> {
+
+    private static final long serialVersionUID = 0x600L; // Version.
+
+    public SequentialMapImpl(MapService<K, V> target) {
+        super(target);
+    }
+
+    @Override
+    public void clear() {
+        target().clear();
+    }
+
+    @Override
+    public boolean containsKey(Object key) {
+        return target().containsKey(key);
+    }
+
+    @Override
+    public V get(Object key) {
+        return target().get(key);
+    }
+
+    @Override
+    public boolean isEmpty() {
+        return target().isEmpty();
+    }
+
+    @Override
+    public Iterator<java.util.Map.Entry<K, V>> iterator() {
+        return target().iterator();
+    }
+
+    @Override
+    public Equality<? super K> keyComparator() {
+        return target().keyComparator();
+    }
+
+    @Override
+    public void perform(Consumer<MapService<K, V>> action, MapService<K, V> view) {
+        action.accept(view); // Executes immediately.
+    }
+
+    @Override
+    public V put(K key, V value) {
+        return target().put(key, value);
+    }
+
+    @Override
+    public V remove(Object key) {
+        return target().remove(key);
+    }
+
+    @Override
+    public int size() {
+        return target().size();
+    }
+
+    @Override
+    public void update(Consumer<MapService<K, V>> action, MapService<K, V> view) {
+        action.accept(view); // Executes immediately.
+    }
+
+    @Override
+    public Equality<? super V> valueComparator() {
+        return target().valueComparator();
+    }
+
+    @Override
+    public MapService<K, V>[] split(int n, boolean threadsafe) {
+        return target().split(n, threadsafe); // Forwards.
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/marmotta-commons/src/ext/java/javolution/util/internal/map/SharedMapImpl.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-commons/src/ext/java/javolution/util/internal/map/SharedMapImpl.java b/commons/marmotta-commons/src/ext/java/javolution/util/internal/map/SharedMapImpl.java
new file mode 100644
index 0000000..1df80ac
--- /dev/null
+++ b/commons/marmotta-commons/src/ext/java/javolution/util/internal/map/SharedMapImpl.java
@@ -0,0 +1,240 @@
+/*
+ * 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.util.internal.map;
+
+import javolution.util.function.Equality;
+import javolution.util.internal.ReadWriteLockImpl;
+import javolution.util.service.MapService;
+
+import java.util.Iterator;
+import java.util.Map;
+
+/**
+ * A shared view over a map.
+ */
+public class SharedMapImpl<K, V> extends MapView<K, V> {
+
+    /** Thread-Safe Iterator. */
+    private class IteratorImpl implements Iterator<Entry<K, V>> {
+        private Entry<K, V> next;
+        private final Iterator<Entry<K, V>> targetIterator;
+
+        public IteratorImpl() {
+            lock.readLock.lock();
+            try {
+                targetIterator = cloneTarget().entrySet().iterator(); // Copy.
+            } finally {
+                lock.readLock.unlock();
+            }
+        }
+
+        @Override
+        public boolean hasNext() {
+            return targetIterator.hasNext();
+        }
+
+        @Override
+        public Entry<K, V> next() {
+            next = targetIterator.next();
+            return next;
+        }
+
+        @Override
+        public void remove() {
+            if (next == null) throw new IllegalStateException();
+            SharedMapImpl.this.remove(next.getKey());
+            next = null;
+        }
+    }
+
+    private static final long serialVersionUID = 0x600L; // Version.
+    protected ReadWriteLockImpl lock;
+    protected transient Thread updatingThread; // The thread executing an update.
+
+    public SharedMapImpl(MapService<K, V> target) {
+        this(target, new ReadWriteLockImpl());
+    }
+
+    public SharedMapImpl(MapService<K, V> target, ReadWriteLockImpl lock) {
+        super(target);
+        this.lock = lock;
+    }
+
+    @Override
+    public void clear() {
+        lock.writeLock.lock();
+        try {
+            target().clear();
+        } finally {
+            lock.writeLock.unlock();
+        }
+    }
+
+    @Override
+    public boolean containsKey(Object key) {
+        lock.readLock.lock();
+        try {
+            return target().containsKey(key);
+        } finally {
+            lock.readLock.unlock();
+        }
+    }
+
+    @Override
+    public boolean containsValue(Object value) {
+        lock.readLock.lock();
+        try {
+            return target().containsValue(value);
+        } finally {
+            lock.readLock.unlock();
+        }
+    }
+
+    @Override
+    public V get(Object key) {
+        lock.readLock.lock();
+        try {
+            return target().get(key);
+        } finally {
+            lock.readLock.unlock();
+        }
+    }
+
+    @Override
+    public boolean isEmpty() {
+        lock.readLock.lock();
+        try {
+            return target().isEmpty();
+        } finally {
+            lock.readLock.unlock();
+        }
+    }
+
+    @Override
+    public Iterator<Entry<K, V>> iterator() {
+        return new IteratorImpl();
+    }
+
+    @Override
+    public Equality<? super K> keyComparator() {
+        return target().keyComparator();
+    }
+
+    @Override
+    public V put(K key, V value) {
+        lock.writeLock.lock();
+        try {
+            return target().put(key, value);
+        } finally {
+            lock.writeLock.unlock();
+        }
+    }
+
+    @Override
+    public void putAll(Map<? extends K, ? extends V> m) {
+        lock.writeLock.lock();
+        try {
+            target().putAll(m);
+        } finally {
+            lock.writeLock.unlock();
+        }
+    }
+
+    @Override
+    public V putIfAbsent(K key, V value) {
+        lock.writeLock.lock();
+        try {
+            return target().putIfAbsent(key, value);
+        } finally {
+            lock.writeLock.unlock();
+        }
+    }
+
+    @Override
+    public V remove(Object key) {
+        lock.writeLock.lock();
+        try {
+            return target().remove(key);
+        } finally {
+            lock.writeLock.unlock();
+        }
+    }
+
+    @Override
+    public boolean remove(Object key, Object value) {
+        lock.writeLock.lock();
+        try {
+            return target().remove(key, value);
+        } finally {
+            lock.writeLock.unlock();
+        }
+    }
+
+    @Override
+    public V replace(K key, V value) {
+        lock.writeLock.lock();
+        try {
+            return target().replace(key, value);
+        } finally {
+            lock.writeLock.unlock();
+        }
+    }
+
+    @Override
+    public boolean replace(K key, V oldValue, V newValue) {
+        lock.writeLock.lock();
+        try {
+            return target().replace(key, oldValue, newValue);
+        } finally {
+            lock.writeLock.unlock();
+        }
+    }
+
+    @Override
+    public int size() {
+        lock.readLock.lock();
+        try {
+            return target().size();
+        } finally {
+            lock.readLock.unlock();
+        }
+    }
+
+    @Override
+    public Equality<? super V> valueComparator() {
+        return target().valueComparator();
+    }
+
+    /** Returns a clone copy of target. */
+    protected MapService<K, V> cloneTarget() {
+        try {
+            return target().clone();
+        } catch (CloneNotSupportedException e) {
+            throw new Error("Cannot happen since target is Cloneable.");
+        }
+    }
+    
+    @SuppressWarnings("unchecked")
+    @Override
+    public MapService<K,V>[] split(int n, boolean updateable) {
+        MapService<K,V>[] tmp;
+        lock.readLock.lock();
+        try {
+            tmp = target().split(n, updateable); 
+        } finally {
+            lock.readLock.unlock();
+        }
+        MapService<K,V>[] result = new MapService[tmp.length];
+        for (int i = 0; i < tmp.length; i++) {
+            result[i] = new SharedMapImpl<K,V>(tmp[i], lock); // Shares the same locks.
+        }
+        return result;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/marmotta-commons/src/ext/java/javolution/util/internal/map/UnmodifiableMapImpl.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-commons/src/ext/java/javolution/util/internal/map/UnmodifiableMapImpl.java b/commons/marmotta-commons/src/ext/java/javolution/util/internal/map/UnmodifiableMapImpl.java
new file mode 100644
index 0000000..c448166
--- /dev/null
+++ b/commons/marmotta-commons/src/ext/java/javolution/util/internal/map/UnmodifiableMapImpl.java
@@ -0,0 +1,109 @@
+/*
+ * 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.util.internal.map;
+
+import javolution.util.function.Equality;
+import javolution.util.service.MapService;
+
+import java.util.Iterator;
+
+/**
+ *  * An unmodifiable view over a map.
+ */
+public class UnmodifiableMapImpl<K, V> extends MapView<K, V> {
+
+    /** Read-Only Iterator. */
+    private class IteratorImpl implements Iterator<Entry<K, V>> {
+        private final Iterator<Entry<K, V>> targetIterator = target()
+                .iterator();
+
+        @Override
+        public boolean hasNext() {
+            return targetIterator.hasNext();
+        }
+
+        @Override
+        public Entry<K, V> next() {
+            return targetIterator.next();
+        }
+
+        @Override
+        public void remove() {
+            throw new UnsupportedOperationException("Read-Only Map.");
+        }
+    }
+
+    private static final long serialVersionUID = 0x600L; // Version.
+
+    public UnmodifiableMapImpl(MapService<K, V> target) {
+        super(target);
+    }
+
+    @Override
+    public void clear() {
+        throw new UnsupportedOperationException("Unmodifiable");
+    }
+
+    @Override
+    public boolean containsKey(Object key) {
+        return target().containsKey(key);
+    }
+
+    @Override
+    public V get(Object key) {
+        return target().get(key);
+    }
+
+    @Override
+    public boolean isEmpty() {
+        return target().isEmpty();
+    }
+
+    @Override
+    public Iterator<Entry<K, V>> iterator() {
+        return new IteratorImpl();
+    }
+
+    @Override
+    public Equality<? super K> keyComparator() {
+        return target().keyComparator();
+    }
+
+    @Override
+    public V put(K key, V value) {
+        throw new UnsupportedOperationException("Unmodifiable");
+    }
+
+    @Override
+    public V remove(Object key) {
+        throw new UnsupportedOperationException("Unmodifiable");
+    }
+
+    @Override
+    public int size() {
+        return target().size();
+    }
+
+    @Override
+    public Equality<? super V> valueComparator() {
+        return target().valueComparator();
+    }
+    
+    @SuppressWarnings("unchecked")
+    @Override
+    public MapService<K,V>[] split(int n, boolean updateable) {
+        MapService<K,V>[] subTargets = target().split(n, updateable);
+        MapService<K,V>[] result = new MapService[subTargets.length];
+        for (int i = 0; i < subTargets.length; i++) {
+            result[i] = new UnmodifiableMapImpl<K,V>(subTargets[i]);
+        }
+        return result;
+    }
+    
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/marmotta-commons/src/ext/java/javolution/util/internal/map/sorted/AtomicSortedMapImpl.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-commons/src/ext/java/javolution/util/internal/map/sorted/AtomicSortedMapImpl.java b/commons/marmotta-commons/src/ext/java/javolution/util/internal/map/sorted/AtomicSortedMapImpl.java
new file mode 100644
index 0000000..5cc4839
--- /dev/null
+++ b/commons/marmotta-commons/src/ext/java/javolution/util/internal/map/sorted/AtomicSortedMapImpl.java
@@ -0,0 +1,82 @@
+/*
+ * 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.util.internal.map.sorted;
+
+import javolution.util.internal.map.AtomicMapImpl;
+import javolution.util.service.SortedMapService;
+import javolution.util.service.SortedSetService;
+
+import java.util.Comparator;
+import java.util.Map;
+
+/**
+ * An atomic view over a sorted map  (copy-on-write).
+ */
+public class AtomicSortedMapImpl<K, V> extends AtomicMapImpl<K, V> implements SortedMapService<K,V> {
+
+    private static final long serialVersionUID = 0x600L; // Version.
+
+    public AtomicSortedMapImpl(SortedMapService<K, V> target) {    
+        super(target);
+    }
+
+    @Override
+    public Comparator<? super K> comparator() {
+        return target().keyComparator();
+    }
+
+    @Override
+    public SortedSetService<Map.Entry<K, V>> entrySet() {
+        return new SubSortedMapImpl<K,V>(this, null, null).entrySet();
+    }
+
+    
+    @Override
+    public K firstKey() {
+        return targetView().firstKey();
+    }
+
+
+    @Override
+    public SortedMapService<K, V> headMap(K toKey) {
+        return new SubSortedMapImpl<K,V>(this, null, toKey);
+    }
+
+    @Override
+    public SortedSetService<K> keySet() {
+        return new SubSortedMapImpl<K,V>(this, null, null).keySet();
+    }
+
+    @Override
+    public K lastKey() {
+        return targetView().lastKey();
+    }
+
+    @SuppressWarnings("unchecked")
+    @Override
+    public SortedMapService<K, V>[] split(int n, boolean updateable) { 
+        return new SortedMapService[] { this }; // Split not supported.
+    }
+
+    @Override
+    public SortedMapService<K, V> subMap(K fromKey, K toKey) {
+        return new SubSortedMapImpl<K,V>(this, fromKey, toKey);
+    }
+
+    @Override
+    public SortedMapService<K, V> tailMap(K fromKey) {
+        return new SubSortedMapImpl<K,V>(this, fromKey, null);
+    }
+
+    @Override
+    protected SortedMapService<K,V> targetView() {
+        return (SortedMapService<K,V>) super.targetView();
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/marmotta-commons/src/ext/java/javolution/util/internal/map/sorted/FastSortedMapImpl.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-commons/src/ext/java/javolution/util/internal/map/sorted/FastSortedMapImpl.java b/commons/marmotta-commons/src/ext/java/javolution/util/internal/map/sorted/FastSortedMapImpl.java
new file mode 100644
index 0000000..f30cc49
--- /dev/null
+++ b/commons/marmotta-commons/src/ext/java/javolution/util/internal/map/sorted/FastSortedMapImpl.java
@@ -0,0 +1,115 @@
+/*
+ * 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.util.internal.map.sorted;
+
+import javolution.util.function.Equality;
+import javolution.util.internal.table.sorted.FastSortedTableImpl;
+
+import java.util.Iterator;
+
+/**
+ * A map view over a sorted table of entries.
+ */
+public class FastSortedMapImpl<K, V> extends SortedMapView<K,V> {
+     
+    private static final long serialVersionUID = 0x600L; // Version.
+    private FastSortedTableImpl<Entry<K,V>> entries 
+        = new FastSortedTableImpl<Entry<K,V>>(new EntryComparator());
+    private final Equality<? super K> keyComparator;
+    private final Equality<? super V> valueComparator;
+
+    public FastSortedMapImpl(final Equality<? super K> keyComparator,
+            final Equality<? super V> valueComparator) {
+        super(null);
+        this.keyComparator = keyComparator;
+        this.valueComparator = valueComparator;
+     }
+
+    @Override
+    public void clear() {
+        entries.clear();
+    }
+
+    @SuppressWarnings("unchecked")
+    @Override
+    public boolean containsKey(Object key) {
+        return entries.contains(new MapEntryImpl<K,V>((K)key, null));
+    }
+
+    @Override
+    public K firstKey() {
+        return entries.getFirst().getKey();
+    }
+
+    @SuppressWarnings("unchecked")
+    @Override
+    public V get(Object key) {
+        int i = entries.indexOf(new MapEntryImpl<K,V>((K)key, null));
+        return (i >= 0) ? entries.get(i).getValue() : null;
+    }
+
+    @Override
+    public boolean isEmpty() {
+        return entries.isEmpty();
+    }
+
+    @Override
+    public Iterator<Entry<K, V>> iterator() {
+        return entries.iterator();
+    }
+
+    @Override
+    public Equality<? super K> keyComparator() {
+        return keyComparator;
+    }
+
+    @Override
+    public K lastKey() {
+        return entries.getLast().getKey();
+    }
+
+    @Override
+    public V put(K key, V value) {
+        MapEntryImpl<K,V> entry = new MapEntryImpl<K,V>(key, value);
+        int i = entries.positionOf(entry);
+        if (i < size()) {
+            Entry<K,V> e = entries.get(i);
+            if (keyComparator().areEqual(key, e.getKey())) { // Entry exists.
+                V previous = e.getValue();
+                e.setValue(value);
+                return previous;
+            }
+        }    
+        entries.add(i, entry);
+        return null;
+    }
+
+    @SuppressWarnings("unchecked")
+    @Override
+    public V remove(Object key) {
+        int i = entries.indexOf(new MapEntryImpl<K,V>((K)key, null));
+        if (i < 0) return null;
+        Entry<K,V> e = entries.get(i);
+        V previous = e.getValue();
+        entries.remove(i);
+        return previous;
+    }
+
+    @Override
+    public int size() {
+        return entries.size();
+    }
+
+    @Override
+    public Equality<? super V> valueComparator() {
+        return valueComparator;
+    }
+
+
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/marmotta-commons/src/ext/java/javolution/util/internal/map/sorted/MapEntryImpl.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-commons/src/ext/java/javolution/util/internal/map/sorted/MapEntryImpl.java b/commons/marmotta-commons/src/ext/java/javolution/util/internal/map/sorted/MapEntryImpl.java
new file mode 100644
index 0000000..5693a43
--- /dev/null
+++ b/commons/marmotta-commons/src/ext/java/javolution/util/internal/map/sorted/MapEntryImpl.java
@@ -0,0 +1,50 @@
+/*
+ * 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.util.internal.map.sorted;
+
+import java.io.Serializable;
+import java.util.Map;
+
+/**
+ * The sorted map entry implementation (serializable).
+ */
+public final class MapEntryImpl<K, V> implements Map.Entry<K, V>, Serializable {
+
+    private static final long serialVersionUID = 0x600L; // Version.
+    K key;
+    V value;
+  
+    public MapEntryImpl(K key, V value) {
+        this.key = key;
+        this.value = value;
+    }
+    
+    @Override
+    public K getKey() {
+        return key;
+    }
+
+    @Override
+    public V getValue() {
+        return value;
+    }
+
+    @Override
+    public V setValue(V value) {
+        V oldValue = this.value;
+        this.value = value;
+        return oldValue;
+    }
+    
+    @Override
+    public String toString() {
+        return key + "=" + value;
+    }
+
+  }

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/marmotta-commons/src/ext/java/javolution/util/internal/map/sorted/SharedSortedMapImpl.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-commons/src/ext/java/javolution/util/internal/map/sorted/SharedSortedMapImpl.java b/commons/marmotta-commons/src/ext/java/javolution/util/internal/map/sorted/SharedSortedMapImpl.java
new file mode 100644
index 0000000..9d1df7d
--- /dev/null
+++ b/commons/marmotta-commons/src/ext/java/javolution/util/internal/map/sorted/SharedSortedMapImpl.java
@@ -0,0 +1,107 @@
+/*
+ * 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.util.internal.map.sorted;
+
+import javolution.util.internal.ReadWriteLockImpl;
+import javolution.util.internal.map.SharedMapImpl;
+import javolution.util.service.SortedMapService;
+import javolution.util.service.SortedSetService;
+
+import java.util.Comparator;
+import java.util.Map;
+
+/**
+ * A shared view over a sorted map.
+ */
+public class SharedSortedMapImpl<K, V> extends SharedMapImpl<K, V> implements SortedMapService<K,V> {
+    
+    private static final long serialVersionUID = 0x600L; // Version.
+
+    public SharedSortedMapImpl(SortedMapService<K, V> target) {
+        super(target);        
+    }
+  
+    public SharedSortedMapImpl(SortedMapService<K, V> target, ReadWriteLockImpl lock) {
+        super(target, lock);
+    }
+  
+    @Override
+    public Comparator<? super K> comparator() {
+        return target().keyComparator();
+    }
+
+    @Override
+    public SortedSetService<Map.Entry<K, V>> entrySet() {
+        return new SubSortedMapImpl<K,V>(this, null, null).entrySet();
+    }
+
+
+    @Override
+    public K firstKey() {
+        lock.readLock.lock();
+        try {
+            return target().firstKey();
+        } finally {
+            lock.readLock.unlock();
+        }
+    }
+
+
+    @Override
+    public SortedMapService<K, V> headMap(K toKey) {
+        return new SubSortedMapImpl<K,V>(this, null, toKey);
+    }
+
+    @Override
+    public SortedSetService<K> keySet() {
+        return new SubSortedMapImpl<K,V>(this, null, null).keySet();
+    }
+
+    @Override
+    public K lastKey() {
+        lock.readLock.lock();
+        try {
+            return target().lastKey();
+        } finally {
+            lock.readLock.unlock();
+        }
+    }
+
+    @SuppressWarnings("unchecked")
+    @Override
+    public SortedMapService<K,V>[] split(int n, boolean updateable) {
+        SortedMapService<K,V>[] tmp;
+        lock.readLock.lock();
+        try {
+            tmp = target().split(n, updateable); 
+        } finally {
+            lock.readLock.unlock();
+        }
+        SortedMapService<K,V>[] result = new SortedMapService[tmp.length];
+        for (int i = 0; i < tmp.length; i++) {
+            result[i] = new SharedSortedMapImpl<K,V>(tmp[i], lock); // Shares the same locks.
+        }
+        return result;
+    }
+
+    @Override
+    public SortedMapService<K, V> subMap(K fromKey, K toKey) {
+        return new SubSortedMapImpl<K,V>(this, fromKey, toKey);
+    }
+
+    @Override
+    public SortedMapService<K, V> tailMap(K fromKey) {
+        return new SubSortedMapImpl<K,V>(this, fromKey, null);
+    }
+    
+    @Override
+    protected SortedMapService<K,V> target() {
+        return (SortedMapService<K,V>) super.target();
+    }
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/marmotta-commons/src/ext/java/javolution/util/internal/map/sorted/SortedMapView.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-commons/src/ext/java/javolution/util/internal/map/sorted/SortedMapView.java b/commons/marmotta-commons/src/ext/java/javolution/util/internal/map/sorted/SortedMapView.java
new file mode 100644
index 0000000..bd7e54f
--- /dev/null
+++ b/commons/marmotta-commons/src/ext/java/javolution/util/internal/map/sorted/SortedMapView.java
@@ -0,0 +1,163 @@
+/*
+ * 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.util.internal.map.sorted;
+
+import javolution.util.internal.map.MapView;
+import javolution.util.internal.set.sorted.SubSortedSetImpl;
+import javolution.util.service.SortedMapService;
+import javolution.util.service.SortedSetService;
+
+import java.util.Comparator;
+import java.util.Map;
+
+/**
+ * Sorted map view implementation; can be used as root class for implementations 
+ * if target is {@code null}.
+ * When possible sub-classes should forward to the actual target for the methods
+ * isEmpty, size and clear rather than using the default implementation.
+ */
+public abstract class SortedMapView<K,V> extends MapView<K,V> implements SortedMapService<K,V> {
+
+    /** Entry Set View */
+    protected class EntrySortedSet extends EntrySet implements SortedSetService<Entry<K,V>> {
+        private static final long serialVersionUID = SortedMapView.serialVersionUID;
+
+        @Override
+        public Entry<K, V> first() {
+            K key = SortedMapView.this.firstKey();
+            V value = SortedMapView.this.get(key);
+            return new MapEntryImpl<K,V>(key, value);
+        }
+
+        @Override
+        public SortedSetService<Entry<K, V>> headSet(Entry<K, V> toElement) {
+            return new SubSortedSetImpl<Entry<K, V>>(this, null, toElement);
+        }
+
+        @Override
+        public java.util.Map.Entry<K, V> last() {
+            K key = SortedMapView.this.lastKey();
+            V value = SortedMapView.this.get(key);
+            return new MapEntryImpl<K,V>(key, value);
+        }
+
+        @SuppressWarnings("unchecked")
+        @Override
+        public SortedSetService<Entry<K, V>>[] split(int n, boolean updateable) { 
+            return new SortedSetService[] { this }; // Split not supported.
+        }
+
+        @Override
+        public SortedSetService<java.util.Map.Entry<K, V>> subSet(
+               Entry<K, V> fromElement,
+               Entry<K, V> toElement) {
+            return new SubSortedSetImpl<Entry<K, V>>(this, fromElement, toElement);
+        }     
+     
+        @Override
+        public SortedSetService<Entry<K, V>> tailSet(Entry<K, V> fromElement) {
+            return new SubSortedSetImpl<Entry<K, V>>(this, fromElement, null);
+        }
+     
+    }
+  
+    /** Entry Key View */
+    protected class KeySortedSet extends KeySet implements SortedSetService<K> {
+        private static final long serialVersionUID = SortedMapView.serialVersionUID;
+
+        @Override
+        public K first() {
+            return SortedMapView.this.firstKey();
+        }
+
+        @Override
+        public SortedSetService<K> headSet(K toElement) {
+            return new SubSortedSetImpl<K>(this, null, toElement);
+        }
+
+        @Override
+        public K last() {
+            return SortedMapView.this.lastKey();
+        }
+
+        @SuppressWarnings("unchecked")
+        @Override
+        public SortedSetService<K>[] split(int n, boolean updateable) { 
+            return new SortedSetService[] { this }; // Split not supported.
+        }
+
+        @Override
+        public SortedSetService<K> subSet(K fromElement, K toElement) {
+            return new SubSortedSetImpl<K>(this, fromElement, toElement);
+        }
+  
+        @Override
+        public SortedSetService<K> tailSet(K fromElement) {
+            return new SubSortedSetImpl<K>(this, fromElement, null);
+        }
+    }
+    
+    private static final long serialVersionUID = 0x600L; // Version.
+
+    /**
+     * The view constructor or root class constructor if target is {@code null}.
+     */
+    public SortedMapView(SortedMapService<K,V> target) {
+        super(target);
+    }
+    
+    @Override
+    public Comparator<? super K> comparator() {
+        return keyComparator();
+    }
+
+    @Override
+    public SortedSetService<Map.Entry<K, V>> entrySet() {
+        return new EntrySortedSet();
+    }
+
+    @Override
+    public abstract K firstKey();
+
+    @Override
+    public SortedMapService<K, V> headMap(K toKey) {
+        return new SubSortedMapImpl<K,V>(this, firstKey(), toKey);
+    }
+
+    @Override
+    public SortedSetService<K> keySet() {
+        return new KeySortedSet();
+    }
+
+    @Override
+    public abstract K lastKey();
+
+    @SuppressWarnings("unchecked")
+    @Override
+    public SortedMapService<K, V>[] split(int n, boolean updateable) { 
+        return new SortedMapService[] { this }; // Split not supported.
+    }
+
+    @Override
+    public SortedMapService<K, V> subMap(K fromKey, K toKey) {
+        return new SubSortedMapImpl<K,V>(this, fromKey, toKey);
+    }
+
+    @Override
+    public SortedMapService<K, V> tailMap(K fromKey) {
+        return new SubSortedMapImpl<K,V>(this, fromKey, lastKey());
+    }
+
+    /** Returns the actual target */
+    @Override
+    protected SortedMapService<K,V> target() {
+        return (SortedMapService<K,V>) super.target();
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/marmotta-commons/src/ext/java/javolution/util/internal/map/sorted/SubSortedMapImpl.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-commons/src/ext/java/javolution/util/internal/map/sorted/SubSortedMapImpl.java b/commons/marmotta-commons/src/ext/java/javolution/util/internal/map/sorted/SubSortedMapImpl.java
new file mode 100644
index 0000000..481e653
--- /dev/null
+++ b/commons/marmotta-commons/src/ext/java/javolution/util/internal/map/sorted/SubSortedMapImpl.java
@@ -0,0 +1,143 @@
+/*
+ * 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.util.internal.map.sorted;
+
+import javolution.util.function.Equality;
+import javolution.util.service.SortedMapService;
+
+import java.util.Iterator;
+import java.util.NoSuchElementException;
+
+/**
+ * A view over a portion of a sorted map. 
+ */
+public class SubSortedMapImpl<K, V> extends SortedMapView<K, V> {
+
+    /** Peeking ahead iterator. */
+    private class IteratorImpl implements Iterator<Entry<K, V>> {
+
+        private boolean ahead;
+        private final Equality<? super K> cmp = keyComparator();
+        private Entry<K, V> next;
+        private final Iterator<Entry<K, V>> targetIterator = target()
+                .iterator();
+
+        @Override
+        public boolean hasNext() {
+            if (ahead) return true;
+            while (targetIterator.hasNext()) {
+                next = targetIterator.next();
+                if ((from != null) && (cmp.compare(next.getKey(), from) < 0)) continue;
+                if ((to != null) && (cmp.compare(next.getKey(), to) >= 0)) break;
+                ahead = true;
+                return true;
+            }
+            return false;
+        }
+
+        @Override
+        public Entry<K, V> next() {
+            hasNext(); // Moves ahead.
+            ahead = false;
+            return next;
+        }
+
+        @Override
+        public void remove() {
+            targetIterator.remove();
+        }
+    }
+
+    private static final long serialVersionUID = 0x600L; // Version.
+
+    private final K from; // Can be null. 
+    private final K to; // Can be null.
+
+    public SubSortedMapImpl(SortedMapService<K, V> target, K from, K to) {
+        super(target);
+        if ((from != null) && (to != null)
+                && (keyComparator().compare(from, to) > 0)) throw new IllegalArgumentException(
+                "from: " + from + ", to: " + to); // As per SortedSet contract.
+        this.from = from;
+        this.to = to;
+    }
+
+    @SuppressWarnings("unchecked")
+    @Override
+    public boolean containsKey(Object key) {
+        Equality<? super K> cmp = keyComparator();
+        if ((from != null) && (cmp.compare((K) key, from) < 0)) return false;
+        if ((to != null) && (cmp.compare((K) key, to) >= 0)) return false;
+        return target().containsKey(key);
+    }
+
+    @Override
+    public K firstKey() {
+        if (from == null) return target().firstKey();
+        Iterator<Entry<K, V>> it = iterator();
+        if (!it.hasNext()) throw new NoSuchElementException();
+        return it.next().getKey();
+    }
+
+    @SuppressWarnings("unchecked")
+    @Override
+    public V get(Object key) {
+        Equality<? super K> cmp = keyComparator();
+        if ((from != null) && (cmp.compare((K) key, from) < 0)) return null;
+        if ((to != null) && (cmp.compare((K) key, to) >= 0)) return null;
+        return target().get(key);
+    }
+
+    @Override
+    public Iterator<Entry<K, V>> iterator() {
+        return new IteratorImpl();
+    }
+
+    @Override
+    public Equality<? super K> keyComparator() {
+        return target().keyComparator();
+    }
+
+    @Override
+    public K lastKey() {
+        if (to == null) return target().lastKey();
+        Iterator<Entry<K, V>> it = iterator();
+        if (!it.hasNext()) throw new NoSuchElementException();
+        Entry<K, V> last = it.next();
+        while (it.hasNext()) {
+            last = it.next();
+        }
+        return last.getKey();
+    }
+
+    @Override
+    public V put(K key, V value) {
+        Equality<? super K> cmp = keyComparator();
+        if ((from != null) && (cmp.compare((K) key, from) < 0)) throw new IllegalArgumentException(
+                "Key: " + key + " outside of this sub-map bounds");
+        if ((to != null) && (cmp.compare((K) key, to) >= 0)) throw new IllegalArgumentException(
+                "Key: " + key + " outside of this sub-map bounds");
+        return target().put(key, value);
+    }
+
+    @SuppressWarnings("unchecked")
+    @Override
+    public V remove(Object key) {
+        Equality<? super K> cmp = keyComparator();
+        if ((from != null) && (cmp.compare((K) key, from) < 0)) return null;
+        if ((to != null) && (cmp.compare((K) key, to) >= 0)) return null;
+        return target().remove(key);
+    }
+
+    @Override
+    public Equality<? super V> valueComparator() {
+        return target().valueComparator();
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/marmotta-commons/src/ext/java/javolution/util/internal/map/sorted/UnmodifiableSortedMapImpl.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-commons/src/ext/java/javolution/util/internal/map/sorted/UnmodifiableSortedMapImpl.java b/commons/marmotta-commons/src/ext/java/javolution/util/internal/map/sorted/UnmodifiableSortedMapImpl.java
new file mode 100644
index 0000000..fc80711
--- /dev/null
+++ b/commons/marmotta-commons/src/ext/java/javolution/util/internal/map/sorted/UnmodifiableSortedMapImpl.java
@@ -0,0 +1,85 @@
+/*
+ * 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.util.internal.map.sorted;
+
+import javolution.util.internal.map.UnmodifiableMapImpl;
+import javolution.util.service.SortedMapService;
+import javolution.util.service.SortedSetService;
+
+import java.util.Comparator;
+import java.util.Map;
+
+/**
+ *  * An unmodifiable view over a map.
+ */
+public class UnmodifiableSortedMapImpl<K, V> extends UnmodifiableMapImpl<K, V> implements SortedMapService<K,V> {
+
+    private static final long serialVersionUID = 0x600L; // Version.
+
+    public UnmodifiableSortedMapImpl(SortedMapService<K, V> target) {
+        super(target);
+    }
+
+    @Override
+    public Comparator<? super K> comparator() {
+        return target().keyComparator();
+    }
+
+    @Override
+    public SortedSetService<Map.Entry<K, V>> entrySet() {
+        return new SubSortedMapImpl<K,V>(this, null, null).entrySet();
+    }
+
+    @Override
+    public K firstKey() {
+        return target().firstKey();
+    }
+
+    @Override
+    public SortedMapService<K, V> headMap(K toKey) {
+        return new SubSortedMapImpl<K,V>(this, null, toKey);
+    }
+
+    @Override
+    public SortedSetService<K> keySet() {
+        return new SubSortedMapImpl<K,V>(this, null, null).keySet();
+    }
+
+    @Override
+    public K lastKey() {
+        return target().lastKey();
+    }
+
+    @Override
+    public SortedMapService<K, V> subMap(K fromKey, K toKey) {
+        return new SubSortedMapImpl<K,V>(this, fromKey, toKey);
+    }
+
+     
+    @Override
+    public SortedMapService<K, V> tailMap(K fromKey) {
+        return new SubSortedMapImpl<K,V>(this, fromKey, null);
+    }
+    
+    @Override
+    protected SortedMapService<K,V> target() {
+        return (SortedMapService<K,V>) super.target();
+    }
+    
+    @SuppressWarnings("unchecked")
+    @Override
+    public SortedMapService<K,V>[] split(int n, boolean updateable) {
+        SortedMapService<K,V>[] subTargets = target().split(n, updateable);
+        SortedMapService<K,V>[] result = new SortedMapService[subTargets.length];
+        for (int i = 0; i < subTargets.length; i++) {
+            result[i] = new UnmodifiableSortedMapImpl<K,V>(subTargets[i]);
+        }
+        return result;
+    }
+ }

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/marmotta-commons/src/ext/java/javolution/util/internal/set/AtomicSetImpl.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-commons/src/ext/java/javolution/util/internal/set/AtomicSetImpl.java b/commons/marmotta-commons/src/ext/java/javolution/util/internal/set/AtomicSetImpl.java
new file mode 100644
index 0000000..7a94b53
--- /dev/null
+++ b/commons/marmotta-commons/src/ext/java/javolution/util/internal/set/AtomicSetImpl.java
@@ -0,0 +1,31 @@
+/*
+ * 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.util.internal.set;
+
+import javolution.util.internal.collection.AtomicCollectionImpl;
+import javolution.util.service.SetService;
+
+/**
+ * An atomic view over a set allowing concurrent access and sequential updates.
+ */
+public class AtomicSetImpl<E> extends AtomicCollectionImpl<E> implements
+        SetService<E> {
+
+    private static final long serialVersionUID = 0x600L; // Version.
+
+    public AtomicSetImpl(SetService<E> target) {
+        super(target);
+    }
+
+    @SuppressWarnings("unchecked")
+    @Override
+    public SetService<E>[] split(int n, boolean updateable) { 
+        return new SetService[] { this }; // Split not supported.
+    }
+ }

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/marmotta-commons/src/ext/java/javolution/util/internal/set/FilteredSetImpl.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-commons/src/ext/java/javolution/util/internal/set/FilteredSetImpl.java b/commons/marmotta-commons/src/ext/java/javolution/util/internal/set/FilteredSetImpl.java
new file mode 100644
index 0000000..78759da
--- /dev/null
+++ b/commons/marmotta-commons/src/ext/java/javolution/util/internal/set/FilteredSetImpl.java
@@ -0,0 +1,43 @@
+/*
+ * 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.util.internal.set;
+
+import javolution.util.function.Predicate;
+import javolution.util.internal.collection.FilteredCollectionImpl;
+import javolution.util.service.SetService;
+
+/**
+ * A filtered view over a set.
+ */
+public class FilteredSetImpl<E> extends FilteredCollectionImpl<E> implements
+        SetService<E> {
+
+    private static final long serialVersionUID = 0x600L; // Version.
+
+    public FilteredSetImpl(SetService<E> target, Predicate<? super E> filter) {
+        super(target, filter);
+    }
+
+    @SuppressWarnings("unchecked")
+    @Override
+    public SetService<E>[] split(int n, boolean updateable) {
+        SetService<E>[] subTargets = target().split(n, updateable);
+        SetService<E>[] result = new SetService[subTargets.length];
+        for (int i = 0; i < subTargets.length; i++) {
+            result[i] = new FilteredSetImpl<E>(subTargets[i], filter);
+        }
+        return result;
+    } 
+
+    /** Returns the actual target */
+    @Override
+    protected SetService<E> target() {
+        return (SetService<E>) super.target();
+    }
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/marmotta-commons/src/ext/java/javolution/util/internal/set/MappedSetImpl.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-commons/src/ext/java/javolution/util/internal/set/MappedSetImpl.java b/commons/marmotta-commons/src/ext/java/javolution/util/internal/set/MappedSetImpl.java
new file mode 100644
index 0000000..83aede0
--- /dev/null
+++ b/commons/marmotta-commons/src/ext/java/javolution/util/internal/set/MappedSetImpl.java
@@ -0,0 +1,43 @@
+/*
+ * 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.util.internal.set;
+
+import javolution.util.function.Function;
+import javolution.util.internal.collection.MappedCollectionImpl;
+import javolution.util.service.SetService;
+
+/**
+ * A mapped view over a set.
+ */
+public abstract class MappedSetImpl<E, R> extends MappedCollectionImpl<E, R>
+        implements SetService<R> {
+
+    private static final long serialVersionUID = 0x600L; // Version.
+
+    public MappedSetImpl(SetService<E> target,
+            Function<? super E, ? extends R> function) {
+        super(target, function);
+    }
+
+    @Override
+    public abstract boolean add(R r);
+
+    @Override
+    public abstract boolean contains(Object r);
+
+    @Override
+    public abstract boolean remove(Object r);
+
+
+    @SuppressWarnings("unchecked")
+    @Override
+    public SetService<R>[] split(int n, boolean updateable) {
+        return new SetService[] { this }; // Split not supported.
+    }    
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/marmotta-commons/src/ext/java/javolution/util/internal/set/SetView.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-commons/src/ext/java/javolution/util/internal/set/SetView.java b/commons/marmotta-commons/src/ext/java/javolution/util/internal/set/SetView.java
new file mode 100644
index 0000000..a5a81e1
--- /dev/null
+++ b/commons/marmotta-commons/src/ext/java/javolution/util/internal/set/SetView.java
@@ -0,0 +1,49 @@
+/*
+ * 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.util.internal.set;
+
+import javolution.util.internal.collection.CollectionView;
+import javolution.util.service.SetService;
+
+/**
+ * Set view implementation; can be used as root class for implementations 
+ * if target is {@code null}.
+ */
+public abstract class SetView<E> extends CollectionView<E> implements SetService<E> {
+
+    private static final long serialVersionUID = 0x600L; // Version.
+
+    /**
+     * The view constructor or root class constructor if target is {@code null}.
+     */
+    public SetView(SetService<E> target) {
+        super(target);
+    }
+
+    @Override
+    public abstract boolean contains(Object o);
+
+    @Override
+    public abstract boolean remove(Object o);
+
+    @Override
+    public abstract int size();
+
+    @SuppressWarnings("unchecked")
+    @Override
+    public SetService<E>[] split(int n, boolean updateable) { 
+        return new SetService[] { this }; // Split not supported.
+    }
+ 
+    @Override
+    protected SetService<E> target() {
+        return (SetService<E>) super.target();
+    }
+    
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/marmotta-commons/src/ext/java/javolution/util/internal/set/SharedSetImpl.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-commons/src/ext/java/javolution/util/internal/set/SharedSetImpl.java b/commons/marmotta-commons/src/ext/java/javolution/util/internal/set/SharedSetImpl.java
new file mode 100644
index 0000000..1b8e0a9
--- /dev/null
+++ b/commons/marmotta-commons/src/ext/java/javolution/util/internal/set/SharedSetImpl.java
@@ -0,0 +1,52 @@
+/*
+ * 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.util.internal.set;
+
+import javolution.util.internal.ReadWriteLockImpl;
+import javolution.util.internal.collection.SharedCollectionImpl;
+import javolution.util.service.SetService;
+
+/**
+ * A shared view over a set allowing concurrent access and sequential updates.
+ */
+public class SharedSetImpl<E> extends SharedCollectionImpl<E> implements
+        SetService<E> {
+
+    private static final long serialVersionUID = 0x600L; // Version.
+
+    public SharedSetImpl(SetService<E> target) {
+        super(target);
+    }
+
+    public SharedSetImpl(SetService<E> target, ReadWriteLockImpl lock) {
+        super(target, lock);
+    }
+    
+    @SuppressWarnings("unchecked")
+    @Override
+    public SetService<E>[] split(int n, boolean updateable) {
+        SetService<E>[] tmp;
+        lock.readLock.lock();
+        try {
+            tmp = target().split(n, updateable); 
+        } finally {
+            lock.readLock.unlock();
+        }
+        SetService<E>[] result = new SetService[tmp.length];
+        for (int i = 0; i < tmp.length; i++) {
+            result[i] = new SharedSetImpl<E>(tmp[i], lock); // Shares the same locks.
+        }
+        return result;
+    }
+    
+    @Override
+    protected SetService<E> target() {
+        return (SetService<E>) super.target();
+    }    
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/marmotta-commons/src/ext/java/javolution/util/internal/set/UnmodifiableSetImpl.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-commons/src/ext/java/javolution/util/internal/set/UnmodifiableSetImpl.java b/commons/marmotta-commons/src/ext/java/javolution/util/internal/set/UnmodifiableSetImpl.java
new file mode 100644
index 0000000..1ff6ff6
--- /dev/null
+++ b/commons/marmotta-commons/src/ext/java/javolution/util/internal/set/UnmodifiableSetImpl.java
@@ -0,0 +1,42 @@
+/*
+ * 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.util.internal.set;
+
+import javolution.util.internal.collection.UnmodifiableCollectionImpl;
+import javolution.util.service.SetService;
+
+/**
+ * An unmodifiable view over a set.
+ */
+public class UnmodifiableSetImpl<E> extends UnmodifiableCollectionImpl<E>
+        implements SetService<E> {
+
+    private static final long serialVersionUID = 0x600L; // Version.
+
+    public UnmodifiableSetImpl(SetService<E> target) {
+        super(target);
+    }
+
+    @SuppressWarnings("unchecked")
+    @Override
+    public SetService<E>[] split(int n, boolean updateable) {
+        SetService<E>[] subTargets = target().split(n, updateable);
+        SetService<E>[] result = new SetService[subTargets.length];
+        for (int i = 0; i < subTargets.length; i++) {
+            result[i] = new UnmodifiableSetImpl<E>(subTargets[i]);
+        }
+        return result;
+    }
+    
+    @Override
+    protected SetService<E> target() {
+        return (SetService<E>) super.target();
+    }
+    
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/marmotta-commons/src/ext/java/javolution/util/internal/set/sorted/AtomicSortedSetImpl.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-commons/src/ext/java/javolution/util/internal/set/sorted/AtomicSortedSetImpl.java b/commons/marmotta-commons/src/ext/java/javolution/util/internal/set/sorted/AtomicSortedSetImpl.java
new file mode 100644
index 0000000..d47e5d0
--- /dev/null
+++ b/commons/marmotta-commons/src/ext/java/javolution/util/internal/set/sorted/AtomicSortedSetImpl.java
@@ -0,0 +1,62 @@
+/*
+ * 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.util.internal.set.sorted;
+
+import javolution.util.internal.set.AtomicSetImpl;
+import javolution.util.service.SortedSetService;
+
+/**
+ * An atomic view over a sorted set allowing concurrent access and sequential updates.
+ */
+public class AtomicSortedSetImpl<E> extends AtomicSetImpl<E> implements
+        SortedSetService<E> {
+
+    private static final long serialVersionUID = 0x600L; // Version.
+
+    public AtomicSortedSetImpl(SortedSetService<E> target) {
+        super(target);
+    }
+
+    @Override
+    public E first() {
+        return targetView().first();
+    }
+
+    @Override
+    public SortedSetService<E> headSet(E toElement) {
+        return new SubSortedSetImpl<E>(this, null, toElement);
+    }
+
+    @Override
+    public E last() {
+        return targetView().last();
+    }
+
+    @Override
+    @SuppressWarnings("unchecked")
+    public SortedSetService<E>[] split(int n, boolean updateable) { 
+        return new SortedSetService[] { this }; // Split not supported.
+    }
+
+    @Override
+    public SortedSetService<E> subSet(E fromElement, E toElement) {
+        return new SubSortedSetImpl<E>(this, fromElement, toElement);
+    }
+    
+    @Override
+    public SortedSetService<E> tailSet(E fromElement) {
+        return new SubSortedSetImpl<E>(this, fromElement, null);
+    }
+ 
+    @Override
+    protected SortedSetService<E> targetView() {
+        return (SortedSetService<E>) super.targetView();
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/marmotta-commons/src/ext/java/javolution/util/internal/set/sorted/SharedSortedSetImpl.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-commons/src/ext/java/javolution/util/internal/set/sorted/SharedSortedSetImpl.java b/commons/marmotta-commons/src/ext/java/javolution/util/internal/set/sorted/SharedSortedSetImpl.java
new file mode 100644
index 0000000..a453b17
--- /dev/null
+++ b/commons/marmotta-commons/src/ext/java/javolution/util/internal/set/sorted/SharedSortedSetImpl.java
@@ -0,0 +1,88 @@
+/*
+ * 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.util.internal.set.sorted;
+
+import javolution.util.internal.ReadWriteLockImpl;
+import javolution.util.internal.set.SharedSetImpl;
+import javolution.util.service.SetService;
+import javolution.util.service.SortedSetService;
+
+/**
+ * A shared view over a set allowing concurrent access and sequential updates.
+ */
+public class SharedSortedSetImpl<E> extends SharedSetImpl<E> implements
+        SortedSetService<E> {
+
+    private static final long serialVersionUID = 0x600L; // Version.
+
+    public SharedSortedSetImpl(SetService<E> target) {
+        super(target);
+    }
+
+    public SharedSortedSetImpl(SortedSetService<E> target, ReadWriteLockImpl lock) {
+        super(target, lock);
+   }
+    
+    @Override
+    public E first() {
+        lock.readLock.lock();
+        try {
+            return target().first();
+        } finally {
+            lock.readLock.unlock();
+        }
+    }
+
+    @Override
+    public SortedSetService<E> headSet(E toElement) {
+        return new SubSortedSetImpl<E>(this, null, toElement);
+    }
+
+    @Override
+    public E last() {
+        lock.readLock.lock();
+        try {
+            return target().last();
+        } finally {
+            lock.readLock.unlock();
+        }
+    }
+
+    @SuppressWarnings("unchecked")
+    @Override
+    public SortedSetService<E>[] split(int n, boolean updateable) {
+        SortedSetService<E>[] tmp;
+        lock.readLock.lock();
+        try {
+            tmp = target().split(n, updateable); 
+        } finally {
+            lock.readLock.unlock();
+        }
+        SortedSetService<E>[] result = new SortedSetService[tmp.length];
+        for (int i = 0; i < tmp.length; i++) {
+            result[i] = new SharedSortedSetImpl<E>(tmp[i], lock); // Shares the same locks.
+        }
+        return result;
+    }
+
+    @Override
+    public SortedSetService<E> subSet(E fromElement, E toElement) {
+        return new SubSortedSetImpl<E>(this, fromElement, toElement);
+    }
+ 
+    @Override
+    public SortedSetService<E> tailSet(E fromElement) {
+        return new SubSortedSetImpl<E>(this, fromElement, null);
+    }
+    
+    @Override
+    protected SortedSetService<E> target() {
+        return (SortedSetService<E>) super.target();
+    }
+}


[060/100] [abbrv] git commit: MAROTTA-395: stabilized integration test for the marmotta-webapp archetype

Posted by wi...@apache.org.
MAROTTA-395: stabilized integration test for the marmotta-webapp archetype


Project: http://git-wip-us.apache.org/repos/asf/marmotta/repo
Commit: http://git-wip-us.apache.org/repos/asf/marmotta/commit/40ebe232
Tree: http://git-wip-us.apache.org/repos/asf/marmotta/tree/40ebe232
Diff: http://git-wip-us.apache.org/repos/asf/marmotta/diff/40ebe232

Branch: refs/heads/ldp
Commit: 40ebe23201848761349bf4e2d76bda3cc088a399
Parents: 4804829
Author: Jakob Frank <ja...@apache.org>
Authored: Tue Apr 8 10:36:05 2014 +0200
Committer: Jakob Frank <ja...@apache.org>
Committed: Tue Apr 8 11:05:47 2014 +0200

----------------------------------------------------------------------
 .../src/main/resources/archetype-resources/pom.xml  | 16 ++++++++++------
 .../src/test/resources/verification.xml             |  4 ++--
 2 files changed, 12 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/marmotta/blob/40ebe232/build/archetypes/marmotta-archetype-webapp/src/main/resources/archetype-resources/pom.xml
----------------------------------------------------------------------
diff --git a/build/archetypes/marmotta-archetype-webapp/src/main/resources/archetype-resources/pom.xml b/build/archetypes/marmotta-archetype-webapp/src/main/resources/archetype-resources/pom.xml
index c45a647..c0899d3 100644
--- a/build/archetypes/marmotta-archetype-webapp/src/main/resources/archetype-resources/pom.xml
+++ b/build/archetypes/marmotta-archetype-webapp/src/main/resources/archetype-resources/pom.xml
@@ -108,8 +108,9 @@
                         <systemProperties>
                             <marmotta.home>\${marmotta.home}</marmotta.home>
                         </systemProperties>
-                        <!--                         <contextReloadable>true</contextReloadable> -->
-                        <!--                         <backgroundProcessorDelay>10</backgroundProcessorDelay> -->
+                        <skipErrorOnShutdown>true</skipErrorOnShutdown>
+                        <!-- <contextReloadable>true</contextReloadable> -->
+                        <!-- <backgroundProcessorDelay>10</backgroundProcessorDelay> -->
                     </configuration>
                 </plugin>
             </plugins>
@@ -136,7 +137,10 @@
                     <execution>
                         <id>tomcat-run</id>
                         <phase>pre-integration-test</phase>
-                        <goals><goal>run-war-only</goal></goals>
+                        <goals>
+                            <goal>shutdown</goal>
+                            <goal>run-war-only</goal>
+                        </goals>
                         <configuration>
                             <fork>true</fork>
                         </configuration>
@@ -173,8 +177,8 @@
                             <goal>wget</goal>
                         </goals>
                         <configuration>
-                            <url>http://localhost:\${marmotta.port}\${marmotta.context}config/list</url>
-                            <outputFileName>config.json</outputFileName>
+                            <url>http://localhost:\${marmotta.port}\${marmotta.context}config/data/kiwi.version</url>
+                            <outputFileName>kiwi-version.json</outputFileName>
                             <outputDirectory>\${project.build.directory}/it/</outputDirectory>
                             <skipCache>true</skipCache>
                         </configuration>
@@ -187,7 +191,7 @@
                 <executions>
                     <execution>
                         <id>check-files</id>
-                        <phase>integration-test</phase>
+                        <phase>verify</phase>
                         <goals><goal>verify</goal></goals>
                         <configuration>
                             <basedir>\${project.build.directory}/it/</basedir>

http://git-wip-us.apache.org/repos/asf/marmotta/blob/40ebe232/build/archetypes/marmotta-archetype-webapp/src/main/resources/archetype-resources/src/test/resources/verification.xml
----------------------------------------------------------------------
diff --git a/build/archetypes/marmotta-archetype-webapp/src/main/resources/archetype-resources/src/test/resources/verification.xml b/build/archetypes/marmotta-archetype-webapp/src/main/resources/archetype-resources/src/test/resources/verification.xml
index 504912c..3c1eb6a 100644
--- a/build/archetypes/marmotta-archetype-webapp/src/main/resources/archetype-resources/src/test/resources/verification.xml
+++ b/build/archetypes/marmotta-archetype-webapp/src/main/resources/archetype-resources/src/test/resources/verification.xml
@@ -24,8 +24,8 @@
             <contains>var _SERVER_URL</contains>
         </file>
         <file>
-            <location>config.json</location>
-            <contains>\Q"kiwi.version":{"value":"${marmottaVersion}"\E</contains>
+            <location>kiwi-version.json</location>
+            <contains>^\Q{"kiwi.version":"${marmottaVersion}"}\E$</contains>
         </file>
     </files>
 </verifications>


[027/100] [abbrv] [partial] Reverting the erroneous merge by Sebastian according to the instructions in INFRA-6876

Posted by wi...@apache.org.
http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/extras/webjars/snorql/src/main/resources/scriptaculous/builder.js
----------------------------------------------------------------------
diff --git a/extras/webjars/snorql/src/main/resources/scriptaculous/builder.js b/extras/webjars/snorql/src/main/resources/scriptaculous/builder.js
new file mode 100755
index 0000000..afa33df
--- /dev/null
+++ b/extras/webjars/snorql/src/main/resources/scriptaculous/builder.js
@@ -0,0 +1,153 @@
+/*
+ * 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.
+ */
+// script.aculo.us builder.js v1.8.1, Thu Jan 03 22:07:12 -0500 2008
+
+// Copyright (c) 2005-2007 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
+//
+// script.aculo.us is freely distributable under the terms of an MIT-style license.
+// For details, see the script.aculo.us web site: http://script.aculo.us/
+
+var Builder = {
+  NODEMAP: {
+    AREA: 'map',
+    CAPTION: 'table',
+    COL: 'table',
+    COLGROUP: 'table',
+    LEGEND: 'fieldset',
+    OPTGROUP: 'select',
+    OPTION: 'select',
+    PARAM: 'object',
+    TBODY: 'table',
+    TD: 'table',
+    TFOOT: 'table',
+    TH: 'table',
+    THEAD: 'table',
+    TR: 'table'
+  },
+  // note: For Firefox < 1.5, OPTION and OPTGROUP tags are currently broken,
+  //       due to a Firefox bug
+  node: function(elementName) {
+    elementName = elementName.toUpperCase();
+    
+    // try innerHTML approach
+    var parentTag = this.NODEMAP[elementName] || 'div';
+    var parentElement = document.createElement(parentTag);
+    try { // prevent IE "feature": http://dev.rubyonrails.org/ticket/2707
+      parentElement.innerHTML = "<" + elementName + "></" + elementName + ">";
+    } catch(e) {}
+    var element = parentElement.firstChild || null;
+      
+    // see if browser added wrapping tags
+    if(element && (element.tagName.toUpperCase() != elementName))
+      element = element.getElementsByTagName(elementName)[0];
+    
+    // fallback to createElement approach
+    if(!element) element = document.createElement(elementName);
+    
+    // abort if nothing could be created
+    if(!element) return;
+
+    // attributes (or text)
+    if(arguments[1])
+      if(this._isStringOrNumber(arguments[1]) ||
+        (arguments[1] instanceof Array) ||
+        arguments[1].tagName) {
+          this._children(element, arguments[1]);
+        } else {
+          var attrs = this._attributes(arguments[1]);
+          if(attrs.length) {
+            try { // prevent IE "feature": http://dev.rubyonrails.org/ticket/2707
+              parentElement.innerHTML = "<" +elementName + " " +
+                attrs + "></" + elementName + ">";
+            } catch(e) {}
+            element = parentElement.firstChild || null;
+            // workaround firefox 1.0.X bug
+            if(!element) {
+              element = document.createElement(elementName);
+              for(attr in arguments[1]) 
+                element[attr == 'class' ? 'className' : attr] = arguments[1][attr];
+            }
+            if(element.tagName.toUpperCase() != elementName)
+              element = parentElement.getElementsByTagName(elementName)[0];
+          }
+        } 
+
+    // text, or array of children
+    if(arguments[2])
+      this._children(element, arguments[2]);
+
+     return element;
+  },
+  _text: function(text) {
+     return document.createTextNode(text);
+  },
+
+  ATTR_MAP: {
+    'className': 'class',
+    'htmlFor': 'for'
+  },
+
+  _attributes: function(attributes) {
+    var attrs = [];
+    for(attribute in attributes)
+      attrs.push((attribute in this.ATTR_MAP ? this.ATTR_MAP[attribute] : attribute) +
+          '="' + attributes[attribute].toString().escapeHTML().gsub(/"/,'&quot;') + '"');
+    return attrs.join(" ");
+  },
+  _children: function(element, children) {
+    if(children.tagName) {
+      element.appendChild(children);
+      return;
+    }
+    if(typeof children=='object') { // array can hold nodes and text
+      children.flatten().each( function(e) {
+        if(typeof e=='object')
+          element.appendChild(e)
+        else
+          if(Builder._isStringOrNumber(e))
+            element.appendChild(Builder._text(e));
+      });
+    } else
+      if(Builder._isStringOrNumber(children))
+        element.appendChild(Builder._text(children));
+  },
+  _isStringOrNumber: function(param) {
+    return(typeof param=='string' || typeof param=='number');
+  },
+  build: function(html) {
+    var element = this.node('div');
+    $(element).update(html.strip());
+    return element.down();
+  },
+  dump: function(scope) { 
+    if(typeof scope != 'object' && typeof scope != 'function') scope = window; //global scope 
+  
+    var tags = ("A ABBR ACRONYM ADDRESS APPLET AREA B BASE BASEFONT BDO BIG BLOCKQUOTE BODY " +
+      "BR BUTTON CAPTION CENTER CITE CODE COL COLGROUP DD DEL DFN DIR DIV DL DT EM FIELDSET " +
+      "FONT FORM FRAME FRAMESET H1 H2 H3 H4 H5 H6 HEAD HR HTML I IFRAME IMG INPUT INS ISINDEX "+
+      "KBD LABEL LEGEND LI LINK MAP MENU META NOFRAMES NOSCRIPT OBJECT OL OPTGROUP OPTION P "+
+      "PARAM PRE Q S SAMP SCRIPT SELECT SMALL SPAN STRIKE STRONG STYLE SUB SUP TABLE TBODY TD "+
+      "TEXTAREA TFOOT TH THEAD TITLE TR TT U UL VAR").split(/\s+/);
+  
+    tags.each( function(tag){ 
+      scope[tag] = function() { 
+        return Builder.node.apply(Builder, [tag].concat($A(arguments)));  
+      } 
+    });
+  }
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/extras/webjars/snorql/src/main/resources/scriptaculous/controls.js
----------------------------------------------------------------------
diff --git a/extras/webjars/snorql/src/main/resources/scriptaculous/controls.js b/extras/webjars/snorql/src/main/resources/scriptaculous/controls.js
new file mode 100755
index 0000000..278f99b
--- /dev/null
+++ b/extras/webjars/snorql/src/main/resources/scriptaculous/controls.js
@@ -0,0 +1,971 @@
+/*
+ * 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.
+ */
+// script.aculo.us controls.js v1.8.1, Thu Jan 03 22:07:12 -0500 2008
+
+// Autocompleter.Base handles all the autocompletion functionality
+// that's independent of the data source for autocompletion. This
+// includes drawing the autocompletion menu, observing keyboard
+// and mouse events, and similar.
+//
+// Specific autocompleters need to provide, at the very least, 
+// a getUpdatedChoices function that will be invoked every time
+// the text inside the monitored textbox changes. This method 
+// should get the text for which to provide autocompletion by
+// invoking this.getToken(), NOT by directly accessing
+// this.element.value. This is to allow incremental tokenized
+// autocompletion. Specific auto-completion logic (AJAX, etc)
+// belongs in getUpdatedChoices.
+//
+// Tokenized incremental autocompletion is enabled automatically
+// when an autocompleter is instantiated with the 'tokens' option
+// in the options parameter, e.g.:
+// new Ajax.Autocompleter('id','upd', '/url/', { tokens: ',' });
+// will incrementally autocomplete with a comma as the token.
+// Additionally, ',' in the above example can be replaced with
+// a token array, e.g. { tokens: [',', '\n'] } which
+// enables autocompletion on multiple tokens. This is most 
+// useful when one of the tokens is \n (a newline), as it 
+// allows smart autocompletion after linebreaks.
+
+if(typeof Effect == 'undefined')
+  throw("controls.js requires including script.aculo.us' effects.js library");
+
+var Autocompleter = { }
+Autocompleter.Base = Class.create({
+  baseInitialize: function(element, update, options) {
+    element          = $(element)
+    this.element     = element; 
+    this.update      = $(update);  
+    this.hasFocus    = false; 
+    this.changed     = false; 
+    this.active      = false; 
+    this.index       = 0;     
+    this.entryCount  = 0;
+    this.oldElementValue = this.element.value;
+
+    if(this.setOptions)
+      this.setOptions(options);
+    else
+      this.options = options || { };
+
+    this.options.paramName    = this.options.paramName || this.element.name;
+    this.options.tokens       = this.options.tokens || [];
+    this.options.frequency    = this.options.frequency || 0.4;
+    this.options.minChars     = this.options.minChars || 1;
+    this.options.onShow       = this.options.onShow || 
+      function(element, update){ 
+        if(!update.style.position || update.style.position=='absolute') {
+          update.style.position = 'absolute';
+          Position.clone(element, update, {
+            setHeight: false, 
+            offsetTop: element.offsetHeight
+          });
+        }
+        Effect.Appear(update,{duration:0.15});
+      };
+    this.options.onHide = this.options.onHide || 
+      function(element, update){ new Effect.Fade(update,{duration:0.15}) };
+
+    if(typeof(this.options.tokens) == 'string') 
+      this.options.tokens = new Array(this.options.tokens);
+    // Force carriage returns as token delimiters anyway
+    if (!this.options.tokens.include('\n'))
+      this.options.tokens.push('\n');
+
+    this.observer = null;
+    
+    this.element.setAttribute('autocomplete','off');
+
+    Element.hide(this.update);
+
+    Event.observe(this.element, 'blur', this.onBlur.bindAsEventListener(this));
+    Event.observe(this.element, 'keydown', this.onKeyPress.bindAsEventListener(this));
+  },
+
+  show: function() {
+    if(Element.getStyle(this.update, 'display')=='none') this.options.onShow(this.element, this.update);
+    if(!this.iefix && 
+      (Prototype.Browser.IE) &&
+      (Element.getStyle(this.update, 'position')=='absolute')) {
+      new Insertion.After(this.update, 
+       '<iframe id="' + this.update.id + '_iefix" '+
+       'style="display:none;position:absolute;filter:progid:DXImageTransform.Microsoft.Alpha(opacity=0);" ' +
+       'src="javascript:false;" frameborder="0" scrolling="no"></iframe>');
+      this.iefix = $(this.update.id+'_iefix');
+    }
+    if(this.iefix) setTimeout(this.fixIEOverlapping.bind(this), 50);
+  },
+  
+  fixIEOverlapping: function() {
+    Position.clone(this.update, this.iefix, {setTop:(!this.update.style.height)});
+    this.iefix.style.zIndex = 1;
+    this.update.style.zIndex = 2;
+    Element.show(this.iefix);
+  },
+
+  hide: function() {
+    this.stopIndicator();
+    if(Element.getStyle(this.update, 'display')!='none') this.options.onHide(this.element, this.update);
+    if(this.iefix) Element.hide(this.iefix);
+  },
+
+  startIndicator: function() {
+    if(this.options.indicator) Element.show(this.options.indicator);
+  },
+
+  stopIndicator: function() {
+    if(this.options.indicator) Element.hide(this.options.indicator);
+  },
+
+  onKeyPress: function(event) {
+    if(this.active)
+      switch(event.keyCode) {
+       case Event.KEY_TAB:
+       case Event.KEY_RETURN:
+         this.selectEntry();
+         Event.stop(event);
+       case Event.KEY_ESC:
+         this.hide();
+         this.active = false;
+         Event.stop(event);
+         return;
+       case Event.KEY_LEFT:
+       case Event.KEY_RIGHT:
+         return;
+       case Event.KEY_UP:
+         this.markPrevious();
+         this.render();
+         Event.stop(event);
+         return;
+       case Event.KEY_DOWN:
+         this.markNext();
+         this.render();
+         Event.stop(event);
+         return;
+      }
+     else 
+       if(event.keyCode==Event.KEY_TAB || event.keyCode==Event.KEY_RETURN || 
+         (Prototype.Browser.WebKit > 0 && event.keyCode == 0)) return;
+
+    this.changed = true;
+    this.hasFocus = true;
+
+    if(this.observer) clearTimeout(this.observer);
+      this.observer = 
+        setTimeout(this.onObserverEvent.bind(this), this.options.frequency*1000);
+  },
+
+  activate: function() {
+    this.changed = false;
+    this.hasFocus = true;
+    this.getUpdatedChoices();
+  },
+
+  onHover: function(event) {
+    var element = Event.findElement(event, 'LI');
+    if(this.index != element.autocompleteIndex) 
+    {
+        this.index = element.autocompleteIndex;
+        this.render();
+    }
+    Event.stop(event);
+  },
+  
+  onClick: function(event) {
+    var element = Event.findElement(event, 'LI');
+    this.index = element.autocompleteIndex;
+    this.selectEntry();
+    this.hide();
+  },
+  
+  onBlur: function(event) {
+    // needed to make click events working
+    setTimeout(this.hide.bind(this), 250);
+    this.hasFocus = false;
+    this.active = false;     
+  }, 
+  
+  render: function() {
+    if(this.entryCount > 0) {
+      for (var i = 0; i < this.entryCount; i++)
+        this.index==i ? 
+          Element.addClassName(this.getEntry(i),"selected") : 
+          Element.removeClassName(this.getEntry(i),"selected");
+      if(this.hasFocus) { 
+        this.show();
+        this.active = true;
+      }
+    } else {
+      this.active = false;
+      this.hide();
+    }
+  },
+  
+  markPrevious: function() {
+    if(this.index > 0) this.index--
+      else this.index = this.entryCount-1;
+    this.getEntry(this.index).scrollIntoView(true);
+  },
+  
+  markNext: function() {
+    if(this.index < this.entryCount-1) this.index++
+      else this.index = 0;
+    this.getEntry(this.index).scrollIntoView(false);
+  },
+  
+  getEntry: function(index) {
+    return this.update.firstChild.childNodes[index];
+  },
+  
+  getCurrentEntry: function() {
+    return this.getEntry(this.index);
+  },
+  
+  selectEntry: function() {
+    this.active = false;
+    this.updateElement(this.getCurrentEntry());
+  },
+
+  updateElement: function(selectedElement) {
+    if (this.options.updateElement) {
+      this.options.updateElement(selectedElement);
+      return;
+    }
+    var value = '';
+    if (this.options.select) {
+      var nodes = $(selectedElement).select('.' + this.options.select) || [];
+      if(nodes.length>0) value = Element.collectTextNodes(nodes[0], this.options.select);
+    } else
+      value = Element.collectTextNodesIgnoreClass(selectedElement, 'informal');
+    
+    var bounds = this.getTokenBounds();
+    if (bounds[0] != -1) {
+      var newValue = this.element.value.substr(0, bounds[0]);
+      var whitespace = this.element.value.substr(bounds[0]).match(/^\s+/);
+      if (whitespace)
+        newValue += whitespace[0];
+      this.element.value = newValue + value + this.element.value.substr(bounds[1]);
+    } else {
+      this.element.value = value;
+    }
+    this.oldElementValue = this.element.value;
+    this.element.focus();
+    
+    if (this.options.afterUpdateElement)
+      this.options.afterUpdateElement(this.element, selectedElement);
+  },
+
+  updateChoices: function(choices) {
+    if(!this.changed && this.hasFocus) {
+      this.update.innerHTML = choices;
+      Element.cleanWhitespace(this.update);
+      Element.cleanWhitespace(this.update.down());
+
+      if(this.update.firstChild && this.update.down().childNodes) {
+        this.entryCount = 
+          this.update.down().childNodes.length;
+        for (var i = 0; i < this.entryCount; i++) {
+          var entry = this.getEntry(i);
+          entry.autocompleteIndex = i;
+          this.addObservers(entry);
+        }
+      } else { 
+        this.entryCount = 0;
+      }
+
+      this.stopIndicator();
+      this.index = 0;
+      
+      if(this.entryCount==1 && this.options.autoSelect) {
+        this.selectEntry();
+        this.hide();
+      } else {
+        this.render();
+      }
+    }
+  },
+
+  addObservers: function(element) {
+    Event.observe(element, "mouseover", this.onHover.bindAsEventListener(this));
+    Event.observe(element, "click", this.onClick.bindAsEventListener(this));
+  },
+
+  onObserverEvent: function() {
+    this.changed = false;   
+    this.tokenBounds = null;
+    if(this.getToken().length>=this.options.minChars) {
+      this.getUpdatedChoices();
+    } else {
+      this.active = false;
+      this.hide();
+    }
+    this.oldElementValue = this.element.value;
+  },
+
+  getToken: function() {
+    var bounds = this.getTokenBounds();
+    return this.element.value.substring(bounds[0], bounds[1]).strip();
+  },
+
+  getTokenBounds: function() {
+    if (null != this.tokenBounds) return this.tokenBounds;
+    var value = this.element.value;
+    if (value.strip().empty()) return [-1, 0];
+    var diff = arguments.callee.getFirstDifferencePos(value, this.oldElementValue);
+    var offset = (diff == this.oldElementValue.length ? 1 : 0);
+    var prevTokenPos = -1, nextTokenPos = value.length;
+    var tp;
+    for (var index = 0, l = this.options.tokens.length; index < l; ++index) {
+      tp = value.lastIndexOf(this.options.tokens[index], diff + offset - 1);
+      if (tp > prevTokenPos) prevTokenPos = tp;
+      tp = value.indexOf(this.options.tokens[index], diff + offset);
+      if (-1 != tp && tp < nextTokenPos) nextTokenPos = tp;
+    }
+    return (this.tokenBounds = [prevTokenPos + 1, nextTokenPos]);
+  }
+});
+
+Autocompleter.Base.prototype.getTokenBounds.getFirstDifferencePos = function(newS, oldS) {
+  var boundary = Math.min(newS.length, oldS.length);
+  for (var index = 0; index < boundary; ++index)
+    if (newS[index] != oldS[index])
+      return index;
+  return boundary;
+};
+
+Ajax.Autocompleter = Class.create(Autocompleter.Base, {
+  initialize: function(element, update, url, options) {
+    this.baseInitialize(element, update, options);
+    this.options.asynchronous  = true;
+    this.options.onComplete    = this.onComplete.bind(this);
+    this.options.defaultParams = this.options.parameters || null;
+    this.url                   = url;
+  },
+
+  getUpdatedChoices: function() {
+    this.startIndicator();
+    
+    var entry = encodeURIComponent(this.options.paramName) + '=' + 
+      encodeURIComponent(this.getToken());
+
+    this.options.parameters = this.options.callback ?
+      this.options.callback(this.element, entry) : entry;
+
+    if(this.options.defaultParams) 
+      this.options.parameters += '&' + this.options.defaultParams;
+    
+    new Ajax.Request(this.url, this.options);
+  },
+
+  onComplete: function(request) {
+    this.updateChoices(request.responseText);
+  }
+});
+
+// The local array autocompleter. Used when you'd prefer to
+// inject an array of autocompletion options into the page, rather
+// than sending out Ajax queries, which can be quite slow sometimes.
+//
+// The constructor takes four parameters. The first two are, as usual,
+// the id of the monitored textbox, and id of the autocompletion menu.
+// The third is the array you want to autocomplete from, and the fourth
+// is the options block.
+//
+// Extra local autocompletion options:
+// - choices - How many autocompletion choices to offer
+//
+// - partialSearch - If false, the autocompleter will match entered
+//                    text only at the beginning of strings in the 
+//                    autocomplete array. Defaults to true, which will
+//                    match text at the beginning of any *word* in the
+//                    strings in the autocomplete array. If you want to
+//                    search anywhere in the string, additionally set
+//                    the option fullSearch to true (default: off).
+//
+// - fullSsearch - Search anywhere in autocomplete array strings.
+//
+// - partialChars - How many characters to enter before triggering
+//                   a partial match (unlike minChars, which defines
+//                   how many characters are required to do any match
+//                   at all). Defaults to 2.
+//
+// - ignoreCase - Whether to ignore case when autocompleting.
+//                 Defaults to true.
+//
+// It's possible to pass in a custom function as the 'selector' 
+// option, if you prefer to write your own autocompletion logic.
+// In that case, the other options above will not apply unless
+// you support them.
+
+Autocompleter.Local = Class.create(Autocompleter.Base, {
+  initialize: function(element, update, array, options) {
+    this.baseInitialize(element, update, options);
+    this.options.array = array;
+  },
+
+  getUpdatedChoices: function() {
+    this.updateChoices(this.options.selector(this));
+  },
+
+  setOptions: function(options) {
+    this.options = Object.extend({
+      choices: 10,
+      partialSearch: true,
+      partialChars: 2,
+      ignoreCase: true,
+      fullSearch: false,
+      selector: function(instance) {
+        var ret       = []; // Beginning matches
+        var partial   = []; // Inside matches
+        var entry     = instance.getToken();
+        var count     = 0;
+
+        for (var i = 0; i < instance.options.array.length &&  
+          ret.length < instance.options.choices ; i++) { 
+
+          var elem = instance.options.array[i];
+          var foundPos = instance.options.ignoreCase ? 
+            elem.toLowerCase().indexOf(entry.toLowerCase()) : 
+            elem.indexOf(entry);
+
+          while (foundPos != -1) {
+            if (foundPos == 0 && elem.length != entry.length) { 
+              ret.push("<li><strong>" + elem.substr(0, entry.length) + "</strong>" + 
+                elem.substr(entry.length) + "</li>");
+              break;
+            } else if (entry.length >= instance.options.partialChars && 
+              instance.options.partialSearch && foundPos != -1) {
+              if (instance.options.fullSearch || /\s/.test(elem.substr(foundPos-1,1))) {
+                partial.push("<li>" + elem.substr(0, foundPos) + "<strong>" +
+                  elem.substr(foundPos, entry.length) + "</strong>" + elem.substr(
+                  foundPos + entry.length) + "</li>");
+                break;
+              }
+            }
+
+            foundPos = instance.options.ignoreCase ? 
+              elem.toLowerCase().indexOf(entry.toLowerCase(), foundPos + 1) : 
+              elem.indexOf(entry, foundPos + 1);
+
+          }
+        }
+        if (partial.length)
+          ret = ret.concat(partial.slice(0, instance.options.choices - ret.length))
+        return "<ul>" + ret.join('') + "</ul>";
+      }
+    }, options || { });
+  }
+});
+
+// AJAX in-place editor and collection editor
+// Full rewrite by Christophe Porteneuve <td...@tddsworld.com> (April 2007).
+
+// Use this if you notice weird scrolling problems on some browsers,
+// the DOM might be a bit confused when this gets called so do this
+// waits 1 ms (with setTimeout) until it does the activation
+Field.scrollFreeActivate = function(field) {
+  setTimeout(function() {
+    Field.activate(field);
+  }, 1);
+}
+
+Ajax.InPlaceEditor = Class.create({
+  initialize: function(element, url, options) {
+    this.url = url;
+    this.element = element = $(element);
+    this.prepareOptions();
+    this._controls = { };
+    arguments.callee.dealWithDeprecatedOptions(options); // DEPRECATION LAYER!!!
+    Object.extend(this.options, options || { });
+    if (!this.options.formId && this.element.id) {
+      this.options.formId = this.element.id + '-inplaceeditor';
+      if ($(this.options.formId))
+        this.options.formId = '';
+    }
+    if (this.options.externalControl)
+      this.options.externalControl = $(this.options.externalControl);
+    if (!this.options.externalControl)
+      this.options.externalControlOnly = false;
+    this._originalBackground = this.element.getStyle('background-color') || 'transparent';
+    this.element.title = this.options.clickToEditText;
+    this._boundCancelHandler = this.handleFormCancellation.bind(this);
+    this._boundComplete = (this.options.onComplete || Prototype.emptyFunction).bind(this);
+    this._boundFailureHandler = this.handleAJAXFailure.bind(this);
+    this._boundSubmitHandler = this.handleFormSubmission.bind(this);
+    this._boundWrapperHandler = this.wrapUp.bind(this);
+    this.registerListeners();
+  },
+  checkForEscapeOrReturn: function(e) {
+    if (!this._editing || e.ctrlKey || e.altKey || e.shiftKey) return;
+    if (Event.KEY_ESC == e.keyCode)
+      this.handleFormCancellation(e);
+    else if (Event.KEY_RETURN == e.keyCode)
+      this.handleFormSubmission(e);
+  },
+  createControl: function(mode, handler, extraClasses) {
+    var control = this.options[mode + 'Control'];
+    var text = this.options[mode + 'Text'];
+    if ('button' == control) {
+      var btn = document.createElement('input');
+      btn.type = 'submit';
+      btn.value = text;
+      btn.className = 'editor_' + mode + '_button';
+      if ('cancel' == mode)
+        btn.onclick = this._boundCancelHandler;
+      this._form.appendChild(btn);
+      this._controls[mode] = btn;
+    } else if ('link' == control) {
+      var link = document.createElement('a');
+      link.href = '#';
+      link.appendChild(document.createTextNode(text));
+      link.onclick = 'cancel' == mode ? this._boundCancelHandler : this._boundSubmitHandler;
+      link.className = 'editor_' + mode + '_link';
+      if (extraClasses)
+        link.className += ' ' + extraClasses;
+      this._form.appendChild(link);
+      this._controls[mode] = link;
+    }
+  },
+  createEditField: function() {
+    var text = (this.options.loadTextURL ? this.options.loadingText : this.getText());
+    var fld;
+    if (1 >= this.options.rows && !/\r|\n/.test(this.getText())) {
+      fld = document.createElement('input');
+      fld.type = 'text';
+      var size = this.options.size || this.options.cols || 0;
+      if (0 < size) fld.size = size;
+    } else {
+      fld = document.createElement('textarea');
+      fld.rows = (1 >= this.options.rows ? this.options.autoRows : this.options.rows);
+      fld.cols = this.options.cols || 40;
+    }
+    fld.name = this.options.paramName;
+    fld.value = text; // No HTML breaks conversion anymore
+    fld.className = 'editor_field';
+    if (this.options.submitOnBlur)
+      fld.onblur = this._boundSubmitHandler;
+    this._controls.editor = fld;
+    if (this.options.loadTextURL)
+      this.loadExternalText();
+    this._form.appendChild(this._controls.editor);
+  },
+  createForm: function() {
+    var ipe = this;
+    function addText(mode, condition) {
+      var text = ipe.options['text' + mode + 'Controls'];
+      if (!text || condition === false) return;
+      ipe._form.appendChild(document.createTextNode(text));
+    };
+    this._form = $(document.createElement('form'));
+    this._form.id = this.options.formId;
+    this._form.addClassName(this.options.formClassName);
+    this._form.onsubmit = this._boundSubmitHandler;
+    this.createEditField();
+    if ('textarea' == this._controls.editor.tagName.toLowerCase())
+      this._form.appendChild(document.createElement('br'));
+    if (this.options.onFormCustomization)
+      this.options.onFormCustomization(this, this._form);
+    addText('Before', this.options.okControl || this.options.cancelControl);
+    this.createControl('ok', this._boundSubmitHandler);
+    addText('Between', this.options.okControl && this.options.cancelControl);
+    this.createControl('cancel', this._boundCancelHandler, 'editor_cancel');
+    addText('After', this.options.okControl || this.options.cancelControl);
+  },
+  destroy: function() {
+    if (this._oldInnerHTML)
+      this.element.innerHTML = this._oldInnerHTML;
+    this.leaveEditMode();
+    this.unregisterListeners();
+  },
+  enterEditMode: function(e) {
+    if (this._saving || this._editing) return;
+    this._editing = true;
+    this.triggerCallback('onEnterEditMode');
+    if (this.options.externalControl)
+      this.options.externalControl.hide();
+    this.element.hide();
+    this.createForm();
+    this.element.parentNode.insertBefore(this._form, this.element);
+    if (!this.options.loadTextURL)
+      this.postProcessEditField();
+    if (e) Event.stop(e);
+  },
+  enterHover: function(e) {
+    if (this.options.hoverClassName)
+      this.element.addClassName(this.options.hoverClassName);
+    if (this._saving) return;
+    this.triggerCallback('onEnterHover');
+  },
+  getText: function() {
+    return this.element.innerHTML;
+  },
+  handleAJAXFailure: function(transport) {
+    this.triggerCallback('onFailure', transport);
+    if (this._oldInnerHTML) {
+      this.element.innerHTML = this._oldInnerHTML;
+      this._oldInnerHTML = null;
+    }
+  },
+  handleFormCancellation: function(e) {
+    this.wrapUp();
+    if (e) Event.stop(e);
+  },
+  handleFormSubmission: function(e) {
+    var form = this._form;
+    var value = $F(this._controls.editor);
+    this.prepareSubmission();
+    var params = this.options.callback(form, value) || '';
+    if (Object.isString(params))
+      params = params.toQueryParams();
+    params.editorId = this.element.id;
+    if (this.options.htmlResponse) {
+      var options = Object.extend({ evalScripts: true }, this.options.ajaxOptions);
+      Object.extend(options, {
+        parameters: params,
+        onComplete: this._boundWrapperHandler,
+        onFailure: this._boundFailureHandler
+      });
+      new Ajax.Updater({ success: this.element }, this.url, options);
+    } else {
+      var options = Object.extend({ method: 'get' }, this.options.ajaxOptions);
+      Object.extend(options, {
+        parameters: params,
+        onComplete: this._boundWrapperHandler,
+        onFailure: this._boundFailureHandler
+      });
+      new Ajax.Request(this.url, options);
+    }
+    if (e) Event.stop(e);
+  },
+  leaveEditMode: function() {
+    this.element.removeClassName(this.options.savingClassName);
+    this.removeForm();
+    this.leaveHover();
+    this.element.style.backgroundColor = this._originalBackground;
+    this.element.show();
+    if (this.options.externalControl)
+      this.options.externalControl.show();
+    this._saving = false;
+    this._editing = false;
+    this._oldInnerHTML = null;
+    this.triggerCallback('onLeaveEditMode');
+  },
+  leaveHover: function(e) {
+    if (this.options.hoverClassName)
+      this.element.removeClassName(this.options.hoverClassName);
+    if (this._saving) return;
+    this.triggerCallback('onLeaveHover');
+  },
+  loadExternalText: function() {
+    this._form.addClassName(this.options.loadingClassName);
+    this._controls.editor.disabled = true;
+    var options = Object.extend({ method: 'get' }, this.options.ajaxOptions);
+    Object.extend(options, {
+      parameters: 'editorId=' + encodeURIComponent(this.element.id),
+      onComplete: Prototype.emptyFunction,
+      onSuccess: function(transport) {
+        this._form.removeClassName(this.options.loadingClassName);
+        var text = transport.responseText;
+        if (this.options.stripLoadedTextTags)
+          text = text.stripTags();
+        this._controls.editor.value = text;
+        this._controls.editor.disabled = false;
+        this.postProcessEditField();
+      }.bind(this),
+      onFailure: this._boundFailureHandler
+    });
+    new Ajax.Request(this.options.loadTextURL, options);
+  },
+  postProcessEditField: function() {
+    var fpc = this.options.fieldPostCreation;
+    if (fpc)
+      $(this._controls.editor)['focus' == fpc ? 'focus' : 'activate']();
+  },
+  prepareOptions: function() {
+    this.options = Object.clone(Ajax.InPlaceEditor.DefaultOptions);
+    Object.extend(this.options, Ajax.InPlaceEditor.DefaultCallbacks);
+    [this._extraDefaultOptions].flatten().compact().each(function(defs) {
+      Object.extend(this.options, defs);
+    }.bind(this));
+  },
+  prepareSubmission: function() {
+    this._saving = true;
+    this.removeForm();
+    this.leaveHover();
+    this.showSaving();
+  },
+  registerListeners: function() {
+    this._listeners = { };
+    var listener;
+    $H(Ajax.InPlaceEditor.Listeners).each(function(pair) {
+      listener = this[pair.value].bind(this);
+      this._listeners[pair.key] = listener;
+      if (!this.options.externalControlOnly)
+        this.element.observe(pair.key, listener);
+      if (this.options.externalControl)
+        this.options.externalControl.observe(pair.key, listener);
+    }.bind(this));
+  },
+  removeForm: function() {
+    if (!this._form) return;
+    this._form.remove();
+    this._form = null;
+    this._controls = { };
+  },
+  showSaving: function() {
+    this._oldInnerHTML = this.element.innerHTML;
+    this.element.innerHTML = this.options.savingText;
+    this.element.addClassName(this.options.savingClassName);
+    this.element.style.backgroundColor = this._originalBackground;
+    this.element.show();
+  },
+  triggerCallback: function(cbName, arg) {
+    if ('function' == typeof this.options[cbName]) {
+      this.options[cbName](this, arg);
+    }
+  },
+  unregisterListeners: function() {
+    $H(this._listeners).each(function(pair) {
+      if (!this.options.externalControlOnly)
+        this.element.stopObserving(pair.key, pair.value);
+      if (this.options.externalControl)
+        this.options.externalControl.stopObserving(pair.key, pair.value);
+    }.bind(this));
+  },
+  wrapUp: function(transport) {
+    this.leaveEditMode();
+    // Can't use triggerCallback due to backward compatibility: requires
+    // binding + direct element
+    this._boundComplete(transport, this.element);
+  }
+});
+
+Object.extend(Ajax.InPlaceEditor.prototype, {
+  dispose: Ajax.InPlaceEditor.prototype.destroy
+});
+
+Ajax.InPlaceCollectionEditor = Class.create(Ajax.InPlaceEditor, {
+  initialize: function($super, element, url, options) {
+    this._extraDefaultOptions = Ajax.InPlaceCollectionEditor.DefaultOptions;
+    $super(element, url, options);
+  },
+
+  createEditField: function() {
+    var list = document.createElement('select');
+    list.name = this.options.paramName;
+    list.size = 1;
+    this._controls.editor = list;
+    this._collection = this.options.collection || [];
+    if (this.options.loadCollectionURL)
+      this.loadCollection();
+    else
+      this.checkForExternalText();
+    this._form.appendChild(this._controls.editor);
+  },
+
+  loadCollection: function() {
+    this._form.addClassName(this.options.loadingClassName);
+    this.showLoadingText(this.options.loadingCollectionText);
+    var options = Object.extend({ method: 'get' }, this.options.ajaxOptions);
+    Object.extend(options, {
+      parameters: 'editorId=' + encodeURIComponent(this.element.id),
+      onComplete: Prototype.emptyFunction,
+      onSuccess: function(transport) {
+        var js = transport.responseText.strip();
+        if (!/^\[.*\]$/.test(js)) // TODO: improve sanity check
+          throw 'Server returned an invalid collection representation.';
+        this._collection = eval(js);
+        this.checkForExternalText();
+      }.bind(this),
+      onFailure: this.onFailure
+    });
+    new Ajax.Request(this.options.loadCollectionURL, options);
+  },
+
+  showLoadingText: function(text) {
+    this._controls.editor.disabled = true;
+    var tempOption = this._controls.editor.firstChild;
+    if (!tempOption) {
+      tempOption = document.createElement('option');
+      tempOption.value = '';
+      this._controls.editor.appendChild(tempOption);
+      tempOption.selected = true;
+    }
+    tempOption.update((text || '').stripScripts().stripTags());
+  },
+
+  checkForExternalText: function() {
+    this._text = this.getText();
+    if (this.options.loadTextURL)
+      this.loadExternalText();
+    else
+      this.buildOptionList();
+  },
+
+  loadExternalText: function() {
+    this.showLoadingText(this.options.loadingText);
+    var options = Object.extend({ method: 'get' }, this.options.ajaxOptions);
+    Object.extend(options, {
+      parameters: 'editorId=' + encodeURIComponent(this.element.id),
+      onComplete: Prototype.emptyFunction,
+      onSuccess: function(transport) {
+        this._text = transport.responseText.strip();
+        this.buildOptionList();
+      }.bind(this),
+      onFailure: this.onFailure
+    });
+    new Ajax.Request(this.options.loadTextURL, options);
+  },
+
+  buildOptionList: function() {
+    this._form.removeClassName(this.options.loadingClassName);
+    this._collection = this._collection.map(function(entry) {
+      return 2 === entry.length ? entry : [entry, entry].flatten();
+    });
+    var marker = ('value' in this.options) ? this.options.value : this._text;
+    var textFound = this._collection.any(function(entry) {
+      return entry[0] == marker;
+    }.bind(this));
+    this._controls.editor.update('');
+    var option;
+    this._collection.each(function(entry, index) {
+      option = document.createElement('option');
+      option.value = entry[0];
+      option.selected = textFound ? entry[0] == marker : 0 == index;
+      option.appendChild(document.createTextNode(entry[1]));
+      this._controls.editor.appendChild(option);
+    }.bind(this));
+    this._controls.editor.disabled = false;
+    Field.scrollFreeActivate(this._controls.editor);
+  }
+});
+
+//**** DEPRECATION LAYER FOR InPlace[Collection]Editor! ****
+//**** This only  exists for a while,  in order to  let ****
+//**** users adapt to  the new API.  Read up on the new ****
+//**** API and convert your code to it ASAP!            ****
+
+Ajax.InPlaceEditor.prototype.initialize.dealWithDeprecatedOptions = function(options) {
+  if (!options) return;
+  function fallback(name, expr) {
+    if (name in options || expr === undefined) return;
+    options[name] = expr;
+  };
+  fallback('cancelControl', (options.cancelLink ? 'link' : (options.cancelButton ? 'button' :
+    options.cancelLink == options.cancelButton == false ? false : undefined)));
+  fallback('okControl', (options.okLink ? 'link' : (options.okButton ? 'button' :
+    options.okLink == options.okButton == false ? false : undefined)));
+  fallback('highlightColor', options.highlightcolor);
+  fallback('highlightEndColor', options.highlightendcolor);
+};
+
+Object.extend(Ajax.InPlaceEditor, {
+  DefaultOptions: {
+    ajaxOptions: { },
+    autoRows: 3,                                // Use when multi-line w/ rows == 1
+    cancelControl: 'link',                      // 'link'|'button'|false
+    cancelText: 'cancel',
+    clickToEditText: 'Click to edit',
+    externalControl: null,                      // id|elt
+    externalControlOnly: false,
+    fieldPostCreation: 'activate',              // 'activate'|'focus'|false
+    formClassName: 'inplaceeditor-form',
+    formId: null,                               // id|elt
+    highlightColor: '#ffff99',
+    highlightEndColor: '#ffffff',
+    hoverClassName: '',
+    htmlResponse: true,
+    loadingClassName: 'inplaceeditor-loading',
+    loadingText: 'Loading...',
+    okControl: 'button',                        // 'link'|'button'|false
+    okText: 'ok',
+    paramName: 'value',
+    rows: 1,                                    // If 1 and multi-line, uses autoRows
+    savingClassName: 'inplaceeditor-saving',
+    savingText: 'Saving...',
+    size: 0,
+    stripLoadedTextTags: false,
+    submitOnBlur: false,
+    textAfterControls: '',
+    textBeforeControls: '',
+    textBetweenControls: ''
+  },
+  DefaultCallbacks: {
+    callback: function(form) {
+      return Form.serialize(form);
+    },
+    onComplete: function(transport, element) {
+      // For backward compatibility, this one is bound to the IPE, and passes
+      // the element directly.  It was too often customized, so we don't break it.
+      new Effect.Highlight(element, {
+        startcolor: this.options.highlightColor, keepBackgroundImage: true });
+    },
+    onEnterEditMode: null,
+    onEnterHover: function(ipe) {
+      ipe.element.style.backgroundColor = ipe.options.highlightColor;
+      if (ipe._effect)
+        ipe._effect.cancel();
+    },
+    onFailure: function(transport, ipe) {
+      alert('Error communication with the server: ' + transport.responseText.stripTags());
+    },
+    onFormCustomization: null, // Takes the IPE and its generated form, after editor, before controls.
+    onLeaveEditMode: null,
+    onLeaveHover: function(ipe) {
+      ipe._effect = new Effect.Highlight(ipe.element, {
+        startcolor: ipe.options.highlightColor, endcolor: ipe.options.highlightEndColor,
+        restorecolor: ipe._originalBackground, keepBackgroundImage: true
+      });
+    }
+  },
+  Listeners: {
+    click: 'enterEditMode',
+    keydown: 'checkForEscapeOrReturn',
+    mouseover: 'enterHover',
+    mouseout: 'leaveHover'
+  }
+});
+
+Ajax.InPlaceCollectionEditor.DefaultOptions = {
+  loadingCollectionText: 'Loading options...'
+};
+
+// Delayed observer, like Form.Element.Observer, 
+// but waits for delay after last key input
+// Ideal for live-search fields
+
+Form.Element.DelayedObserver = Class.create({
+  initialize: function(element, delay, callback) {
+    this.delay     = delay || 0.5;
+    this.element   = $(element);
+    this.callback  = callback;
+    this.timer     = null;
+    this.lastValue = $F(this.element); 
+    Event.observe(this.element,'keyup',this.delayedListener.bindAsEventListener(this));
+  },
+  delayedListener: function(event) {
+    if(this.lastValue == $F(this.element)) return;
+    if(this.timer) clearTimeout(this.timer);
+    this.timer = setTimeout(this.onTimerEvent.bind(this), this.delay * 1000);
+    this.lastValue = $F(this.element);
+  },
+  onTimerEvent: function() {
+    this.timer = null;
+    this.callback(this.element, $F(this.element));
+  }
+});

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/extras/webjars/snorql/src/main/resources/scriptaculous/dragdrop.js
----------------------------------------------------------------------
diff --git a/extras/webjars/snorql/src/main/resources/scriptaculous/dragdrop.js b/extras/webjars/snorql/src/main/resources/scriptaculous/dragdrop.js
new file mode 100755
index 0000000..dde6393
--- /dev/null
+++ b/extras/webjars/snorql/src/main/resources/scriptaculous/dragdrop.js
@@ -0,0 +1,985 @@
+/*
+ * 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.
+ */
+// script.aculo.us dragdrop.js v1.8.1, Thu Jan 03 22:07:12 -0500 2008
+
+if(Object.isUndefined(Effect))
+  throw("dragdrop.js requires including script.aculo.us' effects.js library");
+
+var Droppables = {
+  drops: [],
+
+  remove: function(element) {
+    this.drops = this.drops.reject(function(d) { return d.element==$(element) });
+  },
+
+  add: function(element) {
+    element = $(element);
+    var options = Object.extend({
+      greedy:     true,
+      hoverclass: null,
+      tree:       false
+    }, arguments[1] || { });
+
+    // cache containers
+    if(options.containment) {
+      options._containers = [];
+      var containment = options.containment;
+      if(Object.isArray(containment)) {
+        containment.each( function(c) { options._containers.push($(c)) });
+      } else {
+        options._containers.push($(containment));
+      }
+    }
+    
+    if(options.accept) options.accept = [options.accept].flatten();
+
+    Element.makePositioned(element); // fix IE
+    options.element = element;
+
+    this.drops.push(options);
+  },
+  
+  findDeepestChild: function(drops) {
+    deepest = drops[0];
+      
+    for (i = 1; i < drops.length; ++i)
+      if (Element.isParent(drops[i].element, deepest.element))
+        deepest = drops[i];
+    
+    return deepest;
+  },
+
+  isContained: function(element, drop) {
+    var containmentNode;
+    if(drop.tree) {
+      containmentNode = element.treeNode; 
+    } else {
+      containmentNode = element.parentNode;
+    }
+    return drop._containers.detect(function(c) { return containmentNode == c });
+  },
+  
+  isAffected: function(point, element, drop) {
+    return (
+      (drop.element!=element) &&
+      ((!drop._containers) ||
+        this.isContained(element, drop)) &&
+      ((!drop.accept) ||
+        (Element.classNames(element).detect( 
+          function(v) { return drop.accept.include(v) } ) )) &&
+      Position.within(drop.element, point[0], point[1]) );
+  },
+
+  deactivate: function(drop) {
+    if(drop.hoverclass)
+      Element.removeClassName(drop.element, drop.hoverclass);
+    this.last_active = null;
+  },
+
+  activate: function(drop) {
+    if(drop.hoverclass)
+      Element.addClassName(drop.element, drop.hoverclass);
+    this.last_active = drop;
+  },
+
+  show: function(point, element) {
+    if(!this.drops.length) return;
+    var drop, affected = [];
+    
+    this.drops.each( function(drop) {
+      if(Droppables.isAffected(point, element, drop))
+        affected.push(drop);
+    });
+        
+    if(affected.length>0)
+      drop = Droppables.findDeepestChild(affected);
+
+    if(this.last_active && this.last_active != drop) this.deactivate(this.last_active);
+    if (drop) {
+      Position.within(drop.element, point[0], point[1]);
+      if(drop.onHover)
+        drop.onHover(element, drop.element, Position.overlap(drop.overlap, drop.element));
+      
+      if (drop != this.last_active) Droppables.activate(drop);
+    }
+  },
+
+  fire: function(event, element) {
+    if(!this.last_active) return;
+    Position.prepare();
+
+    if (this.isAffected([Event.pointerX(event), Event.pointerY(event)], element, this.last_active))
+      if (this.last_active.onDrop) {
+        this.last_active.onDrop(element, this.last_active.element, event); 
+        return true; 
+      }
+  },
+
+  reset: function() {
+    if(this.last_active)
+      this.deactivate(this.last_active);
+  }
+}
+
+var Draggables = {
+  drags: [],
+  observers: [],
+  
+  register: function(draggable) {
+    if(this.drags.length == 0) {
+      this.eventMouseUp   = this.endDrag.bindAsEventListener(this);
+      this.eventMouseMove = this.updateDrag.bindAsEventListener(this);
+      this.eventKeypress  = this.keyPress.bindAsEventListener(this);
+      
+      Event.observe(document, "mouseup", this.eventMouseUp);
+      Event.observe(document, "mousemove", this.eventMouseMove);
+      Event.observe(document, "keypress", this.eventKeypress);
+    }
+    this.drags.push(draggable);
+  },
+  
+  unregister: function(draggable) {
+    this.drags = this.drags.reject(function(d) { return d==draggable });
+    if(this.drags.length == 0) {
+      Event.stopObserving(document, "mouseup", this.eventMouseUp);
+      Event.stopObserving(document, "mousemove", this.eventMouseMove);
+      Event.stopObserving(document, "keypress", this.eventKeypress);
+    }
+  },
+  
+  activate: function(draggable) {
+    if(draggable.options.delay) { 
+      this._timeout = setTimeout(function() { 
+        Draggables._timeout = null; 
+        window.focus(); 
+        Draggables.activeDraggable = draggable; 
+      }.bind(this), draggable.options.delay); 
+    } else {
+      window.focus(); // allows keypress events if window isn't currently focused, fails for Safari
+      this.activeDraggable = draggable;
+    }
+  },
+  
+  deactivate: function() {
+    this.activeDraggable = null;
+  },
+  
+  updateDrag: function(event) {
+    if(!this.activeDraggable) return;
+    var pointer = [Event.pointerX(event), Event.pointerY(event)];
+    // Mozilla-based browsers fire successive mousemove events with
+    // the same coordinates, prevent needless redrawing (moz bug?)
+    if(this._lastPointer && (this._lastPointer.inspect() == pointer.inspect())) return;
+    this._lastPointer = pointer;
+    
+    this.activeDraggable.updateDrag(event, pointer);
+  },
+  
+  endDrag: function(event) {
+    if(this._timeout) { 
+      clearTimeout(this._timeout); 
+      this._timeout = null; 
+    }
+    if(!this.activeDraggable) return;
+    this._lastPointer = null;
+    this.activeDraggable.endDrag(event);
+    this.activeDraggable = null;
+  },
+  
+  keyPress: function(event) {
+    if(this.activeDraggable)
+      this.activeDraggable.keyPress(event);
+  },
+  
+  addObserver: function(observer) {
+    this.observers.push(observer);
+    this._cacheObserverCallbacks();
+  },
+  
+  removeObserver: function(element) {  // element instead of observer fixes mem leaks
+    this.observers = this.observers.reject( function(o) { return o.element==element });
+    this._cacheObserverCallbacks();
+  },
+  
+  notify: function(eventName, draggable, event) {  // 'onStart', 'onEnd', 'onDrag'
+    if(this[eventName+'Count'] > 0)
+      this.observers.each( function(o) {
+        if(o[eventName]) o[eventName](eventName, draggable, event);
+      });
+    if(draggable.options[eventName]) draggable.options[eventName](draggable, event);
+  },
+  
+  _cacheObserverCallbacks: function() {
+    ['onStart','onEnd','onDrag'].each( function(eventName) {
+      Draggables[eventName+'Count'] = Draggables.observers.select(
+        function(o) { return o[eventName]; }
+      ).length;
+    });
+  }
+}
+
+/*--------------------------------------------------------------------------*/
+
+var Draggable = Class.create({
+  initialize: function(element) {
+    var defaults = {
+      handle: false,
+      reverteffect: function(element, top_offset, left_offset) {
+        var dur = Math.sqrt(Math.abs(top_offset^2)+Math.abs(left_offset^2))*0.02;
+        new Effect.Move(element, { x: -left_offset, y: -top_offset, duration: dur,
+          queue: {scope:'_draggable', position:'end'}
+        });
+      },
+      endeffect: function(element) {
+        var toOpacity = Object.isNumber(element._opacity) ? element._opacity : 1.0;
+        new Effect.Opacity(element, {duration:0.2, from:0.7, to:toOpacity, 
+          queue: {scope:'_draggable', position:'end'},
+          afterFinish: function(){ 
+            Draggable._dragging[element] = false 
+          }
+        }); 
+      },
+      zindex: 1000,
+      revert: false,
+      quiet: false,
+      scroll: false,
+      scrollSensitivity: 20,
+      scrollSpeed: 15,
+      snap: false,  // false, or xy or [x,y] or function(x,y){ return [x,y] }
+      delay: 0
+    };
+    
+    if(!arguments[1] || Object.isUndefined(arguments[1].endeffect))
+      Object.extend(defaults, {
+        starteffect: function(element) {
+          element._opacity = Element.getOpacity(element);
+          Draggable._dragging[element] = true;
+          new Effect.Opacity(element, {duration:0.2, from:element._opacity, to:0.7}); 
+        }
+      });
+    
+    var options = Object.extend(defaults, arguments[1] || { });
+
+    this.element = $(element);
+    
+    if(options.handle && Object.isString(options.handle))
+      this.handle = this.element.down('.'+options.handle, 0);
+    
+    if(!this.handle) this.handle = $(options.handle);
+    if(!this.handle) this.handle = this.element;
+    
+    if(options.scroll && !options.scroll.scrollTo && !options.scroll.outerHTML) {
+      options.scroll = $(options.scroll);
+      this._isScrollChild = Element.childOf(this.element, options.scroll);
+    }
+
+    Element.makePositioned(this.element); // fix IE    
+
+    this.options  = options;
+    this.dragging = false;   
+
+    this.eventMouseDown = this.initDrag.bindAsEventListener(this);
+    Event.observe(this.handle, "mousedown", this.eventMouseDown);
+    
+    Draggables.register(this);
+  },
+  
+  destroy: function() {
+    Event.stopObserving(this.handle, "mousedown", this.eventMouseDown);
+    Draggables.unregister(this);
+  },
+  
+  currentDelta: function() {
+    return([
+      parseInt(Element.getStyle(this.element,'left') || '0'),
+      parseInt(Element.getStyle(this.element,'top') || '0')]);
+  },
+  
+  initDrag: function(event) {
+    if(!Object.isUndefined(Draggable._dragging[this.element]) &&
+      Draggable._dragging[this.element]) return;
+    if(Event.isLeftClick(event)) {    
+      // abort on form elements, fixes a Firefox issue
+      var src = Event.element(event);
+      if((tag_name = src.tagName.toUpperCase()) && (
+        tag_name=='INPUT' ||
+        tag_name=='SELECT' ||
+        tag_name=='OPTION' ||
+        tag_name=='BUTTON' ||
+        tag_name=='TEXTAREA')) return;
+        
+      var pointer = [Event.pointerX(event), Event.pointerY(event)];
+      var pos     = Position.cumulativeOffset(this.element);
+      this.offset = [0,1].map( function(i) { return (pointer[i] - pos[i]) });
+      
+      Draggables.activate(this);
+      Event.stop(event);
+    }
+  },
+  
+  startDrag: function(event) {
+    this.dragging = true;
+    if(!this.delta)
+      this.delta = this.currentDelta();
+    
+    if(this.options.zindex) {
+      this.originalZ = parseInt(Element.getStyle(this.element,'z-index') || 0);
+      this.element.style.zIndex = this.options.zindex;
+    }
+    
+    if(this.options.ghosting) {
+      this._clone = this.element.cloneNode(true);
+      this.element._originallyAbsolute = (this.element.getStyle('position') == 'absolute');
+      if (!this.element._originallyAbsolute)
+        Position.absolutize(this.element);
+      this.element.parentNode.insertBefore(this._clone, this.element);
+    }
+    
+    if(this.options.scroll) {
+      if (this.options.scroll == window) {
+        var where = this._getWindowScroll(this.options.scroll);
+        this.originalScrollLeft = where.left;
+        this.originalScrollTop = where.top;
+      } else {
+        this.originalScrollLeft = this.options.scroll.scrollLeft;
+        this.originalScrollTop = this.options.scroll.scrollTop;
+      }
+    }
+    
+    Draggables.notify('onStart', this, event);
+        
+    if(this.options.starteffect) this.options.starteffect(this.element);
+  },
+  
+  updateDrag: function(event, pointer) {
+    if(!this.dragging) this.startDrag(event);
+    
+    if(!this.options.quiet){
+      Position.prepare();
+      Droppables.show(pointer, this.element);
+    }
+    
+    Draggables.notify('onDrag', this, event);
+    
+    this.draw(pointer);
+    if(this.options.change) this.options.change(this);
+    
+    if(this.options.scroll) {
+      this.stopScrolling();
+      
+      var p;
+      if (this.options.scroll == window) {
+        with(this._getWindowScroll(this.options.scroll)) { p = [ left, top, left+width, top+height ]; }
+      } else {
+        p = Position.page(this.options.scroll);
+        p[0] += this.options.scroll.scrollLeft + Position.deltaX;
+        p[1] += this.options.scroll.scrollTop + Position.deltaY;
+        p.push(p[0]+this.options.scroll.offsetWidth);
+        p.push(p[1]+this.options.scroll.offsetHeight);
+      }
+      var speed = [0,0];
+      if(pointer[0] < (p[0]+this.options.scrollSensitivity)) speed[0] = pointer[0]-(p[0]+this.options.scrollSensitivity);
+      if(pointer[1] < (p[1]+this.options.scrollSensitivity)) speed[1] = pointer[1]-(p[1]+this.options.scrollSensitivity);
+      if(pointer[0] > (p[2]-this.options.scrollSensitivity)) speed[0] = pointer[0]-(p[2]-this.options.scrollSensitivity);
+      if(pointer[1] > (p[3]-this.options.scrollSensitivity)) speed[1] = pointer[1]-(p[3]-this.options.scrollSensitivity);
+      this.startScrolling(speed);
+    }
+    
+    // fix AppleWebKit rendering
+    if(Prototype.Browser.WebKit) window.scrollBy(0,0);
+    
+    Event.stop(event);
+  },
+  
+  finishDrag: function(event, success) {
+    this.dragging = false;
+    
+    if(this.options.quiet){
+      Position.prepare();
+      var pointer = [Event.pointerX(event), Event.pointerY(event)];
+      Droppables.show(pointer, this.element);
+    }
+
+    if(this.options.ghosting) {
+      if (!this.element._originallyAbsolute)
+        Position.relativize(this.element);
+      delete this.element._originallyAbsolute;
+      Element.remove(this._clone);
+      this._clone = null;
+    }
+
+    var dropped = false; 
+    if(success) { 
+      dropped = Droppables.fire(event, this.element); 
+      if (!dropped) dropped = false; 
+    }
+    if(dropped && this.options.onDropped) this.options.onDropped(this.element);
+    Draggables.notify('onEnd', this, event);
+
+    var revert = this.options.revert;
+    if(revert && Object.isFunction(revert)) revert = revert(this.element);
+    
+    var d = this.currentDelta();
+    if(revert && this.options.reverteffect) {
+      if (dropped == 0 || revert != 'failure')
+        this.options.reverteffect(this.element,
+          d[1]-this.delta[1], d[0]-this.delta[0]);
+    } else {
+      this.delta = d;
+    }
+
+    if(this.options.zindex)
+      this.element.style.zIndex = this.originalZ;
+
+    if(this.options.endeffect) 
+      this.options.endeffect(this.element);
+      
+    Draggables.deactivate(this);
+    Droppables.reset();
+  },
+  
+  keyPress: function(event) {
+    if(event.keyCode!=Event.KEY_ESC) return;
+    this.finishDrag(event, false);
+    Event.stop(event);
+  },
+  
+  endDrag: function(event) {
+    if(!this.dragging) return;
+    this.stopScrolling();
+    this.finishDrag(event, true);
+    Event.stop(event);
+  },
+  
+  draw: function(point) {
+    var pos = Position.cumulativeOffset(this.element);
+    if(this.options.ghosting) {
+      var r   = Position.realOffset(this.element);
+      pos[0] += r[0] - Position.deltaX; pos[1] += r[1] - Position.deltaY;
+    }
+    
+    var d = this.currentDelta();
+    pos[0] -= d[0]; pos[1] -= d[1];
+    
+    if(this.options.scroll && (this.options.scroll != window && this._isScrollChild)) {
+      pos[0] -= this.options.scroll.scrollLeft-this.originalScrollLeft;
+      pos[1] -= this.options.scroll.scrollTop-this.originalScrollTop;
+    }
+    
+    var p = [0,1].map(function(i){ 
+      return (point[i]-pos[i]-this.offset[i]) 
+    }.bind(this));
+    
+    if(this.options.snap) {
+      if(Object.isFunction(this.options.snap)) {
+        p = this.options.snap(p[0],p[1],this);
+      } else {
+      if(Object.isArray(this.options.snap)) {
+        p = p.map( function(v, i) {
+          return (v/this.options.snap[i]).round()*this.options.snap[i] }.bind(this))
+      } else {
+        p = p.map( function(v) {
+          return (v/this.options.snap).round()*this.options.snap }.bind(this))
+      }
+    }}
+    
+    var style = this.element.style;
+    if((!this.options.constraint) || (this.options.constraint=='horizontal'))
+      style.left = p[0] + "px";
+    if((!this.options.constraint) || (this.options.constraint=='vertical'))
+      style.top  = p[1] + "px";
+    
+    if(style.visibility=="hidden") style.visibility = ""; // fix gecko rendering
+  },
+  
+  stopScrolling: function() {
+    if(this.scrollInterval) {
+      clearInterval(this.scrollInterval);
+      this.scrollInterval = null;
+      Draggables._lastScrollPointer = null;
+    }
+  },
+  
+  startScrolling: function(speed) {
+    if(!(speed[0] || speed[1])) return;
+    this.scrollSpeed = [speed[0]*this.options.scrollSpeed,speed[1]*this.options.scrollSpeed];
+    this.lastScrolled = new Date();
+    this.scrollInterval = setInterval(this.scroll.bind(this), 10);
+  },
+  
+  scroll: function() {
+    var current = new Date();
+    var delta = current - this.lastScrolled;
+    this.lastScrolled = current;
+    if(this.options.scroll == window) {
+      with (this._getWindowScroll(this.options.scroll)) {
+        if (this.scrollSpeed[0] || this.scrollSpeed[1]) {
+          var d = delta / 1000;
+          this.options.scroll.scrollTo( left + d*this.scrollSpeed[0], top + d*this.scrollSpeed[1] );
+        }
+      }
+    } else {
+      this.options.scroll.scrollLeft += this.scrollSpeed[0] * delta / 1000;
+      this.options.scroll.scrollTop  += this.scrollSpeed[1] * delta / 1000;
+    }
+    
+    Position.prepare();
+    Droppables.show(Draggables._lastPointer, this.element);
+    Draggables.notify('onDrag', this);
+    if (this._isScrollChild) {
+      Draggables._lastScrollPointer = Draggables._lastScrollPointer || $A(Draggables._lastPointer);
+      Draggables._lastScrollPointer[0] += this.scrollSpeed[0] * delta / 1000;
+      Draggables._lastScrollPointer[1] += this.scrollSpeed[1] * delta / 1000;
+      if (Draggables._lastScrollPointer[0] < 0)
+        Draggables._lastScrollPointer[0] = 0;
+      if (Draggables._lastScrollPointer[1] < 0)
+        Draggables._lastScrollPointer[1] = 0;
+      this.draw(Draggables._lastScrollPointer);
+    }
+    
+    if(this.options.change) this.options.change(this);
+  },
+  
+  _getWindowScroll: function(w) {
+    var T, L, W, H;
+    with (w.document) {
+      if (w.document.documentElement && documentElement.scrollTop) {
+        T = documentElement.scrollTop;
+        L = documentElement.scrollLeft;
+      } else if (w.document.body) {
+        T = body.scrollTop;
+        L = body.scrollLeft;
+      }
+      if (w.innerWidth) {
+        W = w.innerWidth;
+        H = w.innerHeight;
+      } else if (w.document.documentElement && documentElement.clientWidth) {
+        W = documentElement.clientWidth;
+        H = documentElement.clientHeight;
+      } else {
+        W = body.offsetWidth;
+        H = body.offsetHeight
+      }
+    }
+    return { top: T, left: L, width: W, height: H };
+  }
+});
+
+Draggable._dragging = { };
+
+/*--------------------------------------------------------------------------*/
+
+var SortableObserver = Class.create({
+  initialize: function(element, observer) {
+    this.element   = $(element);
+    this.observer  = observer;
+    this.lastValue = Sortable.serialize(this.element);
+  },
+  
+  onStart: function() {
+    this.lastValue = Sortable.serialize(this.element);
+  },
+  
+  onEnd: function() {
+    Sortable.unmark();
+    if(this.lastValue != Sortable.serialize(this.element))
+      this.observer(this.element)
+  }
+});
+
+var Sortable = {
+  SERIALIZE_RULE: /^[^_\-](?:[A-Za-z0-9\-\_]*)[_](.*)$/,
+  
+  sortables: { },
+  
+  _findRootElement: function(element) {
+    while (element.tagName.toUpperCase() != "BODY") {  
+      if(element.id && Sortable.sortables[element.id]) return element;
+      element = element.parentNode;
+    }
+  },
+
+  options: function(element) {
+    element = Sortable._findRootElement($(element));
+    if(!element) return;
+    return Sortable.sortables[element.id];
+  },
+  
+  destroy: function(element){
+    var s = Sortable.options(element);
+    
+    if(s) {
+      Draggables.removeObserver(s.element);
+      s.droppables.each(function(d){ Droppables.remove(d) });
+      s.draggables.invoke('destroy');
+      
+      delete Sortable.sortables[s.element.id];
+    }
+  },
+
+  create: function(element) {
+    element = $(element);
+    var options = Object.extend({ 
+      element:     element,
+      tag:         'li',       // assumes li children, override with tag: 'tagname'
+      dropOnEmpty: false,
+      tree:        false,
+      treeTag:     'ul',
+      overlap:     'vertical', // one of 'vertical', 'horizontal'
+      constraint:  'vertical', // one of 'vertical', 'horizontal', false
+      containment: element,    // also takes array of elements (or id's); or false
+      handle:      false,      // or a CSS class
+      only:        false,
+      delay:       0,
+      hoverclass:  null,
+      ghosting:    false,
+      quiet:       false, 
+      scroll:      false,
+      scrollSensitivity: 20,
+      scrollSpeed: 15,
+      format:      this.SERIALIZE_RULE,
+      
+      // these take arrays of elements or ids and can be 
+      // used for better initialization performance
+      elements:    false,
+      handles:     false,
+      
+      onChange:    Prototype.emptyFunction,
+      onUpdate:    Prototype.emptyFunction
+    }, arguments[1] || { });
+
+    // clear any old sortable with same element
+    this.destroy(element);
+
+    // build options for the draggables
+    var options_for_draggable = {
+      revert:      true,
+      quiet:       options.quiet,
+      scroll:      options.scroll,
+      scrollSpeed: options.scrollSpeed,
+      scrollSensitivity: options.scrollSensitivity,
+      delay:       options.delay,
+      ghosting:    options.ghosting,
+      constraint:  options.constraint,
+      handle:      options.handle };
+
+    if(options.starteffect)
+      options_for_draggable.starteffect = options.starteffect;
+
+    if(options.reverteffect)
+      options_for_draggable.reverteffect = options.reverteffect;
+    else
+      if(options.ghosting) options_for_draggable.reverteffect = function(element) {
+        element.style.top  = 0;
+        element.style.left = 0;
+      };
+
+    if(options.endeffect)
+      options_for_draggable.endeffect = options.endeffect;
+
+    if(options.zindex)
+      options_for_draggable.zindex = options.zindex;
+
+    // build options for the droppables  
+    var options_for_droppable = {
+      overlap:     options.overlap,
+      containment: options.containment,
+      tree:        options.tree,
+      hoverclass:  options.hoverclass,
+      onHover:     Sortable.onHover
+    }
+    
+    var options_for_tree = {
+      onHover:      Sortable.onEmptyHover,
+      overlap:      options.overlap,
+      containment:  options.containment,
+      hoverclass:   options.hoverclass
+    }
+
+    // fix for gecko engine
+    Element.cleanWhitespace(element); 
+
+    options.draggables = [];
+    options.droppables = [];
+
+    // drop on empty handling
+    if(options.dropOnEmpty || options.tree) {
+      Droppables.add(element, options_for_tree);
+      options.droppables.push(element);
+    }
+
+    (options.elements || this.findElements(element, options) || []).each( function(e,i) {
+      var handle = options.handles ? $(options.handles[i]) :
+        (options.handle ? $(e).select('.' + options.handle)[0] : e); 
+      options.draggables.push(
+        new Draggable(e, Object.extend(options_for_draggable, { handle: handle })));
+      Droppables.add(e, options_for_droppable);
+      if(options.tree) e.treeNode = element;
+      options.droppables.push(e);      
+    });
+    
+    if(options.tree) {
+      (Sortable.findTreeElements(element, options) || []).each( function(e) {
+        Droppables.add(e, options_for_tree);
+        e.treeNode = element;
+        options.droppables.push(e);
+      });
+    }
+
+    // keep reference
+    this.sortables[element.id] = options;
+
+    // for onupdate
+    Draggables.addObserver(new SortableObserver(element, options.onUpdate));
+
+  },
+
+  // return all suitable-for-sortable elements in a guaranteed order
+  findElements: function(element, options) {
+    return Element.findChildren(
+      element, options.only, options.tree ? true : false, options.tag);
+  },
+  
+  findTreeElements: function(element, options) {
+    return Element.findChildren(
+      element, options.only, options.tree ? true : false, options.treeTag);
+  },
+
+  onHover: function(element, dropon, overlap) {
+    if(Element.isParent(dropon, element)) return;
+
+    if(overlap > .33 && overlap < .66 && Sortable.options(dropon).tree) {
+      return;
+    } else if(overlap>0.5) {
+      Sortable.mark(dropon, 'before');
+      if(dropon.previousSibling != element) {
+        var oldParentNode = element.parentNode;
+        element.style.visibility = "hidden"; // fix gecko rendering
+        dropon.parentNode.insertBefore(element, dropon);
+        if(dropon.parentNode!=oldParentNode) 
+          Sortable.options(oldParentNode).onChange(element);
+        Sortable.options(dropon.parentNode).onChange(element);
+      }
+    } else {
+      Sortable.mark(dropon, 'after');
+      var nextElement = dropon.nextSibling || null;
+      if(nextElement != element) {
+        var oldParentNode = element.parentNode;
+        element.style.visibility = "hidden"; // fix gecko rendering
+        dropon.parentNode.insertBefore(element, nextElement);
+        if(dropon.parentNode!=oldParentNode) 
+          Sortable.options(oldParentNode).onChange(element);
+        Sortable.options(dropon.parentNode).onChange(element);
+      }
+    }
+  },
+  
+  onEmptyHover: function(element, dropon, overlap) {
+    var oldParentNode = element.parentNode;
+    var droponOptions = Sortable.options(dropon);
+        
+    if(!Element.isParent(dropon, element)) {
+      var index;
+      
+      var children = Sortable.findElements(dropon, {tag: droponOptions.tag, only: droponOptions.only});
+      var child = null;
+            
+      if(children) {
+        var offset = Element.offsetSize(dropon, droponOptions.overlap) * (1.0 - overlap);
+        
+        for (index = 0; index < children.length; index += 1) {
+          if (offset - Element.offsetSize (children[index], droponOptions.overlap) >= 0) {
+            offset -= Element.offsetSize (children[index], droponOptions.overlap);
+          } else if (offset - (Element.offsetSize (children[index], droponOptions.overlap) / 2) >= 0) {
+            child = index + 1 < children.length ? children[index + 1] : null;
+            break;
+          } else {
+            child = children[index];
+            break;
+          }
+        }
+      }
+      
+      dropon.insertBefore(element, child);
+      
+      Sortable.options(oldParentNode).onChange(element);
+      droponOptions.onChange(element);
+    }
+  },
+
+  unmark: function() {
+    if(Sortable._marker) Sortable._marker.hide();
+  },
+
+  mark: function(dropon, position) {
+    // mark on ghosting only
+    var sortable = Sortable.options(dropon.parentNode);
+    if(sortable && !sortable.ghosting) return; 
+
+    if(!Sortable._marker) {
+      Sortable._marker = 
+        ($('dropmarker') || Element.extend(document.createElement('DIV'))).
+          hide().addClassName('dropmarker').setStyle({position:'absolute'});
+      document.getElementsByTagName("body").item(0).appendChild(Sortable._marker);
+    }    
+    var offsets = Position.cumulativeOffset(dropon);
+    Sortable._marker.setStyle({left: offsets[0]+'px', top: offsets[1] + 'px'});
+    
+    if(position=='after')
+      if(sortable.overlap == 'horizontal') 
+        Sortable._marker.setStyle({left: (offsets[0]+dropon.clientWidth) + 'px'});
+      else
+        Sortable._marker.setStyle({top: (offsets[1]+dropon.clientHeight) + 'px'});
+    
+    Sortable._marker.show();
+  },
+  
+  _tree: function(element, options, parent) {
+    var children = Sortable.findElements(element, options) || [];
+  
+    for (var i = 0; i < children.length; ++i) {
+      var match = children[i].id.match(options.format);
+
+      if (!match) continue;
+      
+      var child = {
+        id: encodeURIComponent(match ? match[1] : null),
+        element: element,
+        parent: parent,
+        children: [],
+        position: parent.children.length,
+        container: $(children[i]).down(options.treeTag)
+      }
+      
+      /* Get the element containing the children and recurse over it */
+      if (child.container)
+        this._tree(child.container, options, child)
+      
+      parent.children.push (child);
+    }
+
+    return parent; 
+  },
+
+  tree: function(element) {
+    element = $(element);
+    var sortableOptions = this.options(element);
+    var options = Object.extend({
+      tag: sortableOptions.tag,
+      treeTag: sortableOptions.treeTag,
+      only: sortableOptions.only,
+      name: element.id,
+      format: sortableOptions.format
+    }, arguments[1] || { });
+    
+    var root = {
+      id: null,
+      parent: null,
+      children: [],
+      container: element,
+      position: 0
+    }
+    
+    return Sortable._tree(element, options, root);
+  },
+
+  /* Construct a [i] index for a particular node */
+  _constructIndex: function(node) {
+    var index = '';
+    do {
+      if (node.id) index = '[' + node.position + ']' + index;
+    } while ((node = node.parent) != null);
+    return index;
+  },
+
+  sequence: function(element) {
+    element = $(element);
+    var options = Object.extend(this.options(element), arguments[1] || { });
+    
+    return $(this.findElements(element, options) || []).map( function(item) {
+      return item.id.match(options.format) ? item.id.match(options.format)[1] : '';
+    });
+  },
+
+  setSequence: function(element, new_sequence) {
+    element = $(element);
+    var options = Object.extend(this.options(element), arguments[2] || { });
+    
+    var nodeMap = { };
+    this.findElements(element, options).each( function(n) {
+        if (n.id.match(options.format))
+            nodeMap[n.id.match(options.format)[1]] = [n, n.parentNode];
+        n.parentNode.removeChild(n);
+    });
+   
+    new_sequence.each(function(ident) {
+      var n = nodeMap[ident];
+      if (n) {
+        n[1].appendChild(n[0]);
+        delete nodeMap[ident];
+      }
+    });
+  },
+  
+  serialize: function(element) {
+    element = $(element);
+    var options = Object.extend(Sortable.options(element), arguments[1] || { });
+    var name = encodeURIComponent(
+      (arguments[1] && arguments[1].name) ? arguments[1].name : element.id);
+    
+    if (options.tree) {
+      return Sortable.tree(element, arguments[1]).children.map( function (item) {
+        return [name + Sortable._constructIndex(item) + "[id]=" + 
+                encodeURIComponent(item.id)].concat(item.children.map(arguments.callee));
+      }).flatten().join('&');
+    } else {
+      return Sortable.sequence(element, arguments[1]).map( function(item) {
+        return name + "[]=" + encodeURIComponent(item);
+      }).join('&');
+    }
+  }
+}
+
+// Returns true if child is contained within element
+Element.isParent = function(child, element) {
+  if (!child.parentNode || child == element) return false;
+  if (child.parentNode == element) return true;
+  return Element.isParent(child.parentNode, element);
+}
+
+Element.findChildren = function(element, only, recursive, tagName) {   
+  if(!element.hasChildNodes()) return null;
+  tagName = tagName.toUpperCase();
+  if(only) only = [only].flatten();
+  var elements = [];
+  $A(element.childNodes).each( function(e) {
+    if(e.tagName && e.tagName.toUpperCase()==tagName &&
+      (!only || (Element.classNames(e).detect(function(v) { return only.include(v) }))))
+        elements.push(e);
+    if(recursive) {
+      var grandchildren = Element.findChildren(e, only, recursive, tagName);
+      if(grandchildren) elements.push(grandchildren);
+    }
+  });
+
+  return (elements.length>0 ? elements.flatten() : []);
+}
+
+Element.offsetSize = function (element, type) {
+  return element['offset' + ((type=='vertical' || type=='height') ? 'Height' : 'Width')];
+}


[051/100] [abbrv] [partial] git commit: Reverting the erroneous merge by Sebastian according to the instructions in INFRA-6876

Posted by wi...@apache.org.
Reverting the erroneous merge by Sebastian according to the instructions in INFRA-6876

This reverts commit c576351a57b4de9d75f6cb8f5eec631666c2a5c2.
This reverts commit 4b8b86802a9814f8cffbb03a5262b00f7a42f9a9.
This reverts commit be31f8a736c8ae7b42ff194992b503b7ae0159a4.
This reverts commit a9bf7e4fa56f00e26e09a5fae002686eb65631df.
This reverts commit 4aa87dbe5c121476176292416e36e71f613be83e.

Signed-off-by: Jakob Frank <ja...@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/marmotta/repo
Commit: http://git-wip-us.apache.org/repos/asf/marmotta/commit/582abb5b
Tree: http://git-wip-us.apache.org/repos/asf/marmotta/tree/582abb5b
Diff: http://git-wip-us.apache.org/repos/asf/marmotta/diff/582abb5b

Branch: refs/heads/ldp
Commit: 582abb5b0db790244b5ade0db134b1cf01860536
Parents: 4aa87db
Author: Jakob Frank <ja...@apache.org>
Authored: Tue Nov 5 11:41:35 2013 +0100
Committer: Jakob Frank <ja...@apache.org>
Committed: Tue Nov 5 11:41:35 2013 +0100

----------------------------------------------------------------------
 LICENSE.txt                                     |    30 +
 NOTICE.txt                                      |   142 +-
 .../marmotta-archetype-module/pom.xml           |     2 +-
 .../main/resources/archetype-resources/pom.xml  |    16 +-
 .../src/main/java/webservices/MyWebService.java |     2 +-
 .../marmotta-archetype-webapp/pom.xml           |     2 +-
 .../main/resources/archetype-resources/pom.xml  |    53 +-
 .../src/main/webapp/WEB-INF/templates/404.ftl   |   132 +-
 .../src/main/webapp/WEB-INF/templates/admin.ftl |   141 +-
 .../main/webapp/WEB-INF/templates/rdfhtml.ftl   |   527 +-
 .../src/main/webapp/WEB-INF/web.xml             |     7 +-
 build/archetypes/pom.xml                        |     2 +-
 build/checkstyle-resources/pom.xml              |     2 +-
 build/dependency-resource-supplement/pom.xml    |     2 +-
 build/plugins/buildinfo-maven-plugin/pom.xml    |    10 +-
 .../plugins/buildinfo/ProjectInfoProvider.java  |     2 +-
 build/plugins/marmotta-maven-plugin/pom.xml     |     6 +-
 build/plugins/pom.xml                           |     2 +-
 build/plugins/refpack-maven-plugin/pom.xml      |     6 +-
 build/plugins/repocheck-maven-plugin/pom.xml    |     2 +-
 build/pom.xml                                   |     2 +-
 build/scripts/check_signatures.sh               |    75 +
 build/scripts/check_signatures_and_digests.sh   |    62 -
 client/marmotta-client-java/pom.xml             |    59 +-
 .../apache/marmotta/client/MarmottaClient.java  |     5 +-
 .../marmotta/client/clients/SPARQLClient.java   |   169 +-
 .../apache/marmotta/client/util/HTTPUtil.java   |     9 +-
 .../apache/marmotta/client/util/MetaUtil.java   |    65 +
 .../marmotta/client/util/RDFJSONParser.java     |   142 +-
 client/marmotta-client-js/pom.xml               |     2 +-
 client/marmotta-client-php/pom.xml              |     2 +-
 client/pom.xml                                  |     2 +-
 commons/marmotta-commons/pom.xml                |    62 +-
 .../ext/java/javax/realtime/RealtimeThread.java |    13 +
 .../src/ext/java/javolution/lang/Immutable.java |    45 +
 .../src/ext/java/javolution/lang/MathLib.java   |  1471 +++
 .../java/javolution/lang/Parallelizable.java    |    73 +
 .../src/ext/java/javolution/lang/Realtime.java  |   113 +
 .../src/ext/java/javolution/lang/ValueType.java |    71 +
 .../ext/java/javolution/lang/package-info.java  |     5 +
 .../java/javolution/util/FastCollection.java    |   634 +
 .../src/ext/java/javolution/util/FastMap.java   |   402 +
 .../src/ext/java/javolution/util/FastSet.java   |   146 +
 .../ext/java/javolution/util/FastSortedMap.java |   205 +
 .../ext/java/javolution/util/FastSortedSet.java |   153 +
 .../java/javolution/util/FastSortedTable.java   |   138 +
 .../src/ext/java/javolution/util/FastTable.java |   438 +
 .../java/javolution/util/function/Consumer.java |    29 +
 .../javolution/util/function/Equalities.java    |    74 +
 .../java/javolution/util/function/Equality.java |    77 +
 .../java/javolution/util/function/Function.java |    33 +
 .../javolution/util/function/Iteration.java     |    32 +
 .../javolution/util/function/MultiVariable.java |    54 +
 .../javolution/util/function/Predicate.java     |    32 +
 .../java/javolution/util/function/Reducer.java  |    26 +
 .../java/javolution/util/function/Reducers.java |   229 +
 .../javolution/util/function/Splittable.java    |    53 +
 .../java/javolution/util/function/Supplier.java |    30 +
 .../javolution/util/function/package-info.java  |    25 +
 .../util/internal/ReadWriteLockImpl.java        |   138 +
 .../collection/AtomicCollectionImpl.java        |   194 +
 .../internal/collection/CollectionView.java     |   268 +
 .../collection/DistinctCollectionImpl.java      |   102 +
 .../collection/FilteredCollectionImpl.java      |   111 +
 .../collection/MappedCollectionImpl.java        |   101 +
 .../collection/ReversedCollectionImpl.java      |    98 +
 .../collection/SequentialCollectionImpl.java    |    83 +
 .../collection/SharedCollectionImpl.java        |   270 +
 .../collection/SortedCollectionImpl.java        |   109 +
 .../collection/UnmodifiableCollectionImpl.java  |    98 +
 .../comparator/ArrayComparatorImpl.java         |    72 +
 .../comparator/IdentityComparatorImpl.java      |    42 +
 .../LexicalCaseInsensitiveComparatorImpl.java   |    73 +
 .../comparator/LexicalComparatorImpl.java       |    76 +
 .../comparator/LexicalFastComparatorImpl.java   |    30 +
 .../comparator/StandardComparatorImpl.java      |    48 +
 .../comparator/WrapperComparatorImpl.java       |    52 +
 .../util/internal/map/AtomicMapImpl.java        |   192 +
 .../util/internal/map/FastMapImpl.java          |   250 +
 .../util/internal/map/FractalMapImpl.java       |   121 +
 .../util/internal/map/MapEntryImpl.java         |    46 +
 .../javolution/util/internal/map/MapView.java   |   363 +
 .../util/internal/map/SequentialMapImpl.java    |    93 +
 .../util/internal/map/SharedMapImpl.java        |   240 +
 .../util/internal/map/UnmodifiableMapImpl.java  |   109 +
 .../map/sorted/AtomicSortedMapImpl.java         |    82 +
 .../internal/map/sorted/FastSortedMapImpl.java  |   115 +
 .../util/internal/map/sorted/MapEntryImpl.java  |    50 +
 .../map/sorted/SharedSortedMapImpl.java         |   107 +
 .../util/internal/map/sorted/SortedMapView.java |   163 +
 .../internal/map/sorted/SubSortedMapImpl.java   |   143 +
 .../map/sorted/UnmodifiableSortedMapImpl.java   |    85 +
 .../util/internal/set/AtomicSetImpl.java        |    31 +
 .../util/internal/set/FilteredSetImpl.java      |    43 +
 .../util/internal/set/MappedSetImpl.java        |    43 +
 .../javolution/util/internal/set/SetView.java   |    49 +
 .../util/internal/set/SharedSetImpl.java        |    52 +
 .../util/internal/set/UnmodifiableSetImpl.java  |    42 +
 .../set/sorted/AtomicSortedSetImpl.java         |    62 +
 .../set/sorted/SharedSortedSetImpl.java         |    88 +
 .../util/internal/set/sorted/SortedSetView.java |    60 +
 .../internal/set/sorted/SubSortedSetImpl.java   |   144 +
 .../set/sorted/UnmodifiableSortedSetImpl.java   |    67 +
 .../util/internal/table/AtomicTableImpl.java    |   236 +
 .../util/internal/table/FastTableImpl.java      |   210 +
 .../util/internal/table/FractalTableImpl.java   |   172 +
 .../util/internal/table/QuickSort.java          |    75 +
 .../util/internal/table/ReversedTableImpl.java  |    76 +
 .../util/internal/table/SharedTableImpl.java    |   315 +
 .../util/internal/table/SubTableImpl.java       |   101 +
 .../util/internal/table/TableIteratorImpl.java  |    93 +
 .../util/internal/table/TableView.java          |   259 +
 .../internal/table/UnmodifiableTableImpl.java   |    84 +
 .../table/sorted/AtomicSortedTableImpl.java     |    55 +
 .../table/sorted/FastSortedTableImpl.java       |    67 +
 .../table/sorted/SharedSortedTableImpl.java     |    57 +
 .../internal/table/sorted/SortedTableView.java  |    68 +
 .../table/sorted/SubSortedTableImpl.java        |    87 +
 .../sorted/UnmodifiableSortedTableImpl.java     |    46 +
 .../ext/java/javolution/util/package-info.java  |    32 +
 .../util/service/CollectionService.java         |    39 +
 .../javolution/util/service/MapService.java     |    73 +
 .../javolution/util/service/SetService.java     |    24 +
 .../util/service/SortedMapService.java          |    41 +
 .../util/service/SortedSetService.java          |    33 +
 .../util/service/SortedTableService.java        |    36 +
 .../javolution/util/service/TableService.java   |    29 +
 .../javolution/util/service/package-info.java   |     6 +
 .../commons/collections/CollectionUtils.java    |     2 +
 .../commons/collections/EquivalenceHashMap.java |   563 +
 .../commons/collections/EquivalenceHashSet.java |   472 +
 .../marmotta/commons/http/ETagGenerator.java    |    24 +-
 .../apache/marmotta/commons/http/UriUtil.java   |     2 +-
 .../marmotta/commons/locking/ObjectLocks.java   |    75 +
 .../commons/sesame/model/LiteralCommons.java    |     3 +-
 .../commons/sesame/model/LiteralKey.java        |    60 +
 .../commons/sesame/model/StatementCommons.java  |   190 +
 .../sesame/repository/ResourceUtils.java        |   329 +-
 .../apache/marmotta/commons/util/DateUtils.java |    39 +-
 .../apache/marmotta/commons/vocabulary/XSD.java |   325 +
 .../src/main/resources/META-INF/LICENSE         |   234 +
 .../src/main/resources/META-INF/NOTICE          |    18 +
 .../collections/EquivalenceHashSet2Test.java    |    62 +
 .../collections/EquivalenceHashSetTest.java     |   138 +
 .../sesame/model/LiteralCommonsTest.java        |    31 +-
 .../sesame/model/StatementCommonsTest.java      |   225 +
 .../marmotta/commons/util/DateUtilsTest.java    |    44 +
 commons/pom.xml                                 |     4 +-
 commons/sesame-filter/pom.xml                   |     6 +-
 commons/sesame-tools-facading/pom.xml           |    13 +-
 .../sesame/facading/impl/FacadingImpl.java      |    95 +-
 .../impl/FacadingInvocationHandler.java         |    95 +-
 .../sesame/facading/util/FacadeUtils.java       |    39 +-
 .../sesame/facading/AbstractFacadingTest.java   |    16 +-
 .../builder/FacadingPredicateBuilderTest.java   |     4 +-
 .../facading/builder/model/ExampleFacade.java   |     1 +
 .../builder/model/ExamplePropBuilder.java       |     1 +
 .../collections/CollectionFacadingTest.java     |    22 +-
 .../collections/model/CollectionFacade.java     |     1 +
 .../concurrent/ConcurrentFacadingTest.java      |   198 +
 .../facading/concurrent/model/FooFacade.java    |    30 +
 .../facading/concurrent/model/TypeFacade.java   |    34 +
 .../sesame/facading/foaf/FacadingFoafTest.java  |     1 +
 .../facading/foaf/model/OnlineAccount.java      |     1 +
 .../sesame/facading/foaf/model/Person.java      |     1 +
 .../facading/locale/LocaleFacadingTest.java     |     9 +-
 .../facading/locale/model/LocaleFacade.java     |     1 +
 .../facading/primitive/BoxedFacadingTest.java   |   157 +
 .../primitive/PrimitiveFacadingTest.java        |   130 +
 .../sesame/facading/primitive/model/Boxed.java  |    51 +
 .../facading/primitive/model/Primitive.java     |    47 +
 .../facading/primitive/model/PropBuilder.java   |    29 +
 .../src/test/resources/logback.xml              |     1 +
 commons/sesame-tools-rio-api/pom.xml            |     2 +-
 commons/sesame-tools-rio-ical/pom.xml           |     2 +-
 commons/sesame-tools-rio-jsonld/pom.xml         |   164 -
 .../src/ext/java/de/dfki/km/json/JSONUtils.java |   208 -
 .../de/dfki/km/json/jsonld/JSONLDConsts.java    |    17 -
 .../de/dfki/km/json/jsonld/JSONLDProcessor.java |  1386 --
 .../dfki/km/json/jsonld/JSONLDSerializer.java   |   241 -
 .../km/json/jsonld/JSONLDTripleCallback.java    |    34 -
 .../de/dfki/km/json/jsonld/JSONLDUtils.java     |   855 --
 .../jsonld/impl/SesameJSONLDSerializer.java     |    49 -
 .../json/jsonld/impl/SesameTripleCallback.java  |    83 -
 .../commons/sesame/rio/jsonld/JsonLdParser.java |   202 -
 .../sesame/rio/jsonld/JsonLdParserFactory.java  |    46 -
 .../commons/sesame/rio/jsonld/JsonLdWriter.java |   126 -
 .../sesame/rio/jsonld/JsonLdWriterFactory.java  |    62 -
 .../src/main/resources/META-INF/LICENSE         |   205 -
 .../src/main/resources/META-INF/NOTICE          |     9 -
 .../services/org.openrdf.rio.RDFParserFactory   |     1 -
 .../services/org.openrdf.rio.RDFWriterFactory   |     1 -
 .../sesame/rio/jsonld/TestJSONLdParser.java     |   120 -
 .../src/test/resources/logback.xml              |    27 -
 .../rio/jsonld/compact-0001-context.jsonld      |    13 -
 .../sesame/rio/jsonld/compact-0001-in.jsonld    |    27 -
 .../sesame/rio/jsonld/compact-0001-out.jsonld   |    38 -
 .../rio/jsonld/compact-0002-context.jsonld      |     6 -
 .../sesame/rio/jsonld/compact-0002-in.jsonld    |     4 -
 .../sesame/rio/jsonld/compact-0002-out.jsonld   |     8 -
 .../rio/jsonld/compact-0003-context.jsonld      |     9 -
 .../sesame/rio/jsonld/compact-0003-in.jsonld    |     7 -
 .../sesame/rio/jsonld/compact-0003-out.jsonld   |    12 -
 .../rio/jsonld/compact-0004-context.jsonld      |     9 -
 .../sesame/rio/jsonld/compact-0004-in.jsonld    |     7 -
 .../sesame/rio/jsonld/compact-0004-out.jsonld   |    11 -
 .../rio/jsonld/compact-0005-context.jsonld      |    12 -
 .../sesame/rio/jsonld/compact-0005-in.jsonld    |    13 -
 .../sesame/rio/jsonld/compact-0005-out.jsonld   |    18 -
 .../rio/jsonld/compact-0006-context.jsonld      |     5 -
 .../sesame/rio/jsonld/compact-0006-in.jsonld    |    19 -
 .../sesame/rio/jsonld/compact-0006-out.jsonld   |    10 -
 .../rio/jsonld/compact-0007-context.jsonld      |    15 -
 .../sesame/rio/jsonld/compact-0007-in.jsonld    |    19 -
 .../sesame/rio/jsonld/compact-0007-out.jsonld   |    20 -
 .../rio/jsonld/compact-0008-context.jsonld      |     5 -
 .../sesame/rio/jsonld/compact-0008-in.jsonld    |     7 -
 .../sesame/rio/jsonld/compact-0008-out.jsonld   |    10 -
 .../rio/jsonld/compact-0009-context.jsonld      |     9 -
 .../sesame/rio/jsonld/compact-0009-in.jsonld    |     9 -
 .../sesame/rio/jsonld/compact-0009-out.jsonld   |    17 -
 .../rio/jsonld/compact-0010-context.jsonld      |    14 -
 .../sesame/rio/jsonld/compact-0010-in.jsonld    |    13 -
 .../sesame/rio/jsonld/compact-0010-out.jsonld   |    18 -
 .../sesame/rio/jsonld/compact-manifest.jsonld   |    68 -
 .../sesame/rio/jsonld/expand-0001-in.jsonld     |     3 -
 .../sesame/rio/jsonld/expand-0001-out.jsonld    |     3 -
 .../sesame/rio/jsonld/expand-0002-in.jsonld     |    39 -
 .../sesame/rio/jsonld/expand-0002-out.jsonld    |    31 -
 .../sesame/rio/jsonld/expand-0003-in.jsonld     |    13 -
 .../sesame/rio/jsonld/expand-0003-out.jsonld    |     7 -
 .../sesame/rio/jsonld/expand-0004-in.jsonld     |    18 -
 .../sesame/rio/jsonld/expand-0004-out.jsonld    |    13 -
 .../sesame/rio/jsonld/expand-0005-in.jsonld     |    16 -
 .../sesame/rio/jsonld/expand-0005-out.jsonld    |    19 -
 .../sesame/rio/jsonld/expand-0006-in.jsonld     |     7 -
 .../sesame/rio/jsonld/expand-0006-out.jsonld    |     7 -
 .../sesame/rio/jsonld/expand-0007-in.jsonld     |    10 -
 .../sesame/rio/jsonld/expand-0007-out.jsonld    |     7 -
 .../sesame/rio/jsonld/expand-0008-in.jsonld     |    20 -
 .../sesame/rio/jsonld/expand-0008-out.jsonld    |    13 -
 .../sesame/rio/jsonld/expand-0009-in.jsonld     |    43 -
 .../sesame/rio/jsonld/expand-0009-out.jsonld    |    31 -
 .../sesame/rio/jsonld/expand-0010-in.jsonld     |    23 -
 .../sesame/rio/jsonld/expand-0010-out.jsonld    |    18 -
 .../sesame/rio/jsonld/expand-manifest.jsonld    |    58 -
 .../sesame/rio/jsonld/frame-0001-frame.jsonld   |    13 -
 .../sesame/rio/jsonld/frame-0001-in.jsonld      |    30 -
 .../sesame/rio/jsonld/frame-0001-out.jsonld     |    20 -
 .../sesame/rio/jsonld/frame-0002-frame.jsonld   |    13 -
 .../sesame/rio/jsonld/frame-0002-in.jsonld      |    31 -
 .../sesame/rio/jsonld/frame-0002-out.jsonld     |    21 -
 .../sesame/rio/jsonld/frame-0003-frame.jsonld   |     7 -
 .../sesame/rio/jsonld/frame-0003-in.jsonld      |    30 -
 .../sesame/rio/jsonld/frame-0003-out.jsonld     |     1 -
 .../sesame/rio/jsonld/frame-0004-frame.jsonld   |    10 -
 .../sesame/rio/jsonld/frame-0004-in.jsonld      |    29 -
 .../sesame/rio/jsonld/frame-0004-out.jsonld     |    20 -
 .../sesame/rio/jsonld/frame-0005-frame.jsonld   |    19 -
 .../sesame/rio/jsonld/frame-0005-in.jsonld      |    30 -
 .../sesame/rio/jsonld/frame-0005-out.jsonld     |    19 -
 .../sesame/rio/jsonld/frame-0006-frame.jsonld   |    13 -
 .../sesame/rio/jsonld/frame-0006-in.jsonld      |    30 -
 .../sesame/rio/jsonld/frame-0006-out.jsonld     |    20 -
 .../sesame/rio/jsonld/frame-0007-frame.jsonld   |    13 -
 .../sesame/rio/jsonld/frame-0007-in.jsonld      |    33 -
 .../sesame/rio/jsonld/frame-0007-out.jsonld     |    23 -
 .../sesame/rio/jsonld/frame-0008-frame.jsonld   |    14 -
 .../sesame/rio/jsonld/frame-0008-in.jsonld      |    38 -
 .../sesame/rio/jsonld/frame-0008-out.jsonld     |    34 -
 .../sesame/rio/jsonld/frame-0009-frame.jsonld   |    27 -
 .../sesame/rio/jsonld/frame-0009-in.jsonld      |    19 -
 .../sesame/rio/jsonld/frame-0009-out.jsonld     |    17 -
 .../sesame/rio/jsonld/frame-0010-frame.jsonld   |    13 -
 .../sesame/rio/jsonld/frame-0010-in.jsonld      |    15 -
 .../sesame/rio/jsonld/frame-0010-out.jsonld     |    12 -
 .../sesame/rio/jsonld/frame-0011-frame.jsonld   |    12 -
 .../sesame/rio/jsonld/frame-0011-in.jsonld      |    15 -
 .../sesame/rio/jsonld/frame-0011-out.jsonld     |    14 -
 .../sesame/rio/jsonld/frame-0012-frame.jsonld   |    11 -
 .../sesame/rio/jsonld/frame-0012-in.jsonld      |    20 -
 .../sesame/rio/jsonld/frame-0012-out.jsonld     |    24 -
 .../sesame/rio/jsonld/frame-0013-frame.jsonld   |     1 -
 .../sesame/rio/jsonld/frame-0013-in.jsonld      |    18 -
 .../sesame/rio/jsonld/frame-0013-out.jsonld     |    19 -
 .../sesame/rio/jsonld/frame-0014-frame.jsonld   |     7 -
 .../sesame/rio/jsonld/frame-0014-in.jsonld      |    11 -
 .../sesame/rio/jsonld/frame-0014-out.jsonld     |    17 -
 .../sesame/rio/jsonld/frame-0015-frame.jsonld   |   227 -
 .../sesame/rio/jsonld/frame-0015-in.jsonld      |    70 -
 .../sesame/rio/jsonld/frame-0015-out.jsonld     |    44 -
 .../sesame/rio/jsonld/frame-manifest.jsonld     |    98 -
 .../sesame/rio/jsonld/normalize-0001-in.jsonld  |     3 -
 .../sesame/rio/jsonld/normalize-0001-out.jsonld |     1 -
 .../sesame/rio/jsonld/normalize-0002-in.jsonld  |    14 -
 .../sesame/rio/jsonld/normalize-0002-out.jsonld |     1 -
 .../sesame/rio/jsonld/normalize-0003-in.jsonld  |     6 -
 .../sesame/rio/jsonld/normalize-0003-out.jsonld |     1 -
 .../sesame/rio/jsonld/normalize-0004-in.jsonld  |     9 -
 .../sesame/rio/jsonld/normalize-0004-out.jsonld |     1 -
 .../sesame/rio/jsonld/normalize-0005-in.jsonld  |    10 -
 .../sesame/rio/jsonld/normalize-0005-out.jsonld |     1 -
 .../sesame/rio/jsonld/normalize-0006-in.jsonld  |    10 -
 .../sesame/rio/jsonld/normalize-0006-out.jsonld |     1 -
 .../sesame/rio/jsonld/normalize-0007-in.jsonld  |    12 -
 .../sesame/rio/jsonld/normalize-0007-out.jsonld |     1 -
 .../sesame/rio/jsonld/normalize-0008-in.jsonld  |    20 -
 .../sesame/rio/jsonld/normalize-0008-out.jsonld |     1 -
 .../sesame/rio/jsonld/normalize-0009-in.jsonld  |    39 -
 .../sesame/rio/jsonld/normalize-0009-out.jsonld |     1 -
 .../sesame/rio/jsonld/normalize-0010-in.jsonld  |    11 -
 .../sesame/rio/jsonld/normalize-0010-out.jsonld |     1 -
 .../sesame/rio/jsonld/normalize-0011-in.jsonld  |    11 -
 .../sesame/rio/jsonld/normalize-0011-out.jsonld |     1 -
 .../sesame/rio/jsonld/normalize-0012-in.jsonld  |    14 -
 .../sesame/rio/jsonld/normalize-0012-out.jsonld |     1 -
 .../sesame/rio/jsonld/normalize-0013-in.jsonld  |    18 -
 .../sesame/rio/jsonld/normalize-0013-out.jsonld |     1 -
 .../sesame/rio/jsonld/normalize-0014-in.jsonld  |    16 -
 .../sesame/rio/jsonld/normalize-0014-out.jsonld |     1 -
 .../sesame/rio/jsonld/normalize-0015-in.jsonld  |    13 -
 .../sesame/rio/jsonld/normalize-0015-out.jsonld |     1 -
 .../sesame/rio/jsonld/normalize-0016-in.jsonld  |    18 -
 .../sesame/rio/jsonld/normalize-0016-out.jsonld |     1 -
 .../sesame/rio/jsonld/normalize-0017-in.jsonld  |    20 -
 .../sesame/rio/jsonld/normalize-0017-out.jsonld |     1 -
 .../sesame/rio/jsonld/normalize-0018-in.jsonld  |    11 -
 .../sesame/rio/jsonld/normalize-0018-out.jsonld |     1 -
 .../sesame/rio/jsonld/normalize-0019-in.jsonld  |    19 -
 .../sesame/rio/jsonld/normalize-0019-out.jsonld |     1 -
 .../sesame/rio/jsonld/normalize-0020-in.jsonld  |    33 -
 .../sesame/rio/jsonld/normalize-0020-out.jsonld |     1 -
 .../sesame/rio/jsonld/normalize-0021-in.jsonld  |    19 -
 .../sesame/rio/jsonld/normalize-0021-out.jsonld |     1 -
 .../sesame/rio/jsonld/normalize-0022-in.jsonld  |    24 -
 .../sesame/rio/jsonld/normalize-0022-out.jsonld |     1 -
 .../sesame/rio/jsonld/normalize-0023-in.jsonld  |    23 -
 .../sesame/rio/jsonld/normalize-0023-out.jsonld |     1 -
 .../sesame/rio/jsonld/normalize-0024-in.jsonld  |    29 -
 .../sesame/rio/jsonld/normalize-0024-out.jsonld |     1 -
 .../sesame/rio/jsonld/normalize-0025-in.jsonld  |    29 -
 .../sesame/rio/jsonld/normalize-0025-out.jsonld |     1 -
 .../sesame/rio/jsonld/normalize-0026-in.jsonld  |    29 -
 .../sesame/rio/jsonld/normalize-0026-out.jsonld |     1 -
 .../sesame/rio/jsonld/normalize-0027-in.jsonld  |    29 -
 .../sesame/rio/jsonld/normalize-0027-out.jsonld |     1 -
 .../sesame/rio/jsonld/normalize-0028-in.jsonld  |    29 -
 .../sesame/rio/jsonld/normalize-0028-out.jsonld |     1 -
 .../sesame/rio/jsonld/normalize-0029-in.jsonld  |    29 -
 .../sesame/rio/jsonld/normalize-0029-out.jsonld |     1 -
 .../sesame/rio/jsonld/normalize-0030-in.jsonld  |    38 -
 .../sesame/rio/jsonld/normalize-0030-out.jsonld |     1 -
 .../sesame/rio/jsonld/normalize-0031-in.jsonld  |     7 -
 .../sesame/rio/jsonld/normalize-0031-out.jsonld |     1 -
 .../sesame/rio/jsonld/normalize-0032-in.jsonld  |     7 -
 .../sesame/rio/jsonld/normalize-0032-out.jsonld |     1 -
 .../sesame/rio/jsonld/normalize-0033-in.jsonld  |    19 -
 .../sesame/rio/jsonld/normalize-0033-out.jsonld |     1 -
 .../sesame/rio/jsonld/normalize-0034-in.jsonld  |    19 -
 .../sesame/rio/jsonld/normalize-0034-out.jsonld |     1 -
 .../sesame/rio/jsonld/normalize-0035-in.jsonld  |    27 -
 .../sesame/rio/jsonld/normalize-0035-out.jsonld |     1 -
 .../sesame/rio/jsonld/normalize-0036-in.jsonld  |    27 -
 .../sesame/rio/jsonld/normalize-0036-out.jsonld |     1 -
 .../sesame/rio/jsonld/normalize-0037-in.jsonld  |    27 -
 .../sesame/rio/jsonld/normalize-0037-out.jsonld |     1 -
 .../sesame/rio/jsonld/normalize-0038-in.jsonld  |    28 -
 .../sesame/rio/jsonld/normalize-0038-out.jsonld |     1 -
 .../sesame/rio/jsonld/normalize-0039-in.jsonld  |    22 -
 .../sesame/rio/jsonld/normalize-0039-out.jsonld |     1 -
 .../sesame/rio/jsonld/normalize-0040-in.jsonld  |    33 -
 .../sesame/rio/jsonld/normalize-0040-out.jsonld |     1 -
 .../sesame/rio/jsonld/normalize-0041-in.jsonld  |    33 -
 .../sesame/rio/jsonld/normalize-0041-out.jsonld |     1 -
 .../sesame/rio/jsonld/normalize-0042-in.jsonld  |    27 -
 .../sesame/rio/jsonld/normalize-0042-out.jsonld |     1 -
 .../sesame/rio/jsonld/normalize-0043-in.jsonld  |    10 -
 .../sesame/rio/jsonld/normalize-0043-out.jsonld |     1 -
 .../sesame/rio/jsonld/normalize-0044-in.jsonld  |   107 -
 .../sesame/rio/jsonld/normalize-0044-out.jsonld |     1 -
 .../sesame/rio/jsonld/normalize-0045-in.jsonld  |   107 -
 .../sesame/rio/jsonld/normalize-0045-out.jsonld |     1 -
 .../sesame/rio/jsonld/normalize-0046-in.jsonld  |   107 -
 .../sesame/rio/jsonld/normalize-0046-out.jsonld |     1 -
 .../sesame/rio/jsonld/normalize-0047-in.jsonld  |    49 -
 .../sesame/rio/jsonld/normalize-0047-out.jsonld |     1 -
 .../sesame/rio/jsonld/normalize-0048-in.jsonld  |    49 -
 .../sesame/rio/jsonld/normalize-0048-out.jsonld |     1 -
 .../sesame/rio/jsonld/normalize-0049-in.jsonld  |    11 -
 .../sesame/rio/jsonld/normalize-0049-out.jsonld |     1 -
 .../sesame/rio/jsonld/normalize-0050-in.jsonld  |    20 -
 .../sesame/rio/jsonld/normalize-0050-out.jsonld |     1 -
 .../sesame/rio/jsonld/normalize-0051-in.jsonld  |    14 -
 .../sesame/rio/jsonld/normalize-0051-out.jsonld |     1 -
 .../sesame/rio/jsonld/normalize-0052-in.jsonld  |    20 -
 .../sesame/rio/jsonld/normalize-0052-out.jsonld |     1 -
 .../sesame/rio/jsonld/normalize-manifest.jsonld |   268 -
 .../commons/sesame/rio/jsonld/rdf-0001.jsonld   |     4 -
 .../commons/sesame/rio/jsonld/rdf-0001.sparql   |     5 -
 .../commons/sesame/rio/jsonld/rdf-0002.jsonld   |     5 -
 .../commons/sesame/rio/jsonld/rdf-0002.sparql   |     5 -
 .../commons/sesame/rio/jsonld/rdf-0003.jsonld   |     4 -
 .../commons/sesame/rio/jsonld/rdf-0003.sparql   |     5 -
 .../commons/sesame/rio/jsonld/rdf-0004.jsonld   |     6 -
 .../commons/sesame/rio/jsonld/rdf-0004.sparql   |     5 -
 .../commons/sesame/rio/jsonld/rdf-0005.jsonld   |     6 -
 .../commons/sesame/rio/jsonld/rdf-0005.sparql   |     5 -
 .../commons/sesame/rio/jsonld/rdf-0006.jsonld   |     7 -
 .../commons/sesame/rio/jsonld/rdf-0006.sparql   |     6 -
 .../commons/sesame/rio/jsonld/rdf-0007.jsonld   |     4 -
 .../commons/sesame/rio/jsonld/rdf-0007.sparql   |     6 -
 .../commons/sesame/rio/jsonld/rdf-0008.jsonld   |     4 -
 .../commons/sesame/rio/jsonld/rdf-0008.sparql   |     3 -
 .../commons/sesame/rio/jsonld/rdf-0009.jsonld   |     4 -
 .../commons/sesame/rio/jsonld/rdf-0009.sparql   |     3 -
 .../commons/sesame/rio/jsonld/rdf-0010.jsonld   |     8 -
 .../commons/sesame/rio/jsonld/rdf-0010.sparql   |     6 -
 .../commons/sesame/rio/jsonld/rdf-0011.jsonld   |     9 -
 .../commons/sesame/rio/jsonld/rdf-0011.sparql   |     6 -
 .../commons/sesame/rio/jsonld/rdf-0012.jsonld   |     7 -
 .../commons/sesame/rio/jsonld/rdf-0012.sparql   |     5 -
 .../commons/sesame/rio/jsonld/rdf-0013.jsonld   |     7 -
 .../commons/sesame/rio/jsonld/rdf-0013.sparql   |     5 -
 .../commons/sesame/rio/jsonld/rdf-0014.jsonld   |     7 -
 .../commons/sesame/rio/jsonld/rdf-0014.sparql   |     5 -
 .../commons/sesame/rio/jsonld/rdf-0015.jsonld   |     7 -
 .../commons/sesame/rio/jsonld/rdf-0015.sparql   |     5 -
 .../commons/sesame/rio/jsonld/rdf-0016.jsonld   |     4 -
 .../commons/sesame/rio/jsonld/rdf-0016.sparql   |     5 -
 .../commons/sesame/rio/jsonld/rdf-0017.jsonld   |     4 -
 .../commons/sesame/rio/jsonld/rdf-0017.sparql   |     5 -
 .../commons/sesame/rio/jsonld/rdf-0018.jsonld   |     4 -
 .../commons/sesame/rio/jsonld/rdf-0018.sparql   |     5 -
 .../commons/sesame/rio/jsonld/rdf-0019.jsonld   |     8 -
 .../commons/sesame/rio/jsonld/rdf-0019.sparql   |     5 -
 .../commons/sesame/rio/jsonld/rdf-0020.jsonld   |     8 -
 .../commons/sesame/rio/jsonld/rdf-0020.sparql   |     6 -
 .../commons/sesame/rio/jsonld/rdf-0021.jsonld   |     4 -
 .../commons/sesame/rio/jsonld/rdf-0021.sparql   |     5 -
 .../commons/sesame/rio/jsonld/rdf-0022.jsonld   |     4 -
 .../commons/sesame/rio/jsonld/rdf-0022.sparql   |     5 -
 .../commons/sesame/rio/jsonld/rdf-0023.jsonld   |     4 -
 .../commons/sesame/rio/jsonld/rdf-0023.sparql   |     5 -
 .../commons/sesame/rio/jsonld/rdf-0024.jsonld   |     4 -
 .../commons/sesame/rio/jsonld/rdf-0024.sparql   |     5 -
 .../commons/sesame/rio/jsonld/rdf-0025.jsonld   |     7 -
 .../commons/sesame/rio/jsonld/rdf-0025.sparql   |     5 -
 .../commons/sesame/rio/jsonld/rdf-0026.jsonld   |     4 -
 .../commons/sesame/rio/jsonld/rdf-0026.sparql   |     5 -
 .../sesame/rio/jsonld/rdf-manifest.jsonld       |   166 -
 .../sesame/rio/jsonld/simplify-0001-in.jsonld   |    44 -
 .../sesame/rio/jsonld/simplify-0001-out.jsonld  |    37 -
 .../sesame/rio/jsonld/simplify-manifest.jsonld  |    13 -
 commons/sesame-tools-rio-rdfjson/pom.xml        |   113 -
 .../sesame/rio/rdfjson/RDFJsonParser.java       |   160 -
 .../rio/rdfjson/RDFJsonParserFactory.java       |    46 -
 .../sesame/rio/rdfjson/RDFJsonWriter.java       |   193 -
 .../rio/rdfjson/RDFJsonWriterFactory.java       |    62 -
 .../services/org.openrdf.rio.RDFParserFactory   |     1 -
 .../services/org.openrdf.rio.RDFWriterFactory   |     1 -
 .../sesame/rio/rdfjson/TestRDFJsonParser.java   |   135 -
 .../src/test/resources/logback.xml              |    27 -
 .../commons/sesame/rio/rdfjson/test-001.json    |    21 -
 .../commons/sesame/rio/rdfjson/test-001.rdf     |    37 -
 commons/sesame-tools-rio-rss/pom.xml            |     2 +-
 .../src/main/resources/META-INF/NOTICE          |     8 +-
 commons/sesame-tools-rio-vcard/pom.xml          |     2 +-
 extras/pom.xml                                  |    15 +-
 extras/webjars/codemirror/pom.xml               |    97 +
 .../src/main/resources/codemirror.css           |   259 +
 .../codemirror/src/main/resources/codemirror.js |  5831 +++++++++
 .../codemirror/src/main/resources/ldpath.html   |   246 +
 .../codemirror/src/main/resources/ldpath.js     |   471 +
 .../src/main/resources/matchbrackets.js         |    86 +
 .../src/main/resources/simple-hint.css          |    20 +
 .../src/main/resources/simple-hint.js           |    80 +
 .../codemirror/src/main/resources/skwrl.html    |   254 +
 .../codemirror/src/main/resources/skwrl.js      |   491 +
 .../codemirror/src/main/resources/sparql.js     |   210 +
 extras/webjars/pom.xml                          |    55 +
 extras/webjars/sgvizler/pom.xml                 |    80 +
 .../webjars/sgvizler/0.5.1/lib/d3.v2.min.js     |     1 +
 .../0.5.1/lib/raphael-dracula.pack.min.js       |     1 +
 .../webjars/sgvizler/0.5.1/sgvizler.chart.css   |     1 +
 .../webjars/sgvizler/0.5.1/sgvizler.js          |     1 +
 .../webjars/sgvizler/src/main/resources/LICENSE |    16 +
 .../sgvizler/src/main/resources/REVISION        |     1 +
 .../src/main/resources/lib/d3.v2.min.js         |     4 +
 .../resources/lib/raphael-dracula.pack.min.js   |     7 +
 .../src/main/resources/sgvizler.chart.css       |    37 +
 .../sgvizler/src/main/resources/sgvizler.html   |   114 +
 .../sgvizler/src/main/resources/sgvizler.js     |  1277 ++
 extras/webjars/snorql/pom.xml                   |   106 +
 .../webjars/snorql/src/main/resources/LICENSE   |   202 +
 extras/webjars/snorql/src/main/resources/README |    11 +
 .../webjars/snorql/src/main/resources/link.png  |   Bin 0 -> 165 bytes
 .../snorql/src/main/resources/namespaces.js     |    26 +
 .../snorql/src/main/resources/prototype.js      |  4238 ++++++
 .../snorql/src/main/resources/rdf_flyer.24.gif  |   Bin 0 -> 330 bytes
 .../src/main/resources/scriptaculous/builder.js |   153 +
 .../main/resources/scriptaculous/controls.js    |   971 ++
 .../main/resources/scriptaculous/dragdrop.js    |   985 ++
 .../src/main/resources/scriptaculous/effects.js |  1130 ++
 .../resources/scriptaculous/scriptaculous.js    |    40 +
 .../src/main/resources/scriptaculous/slider.js  |   287 +
 .../src/main/resources/scriptaculous/sound.js   |    65 +
 .../main/resources/scriptaculous/unittest.js    |   578 +
 .../webjars/snorql/src/main/resources/snorql.js |   596 +
 .../webjars/snorql/src/main/resources/sparql.js |   507 +
 .../webjars/snorql/src/main/resources/style.css |    85 +
 .../snorql/src/main/resources/xml-to-html.xsl   |   183 +
 extras/webjars/strftime/pom.xml                 |    81 +
 .../strftime/src/main/resources/strftime.js     |   750 ++
 launchers/marmotta-installer/pom.xml            |     2 +-
 .../src/main/resources/installer/LICENSE.txt    |    31 +
 .../src/main/resources/installer/NOTICE.txt     |   312 +-
 launchers/marmotta-splash/pom.xml               |     4 +-
 .../src/ext/resources/META-INF/NOTICE           |     9 +-
 .../src/main/resources/META-INF/NOTICE          |    12 +-
 launchers/marmotta-webapp/pom.xml               |    53 +-
 .../src/main/resources/ehcache-lmf.xml          |   422 -
 .../src/main/resources/ehcache-marmotta.xml     |   407 +
 .../src/main/webapp/META-INF/LICENSE            |    31 +
 .../src/main/webapp/META-INF/NOTICE             |   269 +-
 .../src/main/webapp/WEB-INF/web.xml             |     8 +-
 .../src/test/resources/ehcache.xml              |     4 +-
 launchers/pom.xml                               |     2 +-
 libraries/kiwi/kiwi-contextaware/pom.xml        |     2 +-
 libraries/kiwi/kiwi-reasoner/pom.xml            |    14 +-
 .../kiwi/reasoner/engine/ReasoningEngine.java   |   546 +-
 .../model/exception/ReasoningException.java     |   100 +
 .../exception/UnjustifiedTripleException.java   |    44 +
 .../reasoner/model/program/Justification.java   |    12 +-
 .../kiwi/reasoner/model/program/Pattern.java    |    21 +-
 .../kiwi/reasoner/model/query/QueryResult.java  |    12 +-
 .../reasoner/parser/KWRLProgramParserBase.java  |     3 +-
 .../kiwi/reasoner/util/JustificationUtils.java  |    26 +
 .../persistence/mysql/statements.properties     |     3 +
 .../persistence/pgsql/statements.properties     |     3 +
 .../engine/JustificationResolutionTest.java     |   316 +
 .../test/engine/ReasoningEngineTest.java        |   150 +-
 .../reasoner/test/model/JustificationTest.java  |   196 +
 .../JustificationPersistenceTest.java           |   141 +-
 .../persistence/KWRLProgramPersistenceTest.java |   119 +-
 .../test/persistence/PatternQueryTest.java      |   122 +-
 .../reasoner/test/sail/ReasoningSailTest.java   |    97 +-
 .../KiWiRDFSchemaRepositoryConnectionTest.java  |   179 +
 .../kiwi/reasoner/test/parser/test-002.kwrl     |     6 +-
 .../reasoner/test/persistence/test-002.kwrl     |     6 +-
 .../kiwi/reasoner/test/sesame/rdfs.skwrl        |    36 +
 libraries/kiwi/kiwi-sparql/pom.xml              |   180 +
 .../evaluation/KiWiEvaluationStatistics.java    |    52 +
 .../evaluation/KiWiEvaluationStrategyImpl.java  |   192 +
 .../sparql/evaluation/KiWiTripleSource.java     |   106 +
 .../persistence/KiWiSparqlConnection.java       |   706 +
 .../kiwi/sparql/sail/KiWiSparqlSail.java        |    87 +
 .../sparql/sail/KiWiSparqlSailConnection.java   |    97 +
 .../kiwi/sparql/sqlmapper/JoinTable.java        |    73 -
 .../sqlmapper/LMFNativeEvaluationStrategy.java  |   479 -
 .../sparql/sqlmapper/SparqlToSQLMapper.java     |  2427 ----
 .../kiwi/sparql/sqlmapper/UnionOptimizer.java   |   239 -
 .../sparql/test/ComplexKiWiSparqlQueryTest.java |    53 +
 .../kiwi/sparql/test/KiWiSparqlJoinTest.java    |   322 +
 .../kiwi/sparql/test/KiWiSparqlUpdateTest.java  |    51 +
 .../marmotta/kiwi/sparql/test/demo-data.foaf    |    78 +
 .../marmotta/kiwi/sparql/test/query1.sparql     |    23 +
 .../marmotta/kiwi/sparql/test/query10.sparql    |    27 +
 .../marmotta/kiwi/sparql/test/query11.sparql    |    25 +
 .../marmotta/kiwi/sparql/test/query12.sparql    |    24 +
 .../marmotta/kiwi/sparql/test/query13.sparql    |    28 +
 .../marmotta/kiwi/sparql/test/query14.sparql    |    25 +
 .../marmotta/kiwi/sparql/test/query2.sparql     |    25 +
 .../marmotta/kiwi/sparql/test/query3.sparql     |    24 +
 .../marmotta/kiwi/sparql/test/query4.sparql     |    24 +
 .../marmotta/kiwi/sparql/test/query5.sparql     |    25 +
 .../marmotta/kiwi/sparql/test/query6.sparql     |    25 +
 .../marmotta/kiwi/sparql/test/query7.sparql     |    25 +
 .../marmotta/kiwi/sparql/test/query8.sparql     |    25 +
 .../marmotta/kiwi/sparql/test/query9.sparql     |    25 +
 libraries/kiwi/kiwi-transactions/pom.xml        |     8 +-
 .../marmotta/kiwi/test/TransactionTest.java     |   130 +-
 libraries/kiwi/kiwi-triplestore/pom.xml         |    21 +-
 .../marmotta/kiwi/config/KiWiConfiguration.java |   163 +
 .../kiwi/model/rdf/KiWiAnonResource.java        |    11 +-
 .../marmotta/kiwi/model/rdf/KiWiLiteral.java    |    38 +-
 .../marmotta/kiwi/model/rdf/KiWiNamespace.java  |     7 +-
 .../marmotta/kiwi/model/rdf/KiWiTriple.java     |    17 +-
 .../kiwi/model/rdf/KiWiUriResource.java         |    13 +-
 .../kiwi/persistence/KiWiConnection.java        |  1200 +-
 .../marmotta/kiwi/persistence/KiWiDialect.java  |    92 +-
 .../kiwi/persistence/KiWiGarbageCollector.java  |   129 +-
 .../kiwi/persistence/KiWiPersistence.java       |   358 +-
 .../marmotta/kiwi/persistence/h2/H2Dialect.java |    43 +
 .../kiwi/persistence/mysql/MySQLDialect.java    |    43 +
 .../persistence/pgsql/PostgreSQLDialect.java    |    52 +
 .../marmotta/kiwi/sail/KiWiSailConnection.java  |   157 +-
 .../apache/marmotta/kiwi/sail/KiWiStore.java    |    46 +-
 .../marmotta/kiwi/sail/KiWiValueFactory.java    |   663 +-
 .../src/main/resources/ehcache-kiwi.xml         |     6 +-
 .../kiwi/persistence/h2/create_base_tables.sql  |    13 +-
 .../kiwi/persistence/h2/drop_base_tables.sql    |     7 +-
 .../kiwi/persistence/h2/statements.properties   |    22 +-
 .../persistence/h2/upgrade_base_001_002.sql     |    20 +
 .../persistence/mysql/create_base_tables.sql    |    27 +-
 .../kiwi/persistence/mysql/drop_base_tables.sql |     7 +-
 .../persistence/mysql/statements.properties     |    23 +-
 .../persistence/mysql/upgrade_base_001_002.sql  |    24 +
 .../persistence/pgsql/create_base_tables.sql    |    22 +-
 .../kiwi/persistence/pgsql/drop_base_tables.sql |     7 +-
 .../persistence/pgsql/statements.properties     |    21 +-
 .../persistence/pgsql/upgrade_base_001_002.sql  |    19 +
 .../marmotta/kiwi/test/ConcurrencyTestBase.java |   189 +
 .../apache/marmotta/kiwi/test/DialectTest.java  |    92 +-
 .../marmotta/kiwi/test/H2ConcurrencyTest.java   |    67 +
 .../kiwi/test/MySQLConcurrencyTest.java         |    69 +
 .../marmotta/kiwi/test/PersistenceTest.java     |   301 +-
 .../kiwi/test/PostgreSQLConcurrencyTest.java    |    74 +
 .../marmotta/kiwi/test/RepositoryTest.java      |   503 +-
 .../kiwi/test/helper/DBConnectionChecker.java   |   110 +-
 .../kiwi/test/junit/DatabaseRunnerTest1.java    |    82 +
 .../kiwi/test/junit/DatabaseRunnerTest2.java    |    79 +
 .../kiwi/test/junit/KiWiDatabaseRunner.java     |   340 +
 .../kiwi/test/sesame/KiWiLocaleTest.java        |   113 +
 .../test/sesame/KiWiSailConcurrencyTest.java    |    83 +
 .../kiwi/test/sesame/KiWiSailInterruptTest.java |    71 +
 .../kiwi/test/sesame/KiWiStoreTest.java         |    66 +
 .../KiWiRepositoryConnectionTest.java           |    70 +
 .../sesame/repository/KiWiRepositoryTest.java   |    66 +
 libraries/kiwi/kiwi-tripletable/pom.xml         |    38 +-
 .../marmotta/kiwi/model/caching/IntArray.java   |    17 +-
 .../kiwi/model/caching/TripleTable.java         |    65 +-
 .../kiwi/model/caching/TripleTableTest.java     |   127 +
 libraries/kiwi/kiwi-versioning/pom.xml          |     8 +-
 .../persistence/KiWiVersioningConnection.java   |    60 +
 .../persistence/KiWiVersioningPersistence.java  |     8 +-
 .../versioning/sail/KiWiVersioningSail.java     |   144 +-
 .../kiwi/persistence/h2/statements.properties   |     2 +-
 .../persistence/mysql/statements.properties     |     3 +-
 .../persistence/pgsql/statements.properties     |     3 +-
 .../versioning/test/SnapshotRepositoryTest.java |   141 +-
 .../test/VersioningPersistenceTest.java         |   238 +-
 .../test/VersioningRepositoryTest.java          |   227 +-
 libraries/kiwi/pom.xml                          |    33 +-
 libraries/ldcache/ldcache-api/pom.xml           |    26 +-
 .../marmotta/ldcache/api/LDCachingBackend.java  |     8 +
 .../marmotta/ldcache/model/CacheEntry.java      |    42 +
 .../ldcache/ldcache-backend-ehcache/pom.xml     |    26 +-
 libraries/ldcache/ldcache-backend-file/pom.xml  |    25 +-
 .../backend/file/LDCachingFileBackend.java      |    22 +
 .../backend/file/util/FileBackendUtils.java     |     5 +-
 .../backend/file/test/LDCacheBackendTest.java   |    10 +-
 libraries/ldcache/ldcache-backend-kiwi/pom.xml  |    25 +-
 .../backend/kiwi/LDCachingKiWiBackend.java      |    23 +
 .../LDCachingKiWiPersistenceConnection.java     |     8 +-
 .../persistence/h2/create_ldcache_tables.sql    |     1 +
 .../kiwi/persistence/h2/statements.properties   |    10 +-
 .../persistence/h2/upgrade_ldcache_001_002.sql  |    19 +
 .../persistence/mysql/create_ldcache_tables.sql |     1 +
 .../persistence/mysql/statements.properties     |    11 +-
 .../mysql/upgrade_ldcache_001_002.sql           |    19 +
 .../persistence/pgsql/create_ldcache_tables.sql |     1 +
 .../persistence/pgsql/statements.properties     |    11 +-
 .../pgsql/upgrade_ldcache_001_002.sql           |    19 +
 .../backend/kiwi/test/LDCacheBackendTest.java   |    10 +-
 .../kiwi/test/LDCachePersistenceTest.java       |     9 +-
 libraries/ldcache/ldcache-backend-mapdb/pom.xml |     2 +-
 libraries/ldcache/ldcache-core/pom.xml          |    29 +-
 .../marmotta/ldcache/services/LDCache.java      |    76 +-
 .../ldcache/services/test/LDCacheKiWiTest.java  |     5 +
 .../services/test/dummy/DummyProvider.java      |     2 +-
 libraries/ldcache/ldcache-sail-generic/pom.xml  |    26 +-
 .../ldcache/sail/test/dummy/DummyProvider.java  |     2 +-
 libraries/ldcache/ldcache-sail-kiwi/pom.xml     |    29 +-
 .../test/KiWiLinkedDataSailOfflineTest.java     |     7 +-
 .../ldcache/sail/test/dummy/DummyProvider.java  |     2 +-
 .../ldcache/sail/test/dummy/resource1.ttl       |     4 +-
 .../ldcache/sail/test/dummy/resource2.ttl       |     2 +-
 .../ldcache/sail/test/dummy/resource3.ttl       |     4 +-
 libraries/ldcache/pom.xml                       |     2 +-
 libraries/ldclient/ldclient-api/pom.xml         |     6 +-
 .../ldclient/api/endpoint/Endpoint.java         |     7 +-
 .../marmotta/ldclient/model/ClientResponse.java |    23 +-
 libraries/ldclient/ldclient-core/pom.xml        |     6 +-
 .../ldclient/services/ldclient/LDClient.java    |     3 +-
 .../services/provider/AbstractHttpProvider.java |    26 +-
 .../services/provider/BlockingProvider.java     |     2 +-
 .../ldclient/test/TestLDClientTest.java         |     4 +-
 .../ldclient/ldclient-provider-facebook/pom.xml |     2 +-
 .../facebook/FacebookGraphProvider.java         |    27 +-
 .../ldclient/ldclient-provider-html/pom.xml     |     2 +-
 .../html/mapping/CssDateLiteralMapper.java      |     2 +-
 .../html/mapping/CssLiteralAttrMapper.java      |     2 +-
 .../html/mapping/CssTextLiteralMapper.java      |     2 +-
 .../ldclient/ldclient-provider-ldap/pom.xml     |     2 +-
 .../provider/ldap/LdapFoafProvider.java         |     2 +-
 .../ldclient-provider-mediawiki/pom.xml         |     2 +-
 .../provider/mediawiki/MediawikiProvider.java   |     2 +-
 .../ldclient/ldclient-provider-phpbb/pom.xml    |     2 +-
 .../ldclient/ldclient-provider-rdf/pom.xml      |    14 +-
 .../ldclient/provider/rdf/SPARQLProvider.java   |    23 +-
 .../ldclient/test/rdf/TestStanbolProvider.java  |     3 +
 .../ldclient/ldclient-provider-rdfa/pom.xml     |     2 +-
 .../ldclient/ldclient-provider-vimeo/pom.xml    |     2 +-
 .../ldclient/ldclient-provider-xml/pom.xml      |     2 +-
 .../ldclient/ldclient-provider-youtube/pom.xml  |     2 +-
 .../youtube/YoutubeVideoPagesProvider.java      |     6 +-
 .../provider/youtube/YoutubeVideoProvider.java  |     2 +-
 libraries/ldclient/pom.xml                      |    23 +-
 libraries/ldpath/ldpath-api/pom.xml             |    23 +-
 .../ldpath/api/functions/NodeFunction.java      |     2 +-
 .../marmotta/ldpath/api/tests/NodeTest.java     |     1 +
 .../api/transformers/NodeTransformer.java       |     8 +-
 libraries/ldpath/ldpath-backend-file/pom.xml    |    26 +-
 .../ldpath/backend/file/ParserTest.java         |    21 +-
 libraries/ldpath/ldpath-backend-jena/pom.xml    |    26 +-
 .../ldpath/ldpath-backend-linkeddata/pom.xml    |    23 +-
 .../src/main/doc/LICENSE.txt                    |    31 +
 .../src/main/doc/NOTICE.txt                     |   110 +-
 libraries/ldpath/ldpath-backend-sesame/pom.xml  |    32 +-
 .../backend/sesame/AbstractSesameBackend.java   |    29 +-
 .../backend/sesame/SesameValueBackend.java      |    17 +
 libraries/ldpath/ldpath-core/pom.xml            |    27 +-
 .../java/org/apache/marmotta/ldpath/LDPath.java |    12 +-
 .../ldpath/model/fields/FieldMapping.java       |    23 +-
 .../model/functions/ConcatenateFunction.java    |     3 +-
 .../ldpath/model/functions/CountFunction.java   |     3 +-
 .../ldpath/model/functions/FirstFunction.java   |     5 +-
 .../ldpath/model/functions/LastFunction.java    |     5 +-
 .../ldpath/model/functions/SortFunction.java    |     3 +-
 .../marmotta/ldpath/model/programs/Program.java |    61 +-
 .../ldpath/model/selectors/GroupedSelector.java |   101 +
 .../model/selectors/IntersectionSelector.java   |     2 +-
 .../ldpath/model/selectors/UnionSelector.java   |     2 +-
 .../marmotta/ldpath/model/tests/IsATest.java    |    57 +
 .../ldpath/model/tests/LiteralTypeTest.java     |    17 +-
 .../ldpath/model/tests/PathEqualityTest.java    |     6 +-
 .../tests/functions/BinaryNumericTest.java      |     4 +-
 .../transformers/BigDecimalTransformer.java     |     4 +-
 .../transformers/BigIntegerTransformer.java     |     4 +-
 .../model/transformers/BooleanTransformer.java  |     6 +-
 .../model/transformers/ByteTransformer.java     |     4 +-
 .../model/transformers/DateTimeTransformer.java |     6 +-
 .../model/transformers/DateTransformer.java     |     6 +-
 .../model/transformers/DoubleTransformer.java   |     6 +-
 .../model/transformers/DurationTransformer.java |     4 +-
 .../model/transformers/FloatTransformer.java    |     6 +-
 .../model/transformers/IdentityTransformer.java |     6 +-
 .../model/transformers/IntTransformer.java      |     6 +-
 .../model/transformers/LongTransformer.java     |     6 +-
 .../model/transformers/ShortTransformer.java    |     4 +-
 .../model/transformers/StringTransformer.java   |     6 +-
 .../model/transformers/TimeTransformer.java     |     6 +-
 .../marmotta/ldpath/util/Collections.java       |     3 +
 .../at/newmedialab/ldpath/parser/rdfpath.jj     |   210 +-
 .../BinaryNumericTestFunctionsTest.java         |     6 +-
 .../ldpath/model/functions/FunctionsTest.java   |    18 +-
 .../ldpath/parser/EmptyTestingBackend.java      |    17 +-
 .../marmotta/ldpath/parser/ParserTest.java      |    40 +-
 .../marmotta/ldpath/parser/ProgramTest.java     |    78 +
 .../marmotta/ldpath/parser/SelectorsTest.java   |   100 +
 .../ldpath/parser/StringTestingBackend.java     |    98 +
 .../marmotta/ldpath/parser/TestsTest.java       |    95 +
 .../marmotta/ldpath/test/AbstractTestBase.java  |    48 +-
 .../ldpath-core/src/test/resources/logback.xml  |     2 +
 .../src/test/resources/parse/namespaces.ldpath  |     3 +-
 .../src/test/resources/parse/program.ldpath     |    22 +-
 .../ldpath/ldpath-functions-collections/pom.xml |    23 +-
 libraries/ldpath/ldpath-functions-date/pom.xml  |    23 +-
 .../model/functions/date/DateFunctionsTest.java |     8 +-
 libraries/ldpath/ldpath-functions-html/pom.xml  |    23 +-
 .../model/functions/html/HtmlFunctionsTest.java |     8 +-
 libraries/ldpath/ldpath-functions-math/pom.xml  |    23 +-
 .../model/functions/math/MaxFunction.java       |     2 +-
 .../model/functions/math/MinFunction.java       |     2 +-
 .../model/functions/math/RoundFunction.java     |     2 +-
 .../model/functions/math/SumFunction.java       |     2 +-
 .../model/functions/math/MathFunctionTest.java  |    30 +-
 libraries/ldpath/ldpath-functions-text/pom.xml  |    23 +-
 .../text/AbstractBinaryStringTest.java          |    59 +
 .../functions/text/AbstractStringTest.java      |   101 +
 .../functions/text/StringContainsTest.java      |    42 +
 .../functions/text/StringEndsWithTest.java      |    44 +
 .../tests/functions/text/StringEqualsIC.java    |    42 +
 .../tests/functions/text/StringEqualsTest.java  |    42 +
 .../tests/functions/text/StringIsEmptyTest.java |    61 +
 .../functions/text/StringStartsWithTest.java    |    44 +
 ...e.marmotta.ldpath.api.functions.TestFunction |     6 +
 .../tests/functions/text/StringTestTest.java    |   181 +
 libraries/ldpath/ldpath-functions-xml/pom.xml   |    23 +-
 .../xml/RemoveXmlTagsFunctionTest.java          |     4 +-
 .../model/functions/xml/XPathFunctionTest.java  |     4 +-
 .../ldpath/ldpath-template-linkeddata/pom.xml   |    23 +-
 libraries/ldpath/ldpath-template/pom.xml        |    23 +-
 .../ldpath/template/engine/LDPathDirective.java |     5 +-
 .../template/engine/NamespaceDirective.java     |     1 +
 .../ldpath/template/engine/TemplateEngine.java  |    18 +-
 .../model/freemarker/TemplateNodeModel.java     |     2 +-
 .../model/freemarker/TemplateWrapperModel.java  |     2 +-
 .../TemplateBooleanTransformer.java             |     6 +-
 .../transformers/TemplateDateTransformer.java   |     6 +-
 .../transformers/TemplateDoubleTransformer.java |     6 +-
 .../transformers/TemplateFloatTransformer.java  |     6 +-
 .../TemplateIntegerTransformer.java             |     6 +-
 .../transformers/TemplateLongTransformer.java   |    10 +-
 .../transformers/TemplateScalarTransformer.java |     6 +-
 libraries/ldpath/pom.xml                        |     2 +-
 libraries/pom.xml                               |     2 +-
 parent/pom.xml                                  |   316 +-
 platform/marmotta-core/pom.xml                  |    79 +-
 .../js/widgets/configurator/configurator.coffee |    19 +-
 .../core/api/config/ConfigurationService.java   |     9 +
 .../core/api/importer/ImportWatchService.java   |    48 +
 .../core/api/jaxrs/ExceptionMapperService.java  |    31 +
 .../core/api/modules/ModuleService.java         |    29 +
 .../platform/core/api/prefix/PrefixService.java |     8 +
 .../core/api/templating/TemplatingService.java  |     8 +
 .../core/api/triplestore/SesameService.java     |    10 +-
 .../platform/core/filters/TemplatingFilter.java |     2 +-
 .../platform/core/jaxrs/CDIExceptionMapper.java |    28 +
 .../platform/core/jaxrs/ErrorResponse.java      |   126 +
 .../core/jaxrs/IllegalStateExceptionMapper.java |    47 +
 .../core/jaxrs/MarmottaExceptionMapper.java     |    49 +
 .../jaxrs/MarmottaImportExceptionMapper.java    |    49 +
 .../core/jaxrs/RepositoryExceptionMapper.java   |    50 +
 .../core/jaxrs/URISyntaxExceptionMapper.java    |    47 +
 .../UnsupportedOperationExceptionMapper.java    |    47 +
 .../platform/core/model/template/MenuItem.java  |    75 +-
 .../core/model/template/MenuItemType.java       |    29 +
 .../platform/core/rio/RDFHtmlWriterImpl.java    |   108 +-
 .../core/services/cache/CachingServiceImpl.java |     7 +-
 .../config/ConfigurationServiceImpl.java        |   206 +-
 .../config/DependenciesServiceImpl.java         |     2 +-
 .../content/FileSystemContentReader.java        |     4 +
 .../content/FileSystemContentWriter.java        |     2 +
 .../services/importer/ImportServiceImpl.java    |    28 +-
 .../importer/ImportWatchServiceImpl.java        |   265 +
 .../services/importer/rdf/RDFImporterImpl.java  |     4 -
 .../core/services/io/MarmottaIOServiceImpl.java |     5 +-
 .../jaxrs/ExceptionMapperServiceImpl.java       |    73 +
 .../services/modules/ModuleServiceImpl.java     |   160 +-
 .../platform/core/services/prefix/PrefixCC.java |    73 +-
 .../core/services/prefix/PrefixServiceCC.java   |     2 +-
 .../core/services/prefix/PrefixServiceImpl.java |    13 +-
 .../platform/core/services/task/TaskImpl.java   |     2 +-
 .../services/task/TaskManagerServiceImpl.java   |    34 +-
 .../templating/AdminTemplatingServiceImpl.java  |   209 +-
 .../templating/TemplatingServiceImpl.java       |     9 +-
 .../triplestore/ContextServiceImpl.java         |     9 +-
 .../services/triplestore/SesameServiceImpl.java |   188 +-
 .../core/services/user/UserServiceImpl.java     |    47 +-
 .../core/servlet/MarmottaOptionsFilter.java     |     2 +-
 .../core/servlet/MarmottaPostStartupFilter.java |     5 -
 .../servlet/MarmottaPreStartupListener.java     |    21 +-
 .../core/startup/MarmottaStartupService.java    |    13 +-
 .../platform/core/util/WebServiceUtil.java      |     2 +-
 .../config/ConfigurationWebService.java         |     2 +-
 .../core/webservices/io/ImportWebService.java   |     2 +
 .../webservices/prefix/PrefixWebService.java    |    20 +-
 .../resource/InspectionWebService.java          |     2 +-
 .../webservices/resource/MetaWebService.java    |    59 +-
 .../resource/ResourceWebService.java            |    59 +-
 .../resource/ResourceWebServiceHelper.java      |    34 +-
 .../webservices/system/SystemWebService.java    |    35 +-
 .../triplestore/ContextWebService.java          |     2 +-
 .../src/main/resources/META-INF/NOTICE          |    23 +-
 .../main/resources/config-defaults.properties   |    15 +
 .../resources/config-descriptions.properties    |    14 +
 .../src/main/resources/kiwi-module.properties   |    42 +-
 .../src/main/resources/templates/404.ftl        |     2 +-
 .../src/main/resources/templates/admin.ftl      |   110 +-
 .../src/main/resources/templates/rdfhtml.ftl    |    62 +-
 .../src/main/resources/web/admin/about.html     |    18 +-
 .../main/resources/web/admin/configuration.html |     2 +-
 .../src/main/resources/web/admin/contexts.html  |     2 +-
 .../src/main/resources/web/admin/dataview.html  |     8 +-
 .../src/main/resources/web/admin/export.html    |     2 +-
 .../resources/web/admin/js/lib/d3.v2.min.js     |     4 -
 .../admin/js/lib/raphael-dracula.pack.min.js    |     7 -
 .../resources/web/admin/js/lib/sgvizler.pack.js |  1294 --
 .../src/main/resources/web/admin/prefixes.html  |    23 +-
 .../src/main/resources/web/admin/system.html    |     8 +-
 .../src/main/resources/web/admin/tasks.html     |     4 +-
 .../resources/web/public/html/reasoning.html    |     2 +-
 .../resources/web/public/js/lib/jquery-1.6.4.js |  9046 -------------
 .../resources/web/public/js/lib/jquery-1.7.2.js |     4 -
 .../web/public/js/lib/jquery-ui-1.8.21.js       |   125 -
 .../resources/web/public/js/lib/strftime.js     |   750 --
 .../platform/core/test/base/JettyMarmotta.java  |    34 +-
 .../test/base/jetty/TestInjectorFactory.java    |    38 +-
 .../platform/core/test/ld/LinkedDataTest.java   |   280 +
 .../core/test/user/UserServiceTest.java         |     2 +-
 .../src/test/resources/ehcache-db.xml           |   451 -
 .../src/test/resources/ehcache-lmf.xml          |   417 -
 .../src/test/resources/ehcache-marmotta.xml     |   405 +
 platform/marmotta-ldcache/pom.xml               |    30 +-
 .../model/filter/LDCacheIgnoreFilter.java       |    32 +
 .../model/filter/MarmottaNotCachedFilter.java   |    85 +
 .../endpoint/LinkedDataEndpointServiceImpl.java |     2 +-
 .../services/ldcache/LDCacheSailProvider.java   |    92 +-
 .../LinkedDataCachingWebService.java            |   171 +-
 .../src/main/resources/kiwi-module.properties   |     6 +-
 .../main/resources/web/admin/configuration.html |     2 +-
 .../resources/web/admin/widgets/lmf_ldcache.js  |    26 +-
 platform/marmotta-ldpath/pom.xml                |    36 +-
 .../platform/ldpath/api/LDPathService.java      |    13 +
 .../ldpath/services/LDPathServiceImpl.java      |    52 +-
 .../webservices/LDPathUtilWebService.java       |     9 +-
 .../src/main/resources/META-INF/NOTICE          |     6 +-
 .../src/main/resources/kiwi-module.properties   |    12 +-
 .../src/main/resources/web/admin/functions.html |     2 +-
 .../src/main/resources/web/admin/ldpath.html    |     7 +-
 .../src/main/resources/web/cm/LICENSE.txt       |    23 -
 .../src/main/resources/web/cm/codemirror.css    |   191 -
 .../src/main/resources/web/cm/codemirror.js     |  3241 -----
 .../src/main/resources/web/cm/index.html        |   255 -
 .../src/main/resources/web/cm/ldpath.js         |   444 -
 .../src/main/resources/web/cm/simple-hint.css   |    33 -
 .../src/main/resources/web/cm/simple-hint.js    |    93 -
 platform/marmotta-reasoner/pom.xml              |    42 +-
 .../services/ReasoningSailProvider.java         |    59 +-
 .../src/main/resources/kiwi-module.properties   |     6 +-
 .../src/main/resources/web/admin/configure.html |     2 +-
 platform/marmotta-security/pom.xml              |    30 +-
 .../src/main/resources/kiwi-module.properties   |    13 +-
 .../src/main/resources/web/admin/about.html     |    41 +-
 .../main/resources/web/admin/configuration.html |     2 +-
 .../src/main/resources/web/admin/profiles.html  |     2 +-
 .../src/main/resources/web/admin/rules.html     |     2 +-
 platform/marmotta-sparql/jooq-config.xml        |    89 -
 platform/marmotta-sparql/pom.xml                |    82 +-
 .../sparql/api/sparql/SparqlService.java        |    31 +-
 .../services/sail/SPARQLSailProvider.java       |    77 +
 .../services/sparql/SparqlServiceImpl.java      |   271 +-
 .../sparqlio/rdf/SPARQLGraphResultWriter.java   |    21 +-
 .../sparqlhtml/SPARQLBooleanHTMLWriter.java     |   157 +-
 .../sparqlhtml/SPARQLResultsHTMLWriter.java     |    99 +-
 .../sparqlhtml/SPARQLResultsHTMLWriterXSL.java  |   104 +-
 .../sparqljson/SPARQLBooleanJSONWriter.java     |    62 -
 .../sparqljson/SPARQLResultsJSONWriter.java     |   292 -
 .../sparql/webservices/SparqlWebService.java    |    53 +-
 .../src/main/resources/META-INF/NOTICE          |    27 +-
 .../main/resources/config-defaults.properties   |    28 -
 .../resources/config-descriptions.properties    |    32 +-
 .../src/main/resources/kiwi-module.properties   |    14 +-
 .../main/resources/web/admin/configuration.html |     2 +-
 .../main/resources/web/admin/editor/.gitignore  |     2 -
 .../web/admin/editor/CodeMirror_license.txt     |    19 -
 .../web/admin/editor/Flint_license.txt          |    15 -
 .../main/resources/web/admin/editor/README.txt  |   134 -
 .../web/admin/editor/flint_sparql_editor.html   |    75 -
 .../admin/editor/sparql/css/Remove_16x16.png    |   Bin 829 -> 0 bytes
 .../web/admin/editor/sparql/css/docs.css        |   704 -
 .../web/admin/editor/sparql/css/font.js         |    32 -
 .../admin/editor/sparql/css/sparqlcolors.css    |    76 -
 .../web/admin/editor/sparql/flint-editor.js     |  1923 ---
 .../admin/editor/sparql/images/Cancel_16x16.png |   Bin 807 -> 0 bytes
 .../editor/sparql/images/Copy v2_16x16.png      |   Bin 433 -> 0 bytes
 .../admin/editor/sparql/images/Copy_16x16.png   |   Bin 309 -> 0 bytes
 .../admin/editor/sparql/images/Cut_16x16.png    |   Bin 511 -> 0 bytes
 .../admin/editor/sparql/images/Cut_24x24.png    |   Bin 937 -> 0 bytes
 .../admin/editor/sparql/images/Delete_16x16.png |   Bin 733 -> 0 bytes
 .../admin/editor/sparql/images/Edit_16x16.png   |   Bin 330 -> 0 bytes
 .../editor/sparql/images/Favorites_16x16.png    |   Bin 635 -> 0 bytes
 .../editor/sparql/images/Favorites_24x24.png    |   Bin 1091 -> 0 bytes
 .../admin/editor/sparql/images/Find_16x16.png   |   Bin 417 -> 0 bytes
 .../admin/editor/sparql/images/Globe_16x16.png  |   Bin 808 -> 0 bytes
 .../admin/editor/sparql/images/Globe_24x24.png  |   Bin 1534 -> 0 bytes
 .../editor/sparql/images/Information_16x16.png  |   Bin 736 -> 0 bytes
 .../admin/editor/sparql/images/Key_16x16.png    |   Bin 431 -> 0 bytes
 .../admin/editor/sparql/images/Key_24x24.png    |   Bin 702 -> 0 bytes
 .../admin/editor/sparql/images/New_16x16.png    |   Bin 240 -> 0 bytes
 .../admin/editor/sparql/images/New_24x24.png    |   Bin 315 -> 0 bytes
 .../admin/editor/sparql/images/Next_16x16.png   |   Bin 844 -> 0 bytes
 .../admin/editor/sparql/images/Next_24x24.png   |   Bin 1528 -> 0 bytes
 .../admin/editor/sparql/images/Open_16x16.png   |   Bin 710 -> 0 bytes
 .../admin/editor/sparql/images/Paste_16x16.png  |   Bin 469 -> 0 bytes
 .../admin/editor/sparql/images/Prev_16x16.png   |   Bin 852 -> 0 bytes
 .../admin/editor/sparql/images/Prev_24x24.png   |   Bin 2410 -> 0 bytes
 .../editor/sparql/images/Preview_16x16.png      |   Bin 564 -> 0 bytes
 .../editor/sparql/images/Previous_16x16.png     |   Bin 832 -> 0 bytes
 .../editor/sparql/images/Properties_16x16.png   |   Bin 592 -> 0 bytes
 .../editor/sparql/images/Properties_24x24.png   |   Bin 896 -> 0 bytes
 .../admin/editor/sparql/images/Redo_16x16.png   |   Bin 579 -> 0 bytes
 .../admin/editor/sparql/images/Redo_24x24.png   |   Bin 943 -> 0 bytes
 .../editor/sparql/images/Refresh_16x16.png      |   Bin 502 -> 0 bytes
 .../admin/editor/sparql/images/Remove_16x16.png |   Bin 829 -> 0 bytes
 .../sparql/images/Text Document_16x16.png       |   Bin 291 -> 0 bytes
 .../admin/editor/sparql/images/Undo_16x16.png   |   Bin 589 -> 0 bytes
 .../admin/editor/sparql/images/Undo_24x24.png   |   Bin 991 -> 0 bytes
 .../editor/sparql/images/ajax-loader-red.gif    |   Bin 3208 -> 0 bytes
 .../web/admin/editor/sparql/init-local.js       |    69 -
 .../web/admin/editor/sparql/init-openuplabs.js  |    84 -
 .../admin/editor/sparql/init-sparqlservice.js   |   101 -
 .../web/admin/editor/sparql/jquery-1.5.2.min.js |    16 -
 .../web/admin/editor/sparql/lib/codemirror.css  |    70 -
 .../web/admin/editor/sparql/lib/codemirror.js   |  2038 ---
 .../web/admin/editor/sparql/lib/overlay.js      |    68 -
 .../web/admin/editor/sparql/lib/runmode.js      |    44 -
 .../web/admin/editor/sparql/sparqlParser.js     | 11461 -----------------
 .../web/admin/editor/sparql/sparqlmode.js       |   185 -
 .../web/admin/editor/sparql/sparqlmode_ll1.js   |  1765 ---
 .../src/main/resources/web/admin/link.png       |   Bin 0 -> 165 bytes
 .../src/main/resources/web/admin/sgvizler.html  |   141 +
 .../resources/web/admin/sgvizler/0.5/LICENSE    |    16 -
 .../admin/sgvizler/0.5/example/exDBpedia1.html  |    41 -
 .../web/admin/sgvizler/0.5/example/exFROM1.html |    43 -
 .../web/admin/sgvizler/0.5/example/exNPD1.html  |    50 -
 .../web/admin/sgvizler/0.5/example/exNPD10.html |    40 -
 .../web/admin/sgvizler/0.5/example/exNPD2.html  |    50 -
 .../web/admin/sgvizler/0.5/example/exNPD3.html  |    46 -
 .../web/admin/sgvizler/0.5/example/exNPD4.html  |    45 -
 .../web/admin/sgvizler/0.5/example/exNPD5.html  |    40 -
 .../web/admin/sgvizler/0.5/example/exNPD6.html  |    41 -
 .../web/admin/sgvizler/0.5/example/exNPD7.html  |    40 -
 .../web/admin/sgvizler/0.5/example/exNPD8.html  |    40 -
 .../web/admin/sgvizler/0.5/example/exNPD9.html  |    40 -
 .../admin/sgvizler/0.5/example/exWorld1.html    |    50 -
 .../admin/sgvizler/0.5/example/exWorld2.html    |    41 -
 .../admin/sgvizler/0.5/example/exWorld3.html    |    41 -
 .../admin/sgvizler/0.5/example/exWorld4.html    |    41 -
 .../admin/sgvizler/0.5/example/exWorld5.html    |    40 -
 .../admin/sgvizler/0.5/example/exWorld6.html    |    47 -
 .../admin/sgvizler/0.5/example/exWorld7.html    |    43 -
 .../web/admin/sgvizler/0.5/example/examples.css |    50 -
 .../web/admin/sgvizler/0.5/example/index.html   |    12 -
 .../admin/sgvizler/0.5/example/mainframe.html   |   110 -
 .../admin/sgvizler/0.5/example/menuframe.html   |    46 -
 .../web/admin/sgvizler/0.5/lib/d3.geom.min.js   |     1 -
 .../web/admin/sgvizler/0.5/lib/d3.layout.min.js |     1 -
 .../web/admin/sgvizler/0.5/lib/d3.min.js        |     2 -
 .../web/admin/sgvizler/0.5/sgvizler.chart.css   |    37 -
 .../web/admin/sgvizler/0.5/sgvizler.html        |   141 -
 .../web/admin/sgvizler/0.5/sgvizler.js          |     6 -
 .../src/main/resources/web/admin/snorql.html    |   151 +
 .../src/main/resources/web/admin/snorql/LICENSE |   202 -
 .../src/main/resources/web/admin/snorql/README  |    11 -
 .../main/resources/web/admin/snorql/link.png    |   Bin 165 -> 0 bytes
 .../resources/web/admin/snorql/namespaces.js    |    26 -
 .../resources/web/admin/snorql/prototype.js     |  4238 ------
 .../resources/web/admin/snorql/rdf_flyer.24.gif |   Bin 330 -> 0 bytes
 .../web/admin/snorql/scriptaculous/builder.js   |   153 -
 .../web/admin/snorql/scriptaculous/controls.js  |   971 --
 .../web/admin/snorql/scriptaculous/dragdrop.js  |   985 --
 .../web/admin/snorql/scriptaculous/effects.js   |  1130 --
 .../admin/snorql/scriptaculous/scriptaculous.js |    52 -
 .../web/admin/snorql/scriptaculous/slider.js    |   287 -
 .../web/admin/snorql/scriptaculous/sound.js     |    65 -
 .../web/admin/snorql/scriptaculous/unittest.js  |   578 -
 .../main/resources/web/admin/snorql/snorql.html |   146 -
 .../main/resources/web/admin/snorql/snorql.js   |   584 -
 .../main/resources/web/admin/snorql/sparql.js   |   507 -
 .../main/resources/web/admin/snorql/style.css   |    85 -
 .../resources/web/admin/snorql/xml-to-html.xsl  |   183 -
 .../src/main/resources/web/admin/update.html    |    24 +-
 .../src/main/resources/web/cm/codemirror.css    |   132 -
 .../src/main/resources/web/cm/codemirror.js     |  3064 -----
 .../src/main/resources/web/cm/index.html        |   242 -
 .../src/main/resources/web/cm/simple-hint.css   |    33 -
 .../src/main/resources/web/cm/simple-hint.js    |    89 -
 .../src/main/resources/web/cm/sparql.js         |   219 -
 platform/marmotta-user/pom.xml                  |    30 +-
 .../user/services/AccountServiceImpl.java       |     2 +-
 .../webservices/UserManagementWebService.java   |     2 +-
 .../user/webservices/UserWebService.java        |    34 +-
 .../src/main/resources/kiwi-module.properties   |     8 +-
 platform/marmotta-versioning/pom.xml            |    30 +-
 .../services/VersioningSailProvider.java        |    48 +-
 .../webservices/VersioningWebService.java       |    61 +-
 .../src/main/resources/kiwi-module.properties   |     6 +-
 .../src/main/resources/template/timemap.ftl     |    10 +-
 platform/pom.xml                                |     2 +-
 pom.xml                                         |    16 +-
 1072 files changed, 53755 insertions(+), 69574 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/LICENSE.txt
----------------------------------------------------------------------
diff --git a/LICENSE.txt b/LICENSE.txt
index 0205189..f9de3d8 100644
--- a/LICENSE.txt
+++ b/LICENSE.txt
@@ -599,6 +599,36 @@ For the JSONLD-Java component,
     THE POSSIBILITY OF SUCH DAMAGE.
         
 
+For the marmotta-commons component,
+
+    located at commons/marmotta-commons/src/ext/java
+
+   Javolution - Java(tm) Solution for Real-Time and Embedded Systems
+   Copyright (c) 2012, Javolution (http://javolution.org/)
+   All rights reserved.
+
+   Redistribution and use in source and binary forms, with or without
+   modification, are permitted provided that the following conditions are met:
+
+      1. Redistributions of source code must retain the above copyright
+         notice, this list of conditions and the following disclaimer.
+
+      2. Redistributions in binary form must reproduce the above copyright
+         notice, this list of conditions and the following disclaimer in the
+         documentation and/or other materials provided with the distribution.
+
+   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+   CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+   EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+   PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+   PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+   LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+   NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+   SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
 
 Apache Marmotta 3rd party data files:
 ====================================

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/NOTICE.txt
----------------------------------------------------------------------
diff --git a/NOTICE.txt b/NOTICE.txt
index 22f8d89..8a419b1 100644
--- a/NOTICE.txt
+++ b/NOTICE.txt
@@ -1,6 +1,8 @@
-Apache Marmotta, Copyright 2012-2013 The Apache Software Foundation
+Apache Marmotta
+Copyright 2012-2013 The Apache Software Foundation
 
-This product includes software developed at The Apache Software Foundation (http://www.apache.org/).
+This product includes software developed at 
+The Apache Software Foundation (http://www.apache.org/).
 
 Portions of this software were originally based on the following:
 
@@ -8,131 +10,15 @@ Portions of this software were originally based on the following:
 
 These have been licensed to the Apache Software Foundation under a software grant.
 
+This product also includes some third-party source components:
 
-==============================================================================
-Javascript Libraries included in Marmotta Platform
-==============================================================================
+ * The module extras/webjars/snorql constains a adapted version of the D2R 
+   Snorql library, which was originally created by Richard Cyganaik for the D2R 
+   Server project (http://www4.wiwiss.fu-berlin.de/bizer/d2r-server/). It is 
+   licensed under the Apache Software License 2.0. The source code is available 
+   from http://github.com/kurtjx/SNORQL
 
-D3.js is copyright (c) 2013, Michael Bostock and licensed under New BSD
-License. The source code is available at https://github.com/mbostock/d3
-
-Source Locations:
-- platform/marmotta-core/src/main/resources/web/admin/js/lib/
-- platform/marmotta-sparql/src/main/resources/web/admin/sgvizler/0.5/lib/
-
-
-The Dracula Graph Library is (c) 2010 by Johann Philipp Strathausen
-<st...@gmail.com> and licensed under MIT License. The source code is
-available at https://github.com/strathausen/dracula
-
-Source Locations:
-- platform/marmotta-core/src/main/resources/web/admin/js/lib/
-
-
-The strftime library is copyright (c) 2008, Philip S Tellis
-<ph...@bluesmoon.info> and licensed under New BSD License. The source code
-is available at http://hacks.bluesmoon.info/strftime/files.html
-
-Source Locations:
-- platform/marmotta-core/src/main/resources/web/public/js/lib
-
-
-The JQuery Library is copyright 2013 jQuery Foundation and other contributors,
-and licensed under MIT License. The source code is available at
-https://github.com/jquery/jquery
-
-Source Locations:
-- platform/marmotta-core/src/main/resources/web/public/js/lib
-
-
-The CodeMirror Library is copyright (C) 2013 by Marijn Haverbeke
-<ma...@gmail.com> and licensed under MIT License. The source code is
-available at https://github.com/marijnh/CodeMirror
-
-Source Locations:
-- platform/marmotta-ldpath/src/main/resources/web/cm
-- platform/marmotta-sparql/src/main/resources/web/cm
-- platform/marmotta-sparql/src/main/resources/web/admin/editor/sparql/lib
-
-
-The D2R Snorql Library was originally created by Richard Cyganaik
-(http://richard.cyganiak.de/) for the D2R server project
-(http://www4.wiwiss.fu-berlin.de/bizer/d2r-server/). It is licensed under the
-Apache Software License 2.0. The source code is available at
-https://github.com/kurtjx/SNORQL
-
-Source Locations:
-- platform/marmotta-sparql/src/main/resources/web/admin/snorql
-
-
-The script.aculo.us library is copyright (c) 2005-2010 Thomas Fuchs and is
-licensed under MIT License. The source code is available at
-https://github.com/madrobby/scriptaculous
-
-Source Locations:
-- platform/marmotta-sparql/src/main/resources/web/admin/snorql/scriptaculous
-
-
-The Prototype Library is copyright (c) 2005-2010 Sam Stephenson and is
-licensed under MIT License. The source code is available at
-https://github.com/sstephenson/prototype
-
-Source Locations:
-- platform/marmotta-sparql/src/main/resources/web/admin/snorql
-
-
-The SPARQL Flint Editor is copyright (c) 2011 TSO Ltd and is licensed under
-MIT License. The source code is available at
-https://github.com/TSO-Openup/FlintSparqlEditor
-
-Source Locations:
-- platform/marmotta-sparql/src/main/resources/web/admin/editor/
-
-
-The Sgvizler Library is copyright (c) 2011 Martin G. Skjæveland and is
-licensed under MIT License. The source code is available at
-https://code.google.com/p/sgvizler/source
-
-Source Locations:
-- platform/marmotta-core/src/main/resources/web/admin/js/lib
-- platform/marmotta-sparql/src/main/resources/web/admin/sgvizler
-
-
-==============================================================================
-3rd Party Source Code
-==============================================================================
-
-The module launchers/marmotta-splash contains source code from the projects
-MigLayout and SwingBits, which has the following copyrights:
-
-The MigLayout library is copyright (c) 2004, Mikael Grev, MiG InfoCom AB, and
-licensed under a New BSD License. The source code is available at
-http://www.migcalendar.com/miglayout/versions/
-
-The SwingBits library is copyright (C) 2006 Michael Hjembaek, and licensed
-under a New BSD License. The source code is available at
-http://swingbits.sourceforge.net/
-
-
-The module commons/sesame-tools-rio-rss contains source code from the
-orphaned ROME project. ROME has copyright 2004 Sun Microsystems, Inc.
-and copyright 2011 The ROME Team, and is licensed under Apache License 2.0.
-The source code is available at
-https://rometools.jira.com/source/browse/ROME/trunk
-
-
-The module commons/sesame-tools-rio-jsonld contains source code from the
-JSONLD-Java project. JSONLD-Java is copyright (c) 2012, Deutsches
-Forschungszentrum für Künstliche Intelligenz GmbH and licensed under a
-New BSD License. The source code is available at
-https://github.com/tristan/jsonld-java
-
-
-==============================================================================
-3rd Party Data Files
-==============================================================================
-
-The test sources for commons/sesame-tools-rio-jsonld contain the data files
-from the JSON-LD Test Suite. The JSON-LD Test Suite is published as public
-domain (with a Creative Commons Zero license and without copyright). The
-source code is available at https://github.com/json-ld/json-ld.org
\ No newline at end of file
+ * The module commons/marmotta-commons contains a modified and reduced version
+   of the Javolution library. Javolution has copyright (c) 2012, Javolution and
+   is licensed under BSD license. The original source code is available from
+   http://javolution.org

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/build/archetypes/marmotta-archetype-module/pom.xml
----------------------------------------------------------------------
diff --git a/build/archetypes/marmotta-archetype-module/pom.xml b/build/archetypes/marmotta-archetype-module/pom.xml
index 15ab89d..8cc13ff 100644
--- a/build/archetypes/marmotta-archetype-module/pom.xml
+++ b/build/archetypes/marmotta-archetype-module/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/marmotta/blob/582abb5b/build/archetypes/marmotta-archetype-module/src/main/resources/archetype-resources/pom.xml
----------------------------------------------------------------------
diff --git a/build/archetypes/marmotta-archetype-module/src/main/resources/archetype-resources/pom.xml b/build/archetypes/marmotta-archetype-module/src/main/resources/archetype-resources/pom.xml
index 00ae519..6c11e80 100644
--- a/build/archetypes/marmotta-archetype-module/src/main/resources/archetype-resources/pom.xml
+++ b/build/archetypes/marmotta-archetype-module/src/main/resources/archetype-resources/pom.xml
@@ -32,8 +32,8 @@
                 <artifactId>maven-compiler-plugin</artifactId>
                 <version>3.0</version>
                 <configuration>
-                    <source>1.6</source>
-                    <target>1.6</target>
+                    <source>1.7</source>
+                    <target>1.7</target>
                 </configuration>
             </plugin>
             <plugin>
@@ -64,9 +64,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>

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/build/archetypes/marmotta-archetype-module/src/main/resources/archetype-resources/src/main/java/webservices/MyWebService.java
----------------------------------------------------------------------
diff --git a/build/archetypes/marmotta-archetype-module/src/main/resources/archetype-resources/src/main/java/webservices/MyWebService.java b/build/archetypes/marmotta-archetype-module/src/main/resources/archetype-resources/src/main/java/webservices/MyWebService.java
index 1d8686e..c0b0358 100644
--- a/build/archetypes/marmotta-archetype-module/src/main/resources/archetype-resources/src/main/java/webservices/MyWebService.java
+++ b/build/archetypes/marmotta-archetype-module/src/main/resources/archetype-resources/src/main/java/webservices/MyWebService.java
@@ -17,7 +17,7 @@
  */
 package ${package}.webservices;
 
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 
 import javax.enterprise.context.ApplicationScoped;
 import javax.inject.Inject;

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/build/archetypes/marmotta-archetype-webapp/pom.xml
----------------------------------------------------------------------
diff --git a/build/archetypes/marmotta-archetype-webapp/pom.xml b/build/archetypes/marmotta-archetype-webapp/pom.xml
index dde1896..bfb2aba 100644
--- a/build/archetypes/marmotta-archetype-webapp/pom.xml
+++ b/build/archetypes/marmotta-archetype-webapp/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/marmotta/blob/582abb5b/build/archetypes/marmotta-archetype-webapp/src/main/resources/archetype-resources/pom.xml
----------------------------------------------------------------------
diff --git a/build/archetypes/marmotta-archetype-webapp/src/main/resources/archetype-resources/pom.xml b/build/archetypes/marmotta-archetype-webapp/src/main/resources/archetype-resources/pom.xml
index 61bae84..b278e6c 100644
--- a/build/archetypes/marmotta-archetype-webapp/src/main/resources/archetype-resources/pom.xml
+++ b/build/archetypes/marmotta-archetype-webapp/src/main/resources/archetype-resources/pom.xml
@@ -41,8 +41,8 @@
                     <artifactId>maven-compiler-plugin</artifactId>
                     <version>3.0</version>
                     <configuration>
-                        <source>1.6</source>
-                        <target>1.6</target>
+                        <source>1.7</source>
+                        <target>1.7</target>
                     </configuration>
                 </plugin>
                 <plugin>
@@ -84,18 +84,6 @@
                 </plugin>
                 <plugin>
                     <groupId>org.apache.tomcat.maven</groupId>
-                    <artifactId>tomcat6-maven-plugin</artifactId>
-                    <version>2.0</version>
-                    <configuration>
-                        <path>${marmotta.context}</path>
-                        <port>${marmotta.port}</port>
-                        <systemProperties>
-                            <marmotta.home>${marmotta.home}</marmotta.home>
-                        </systemProperties>
-                    </configuration>
-                </plugin>
-                <plugin>
-                    <groupId>org.apache.tomcat.maven</groupId>
                     <artifactId>tomcat7-maven-plugin</artifactId>
                     <version>2.0</version>
                     <configuration>
@@ -108,27 +96,6 @@
                         <!--                         <backgroundProcessorDelay>10</backgroundProcessorDelay> -->
                     </configuration>
                 </plugin>
-                <plugin>
-                    <groupId>org.mortbay.jetty</groupId>
-                    <artifactId>maven-jetty-plugin</artifactId>
-                    <version>6.1.10</version>
-                    <configuration>
-                        <contextPath>${marmotta.context}</contextPath>
-                        <connectors>
-                            <connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
-                                <port>${marmotta.port}</port>
-                            </connector>
-                        </connectors>
-                        <systemProperties>
-                            <systemProperty>
-                                <name>marmotta.home</name>
-                                <value>${marmotta.home}</value>
-                            </systemProperty>
-                        </systemProperties>
-                        <stopKey>marmotta</stopKey>
-                        <stopPort>9999</stopPort>
-                    </configuration>
-                </plugin>
             </plugins>
         </pluginManagement>
         <resources>
@@ -148,17 +115,9 @@
             </plugin>
             <plugin>
                 <groupId>org.apache.tomcat.maven</groupId>
-                <artifactId>tomcat6-maven-plugin</artifactId>
-            </plugin>
-            <plugin>
-                <groupId>org.apache.tomcat.maven</groupId>
                 <artifactId>tomcat7-maven-plugin</artifactId>
             </plugin>
             <plugin>
-                <groupId>org.mortbay.jetty</groupId>
-                <artifactId>maven-jetty-plugin</artifactId>
-            </plugin>
-            <plugin>
                 <artifactId>maven-dependency-plugin</artifactId>
             </plugin>
         </plugins>
@@ -232,13 +191,13 @@
         <!-- Servlet / CDI Environment -->
         <dependency>
             <groupId>javax.servlet</groupId>
-            <artifactId>servlet-api</artifactId>
-            <version>${servletApiVersion}</version>
+            <artifactId>javax.servlet-api</artifactId>
+            <version>3.0.1</version>
             <scope>provided</scope>
         </dependency>
         <dependency>
             <groupId>javax.el</groupId>
-            <artifactId>el-api</artifactId>
+            <artifactId>javax.el-api</artifactId>
             <version>${javaxElVersion}</version>
             <scope>provided</scope>
         </dependency>
@@ -258,7 +217,7 @@
             <version>${h2Version}</version>
         </dependency>
         <dependency>
-            <groupId>org.jumpmind.symmetric.jdbc</groupId>
+            <groupId>org.postgresql</groupId>
             <artifactId>postgresql</artifactId>
             <version>${postgresqlVersion}</version>
         </dependency>

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/build/archetypes/marmotta-archetype-webapp/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/templates/404.ftl
----------------------------------------------------------------------
diff --git a/build/archetypes/marmotta-archetype-webapp/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/templates/404.ftl b/build/archetypes/marmotta-archetype-webapp/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/templates/404.ftl
index 7309ab3..52eca32 100644
--- a/build/archetypes/marmotta-archetype-webapp/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/templates/404.ftl
+++ b/build/archetypes/marmotta-archetype-webapp/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/templates/404.ftl
@@ -17,74 +17,68 @@
     limitations under the License.
 
 -->
-<!DOCTYPE html>
-<html lang="en">
-
-<head>
-  <title>404 Not Found - LMF Linked Data Explorer</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/center.css" title="screen" rel="stylesheet" type="text/css" />  
-  <style type="text/css">
-    div#center {
-      float: none; 
-      width: auto; 
-      vertical-align: middle; 
-      min-height: 400px; 
-      margin: 0; 
-      padding: 2em 30% 5em 30%;
-    }
-    div#center > * {
-      margin-top: 2em;
-      font-size: 1.6em;
-    }
-    div#center > p > a > img {
-      vertical-align: text-top;
-      margin-left: 0.15em;
-    }
-  </style>  
-</head>
-
-<body>
-
-<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>
-
-<div id="center">
-
-  <h2>404 Not Found</h2>
-
-  <p>
-    <strong><a href="${baseUri}resource?uri=${encoded_uri}">${uri}</a></strong><a href="${uri}"><img src="${baseUri}core/public/img/link.png" alt="${uri}" title="go to ${uri} directly" /></a>
-  </p>
-  
-  <p>
-    Sorry, but the requested resource could not be found in LMF right now,
-    but may be available again in the future.
-  </p>  
-
-</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() {
-
-  });
-
-</script> 
-
-</body>
+<!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" />
+    <title>404 Not Found - Marmotta Linked Data Explorer</title>
+    <script src="${SERVER_URL}webjars/jquery/1.8.2/jquery.min.js" type="text/javascript" ></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" />
+    <link href="${SERVER_URL}${DEFAULT_STYLE}404.css" rel="stylesheet" type="text/css" />
+  </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>Marmotta Linked Data Explorer</h1>
+        <div class="clean"></div>
+    </div>
+    <div class="clear"></div>
+    <div id="center">
+        <div id="content">
+
+          <h2>404 Not Found</h2>
+        
+          <p>
+            <strong><a href="${SERVER_URL}resource?uri=${encoded_uri}">${uri}</a></strong><a href="${uri}"><img src="${SERVER_URL}core/public/img/icon/link.png" alt="${uri}" title="go to ${uri} directly" /></a>
+          </p>
+          
+          <p>
+            Sorry, but ${message}.
+          </p>  
+        
+        </div>
+        
+    </div>
+
+    <div class="clear"></div>
+    <div id="footer">
+        <div id="footer_line">
+            <span>
+                ${FOOTER}
+            </span>
+        </div>
+    </div> 
+
+    </div>
+
+    <script type="text/javascript"> 
+
+    $(document).ready(function() {
+
+    });
+
+    </script> 
+
+  </body>
 
 </html>
+


[076/100] [abbrv] git commit: cosmetic details in the ldpath admin pages

Posted by wi...@apache.org.
cosmetic details in the ldpath admin pages


Project: http://git-wip-us.apache.org/repos/asf/marmotta/repo
Commit: http://git-wip-us.apache.org/repos/asf/marmotta/commit/e9d8aada
Tree: http://git-wip-us.apache.org/repos/asf/marmotta/tree/e9d8aada
Diff: http://git-wip-us.apache.org/repos/asf/marmotta/diff/e9d8aada

Branch: refs/heads/ldp
Commit: e9d8aada2d374d667408df095ae2c2bae67885ca
Parents: c8bd0c0
Author: Sergio Fernández <wi...@apache.org>
Authored: Thu Apr 10 09:46:26 2014 +0200
Committer: Sergio Fernández <wi...@apache.org>
Committed: Thu Apr 10 09:46:26 2014 +0200

----------------------------------------------------------------------
 .../src/main/resources/kiwi-module.properties                | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/marmotta/blob/e9d8aada/platform/marmotta-ldpath/src/main/resources/kiwi-module.properties
----------------------------------------------------------------------
diff --git a/platform/marmotta-ldpath/src/main/resources/kiwi-module.properties b/platform/marmotta-ldpath/src/main/resources/kiwi-module.properties
index 6cfc446..b3258cf 100644
--- a/platform/marmotta-ldpath/src/main/resources/kiwi-module.properties
+++ b/platform/marmotta-ldpath/src/main/resources/kiwi-module.properties
@@ -16,7 +16,7 @@
 # limitations under the License.
 #
 
-name=LD Path Querying
+name = LDPath
 
 container = Query and Update
 
@@ -34,11 +34,9 @@ adminpages= /admin/about.html, /admin/ldpath.html, /admin/functions.html
 adminpage.0.title=About
 adminpage.0.link=/admin/about.html
 
-adminpage.1.title=Query Interface
+adminpage.1.title=Query
 adminpage.1.link=/admin/ldpath.html
 
-adminpage.2.title=Function Set
+adminpage.2.title=Functions
 adminpage.2.link=/admin/functions.html
 
-
-


[094/100] [abbrv] git commit: MARMOTTA-502: source provider (youtube) has changed the name of the favorites playlist

Posted by wi...@apache.org.
MARMOTTA-502: source provider (youtube) has changed the name of the favorites playlist


Project: http://git-wip-us.apache.org/repos/asf/marmotta/repo
Commit: http://git-wip-us.apache.org/repos/asf/marmotta/commit/ab80f740
Tree: http://git-wip-us.apache.org/repos/asf/marmotta/tree/ab80f740
Diff: http://git-wip-us.apache.org/repos/asf/marmotta/diff/ab80f740

Branch: refs/heads/ldp
Commit: ab80f7400a7198c43758e05ee2a84fc668a2ca7e
Parents: 8b6ebc1
Author: Sergio Fernández <wi...@apache.org>
Authored: Mon May 19 15:51:24 2014 +0200
Committer: Sergio Fernández <wi...@apache.org>
Committed: Mon May 19 15:51:24 2014 +0200

----------------------------------------------------------------------
 .../ldclient/provider/youtube/YoutubePlaylistProvider.java       | 3 ---
 .../marmotta/ldclient/test/youtube/youtube-playlist.sparql       | 4 ++--
 2 files changed, 2 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/marmotta/blob/ab80f740/libraries/ldclient/ldclient-provider-youtube/src/main/java/org/apache/marmotta/ldclient/provider/youtube/YoutubePlaylistProvider.java
----------------------------------------------------------------------
diff --git a/libraries/ldclient/ldclient-provider-youtube/src/main/java/org/apache/marmotta/ldclient/provider/youtube/YoutubePlaylistProvider.java b/libraries/ldclient/ldclient-provider-youtube/src/main/java/org/apache/marmotta/ldclient/provider/youtube/YoutubePlaylistProvider.java
index 04b3762..7b8384d 100644
--- a/libraries/ldclient/ldclient-provider-youtube/src/main/java/org/apache/marmotta/ldclient/provider/youtube/YoutubePlaylistProvider.java
+++ b/libraries/ldclient/ldclient-provider-youtube/src/main/java/org/apache/marmotta/ldclient/provider/youtube/YoutubePlaylistProvider.java
@@ -57,7 +57,6 @@ public class YoutubePlaylistProvider extends AbstractXMLDataProvider implements
         youtubeNamespaces.put("gml","http://www.opengis.net/gml");
     }
 
-
     private static Map<String,XPathValueMapper> mediaOntMappings = new HashMap<String, XPathValueMapper>();
     static {
         mediaOntMappings.put("http://www.w3.org/ns/ma-ont#collectionName",new XPathLiteralMapper("/atom:feed/atom:title", youtubeNamespaces));
@@ -66,8 +65,6 @@ public class YoutubePlaylistProvider extends AbstractXMLDataProvider implements
         mediaOntMappings.put("http://www.w3.org/ns/ma-ont#hasPublisher",  new XPathURIMapper("/atom:feed/atom:author/@uri", youtubeNamespaces));               // URI
     }
 
-
-
     private static Logger log = LoggerFactory.getLogger(YoutubePlaylistProvider.class);
 
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/ab80f740/libraries/ldclient/ldclient-provider-youtube/src/test/resources/org/apache/marmotta/ldclient/test/youtube/youtube-playlist.sparql
----------------------------------------------------------------------
diff --git a/libraries/ldclient/ldclient-provider-youtube/src/test/resources/org/apache/marmotta/ldclient/test/youtube/youtube-playlist.sparql b/libraries/ldclient/ldclient-provider-youtube/src/test/resources/org/apache/marmotta/ldclient/test/youtube/youtube-playlist.sparql
index 5c20b17..e9ca801 100644
--- a/libraries/ldclient/ldclient-provider-youtube/src/test/resources/org/apache/marmotta/ldclient/test/youtube/youtube-playlist.sparql
+++ b/libraries/ldclient/ldclient-provider-youtube/src/test/resources/org/apache/marmotta/ldclient/test/youtube/youtube-playlist.sparql
@@ -19,7 +19,7 @@ PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
 PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
 PREFIX ma: <http://www.w3.org/ns/ma-ont#>
 ASK {
-    <http://www.youtube.com/playlist?list=FLsrORDOimfQf42SDGJgRY4g> ma:collectionName "Favorite videos" .
+    <http://www.youtube.com/playlist?list=FLsrORDOimfQf42SDGJgRY4g> ma:collectionName "Favorites" .
     <http://www.youtube.com/playlist?list=FLsrORDOimfQf42SDGJgRY4g> ma:hasMember <http://gdata.youtube.com/feeds/api/videos/fUEdwKX-Dw4> .
-    <http://www.youtube.com/playlist?list=FLsrORDOimfQf42SDGJgRY4g> rdf:type ma:Collection
+    <http://www.youtube.com/playlist?list=FLsrORDOimfQf42SDGJgRY4g> rdf:type ma:Collection .
 }


[095/100] [abbrv] git commit: Merge master into develop

Posted by wi...@apache.org.
Merge master into develop


Project: http://git-wip-us.apache.org/repos/asf/marmotta/repo
Commit: http://git-wip-us.apache.org/repos/asf/marmotta/commit/c4d15986
Tree: http://git-wip-us.apache.org/repos/asf/marmotta/tree/c4d15986
Diff: http://git-wip-us.apache.org/repos/asf/marmotta/diff/c4d15986

Branch: refs/heads/ldp
Commit: c4d15986dcc423024a86536139aeb4703595a766
Parents: 8b6ebc1 1d73c3b
Author: Jakob Frank <ja...@apache.org>
Authored: Tue May 20 12:20:01 2014 +0200
Committer: Jakob Frank <ja...@apache.org>
Committed: Tue May 20 12:20:01 2014 +0200

----------------------------------------------------------------------
 client/marmotta-client-js-sample-webapp/pom.xml    | 2 +-
 client/marmotta-client-php/pom.xml                 | 2 +-
 platform/backends/marmotta-backend-bigdata/pom.xml | 2 +-
 platform/backends/marmotta-backend-http/pom.xml    | 2 +-
 platform/backends/marmotta-backend-sparql/pom.xml  | 2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------



[075/100] [abbrv] git commit: [maven-release-plugin] prepare for next development iteration

Posted by wi...@apache.org.
[maven-release-plugin] prepare for next development iteration


Project: http://git-wip-us.apache.org/repos/asf/marmotta/repo
Commit: http://git-wip-us.apache.org/repos/asf/marmotta/commit/c8bd0c01
Tree: http://git-wip-us.apache.org/repos/asf/marmotta/tree/c8bd0c01
Diff: http://git-wip-us.apache.org/repos/asf/marmotta/diff/c8bd0c01

Branch: refs/heads/ldp
Commit: c8bd0c0191ca1122e6e8a888f25113424b388bab
Parents: f5b5cf0
Author: Jakob Frank <ja...@salzburgresearch.at>
Authored: Wed Apr 9 10:03:15 2014 +0200
Committer: Jakob Frank <ja...@salzburgresearch.at>
Committed: Wed Apr 9 10:03:15 2014 +0200

----------------------------------------------------------------------
 build/archetypes/marmotta-archetype-module/pom.xml             | 2 +-
 build/archetypes/marmotta-archetype-webapp/pom.xml             | 2 +-
 build/archetypes/pom.xml                                       | 2 +-
 build/checkstyle-resources/pom.xml                             | 2 +-
 build/dependency-resource-supplement/pom.xml                   | 2 +-
 build/plugins/buildinfo-maven-plugin/pom.xml                   | 2 +-
 build/plugins/marmotta-maven-plugin/pom.xml                    | 2 +-
 build/plugins/pom.xml                                          | 2 +-
 build/plugins/refpack-maven-plugin/pom.xml                     | 2 +-
 build/plugins/repocheck-maven-plugin/pom.xml                   | 2 +-
 build/pom.xml                                                  | 2 +-
 client/marmotta-client-java/pom.xml                            | 2 +-
 client/marmotta-client-js/pom.xml                              | 2 +-
 client/pom.xml                                                 | 2 +-
 commons/marmotta-commons/pom.xml                               | 2 +-
 commons/marmotta-sesame-tools/marmotta-model-vocabs/pom.xml    | 2 +-
 commons/marmotta-sesame-tools/marmotta-rio-api/pom.xml         | 2 +-
 commons/marmotta-sesame-tools/marmotta-rio-ical/pom.xml        | 2 +-
 commons/marmotta-sesame-tools/marmotta-rio-rss/pom.xml         | 2 +-
 commons/marmotta-sesame-tools/marmotta-rio-vcard/pom.xml       | 2 +-
 .../marmotta-sesame-tools/marmotta-sail-contextaware/pom.xml   | 2 +-
 .../marmotta-sesame-tools/marmotta-sail-transactions/pom.xml   | 2 +-
 commons/marmotta-sesame-tools/marmotta-sesame-matchers/pom.xml | 2 +-
 commons/marmotta-sesame-tools/marmotta-util-facading/pom.xml   | 2 +-
 commons/marmotta-sesame-tools/marmotta-util-filter/pom.xml     | 2 +-
 commons/marmotta-sesame-tools/marmotta-util-rdfpatch/pom.xml   | 2 +-
 .../marmotta-sesame-tools/marmotta-util-tripletable/pom.xml    | 2 +-
 commons/marmotta-sesame-tools/pom.xml                          | 2 +-
 commons/pom.xml                                                | 2 +-
 extras/pom.xml                                                 | 2 +-
 extras/webjars/codemirror/pom.xml                              | 2 +-
 extras/webjars/pom.xml                                         | 2 +-
 extras/webjars/strftime/pom.xml                                | 2 +-
 launchers/marmotta-installer/pom.xml                           | 2 +-
 launchers/marmotta-splash/pom.xml                              | 2 +-
 launchers/marmotta-webapp/pom.xml                              | 2 +-
 launchers/pom.xml                                              | 2 +-
 libraries/kiwi/kiwi-caching-ehcache/pom.xml                    | 2 +-
 libraries/kiwi/kiwi-caching-hazelcast/pom.xml                  | 2 +-
 libraries/kiwi/kiwi-caching-infinispan/pom.xml                 | 2 +-
 libraries/kiwi/kiwi-loader/pom.xml                             | 2 +-
 libraries/kiwi/kiwi-reasoner/pom.xml                           | 2 +-
 libraries/kiwi/kiwi-sparql/pom.xml                             | 2 +-
 libraries/kiwi/kiwi-triplestore/pom.xml                        | 2 +-
 libraries/kiwi/kiwi-versioning/pom.xml                         | 2 +-
 libraries/kiwi/pom.xml                                         | 2 +-
 libraries/ldcache/ldcache-api/pom.xml                          | 2 +-
 libraries/ldcache/ldcache-backend-file/pom.xml                 | 2 +-
 libraries/ldcache/ldcache-backend-infinispan/pom.xml           | 2 +-
 libraries/ldcache/ldcache-backend-kiwi/pom.xml                 | 2 +-
 libraries/ldcache/ldcache-core/pom.xml                         | 2 +-
 libraries/ldcache/ldcache-sail-generic/pom.xml                 | 2 +-
 libraries/ldcache/ldcache-sail-kiwi/pom.xml                    | 2 +-
 libraries/ldcache/pom.xml                                      | 2 +-
 libraries/ldclient/ldclient-api/pom.xml                        | 2 +-
 libraries/ldclient/ldclient-core/pom.xml                       | 2 +-
 libraries/ldclient/ldclient-provider-facebook/pom.xml          | 2 +-
 libraries/ldclient/ldclient-provider-freebase/pom.xml          | 2 +-
 libraries/ldclient/ldclient-provider-html/pom.xml              | 2 +-
 libraries/ldclient/ldclient-provider-ldap/pom.xml              | 2 +-
 libraries/ldclient/ldclient-provider-mediawiki/pom.xml         | 2 +-
 libraries/ldclient/ldclient-provider-phpbb/pom.xml             | 2 +-
 libraries/ldclient/ldclient-provider-rdf/pom.xml               | 2 +-
 libraries/ldclient/ldclient-provider-rdfa/pom.xml              | 2 +-
 libraries/ldclient/ldclient-provider-vimeo/pom.xml             | 2 +-
 libraries/ldclient/ldclient-provider-xml/pom.xml               | 2 +-
 libraries/ldclient/ldclient-provider-youtube/pom.xml           | 2 +-
 libraries/ldclient/pom.xml                                     | 2 +-
 libraries/ldpath/ldpath-api/pom.xml                            | 2 +-
 libraries/ldpath/ldpath-backend-file/pom.xml                   | 2 +-
 libraries/ldpath/ldpath-backend-jena/pom.xml                   | 2 +-
 libraries/ldpath/ldpath-backend-linkeddata/pom.xml             | 2 +-
 libraries/ldpath/ldpath-backend-sesame/pom.xml                 | 2 +-
 libraries/ldpath/ldpath-core-bundle/pom.xml                    | 2 +-
 libraries/ldpath/ldpath-core/pom.xml                           | 2 +-
 libraries/ldpath/ldpath-functions-collections/pom.xml          | 2 +-
 libraries/ldpath/ldpath-functions-date/pom.xml                 | 2 +-
 libraries/ldpath/ldpath-functions-html/pom.xml                 | 2 +-
 libraries/ldpath/ldpath-functions-math/pom.xml                 | 2 +-
 libraries/ldpath/ldpath-functions-text/pom.xml                 | 2 +-
 libraries/ldpath/ldpath-functions-xml/pom.xml                  | 2 +-
 libraries/ldpath/ldpath-template-linkeddata/pom.xml            | 2 +-
 libraries/ldpath/ldpath-template/pom.xml                       | 2 +-
 libraries/ldpath/pom.xml                                       | 2 +-
 libraries/pom.xml                                              | 2 +-
 loader/marmotta-loader-berkeley/pom.xml                        | 2 +-
 loader/marmotta-loader-core/pom.xml                            | 2 +-
 loader/marmotta-loader-hbase/pom.xml                           | 2 +-
 loader/marmotta-loader-kiwi/pom.xml                            | 2 +-
 loader/marmotta-loader-titan/pom.xml                           | 2 +-
 loader/pom.xml                                                 | 2 +-
 parent/pom.xml                                                 | 6 +-----
 platform/backends/marmotta-backend-kiwi/pom.xml                | 2 +-
 platform/backends/marmotta-backend-memory/pom.xml              | 2 +-
 platform/backends/marmotta-backend-native/pom.xml              | 2 +-
 platform/backends/marmotta-backend-titan/pom.xml               | 2 +-
 platform/backends/pom.xml                                      | 2 +-
 platform/ldcache/marmotta-ldcache-common/pom.xml               | 2 +-
 platform/ldcache/marmotta-ldcache-file/pom.xml                 | 2 +-
 platform/ldcache/marmotta-ldcache-kiwi/pom.xml                 | 2 +-
 platform/ldcache/pom.xml                                       | 2 +-
 platform/marmotta-core/pom.xml                                 | 2 +-
 platform/marmotta-ldp/pom.xml                                  | 2 +-
 platform/marmotta-ldpath/pom.xml                               | 2 +-
 platform/marmotta-reasoner-kiwi/pom.xml                        | 2 +-
 platform/marmotta-security/pom.xml                             | 2 +-
 platform/marmotta-sparql/pom.xml                               | 2 +-
 platform/marmotta-user/pom.xml                                 | 2 +-
 platform/marmotta-versioning-common/pom.xml                    | 2 +-
 platform/marmotta-versioning-kiwi/pom.xml                      | 2 +-
 platform/marmotta-zookeeper/pom.xml                            | 2 +-
 platform/pom.xml                                               | 2 +-
 pom.xml                                                        | 4 ++--
 113 files changed, 114 insertions(+), 118 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/marmotta/blob/c8bd0c01/build/archetypes/marmotta-archetype-module/pom.xml
----------------------------------------------------------------------
diff --git a/build/archetypes/marmotta-archetype-module/pom.xml b/build/archetypes/marmotta-archetype-module/pom.xml
index 7b0e110..0dfd265 100644
--- a/build/archetypes/marmotta-archetype-module/pom.xml
+++ b/build/archetypes/marmotta-archetype-module/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.3.0-SNAPSHOT</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/c8bd0c01/build/archetypes/marmotta-archetype-webapp/pom.xml
----------------------------------------------------------------------
diff --git a/build/archetypes/marmotta-archetype-webapp/pom.xml b/build/archetypes/marmotta-archetype-webapp/pom.xml
index 88dd566..1596dff 100644
--- a/build/archetypes/marmotta-archetype-webapp/pom.xml
+++ b/build/archetypes/marmotta-archetype-webapp/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.3.0-SNAPSHOT</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/c8bd0c01/build/archetypes/pom.xml
----------------------------------------------------------------------
diff --git a/build/archetypes/pom.xml b/build/archetypes/pom.xml
index 3bbb7b5..89df9b4 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.2.0</version>
+        <version>3.3.0-SNAPSHOT</version>
         <relativePath>../../parent</relativePath>
     </parent>
     <artifactId>archetypes-reactor</artifactId>

http://git-wip-us.apache.org/repos/asf/marmotta/blob/c8bd0c01/build/checkstyle-resources/pom.xml
----------------------------------------------------------------------
diff --git a/build/checkstyle-resources/pom.xml b/build/checkstyle-resources/pom.xml
index 6bcf91f..be44bc6 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.2.0</version>
+        <version>3.3.0-SNAPSHOT</version>
         <relativePath>../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/c8bd0c01/build/dependency-resource-supplement/pom.xml
----------------------------------------------------------------------
diff --git a/build/dependency-resource-supplement/pom.xml b/build/dependency-resource-supplement/pom.xml
index 70be603..036a1d2 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.2.0</version>
+        <version>3.3.0-SNAPSHOT</version>
         <relativePath>../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/c8bd0c01/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 757a77d..9df1a7e 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.2.0</version>
+        <version>3.3.0-SNAPSHOT</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/c8bd0c01/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 3e3437f..7378d26 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.2.0</version>
+        <version>3.3.0-SNAPSHOT</version>
         <relativePath>../</relativePath>
         <artifactId>plugins-reactor</artifactId>
     </parent>

http://git-wip-us.apache.org/repos/asf/marmotta/blob/c8bd0c01/build/plugins/pom.xml
----------------------------------------------------------------------
diff --git a/build/plugins/pom.xml b/build/plugins/pom.xml
index 4a9bdf6..158bdab 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.2.0</version>
+        <version>3.3.0-SNAPSHOT</version>
         <relativePath>../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/c8bd0c01/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 67f99ae..4940b76 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.2.0</version>
+        <version>3.3.0-SNAPSHOT</version>
         <artifactId>plugins-reactor</artifactId>
         <relativePath>../</relativePath>
     </parent>

http://git-wip-us.apache.org/repos/asf/marmotta/blob/c8bd0c01/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 b0bfa46..b7b910a 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.2.0</version>
+        <version>3.3.0-SNAPSHOT</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/marmotta/blob/c8bd0c01/build/pom.xml
----------------------------------------------------------------------
diff --git a/build/pom.xml b/build/pom.xml
index d6615c4..b2a5979 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.2.0</version>
+        <version>3.3.0-SNAPSHOT</version>
         <relativePath>../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/c8bd0c01/client/marmotta-client-java/pom.xml
----------------------------------------------------------------------
diff --git a/client/marmotta-client-java/pom.xml b/client/marmotta-client-java/pom.xml
index e35de4b..470cb1b 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.2.0</version>
+        <version>3.3.0-SNAPSHOT</version>
         <relativePath>../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/c8bd0c01/client/marmotta-client-js/pom.xml
----------------------------------------------------------------------
diff --git a/client/marmotta-client-js/pom.xml b/client/marmotta-client-js/pom.xml
index 5319778..0f87254 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.2.0</version>
+        <version>3.3.0-SNAPSHOT</version>
         <relativePath>../../parent/pom.xml</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/c8bd0c01/client/pom.xml
----------------------------------------------------------------------
diff --git a/client/pom.xml b/client/pom.xml
index a5e655b..1560b39 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.2.0</version>
+        <version>3.3.0-SNAPSHOT</version>
         <relativePath>../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/c8bd0c01/commons/marmotta-commons/pom.xml
----------------------------------------------------------------------
diff --git a/commons/marmotta-commons/pom.xml b/commons/marmotta-commons/pom.xml
index 237e4a5..3bf80e9 100644
--- a/commons/marmotta-commons/pom.xml
+++ b/commons/marmotta-commons/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.3.0-SNAPSHOT</version>
         <relativePath>../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/c8bd0c01/commons/marmotta-sesame-tools/marmotta-model-vocabs/pom.xml
----------------------------------------------------------------------
diff --git a/commons/marmotta-sesame-tools/marmotta-model-vocabs/pom.xml b/commons/marmotta-sesame-tools/marmotta-model-vocabs/pom.xml
index 6d29685..865c36b 100644
--- a/commons/marmotta-sesame-tools/marmotta-model-vocabs/pom.xml
+++ b/commons/marmotta-sesame-tools/marmotta-model-vocabs/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.3.0-SNAPSHOT</version>
         <relativePath>../../../parent/</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/c8bd0c01/commons/marmotta-sesame-tools/marmotta-rio-api/pom.xml
----------------------------------------------------------------------
diff --git a/commons/marmotta-sesame-tools/marmotta-rio-api/pom.xml b/commons/marmotta-sesame-tools/marmotta-rio-api/pom.xml
index 0b7b2a0..5b64851 100644
--- a/commons/marmotta-sesame-tools/marmotta-rio-api/pom.xml
+++ b/commons/marmotta-sesame-tools/marmotta-rio-api/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.3.0-SNAPSHOT</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/c8bd0c01/commons/marmotta-sesame-tools/marmotta-rio-ical/pom.xml
----------------------------------------------------------------------
diff --git a/commons/marmotta-sesame-tools/marmotta-rio-ical/pom.xml b/commons/marmotta-sesame-tools/marmotta-rio-ical/pom.xml
index 28608f1..c1fc5d8 100644
--- a/commons/marmotta-sesame-tools/marmotta-rio-ical/pom.xml
+++ b/commons/marmotta-sesame-tools/marmotta-rio-ical/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.3.0-SNAPSHOT</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/c8bd0c01/commons/marmotta-sesame-tools/marmotta-rio-rss/pom.xml
----------------------------------------------------------------------
diff --git a/commons/marmotta-sesame-tools/marmotta-rio-rss/pom.xml b/commons/marmotta-sesame-tools/marmotta-rio-rss/pom.xml
index 9d1539b..acb73bb 100644
--- a/commons/marmotta-sesame-tools/marmotta-rio-rss/pom.xml
+++ b/commons/marmotta-sesame-tools/marmotta-rio-rss/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.3.0-SNAPSHOT</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/c8bd0c01/commons/marmotta-sesame-tools/marmotta-rio-vcard/pom.xml
----------------------------------------------------------------------
diff --git a/commons/marmotta-sesame-tools/marmotta-rio-vcard/pom.xml b/commons/marmotta-sesame-tools/marmotta-rio-vcard/pom.xml
index 698037e..3e1afe2 100644
--- a/commons/marmotta-sesame-tools/marmotta-rio-vcard/pom.xml
+++ b/commons/marmotta-sesame-tools/marmotta-rio-vcard/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.3.0-SNAPSHOT</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/c8bd0c01/commons/marmotta-sesame-tools/marmotta-sail-contextaware/pom.xml
----------------------------------------------------------------------
diff --git a/commons/marmotta-sesame-tools/marmotta-sail-contextaware/pom.xml b/commons/marmotta-sesame-tools/marmotta-sail-contextaware/pom.xml
index 42128aa..eeca9ff 100644
--- a/commons/marmotta-sesame-tools/marmotta-sail-contextaware/pom.xml
+++ b/commons/marmotta-sesame-tools/marmotta-sail-contextaware/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.3.0-SNAPSHOT</version>
         <relativePath>../../../parent/</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/c8bd0c01/commons/marmotta-sesame-tools/marmotta-sail-transactions/pom.xml
----------------------------------------------------------------------
diff --git a/commons/marmotta-sesame-tools/marmotta-sail-transactions/pom.xml b/commons/marmotta-sesame-tools/marmotta-sail-transactions/pom.xml
index 4a24f91..1319fe6 100644
--- a/commons/marmotta-sesame-tools/marmotta-sail-transactions/pom.xml
+++ b/commons/marmotta-sesame-tools/marmotta-sail-transactions/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.3.0-SNAPSHOT</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/c8bd0c01/commons/marmotta-sesame-tools/marmotta-sesame-matchers/pom.xml
----------------------------------------------------------------------
diff --git a/commons/marmotta-sesame-tools/marmotta-sesame-matchers/pom.xml b/commons/marmotta-sesame-tools/marmotta-sesame-matchers/pom.xml
index f5a9e7a..b1cc9c2 100644
--- a/commons/marmotta-sesame-tools/marmotta-sesame-matchers/pom.xml
+++ b/commons/marmotta-sesame-tools/marmotta-sesame-matchers/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.3.0-SNAPSHOT</version>
         <relativePath>../../../parent/</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/c8bd0c01/commons/marmotta-sesame-tools/marmotta-util-facading/pom.xml
----------------------------------------------------------------------
diff --git a/commons/marmotta-sesame-tools/marmotta-util-facading/pom.xml b/commons/marmotta-sesame-tools/marmotta-util-facading/pom.xml
index 7babadb..d13a56e 100644
--- a/commons/marmotta-sesame-tools/marmotta-util-facading/pom.xml
+++ b/commons/marmotta-sesame-tools/marmotta-util-facading/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.3.0-SNAPSHOT</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/c8bd0c01/commons/marmotta-sesame-tools/marmotta-util-filter/pom.xml
----------------------------------------------------------------------
diff --git a/commons/marmotta-sesame-tools/marmotta-util-filter/pom.xml b/commons/marmotta-sesame-tools/marmotta-util-filter/pom.xml
index 8f585eb..68b9788 100644
--- a/commons/marmotta-sesame-tools/marmotta-util-filter/pom.xml
+++ b/commons/marmotta-sesame-tools/marmotta-util-filter/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.3.0-SNAPSHOT</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/c8bd0c01/commons/marmotta-sesame-tools/marmotta-util-rdfpatch/pom.xml
----------------------------------------------------------------------
diff --git a/commons/marmotta-sesame-tools/marmotta-util-rdfpatch/pom.xml b/commons/marmotta-sesame-tools/marmotta-util-rdfpatch/pom.xml
index 6ed1b35..f186459 100644
--- a/commons/marmotta-sesame-tools/marmotta-util-rdfpatch/pom.xml
+++ b/commons/marmotta-sesame-tools/marmotta-util-rdfpatch/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.3.0-SNAPSHOT</version>
         <relativePath>../../../parent/</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/c8bd0c01/commons/marmotta-sesame-tools/marmotta-util-tripletable/pom.xml
----------------------------------------------------------------------
diff --git a/commons/marmotta-sesame-tools/marmotta-util-tripletable/pom.xml b/commons/marmotta-sesame-tools/marmotta-util-tripletable/pom.xml
index cdde08a..fcbde03 100644
--- a/commons/marmotta-sesame-tools/marmotta-util-tripletable/pom.xml
+++ b/commons/marmotta-sesame-tools/marmotta-util-tripletable/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.3.0-SNAPSHOT</version>
         <relativePath>../../../parent/</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/c8bd0c01/commons/marmotta-sesame-tools/pom.xml
----------------------------------------------------------------------
diff --git a/commons/marmotta-sesame-tools/pom.xml b/commons/marmotta-sesame-tools/pom.xml
index edce64c..e5520fc 100644
--- a/commons/marmotta-sesame-tools/pom.xml
+++ b/commons/marmotta-sesame-tools/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.3.0-SNAPSHOT</version>
         <relativePath>../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/c8bd0c01/commons/pom.xml
----------------------------------------------------------------------
diff --git a/commons/pom.xml b/commons/pom.xml
index 3d9355f..aea6832 100644
--- a/commons/pom.xml
+++ b/commons/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.3.0-SNAPSHOT</version>
         <relativePath>../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/c8bd0c01/extras/pom.xml
----------------------------------------------------------------------
diff --git a/extras/pom.xml b/extras/pom.xml
index e3b34af..121d86b 100644
--- a/extras/pom.xml
+++ b/extras/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.3.0-SNAPSHOT</version>
         <relativePath>../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/c8bd0c01/extras/webjars/codemirror/pom.xml
----------------------------------------------------------------------
diff --git a/extras/webjars/codemirror/pom.xml b/extras/webjars/codemirror/pom.xml
index 0046a6e..241f95e 100644
--- a/extras/webjars/codemirror/pom.xml
+++ b/extras/webjars/codemirror/pom.xml
@@ -22,7 +22,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.3.0-SNAPSHOT</version>
         <relativePath>../../../parent/</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/c8bd0c01/extras/webjars/pom.xml
----------------------------------------------------------------------
diff --git a/extras/webjars/pom.xml b/extras/webjars/pom.xml
index fde39f4..44fa2a4 100644
--- a/extras/webjars/pom.xml
+++ b/extras/webjars/pom.xml
@@ -22,7 +22,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.3.0-SNAPSHOT</version>
         <relativePath>../../parent/</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/c8bd0c01/extras/webjars/strftime/pom.xml
----------------------------------------------------------------------
diff --git a/extras/webjars/strftime/pom.xml b/extras/webjars/strftime/pom.xml
index fcf0455..d90c315 100644
--- a/extras/webjars/strftime/pom.xml
+++ b/extras/webjars/strftime/pom.xml
@@ -22,7 +22,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.3.0-SNAPSHOT</version>
         <relativePath>../../../parent/</relativePath> 
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/c8bd0c01/launchers/marmotta-installer/pom.xml
----------------------------------------------------------------------
diff --git a/launchers/marmotta-installer/pom.xml b/launchers/marmotta-installer/pom.xml
index 35ca306..ec13351 100644
--- a/launchers/marmotta-installer/pom.xml
+++ b/launchers/marmotta-installer/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.3.0-SNAPSHOT</version>
         <relativePath>../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/c8bd0c01/launchers/marmotta-splash/pom.xml
----------------------------------------------------------------------
diff --git a/launchers/marmotta-splash/pom.xml b/launchers/marmotta-splash/pom.xml
index 9dbb127..cb1b2bb 100644
--- a/launchers/marmotta-splash/pom.xml
+++ b/launchers/marmotta-splash/pom.xml
@@ -22,7 +22,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.3.0-SNAPSHOT</version>
         <relativePath>../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/c8bd0c01/launchers/marmotta-webapp/pom.xml
----------------------------------------------------------------------
diff --git a/launchers/marmotta-webapp/pom.xml b/launchers/marmotta-webapp/pom.xml
index 5f1ed2e..3dc1aa2 100644
--- a/launchers/marmotta-webapp/pom.xml
+++ b/launchers/marmotta-webapp/pom.xml
@@ -22,7 +22,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.3.0-SNAPSHOT</version>
         <relativePath>../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/c8bd0c01/launchers/pom.xml
----------------------------------------------------------------------
diff --git a/launchers/pom.xml b/launchers/pom.xml
index e0bbb1b..6f5631c 100644
--- a/launchers/pom.xml
+++ b/launchers/pom.xml
@@ -22,7 +22,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.3.0-SNAPSHOT</version>
         <relativePath>../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/c8bd0c01/libraries/kiwi/kiwi-caching-ehcache/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-caching-ehcache/pom.xml b/libraries/kiwi/kiwi-caching-ehcache/pom.xml
index 4cb3dfa..52408a0 100644
--- a/libraries/kiwi/kiwi-caching-ehcache/pom.xml
+++ b/libraries/kiwi/kiwi-caching-ehcache/pom.xml
@@ -22,7 +22,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>kiwi-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.3.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>kiwi-caching-ehcache</artifactId>

http://git-wip-us.apache.org/repos/asf/marmotta/blob/c8bd0c01/libraries/kiwi/kiwi-caching-hazelcast/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-caching-hazelcast/pom.xml b/libraries/kiwi/kiwi-caching-hazelcast/pom.xml
index b07b6c9..478797f 100644
--- a/libraries/kiwi/kiwi-caching-hazelcast/pom.xml
+++ b/libraries/kiwi/kiwi-caching-hazelcast/pom.xml
@@ -22,7 +22,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>kiwi-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.3.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>kiwi-caching-hazelcast</artifactId>

http://git-wip-us.apache.org/repos/asf/marmotta/blob/c8bd0c01/libraries/kiwi/kiwi-caching-infinispan/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-caching-infinispan/pom.xml b/libraries/kiwi/kiwi-caching-infinispan/pom.xml
index 61e649a..e121817 100644
--- a/libraries/kiwi/kiwi-caching-infinispan/pom.xml
+++ b/libraries/kiwi/kiwi-caching-infinispan/pom.xml
@@ -22,7 +22,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>kiwi-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.3.0-SNAPSHOT</version>
         <relativePath>../</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/c8bd0c01/libraries/kiwi/kiwi-loader/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-loader/pom.xml b/libraries/kiwi/kiwi-loader/pom.xml
index d07fe52..d0bc68c 100644
--- a/libraries/kiwi/kiwi-loader/pom.xml
+++ b/libraries/kiwi/kiwi-loader/pom.xml
@@ -14,7 +14,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>kiwi-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.3.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>kiwi-loader</artifactId>

http://git-wip-us.apache.org/repos/asf/marmotta/blob/c8bd0c01/libraries/kiwi/kiwi-reasoner/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-reasoner/pom.xml b/libraries/kiwi/kiwi-reasoner/pom.xml
index ddbed48..4d723f3 100644
--- a/libraries/kiwi/kiwi-reasoner/pom.xml
+++ b/libraries/kiwi/kiwi-reasoner/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>kiwi-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.3.0-SNAPSHOT</version>
         <relativePath>../</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/c8bd0c01/libraries/kiwi/kiwi-sparql/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-sparql/pom.xml b/libraries/kiwi/kiwi-sparql/pom.xml
index 0768ceb..c2087e7 100644
--- a/libraries/kiwi/kiwi-sparql/pom.xml
+++ b/libraries/kiwi/kiwi-sparql/pom.xml
@@ -22,7 +22,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>kiwi-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.3.0-SNAPSHOT</version>
         <relativePath>../</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/c8bd0c01/libraries/kiwi/kiwi-triplestore/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-triplestore/pom.xml b/libraries/kiwi/kiwi-triplestore/pom.xml
index 8be0f8f..129fcca 100644
--- a/libraries/kiwi/kiwi-triplestore/pom.xml
+++ b/libraries/kiwi/kiwi-triplestore/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>kiwi-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.3.0-SNAPSHOT</version>
         <relativePath>../</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/c8bd0c01/libraries/kiwi/kiwi-versioning/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-versioning/pom.xml b/libraries/kiwi/kiwi-versioning/pom.xml
index cf30946..f5d175a 100644
--- a/libraries/kiwi/kiwi-versioning/pom.xml
+++ b/libraries/kiwi/kiwi-versioning/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>kiwi-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.3.0-SNAPSHOT</version>
         <relativePath>../</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/c8bd0c01/libraries/kiwi/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/kiwi/pom.xml b/libraries/kiwi/pom.xml
index 694f270..4af19be 100644
--- a/libraries/kiwi/pom.xml
+++ b/libraries/kiwi/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.3.0-SNAPSHOT</version>
         <relativePath>../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/c8bd0c01/libraries/ldcache/ldcache-api/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldcache/ldcache-api/pom.xml b/libraries/ldcache/ldcache-api/pom.xml
index fa5bcea..0146566 100644
--- a/libraries/ldcache/ldcache-api/pom.xml
+++ b/libraries/ldcache/ldcache-api/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.3.0-SNAPSHOT</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/c8bd0c01/libraries/ldcache/ldcache-backend-file/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldcache/ldcache-backend-file/pom.xml b/libraries/ldcache/ldcache-backend-file/pom.xml
index e9abeef..c0bfab6 100644
--- a/libraries/ldcache/ldcache-backend-file/pom.xml
+++ b/libraries/ldcache/ldcache-backend-file/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.3.0-SNAPSHOT</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/c8bd0c01/libraries/ldcache/ldcache-backend-infinispan/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldcache/ldcache-backend-infinispan/pom.xml b/libraries/ldcache/ldcache-backend-infinispan/pom.xml
index 873511e..be1ad5d 100644
--- a/libraries/ldcache/ldcache-backend-infinispan/pom.xml
+++ b/libraries/ldcache/ldcache-backend-infinispan/pom.xml
@@ -22,7 +22,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.3.0-SNAPSHOT</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/c8bd0c01/libraries/ldcache/ldcache-backend-kiwi/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldcache/ldcache-backend-kiwi/pom.xml b/libraries/ldcache/ldcache-backend-kiwi/pom.xml
index ca78593..94c87fa 100644
--- a/libraries/ldcache/ldcache-backend-kiwi/pom.xml
+++ b/libraries/ldcache/ldcache-backend-kiwi/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.3.0-SNAPSHOT</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/c8bd0c01/libraries/ldcache/ldcache-core/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldcache/ldcache-core/pom.xml b/libraries/ldcache/ldcache-core/pom.xml
index f6c5e27..a90d818 100644
--- a/libraries/ldcache/ldcache-core/pom.xml
+++ b/libraries/ldcache/ldcache-core/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.3.0-SNAPSHOT</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/c8bd0c01/libraries/ldcache/ldcache-sail-generic/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldcache/ldcache-sail-generic/pom.xml b/libraries/ldcache/ldcache-sail-generic/pom.xml
index 78ad47f..0bb78b2 100644
--- a/libraries/ldcache/ldcache-sail-generic/pom.xml
+++ b/libraries/ldcache/ldcache-sail-generic/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.3.0-SNAPSHOT</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/c8bd0c01/libraries/ldcache/ldcache-sail-kiwi/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldcache/ldcache-sail-kiwi/pom.xml b/libraries/ldcache/ldcache-sail-kiwi/pom.xml
index 34fa855..69e2a14 100644
--- a/libraries/ldcache/ldcache-sail-kiwi/pom.xml
+++ b/libraries/ldcache/ldcache-sail-kiwi/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.3.0-SNAPSHOT</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/c8bd0c01/libraries/ldcache/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldcache/pom.xml b/libraries/ldcache/pom.xml
index f184f63..21abadc 100644
--- a/libraries/ldcache/pom.xml
+++ b/libraries/ldcache/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.3.0-SNAPSHOT</version>
         <relativePath>../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/c8bd0c01/libraries/ldclient/ldclient-api/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldclient/ldclient-api/pom.xml b/libraries/ldclient/ldclient-api/pom.xml
index c672943..37c5bd1 100644
--- a/libraries/ldclient/ldclient-api/pom.xml
+++ b/libraries/ldclient/ldclient-api/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.3.0-SNAPSHOT</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/c8bd0c01/libraries/ldclient/ldclient-core/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldclient/ldclient-core/pom.xml b/libraries/ldclient/ldclient-core/pom.xml
index ac24d0b..312b649 100644
--- a/libraries/ldclient/ldclient-core/pom.xml
+++ b/libraries/ldclient/ldclient-core/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.3.0-SNAPSHOT</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/c8bd0c01/libraries/ldclient/ldclient-provider-facebook/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldclient/ldclient-provider-facebook/pom.xml b/libraries/ldclient/ldclient-provider-facebook/pom.xml
index e249a0a..8ce90cf 100644
--- a/libraries/ldclient/ldclient-provider-facebook/pom.xml
+++ b/libraries/ldclient/ldclient-provider-facebook/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.3.0-SNAPSHOT</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/c8bd0c01/libraries/ldclient/ldclient-provider-freebase/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldclient/ldclient-provider-freebase/pom.xml b/libraries/ldclient/ldclient-provider-freebase/pom.xml
index 59b33ed..39f9848 100644
--- a/libraries/ldclient/ldclient-provider-freebase/pom.xml
+++ b/libraries/ldclient/ldclient-provider-freebase/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.3.0-SNAPSHOT</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/c8bd0c01/libraries/ldclient/ldclient-provider-html/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldclient/ldclient-provider-html/pom.xml b/libraries/ldclient/ldclient-provider-html/pom.xml
index 3040455..89f302d 100644
--- a/libraries/ldclient/ldclient-provider-html/pom.xml
+++ b/libraries/ldclient/ldclient-provider-html/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.3.0-SNAPSHOT</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/c8bd0c01/libraries/ldclient/ldclient-provider-ldap/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldclient/ldclient-provider-ldap/pom.xml b/libraries/ldclient/ldclient-provider-ldap/pom.xml
index 45651fa..f321e5c 100644
--- a/libraries/ldclient/ldclient-provider-ldap/pom.xml
+++ b/libraries/ldclient/ldclient-provider-ldap/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.3.0-SNAPSHOT</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/c8bd0c01/libraries/ldclient/ldclient-provider-mediawiki/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldclient/ldclient-provider-mediawiki/pom.xml b/libraries/ldclient/ldclient-provider-mediawiki/pom.xml
index a1aca3d..01cdf17 100644
--- a/libraries/ldclient/ldclient-provider-mediawiki/pom.xml
+++ b/libraries/ldclient/ldclient-provider-mediawiki/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.3.0-SNAPSHOT</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/c8bd0c01/libraries/ldclient/ldclient-provider-phpbb/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldclient/ldclient-provider-phpbb/pom.xml b/libraries/ldclient/ldclient-provider-phpbb/pom.xml
index 7239d64..0f78526 100644
--- a/libraries/ldclient/ldclient-provider-phpbb/pom.xml
+++ b/libraries/ldclient/ldclient-provider-phpbb/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.3.0-SNAPSHOT</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/c8bd0c01/libraries/ldclient/ldclient-provider-rdf/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldclient/ldclient-provider-rdf/pom.xml b/libraries/ldclient/ldclient-provider-rdf/pom.xml
index ad1166f..70e7f67 100644
--- a/libraries/ldclient/ldclient-provider-rdf/pom.xml
+++ b/libraries/ldclient/ldclient-provider-rdf/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.3.0-SNAPSHOT</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/c8bd0c01/libraries/ldclient/ldclient-provider-rdfa/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldclient/ldclient-provider-rdfa/pom.xml b/libraries/ldclient/ldclient-provider-rdfa/pom.xml
index f0bdddf..8659a89 100644
--- a/libraries/ldclient/ldclient-provider-rdfa/pom.xml
+++ b/libraries/ldclient/ldclient-provider-rdfa/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.3.0-SNAPSHOT</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/c8bd0c01/libraries/ldclient/ldclient-provider-vimeo/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldclient/ldclient-provider-vimeo/pom.xml b/libraries/ldclient/ldclient-provider-vimeo/pom.xml
index e1b12cf..8a6ad54 100644
--- a/libraries/ldclient/ldclient-provider-vimeo/pom.xml
+++ b/libraries/ldclient/ldclient-provider-vimeo/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.3.0-SNAPSHOT</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/c8bd0c01/libraries/ldclient/ldclient-provider-xml/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldclient/ldclient-provider-xml/pom.xml b/libraries/ldclient/ldclient-provider-xml/pom.xml
index 8e63562..5cb1c4a 100644
--- a/libraries/ldclient/ldclient-provider-xml/pom.xml
+++ b/libraries/ldclient/ldclient-provider-xml/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.3.0-SNAPSHOT</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/c8bd0c01/libraries/ldclient/ldclient-provider-youtube/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldclient/ldclient-provider-youtube/pom.xml b/libraries/ldclient/ldclient-provider-youtube/pom.xml
index 95727eb..c90c196 100644
--- a/libraries/ldclient/ldclient-provider-youtube/pom.xml
+++ b/libraries/ldclient/ldclient-provider-youtube/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.3.0-SNAPSHOT</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/c8bd0c01/libraries/ldclient/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldclient/pom.xml b/libraries/ldclient/pom.xml
index 0d9a53f..2cd0db7 100644
--- a/libraries/ldclient/pom.xml
+++ b/libraries/ldclient/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.3.0-SNAPSHOT</version>
         <relativePath>../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/c8bd0c01/libraries/ldpath/ldpath-api/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-api/pom.xml b/libraries/ldpath/ldpath-api/pom.xml
index 2c5b5cb..ab960d9 100644
--- a/libraries/ldpath/ldpath-api/pom.xml
+++ b/libraries/ldpath/ldpath-api/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.3.0-SNAPSHOT</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/c8bd0c01/libraries/ldpath/ldpath-backend-file/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-backend-file/pom.xml b/libraries/ldpath/ldpath-backend-file/pom.xml
index 6ba19ca..3881563 100644
--- a/libraries/ldpath/ldpath-backend-file/pom.xml
+++ b/libraries/ldpath/ldpath-backend-file/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.3.0-SNAPSHOT</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/c8bd0c01/libraries/ldpath/ldpath-backend-jena/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-backend-jena/pom.xml b/libraries/ldpath/ldpath-backend-jena/pom.xml
index a5e91d6..3d551b4 100644
--- a/libraries/ldpath/ldpath-backend-jena/pom.xml
+++ b/libraries/ldpath/ldpath-backend-jena/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.3.0-SNAPSHOT</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/c8bd0c01/libraries/ldpath/ldpath-backend-linkeddata/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-backend-linkeddata/pom.xml b/libraries/ldpath/ldpath-backend-linkeddata/pom.xml
index 5848b48..1483a00 100644
--- a/libraries/ldpath/ldpath-backend-linkeddata/pom.xml
+++ b/libraries/ldpath/ldpath-backend-linkeddata/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.3.0-SNAPSHOT</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/c8bd0c01/libraries/ldpath/ldpath-backend-sesame/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-backend-sesame/pom.xml b/libraries/ldpath/ldpath-backend-sesame/pom.xml
index 3262375..1d369c1 100644
--- a/libraries/ldpath/ldpath-backend-sesame/pom.xml
+++ b/libraries/ldpath/ldpath-backend-sesame/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.3.0-SNAPSHOT</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/c8bd0c01/libraries/ldpath/ldpath-core-bundle/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-core-bundle/pom.xml b/libraries/ldpath/ldpath-core-bundle/pom.xml
index fb57445..fdf351f 100644
--- a/libraries/ldpath/ldpath-core-bundle/pom.xml
+++ b/libraries/ldpath/ldpath-core-bundle/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.3.0-SNAPSHOT</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/c8bd0c01/libraries/ldpath/ldpath-core/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-core/pom.xml b/libraries/ldpath/ldpath-core/pom.xml
index c963b0a..ee1d774 100644
--- a/libraries/ldpath/ldpath-core/pom.xml
+++ b/libraries/ldpath/ldpath-core/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.3.0-SNAPSHOT</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/c8bd0c01/libraries/ldpath/ldpath-functions-collections/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-functions-collections/pom.xml b/libraries/ldpath/ldpath-functions-collections/pom.xml
index dfa590b..5a804f7 100644
--- a/libraries/ldpath/ldpath-functions-collections/pom.xml
+++ b/libraries/ldpath/ldpath-functions-collections/pom.xml
@@ -20,7 +20,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.3.0-SNAPSHOT</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/c8bd0c01/libraries/ldpath/ldpath-functions-date/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-functions-date/pom.xml b/libraries/ldpath/ldpath-functions-date/pom.xml
index 98f1121..226c17c 100644
--- a/libraries/ldpath/ldpath-functions-date/pom.xml
+++ b/libraries/ldpath/ldpath-functions-date/pom.xml
@@ -20,7 +20,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.3.0-SNAPSHOT</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/c8bd0c01/libraries/ldpath/ldpath-functions-html/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-functions-html/pom.xml b/libraries/ldpath/ldpath-functions-html/pom.xml
index 991f0b3..3298fb5 100644
--- a/libraries/ldpath/ldpath-functions-html/pom.xml
+++ b/libraries/ldpath/ldpath-functions-html/pom.xml
@@ -19,7 +19,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.3.0-SNAPSHOT</version>
         <relativePath>../../../parent</relativePath>
     </parent>
     <modelVersion>4.0.0</modelVersion>

http://git-wip-us.apache.org/repos/asf/marmotta/blob/c8bd0c01/libraries/ldpath/ldpath-functions-math/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-functions-math/pom.xml b/libraries/ldpath/ldpath-functions-math/pom.xml
index 3231efb..6c3ac5f 100644
--- a/libraries/ldpath/ldpath-functions-math/pom.xml
+++ b/libraries/ldpath/ldpath-functions-math/pom.xml
@@ -20,7 +20,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.3.0-SNAPSHOT</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/c8bd0c01/libraries/ldpath/ldpath-functions-text/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-functions-text/pom.xml b/libraries/ldpath/ldpath-functions-text/pom.xml
index e7d08a0..c3de4e7 100644
--- a/libraries/ldpath/ldpath-functions-text/pom.xml
+++ b/libraries/ldpath/ldpath-functions-text/pom.xml
@@ -20,7 +20,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.3.0-SNAPSHOT</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/c8bd0c01/libraries/ldpath/ldpath-functions-xml/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-functions-xml/pom.xml b/libraries/ldpath/ldpath-functions-xml/pom.xml
index 7cc029c..0161ce1 100644
--- a/libraries/ldpath/ldpath-functions-xml/pom.xml
+++ b/libraries/ldpath/ldpath-functions-xml/pom.xml
@@ -19,7 +19,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.3.0-SNAPSHOT</version>
         <relativePath>../../../parent</relativePath>
     </parent>
     <modelVersion>4.0.0</modelVersion>

http://git-wip-us.apache.org/repos/asf/marmotta/blob/c8bd0c01/libraries/ldpath/ldpath-template-linkeddata/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-template-linkeddata/pom.xml b/libraries/ldpath/ldpath-template-linkeddata/pom.xml
index 1bce32c..0134ee3 100644
--- a/libraries/ldpath/ldpath-template-linkeddata/pom.xml
+++ b/libraries/ldpath/ldpath-template-linkeddata/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.3.0-SNAPSHOT</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/c8bd0c01/libraries/ldpath/ldpath-template/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-template/pom.xml b/libraries/ldpath/ldpath-template/pom.xml
index d1917ad..6fc1a80 100644
--- a/libraries/ldpath/ldpath-template/pom.xml
+++ b/libraries/ldpath/ldpath-template/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.3.0-SNAPSHOT</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/c8bd0c01/libraries/ldpath/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldpath/pom.xml b/libraries/ldpath/pom.xml
index fab550e..ec49339 100644
--- a/libraries/ldpath/pom.xml
+++ b/libraries/ldpath/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.3.0-SNAPSHOT</version>
         <relativePath>../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/c8bd0c01/libraries/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/pom.xml b/libraries/pom.xml
index 6ed6798..99419d9 100644
--- a/libraries/pom.xml
+++ b/libraries/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.3.0-SNAPSHOT</version>
         <relativePath>../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/c8bd0c01/loader/marmotta-loader-berkeley/pom.xml
----------------------------------------------------------------------
diff --git a/loader/marmotta-loader-berkeley/pom.xml b/loader/marmotta-loader-berkeley/pom.xml
index 5cb346a..0e90b20 100644
--- a/loader/marmotta-loader-berkeley/pom.xml
+++ b/loader/marmotta-loader-berkeley/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.3.0-SNAPSHOT</version>
         <relativePath>../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/c8bd0c01/loader/marmotta-loader-core/pom.xml
----------------------------------------------------------------------
diff --git a/loader/marmotta-loader-core/pom.xml b/loader/marmotta-loader-core/pom.xml
index 83cebb4..0c08d76 100644
--- a/loader/marmotta-loader-core/pom.xml
+++ b/loader/marmotta-loader-core/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.3.0-SNAPSHOT</version>
         <relativePath>../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/c8bd0c01/loader/marmotta-loader-hbase/pom.xml
----------------------------------------------------------------------
diff --git a/loader/marmotta-loader-hbase/pom.xml b/loader/marmotta-loader-hbase/pom.xml
index 27872d3..8f8b9c6 100644
--- a/loader/marmotta-loader-hbase/pom.xml
+++ b/loader/marmotta-loader-hbase/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.3.0-SNAPSHOT</version>
         <relativePath>../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/c8bd0c01/loader/marmotta-loader-kiwi/pom.xml
----------------------------------------------------------------------
diff --git a/loader/marmotta-loader-kiwi/pom.xml b/loader/marmotta-loader-kiwi/pom.xml
index 94d8d92..5bb71be 100644
--- a/loader/marmotta-loader-kiwi/pom.xml
+++ b/loader/marmotta-loader-kiwi/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.3.0-SNAPSHOT</version>
         <relativePath>../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/c8bd0c01/loader/marmotta-loader-titan/pom.xml
----------------------------------------------------------------------
diff --git a/loader/marmotta-loader-titan/pom.xml b/loader/marmotta-loader-titan/pom.xml
index 02358b9..af6e0e6 100644
--- a/loader/marmotta-loader-titan/pom.xml
+++ b/loader/marmotta-loader-titan/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.3.0-SNAPSHOT</version>
         <relativePath>../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/c8bd0c01/loader/pom.xml
----------------------------------------------------------------------
diff --git a/loader/pom.xml b/loader/pom.xml
index b1044db..b5e8006 100644
--- a/loader/pom.xml
+++ b/loader/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.3.0-SNAPSHOT</version>
         <relativePath>../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/c8bd0c01/parent/pom.xml
----------------------------------------------------------------------
diff --git a/parent/pom.xml b/parent/pom.xml
index 3c2f128..2096480 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -29,7 +29,7 @@
     <groupId>org.apache.marmotta</groupId>
     <artifactId>marmotta-parent</artifactId>
     <packaging>pom</packaging>
-    <version>3.2.0</version>
+    <version>3.3.0-SNAPSHOT</version>
 
     <name>Apache Marmotta Parent</name>
     <description>Parent POM for the Apache Marmotta project</description>
@@ -1781,8 +1781,4 @@
         <tag>3.1.0</tag>
     </scm>
 -->
-
-  <scm>
-    <tag>3.2.0</tag>
-  </scm>
 </project>

http://git-wip-us.apache.org/repos/asf/marmotta/blob/c8bd0c01/platform/backends/marmotta-backend-kiwi/pom.xml
----------------------------------------------------------------------
diff --git a/platform/backends/marmotta-backend-kiwi/pom.xml b/platform/backends/marmotta-backend-kiwi/pom.xml
index faea6ff..ab8fd62 100644
--- a/platform/backends/marmotta-backend-kiwi/pom.xml
+++ b/platform/backends/marmotta-backend-kiwi/pom.xml
@@ -22,7 +22,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.3.0-SNAPSHOT</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/c8bd0c01/platform/backends/marmotta-backend-memory/pom.xml
----------------------------------------------------------------------
diff --git a/platform/backends/marmotta-backend-memory/pom.xml b/platform/backends/marmotta-backend-memory/pom.xml
index 94a4979..4ed6825 100644
--- a/platform/backends/marmotta-backend-memory/pom.xml
+++ b/platform/backends/marmotta-backend-memory/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.3.0-SNAPSHOT</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/c8bd0c01/platform/backends/marmotta-backend-native/pom.xml
----------------------------------------------------------------------
diff --git a/platform/backends/marmotta-backend-native/pom.xml b/platform/backends/marmotta-backend-native/pom.xml
index 09f80fb..7203f7a 100644
--- a/platform/backends/marmotta-backend-native/pom.xml
+++ b/platform/backends/marmotta-backend-native/pom.xml
@@ -22,7 +22,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.3.0-SNAPSHOT</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/c8bd0c01/platform/backends/marmotta-backend-titan/pom.xml
----------------------------------------------------------------------
diff --git a/platform/backends/marmotta-backend-titan/pom.xml b/platform/backends/marmotta-backend-titan/pom.xml
index b3fb632..dde110f 100644
--- a/platform/backends/marmotta-backend-titan/pom.xml
+++ b/platform/backends/marmotta-backend-titan/pom.xml
@@ -22,7 +22,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.3.0-SNAPSHOT</version>
         <relativePath>../../../parent/pom.xml</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/c8bd0c01/platform/backends/pom.xml
----------------------------------------------------------------------
diff --git a/platform/backends/pom.xml b/platform/backends/pom.xml
index 3f40a2b..56cd10d 100644
--- a/platform/backends/pom.xml
+++ b/platform/backends/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.3.0-SNAPSHOT</version>
         <relativePath>../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/c8bd0c01/platform/ldcache/marmotta-ldcache-common/pom.xml
----------------------------------------------------------------------
diff --git a/platform/ldcache/marmotta-ldcache-common/pom.xml b/platform/ldcache/marmotta-ldcache-common/pom.xml
index 7fe23a3..2a64edc 100644
--- a/platform/ldcache/marmotta-ldcache-common/pom.xml
+++ b/platform/ldcache/marmotta-ldcache-common/pom.xml
@@ -22,7 +22,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.3.0-SNAPSHOT</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/c8bd0c01/platform/ldcache/marmotta-ldcache-file/pom.xml
----------------------------------------------------------------------
diff --git a/platform/ldcache/marmotta-ldcache-file/pom.xml b/platform/ldcache/marmotta-ldcache-file/pom.xml
index a7044d9..b7041d9 100644
--- a/platform/ldcache/marmotta-ldcache-file/pom.xml
+++ b/platform/ldcache/marmotta-ldcache-file/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.3.0-SNAPSHOT</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/c8bd0c01/platform/ldcache/marmotta-ldcache-kiwi/pom.xml
----------------------------------------------------------------------
diff --git a/platform/ldcache/marmotta-ldcache-kiwi/pom.xml b/platform/ldcache/marmotta-ldcache-kiwi/pom.xml
index 7c7bd68..dec7440 100644
--- a/platform/ldcache/marmotta-ldcache-kiwi/pom.xml
+++ b/platform/ldcache/marmotta-ldcache-kiwi/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.3.0-SNAPSHOT</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/c8bd0c01/platform/ldcache/pom.xml
----------------------------------------------------------------------
diff --git a/platform/ldcache/pom.xml b/platform/ldcache/pom.xml
index 1b0cbf0..e1a8e0f 100644
--- a/platform/ldcache/pom.xml
+++ b/platform/ldcache/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.3.0-SNAPSHOT</version>
         <relativePath>../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/c8bd0c01/platform/marmotta-core/pom.xml
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/pom.xml b/platform/marmotta-core/pom.xml
index 2f24a13..4dbed3e 100644
--- a/platform/marmotta-core/pom.xml
+++ b/platform/marmotta-core/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.3.0-SNAPSHOT</version>
         <relativePath>../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/c8bd0c01/platform/marmotta-ldp/pom.xml
----------------------------------------------------------------------
diff --git a/platform/marmotta-ldp/pom.xml b/platform/marmotta-ldp/pom.xml
index a7a6b88..f0e7dd5 100644
--- a/platform/marmotta-ldp/pom.xml
+++ b/platform/marmotta-ldp/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.3.0-SNAPSHOT</version>
         <relativePath>../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/c8bd0c01/platform/marmotta-ldpath/pom.xml
----------------------------------------------------------------------
diff --git a/platform/marmotta-ldpath/pom.xml b/platform/marmotta-ldpath/pom.xml
index 95f9eb6..36d5f9a 100644
--- a/platform/marmotta-ldpath/pom.xml
+++ b/platform/marmotta-ldpath/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.3.0-SNAPSHOT</version>
         <relativePath>../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/c8bd0c01/platform/marmotta-reasoner-kiwi/pom.xml
----------------------------------------------------------------------
diff --git a/platform/marmotta-reasoner-kiwi/pom.xml b/platform/marmotta-reasoner-kiwi/pom.xml
index 5905919..1a1a632 100644
--- a/platform/marmotta-reasoner-kiwi/pom.xml
+++ b/platform/marmotta-reasoner-kiwi/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.3.0-SNAPSHOT</version>
         <relativePath>../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/c8bd0c01/platform/marmotta-security/pom.xml
----------------------------------------------------------------------
diff --git a/platform/marmotta-security/pom.xml b/platform/marmotta-security/pom.xml
index 847559e..75aa398 100644
--- a/platform/marmotta-security/pom.xml
+++ b/platform/marmotta-security/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.3.0-SNAPSHOT</version>
         <relativePath>../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/c8bd0c01/platform/marmotta-sparql/pom.xml
----------------------------------------------------------------------
diff --git a/platform/marmotta-sparql/pom.xml b/platform/marmotta-sparql/pom.xml
index 88636d6..11f5fab 100644
--- a/platform/marmotta-sparql/pom.xml
+++ b/platform/marmotta-sparql/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.3.0-SNAPSHOT</version>
         <relativePath>../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/c8bd0c01/platform/marmotta-user/pom.xml
----------------------------------------------------------------------
diff --git a/platform/marmotta-user/pom.xml b/platform/marmotta-user/pom.xml
index 08012c5..661ad43 100644
--- a/platform/marmotta-user/pom.xml
+++ b/platform/marmotta-user/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.3.0-SNAPSHOT</version>
         <relativePath>../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/c8bd0c01/platform/marmotta-versioning-common/pom.xml
----------------------------------------------------------------------
diff --git a/platform/marmotta-versioning-common/pom.xml b/platform/marmotta-versioning-common/pom.xml
index cd08d5a..f3523cb 100644
--- a/platform/marmotta-versioning-common/pom.xml
+++ b/platform/marmotta-versioning-common/pom.xml
@@ -22,7 +22,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.3.0-SNAPSHOT</version>
         <relativePath>../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/c8bd0c01/platform/marmotta-versioning-kiwi/pom.xml
----------------------------------------------------------------------
diff --git a/platform/marmotta-versioning-kiwi/pom.xml b/platform/marmotta-versioning-kiwi/pom.xml
index 55d4d8b..bc1decc 100644
--- a/platform/marmotta-versioning-kiwi/pom.xml
+++ b/platform/marmotta-versioning-kiwi/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.3.0-SNAPSHOT</version>
         <relativePath>../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/c8bd0c01/platform/marmotta-zookeeper/pom.xml
----------------------------------------------------------------------
diff --git a/platform/marmotta-zookeeper/pom.xml b/platform/marmotta-zookeeper/pom.xml
index 1a443fa..f8d06ed 100644
--- a/platform/marmotta-zookeeper/pom.xml
+++ b/platform/marmotta-zookeeper/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.3.0-SNAPSHOT</version>
         <relativePath>../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/c8bd0c01/platform/pom.xml
----------------------------------------------------------------------
diff --git a/platform/pom.xml b/platform/pom.xml
index d6b3275..2a44408 100644
--- a/platform/pom.xml
+++ b/platform/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.3.0-SNAPSHOT</version>
         <relativePath>../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/c8bd0c01/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index d9979a0..03fa164 100644
--- a/pom.xml
+++ b/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.3.0-SNAPSHOT</version>
         <relativePath>parent</relativePath>
     </parent>
 
@@ -118,7 +118,7 @@
         <url>https://git-wip-us.apache.org/repos/asf/marmotta.git</url>
         <connection>scm:git:https://git-wip-us.apache.org/repos/asf/marmotta.git</connection>
         <developerConnection>scm:git:https://git-wip-us.apache.org/repos/asf/marmotta.git</developerConnection>
-        <tag>3.2.0</tag>
+        <tag>HEAD</tag>
     </scm>
 
     <issueManagement>


[097/100] [abbrv] git commit: fixed duplicated shutdown method

Posted by wi...@apache.org.
fixed duplicated shutdown method


Project: http://git-wip-us.apache.org/repos/asf/marmotta/repo
Commit: http://git-wip-us.apache.org/repos/asf/marmotta/commit/14e522d9
Tree: http://git-wip-us.apache.org/repos/asf/marmotta/tree/14e522d9
Diff: http://git-wip-us.apache.org/repos/asf/marmotta/diff/14e522d9

Branch: refs/heads/ldp
Commit: 14e522d9c216c951f50fb7ac5105a37d366f7035
Parents: c684a1b
Author: Sergio Fernández <wi...@apache.org>
Authored: Thu Jun 12 20:02:45 2014 +0200
Committer: Sergio Fernández <wi...@apache.org>
Committed: Thu Jun 12 20:02:45 2014 +0200

----------------------------------------------------------------------
 .../marmotta/platform/ldp/webservices/LdpWebServiceTest.java  | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/marmotta/blob/14e522d9/platform/marmotta-ldp/src/test/java/org/apache/marmotta/platform/ldp/webservices/LdpWebServiceTest.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-ldp/src/test/java/org/apache/marmotta/platform/ldp/webservices/LdpWebServiceTest.java b/platform/marmotta-ldp/src/test/java/org/apache/marmotta/platform/ldp/webservices/LdpWebServiceTest.java
index 8cd5c69..3446649 100644
--- a/platform/marmotta-ldp/src/test/java/org/apache/marmotta/platform/ldp/webservices/LdpWebServiceTest.java
+++ b/platform/marmotta-ldp/src/test/java/org/apache/marmotta/platform/ldp/webservices/LdpWebServiceTest.java
@@ -74,7 +74,7 @@ public class LdpWebServiceTest {
 
     @AfterClass
     public static void shutdown() {
-        //marmotta.shutdown();
+        marmotta.shutdown();
         marmotta = null;
         testResourceTTL = null;
     }
@@ -309,9 +309,4 @@ public class LdpWebServiceTest {
             .post(container);
     }
 
-    @AfterClass
-    public static void tearDown() {
-        marmotta.shutdown();
-    }
-
 }


[077/100] [abbrv] git commit: added option to skip integration tests

Posted by wi...@apache.org.
added option to skip integration tests


Project: http://git-wip-us.apache.org/repos/asf/marmotta/repo
Commit: http://git-wip-us.apache.org/repos/asf/marmotta/commit/6c47f775
Tree: http://git-wip-us.apache.org/repos/asf/marmotta/tree/6c47f775
Diff: http://git-wip-us.apache.org/repos/asf/marmotta/diff/6c47f775

Branch: refs/heads/ldp
Commit: 6c47f775da5e2d975cef6d91a76c4a5f10fc38a3
Parents: 4483644
Author: Sebastian Schaffert <ss...@apache.org>
Authored: Thu Apr 10 10:11:40 2014 +0200
Committer: Sebastian Schaffert <ss...@apache.org>
Committed: Thu Apr 10 10:11:40 2014 +0200

----------------------------------------------------------------------
 build/archetypes/marmotta-archetype-module/pom.xml | 3 +++
 build/archetypes/marmotta-archetype-webapp/pom.xml | 3 +++
 2 files changed, 6 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/marmotta/blob/6c47f775/build/archetypes/marmotta-archetype-module/pom.xml
----------------------------------------------------------------------
diff --git a/build/archetypes/marmotta-archetype-module/pom.xml b/build/archetypes/marmotta-archetype-module/pom.xml
index f5301aa..a11300c 100644
--- a/build/archetypes/marmotta-archetype-module/pom.xml
+++ b/build/archetypes/marmotta-archetype-module/pom.xml
@@ -88,6 +88,9 @@
                 <plugin>
                     <artifactId>maven-archetype-plugin</artifactId>
                     <version>2.2</version>
+                    <configuration>
+                        <skip>${skipITs}</skip>
+                    </configuration>
                 </plugin>
             </plugins>
         </pluginManagement>

http://git-wip-us.apache.org/repos/asf/marmotta/blob/6c47f775/build/archetypes/marmotta-archetype-webapp/pom.xml
----------------------------------------------------------------------
diff --git a/build/archetypes/marmotta-archetype-webapp/pom.xml b/build/archetypes/marmotta-archetype-webapp/pom.xml
index 14aff1b..7c6b789 100644
--- a/build/archetypes/marmotta-archetype-webapp/pom.xml
+++ b/build/archetypes/marmotta-archetype-webapp/pom.xml
@@ -85,6 +85,9 @@
                 <plugin>
                     <artifactId>maven-archetype-plugin</artifactId>
                     <version>2.2</version>
+                    <configuration>
+                        <skip>${skipITs}</skip>
+                    </configuration>
                 </plugin>
             </plugins>
         </pluginManagement>


[079/100] [abbrv] git commit: updated the tomcatversion used for the installer

Posted by wi...@apache.org.
updated the tomcatversion used for the installer


Project: http://git-wip-us.apache.org/repos/asf/marmotta/repo
Commit: http://git-wip-us.apache.org/repos/asf/marmotta/commit/477ccd3d
Tree: http://git-wip-us.apache.org/repos/asf/marmotta/tree/477ccd3d
Diff: http://git-wip-us.apache.org/repos/asf/marmotta/diff/477ccd3d

Branch: refs/heads/ldp
Commit: 477ccd3de5adc7778be641ba87527fc3b13f5eb1
Parents: e9d8aad
Author: Sergio Fernández <wi...@apache.org>
Authored: Fri Apr 11 16:25:48 2014 +0200
Committer: Sergio Fernández <wi...@apache.org>
Committed: Fri Apr 11 16:25:48 2014 +0200

----------------------------------------------------------------------
 launchers/marmotta-installer/pom.xml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/marmotta/blob/477ccd3d/launchers/marmotta-installer/pom.xml
----------------------------------------------------------------------
diff --git a/launchers/marmotta-installer/pom.xml b/launchers/marmotta-installer/pom.xml
index ec13351..9c57a19 100644
--- a/launchers/marmotta-installer/pom.xml
+++ b/launchers/marmotta-installer/pom.xml
@@ -36,7 +36,7 @@
         <stagingDir>${project.build.directory}/installer</stagingDir>
 
         <!-- these are replaced in installer files -->
-        <TOMCAT_VERSION>7.0.39</TOMCAT_VERSION>
+        <TOMCAT_VERSION>7.0.53</TOMCAT_VERSION>
         <MARMOTTA_VERSION>${project.version}</MARMOTTA_VERSION>
         <MARMOTTA_ROOT>${project.basedir}/../../</MARMOTTA_ROOT>
     </properties>
@@ -259,7 +259,7 @@
                                     <url>http://archive.apache.org/dist/tomcat/tomcat-7/v${TOMCAT_VERSION}/bin/apache-tomcat-${TOMCAT_VERSION}.zip</url>
                                     <unpack>false</unpack>
                                     <outputDirectory>${stagingDir}/lib</outputDirectory>
-                                    <md5>30c6adc5b537be4bd098a4b30b5385a5</md5>
+                                    <md5>e819542bf313c3a5e0c1ad03c15880b6</md5>
                                 </configuration>
                             </execution>
                         </executions>


[055/100] [abbrv] git commit: fixed minor detail serializing prefix mappings to rdfa

Posted by wi...@apache.org.
fixed minor detail serializing prefix mappings to rdfa


Project: http://git-wip-us.apache.org/repos/asf/marmotta/repo
Commit: http://git-wip-us.apache.org/repos/asf/marmotta/commit/97403295
Tree: http://git-wip-us.apache.org/repos/asf/marmotta/tree/97403295
Diff: http://git-wip-us.apache.org/repos/asf/marmotta/diff/97403295

Branch: refs/heads/ldp
Commit: 974032953536dd07443966e615b9724bbec25ee3
Parents: 89fe9d4
Author: Sergio Fernández <wi...@apache.org>
Authored: Tue Apr 8 10:46:18 2014 +0200
Committer: Sergio Fernández <wi...@apache.org>
Committed: Tue Apr 8 10:46:18 2014 +0200

----------------------------------------------------------------------
 .../core/services/prefix/PrefixServiceImpl.java | 30 ++++++++++----------
 1 file changed, 15 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/marmotta/blob/97403295/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/prefix/PrefixServiceImpl.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/prefix/PrefixServiceImpl.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/prefix/PrefixServiceImpl.java
index b26afe3..ba3ab78 100644
--- a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/prefix/PrefixServiceImpl.java
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/prefix/PrefixServiceImpl.java
@@ -38,9 +38,8 @@ import com.google.common.collect.HashBiMap;
 
 /**
  * Prefix Manager default implementation
- * 
+ *
  * @author Sergio Fernández
- * 
  */
 @ApplicationScoped
 public class PrefixServiceImpl implements PrefixService {
@@ -51,7 +50,7 @@ public class PrefixServiceImpl implements PrefixService {
     private Logger log;
 
     @Inject
-    private ConfigurationService  configurationService;
+    private ConfigurationService configurationService;
 
     private BiMap<String, String> cache;
 
@@ -127,17 +126,17 @@ public class PrefixServiceImpl implements PrefixService {
     public Map<String, String> getMappings() {
         return Collections.unmodifiableMap(cache);
     }
-    
-	@Override
-	public boolean remove(String prefix) {
-		if (cache.containsKey(prefix)) {
-			cache.remove(prefix);
-			configurationService.removeConfiguration(CONFIGURATION_PREFIX + "." + prefix);
-			return true;
-		} else {
-			return false;
-		}
-	}
+
+    @Override
+    public boolean remove(String prefix) {
+        if (cache.containsKey(prefix)) {
+            cache.remove(prefix);
+            configurationService.removeConfiguration(CONFIGURATION_PREFIX + "." + prefix);
+            return true;
+        } else {
+            return false;
+        }
+    }
 
     @Override
     public boolean containsPrefix(String prefix) {
@@ -180,8 +179,9 @@ public class PrefixServiceImpl implements PrefixService {
     public String serializePrefixMapping() {
         StringBuffer sb = new StringBuffer();
         for (Map.Entry<String, String> mapping : cache.entrySet()) {
-            sb.append("\n").append(mapping.getKey()).append(": ").append(mapping.getValue()).append(" ");
+            sb.append(mapping.getKey()).append(": ").append(mapping.getValue()).append("\n");
         }
+        sb.setLength(sb.length() - 1);
         return sb.toString();
     }
 


[091/100] [abbrv] git commit: prepare for next development iteration (3.2.1)

Posted by wi...@apache.org.
prepare for next development iteration (3.2.1)


Project: http://git-wip-us.apache.org/repos/asf/marmotta/repo
Commit: http://git-wip-us.apache.org/repos/asf/marmotta/commit/5e385b5f
Tree: http://git-wip-us.apache.org/repos/asf/marmotta/tree/5e385b5f
Diff: http://git-wip-us.apache.org/repos/asf/marmotta/diff/5e385b5f

Branch: refs/heads/ldp
Commit: 5e385b5f0ec68722d77d7800109dd407d4655e4c
Parents: f5b5cf0
Author: Jakob Frank <ja...@apache.org>
Authored: Mon May 19 14:40:00 2014 +0200
Committer: Jakob Frank <ja...@apache.org>
Committed: Mon May 19 14:40:00 2014 +0200

----------------------------------------------------------------------
 build/archetypes/marmotta-archetype-module/pom.xml               | 2 +-
 build/archetypes/marmotta-archetype-webapp/pom.xml               | 2 +-
 build/archetypes/pom.xml                                         | 2 +-
 build/checkstyle-resources/pom.xml                               | 2 +-
 build/dependency-resource-supplement/pom.xml                     | 2 +-
 build/plugins/buildinfo-maven-plugin/pom.xml                     | 2 +-
 build/plugins/marmotta-maven-plugin/pom.xml                      | 2 +-
 build/plugins/pom.xml                                            | 2 +-
 build/plugins/refpack-maven-plugin/pom.xml                       | 2 +-
 build/plugins/repocheck-maven-plugin/pom.xml                     | 2 +-
 build/pom.xml                                                    | 2 +-
 client/marmotta-client-java/pom.xml                              | 2 +-
 client/marmotta-client-js-sample-webapp/pom.xml                  | 2 +-
 client/marmotta-client-js/pom.xml                                | 2 +-
 client/marmotta-client-php/pom.xml                               | 2 +-
 client/pom.xml                                                   | 2 +-
 commons/marmotta-commons/pom.xml                                 | 2 +-
 commons/marmotta-sesame-tools/marmotta-model-vocabs/pom.xml      | 2 +-
 commons/marmotta-sesame-tools/marmotta-rio-api/pom.xml           | 2 +-
 commons/marmotta-sesame-tools/marmotta-rio-ical/pom.xml          | 2 +-
 commons/marmotta-sesame-tools/marmotta-rio-rss/pom.xml           | 2 +-
 commons/marmotta-sesame-tools/marmotta-rio-vcard/pom.xml         | 2 +-
 commons/marmotta-sesame-tools/marmotta-sail-contextaware/pom.xml | 2 +-
 commons/marmotta-sesame-tools/marmotta-sail-transactions/pom.xml | 2 +-
 commons/marmotta-sesame-tools/marmotta-sesame-matchers/pom.xml   | 2 +-
 commons/marmotta-sesame-tools/marmotta-util-facading/pom.xml     | 2 +-
 commons/marmotta-sesame-tools/marmotta-util-filter/pom.xml       | 2 +-
 commons/marmotta-sesame-tools/marmotta-util-rdfpatch/pom.xml     | 2 +-
 commons/marmotta-sesame-tools/marmotta-util-tripletable/pom.xml  | 2 +-
 commons/marmotta-sesame-tools/pom.xml                            | 2 +-
 commons/pom.xml                                                  | 2 +-
 extras/pom.xml                                                   | 2 +-
 extras/webjars/codemirror/pom.xml                                | 2 +-
 extras/webjars/pom.xml                                           | 2 +-
 extras/webjars/strftime/pom.xml                                  | 2 +-
 launchers/marmotta-installer/pom.xml                             | 2 +-
 launchers/marmotta-splash/pom.xml                                | 2 +-
 launchers/marmotta-webapp/pom.xml                                | 2 +-
 launchers/pom.xml                                                | 2 +-
 libraries/kiwi/kiwi-caching-ehcache/pom.xml                      | 2 +-
 libraries/kiwi/kiwi-caching-hazelcast/pom.xml                    | 2 +-
 libraries/kiwi/kiwi-caching-infinispan/pom.xml                   | 2 +-
 libraries/kiwi/kiwi-loader/pom.xml                               | 2 +-
 libraries/kiwi/kiwi-reasoner/pom.xml                             | 2 +-
 libraries/kiwi/kiwi-sparql/pom.xml                               | 2 +-
 libraries/kiwi/kiwi-triplestore/pom.xml                          | 2 +-
 libraries/kiwi/kiwi-versioning/pom.xml                           | 2 +-
 libraries/kiwi/pom.xml                                           | 2 +-
 libraries/ldcache/ldcache-api/pom.xml                            | 2 +-
 libraries/ldcache/ldcache-backend-file/pom.xml                   | 2 +-
 libraries/ldcache/ldcache-backend-infinispan/pom.xml             | 2 +-
 libraries/ldcache/ldcache-backend-kiwi/pom.xml                   | 2 +-
 libraries/ldcache/ldcache-core/pom.xml                           | 2 +-
 libraries/ldcache/ldcache-sail-generic/pom.xml                   | 2 +-
 libraries/ldcache/ldcache-sail-kiwi/pom.xml                      | 2 +-
 libraries/ldcache/pom.xml                                        | 2 +-
 libraries/ldclient/ldclient-api/pom.xml                          | 2 +-
 libraries/ldclient/ldclient-core/pom.xml                         | 2 +-
 libraries/ldclient/ldclient-provider-facebook/pom.xml            | 2 +-
 libraries/ldclient/ldclient-provider-freebase/pom.xml            | 2 +-
 libraries/ldclient/ldclient-provider-html/pom.xml                | 2 +-
 libraries/ldclient/ldclient-provider-ldap/pom.xml                | 2 +-
 libraries/ldclient/ldclient-provider-mediawiki/pom.xml           | 2 +-
 libraries/ldclient/ldclient-provider-phpbb/pom.xml               | 2 +-
 libraries/ldclient/ldclient-provider-rdf/pom.xml                 | 2 +-
 libraries/ldclient/ldclient-provider-rdfa/pom.xml                | 2 +-
 libraries/ldclient/ldclient-provider-vimeo/pom.xml               | 2 +-
 libraries/ldclient/ldclient-provider-xml/pom.xml                 | 2 +-
 libraries/ldclient/ldclient-provider-youtube/pom.xml             | 2 +-
 libraries/ldclient/pom.xml                                       | 2 +-
 libraries/ldpath/ldpath-api/pom.xml                              | 2 +-
 libraries/ldpath/ldpath-backend-file/pom.xml                     | 2 +-
 libraries/ldpath/ldpath-backend-jena/pom.xml                     | 2 +-
 libraries/ldpath/ldpath-backend-linkeddata/pom.xml               | 2 +-
 libraries/ldpath/ldpath-backend-sesame/pom.xml                   | 2 +-
 libraries/ldpath/ldpath-core-bundle/pom.xml                      | 2 +-
 libraries/ldpath/ldpath-core/pom.xml                             | 2 +-
 libraries/ldpath/ldpath-functions-collections/pom.xml            | 2 +-
 libraries/ldpath/ldpath-functions-date/pom.xml                   | 2 +-
 libraries/ldpath/ldpath-functions-html/pom.xml                   | 2 +-
 libraries/ldpath/ldpath-functions-math/pom.xml                   | 2 +-
 libraries/ldpath/ldpath-functions-text/pom.xml                   | 2 +-
 libraries/ldpath/ldpath-functions-xml/pom.xml                    | 2 +-
 libraries/ldpath/ldpath-template-linkeddata/pom.xml              | 2 +-
 libraries/ldpath/ldpath-template/pom.xml                         | 2 +-
 libraries/ldpath/pom.xml                                         | 2 +-
 libraries/pom.xml                                                | 2 +-
 loader/marmotta-loader-berkeley/pom.xml                          | 2 +-
 loader/marmotta-loader-core/pom.xml                              | 2 +-
 loader/marmotta-loader-hbase/pom.xml                             | 2 +-
 loader/marmotta-loader-kiwi/pom.xml                              | 2 +-
 loader/marmotta-loader-titan/pom.xml                             | 2 +-
 loader/pom.xml                                                   | 2 +-
 parent/pom.xml                                                   | 2 +-
 platform/backends/marmotta-backend-bigdata/pom.xml               | 2 +-
 platform/backends/marmotta-backend-http/pom.xml                  | 2 +-
 platform/backends/marmotta-backend-kiwi/pom.xml                  | 2 +-
 platform/backends/marmotta-backend-memory/pom.xml                | 2 +-
 platform/backends/marmotta-backend-native/pom.xml                | 2 +-
 platform/backends/marmotta-backend-sparql/pom.xml                | 2 +-
 platform/backends/marmotta-backend-titan/pom.xml                 | 2 +-
 platform/backends/pom.xml                                        | 2 +-
 platform/ldcache/marmotta-ldcache-common/pom.xml                 | 2 +-
 platform/ldcache/marmotta-ldcache-file/pom.xml                   | 2 +-
 platform/ldcache/marmotta-ldcache-kiwi/pom.xml                   | 2 +-
 platform/ldcache/pom.xml                                         | 2 +-
 platform/marmotta-core/pom.xml                                   | 2 +-
 platform/marmotta-ldp/pom.xml                                    | 2 +-
 platform/marmotta-ldpath/pom.xml                                 | 2 +-
 platform/marmotta-reasoner-kiwi/pom.xml                          | 2 +-
 platform/marmotta-security/pom.xml                               | 2 +-
 platform/marmotta-sparql/pom.xml                                 | 2 +-
 platform/marmotta-user/pom.xml                                   | 2 +-
 platform/marmotta-versioning-common/pom.xml                      | 2 +-
 platform/marmotta-versioning-kiwi/pom.xml                        | 2 +-
 platform/marmotta-zookeeper/pom.xml                              | 2 +-
 platform/pom.xml                                                 | 2 +-
 pom.xml                                                          | 2 +-
 118 files changed, 118 insertions(+), 118 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/marmotta/blob/5e385b5f/build/archetypes/marmotta-archetype-module/pom.xml
----------------------------------------------------------------------
diff --git a/build/archetypes/marmotta-archetype-module/pom.xml b/build/archetypes/marmotta-archetype-module/pom.xml
index 7b0e110..f7837dd 100644
--- a/build/archetypes/marmotta-archetype-module/pom.xml
+++ b/build/archetypes/marmotta-archetype-module/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.2.1-SNAPSHOT</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/5e385b5f/build/archetypes/marmotta-archetype-webapp/pom.xml
----------------------------------------------------------------------
diff --git a/build/archetypes/marmotta-archetype-webapp/pom.xml b/build/archetypes/marmotta-archetype-webapp/pom.xml
index 88dd566..c8746ea 100644
--- a/build/archetypes/marmotta-archetype-webapp/pom.xml
+++ b/build/archetypes/marmotta-archetype-webapp/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.2.1-SNAPSHOT</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/5e385b5f/build/archetypes/pom.xml
----------------------------------------------------------------------
diff --git a/build/archetypes/pom.xml b/build/archetypes/pom.xml
index 3bbb7b5..5a97e23 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.2.0</version>
+        <version>3.2.1-SNAPSHOT</version>
         <relativePath>../../parent</relativePath>
     </parent>
     <artifactId>archetypes-reactor</artifactId>

http://git-wip-us.apache.org/repos/asf/marmotta/blob/5e385b5f/build/checkstyle-resources/pom.xml
----------------------------------------------------------------------
diff --git a/build/checkstyle-resources/pom.xml b/build/checkstyle-resources/pom.xml
index 6bcf91f..9d1142e 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.2.0</version>
+        <version>3.2.1-SNAPSHOT</version>
         <relativePath>../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/5e385b5f/build/dependency-resource-supplement/pom.xml
----------------------------------------------------------------------
diff --git a/build/dependency-resource-supplement/pom.xml b/build/dependency-resource-supplement/pom.xml
index 70be603..c196b30 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.2.0</version>
+        <version>3.2.1-SNAPSHOT</version>
         <relativePath>../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/5e385b5f/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 757a77d..72bc6e1 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.2.0</version>
+        <version>3.2.1-SNAPSHOT</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/5e385b5f/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 3e3437f..bf4e780 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.2.0</version>
+        <version>3.2.1-SNAPSHOT</version>
         <relativePath>../</relativePath>
         <artifactId>plugins-reactor</artifactId>
     </parent>

http://git-wip-us.apache.org/repos/asf/marmotta/blob/5e385b5f/build/plugins/pom.xml
----------------------------------------------------------------------
diff --git a/build/plugins/pom.xml b/build/plugins/pom.xml
index 4a9bdf6..defe211 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.2.0</version>
+        <version>3.2.1-SNAPSHOT</version>
         <relativePath>../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/5e385b5f/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 67f99ae..eb55da8 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.2.0</version>
+        <version>3.2.1-SNAPSHOT</version>
         <artifactId>plugins-reactor</artifactId>
         <relativePath>../</relativePath>
     </parent>

http://git-wip-us.apache.org/repos/asf/marmotta/blob/5e385b5f/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 b0bfa46..f34c78e 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.2.0</version>
+        <version>3.2.1-SNAPSHOT</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/marmotta/blob/5e385b5f/build/pom.xml
----------------------------------------------------------------------
diff --git a/build/pom.xml b/build/pom.xml
index d6615c4..79c197e 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.2.0</version>
+        <version>3.2.1-SNAPSHOT</version>
         <relativePath>../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/5e385b5f/client/marmotta-client-java/pom.xml
----------------------------------------------------------------------
diff --git a/client/marmotta-client-java/pom.xml b/client/marmotta-client-java/pom.xml
index e35de4b..8ab5e99 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.2.0</version>
+        <version>3.2.1-SNAPSHOT</version>
         <relativePath>../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/5e385b5f/client/marmotta-client-js-sample-webapp/pom.xml
----------------------------------------------------------------------
diff --git a/client/marmotta-client-js-sample-webapp/pom.xml b/client/marmotta-client-js-sample-webapp/pom.xml
index bf16f50..8c20436 100644
--- a/client/marmotta-client-js-sample-webapp/pom.xml
+++ b/client/marmotta-client-js-sample-webapp/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0-SNAPSHOT</version>
+        <version>3.2.1-SNAPSHOT</version>
         <relativePath>../../parent/pom.xml</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/5e385b5f/client/marmotta-client-js/pom.xml
----------------------------------------------------------------------
diff --git a/client/marmotta-client-js/pom.xml b/client/marmotta-client-js/pom.xml
index 5319778..b87d0cc 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.2.0</version>
+        <version>3.2.1-SNAPSHOT</version>
         <relativePath>../../parent/pom.xml</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/5e385b5f/client/marmotta-client-php/pom.xml
----------------------------------------------------------------------
diff --git a/client/marmotta-client-php/pom.xml b/client/marmotta-client-php/pom.xml
index 7c35f3f..fc1692a 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.2.0-SNAPSHOT</version>
+        <version>3.2.1-SNAPSHOT</version>
         <relativePath>../../parent/pom.xml</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/5e385b5f/client/pom.xml
----------------------------------------------------------------------
diff --git a/client/pom.xml b/client/pom.xml
index a5e655b..cd02ecf 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.2.0</version>
+        <version>3.2.1-SNAPSHOT</version>
         <relativePath>../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/5e385b5f/commons/marmotta-commons/pom.xml
----------------------------------------------------------------------
diff --git a/commons/marmotta-commons/pom.xml b/commons/marmotta-commons/pom.xml
index 237e4a5..fcf9408 100644
--- a/commons/marmotta-commons/pom.xml
+++ b/commons/marmotta-commons/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.2.1-SNAPSHOT</version>
         <relativePath>../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/5e385b5f/commons/marmotta-sesame-tools/marmotta-model-vocabs/pom.xml
----------------------------------------------------------------------
diff --git a/commons/marmotta-sesame-tools/marmotta-model-vocabs/pom.xml b/commons/marmotta-sesame-tools/marmotta-model-vocabs/pom.xml
index 6d29685..d1875e8 100644
--- a/commons/marmotta-sesame-tools/marmotta-model-vocabs/pom.xml
+++ b/commons/marmotta-sesame-tools/marmotta-model-vocabs/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.2.1-SNAPSHOT</version>
         <relativePath>../../../parent/</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/5e385b5f/commons/marmotta-sesame-tools/marmotta-rio-api/pom.xml
----------------------------------------------------------------------
diff --git a/commons/marmotta-sesame-tools/marmotta-rio-api/pom.xml b/commons/marmotta-sesame-tools/marmotta-rio-api/pom.xml
index 0b7b2a0..0ac6929 100644
--- a/commons/marmotta-sesame-tools/marmotta-rio-api/pom.xml
+++ b/commons/marmotta-sesame-tools/marmotta-rio-api/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.2.1-SNAPSHOT</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/5e385b5f/commons/marmotta-sesame-tools/marmotta-rio-ical/pom.xml
----------------------------------------------------------------------
diff --git a/commons/marmotta-sesame-tools/marmotta-rio-ical/pom.xml b/commons/marmotta-sesame-tools/marmotta-rio-ical/pom.xml
index 28608f1..fde58e5 100644
--- a/commons/marmotta-sesame-tools/marmotta-rio-ical/pom.xml
+++ b/commons/marmotta-sesame-tools/marmotta-rio-ical/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.2.1-SNAPSHOT</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/5e385b5f/commons/marmotta-sesame-tools/marmotta-rio-rss/pom.xml
----------------------------------------------------------------------
diff --git a/commons/marmotta-sesame-tools/marmotta-rio-rss/pom.xml b/commons/marmotta-sesame-tools/marmotta-rio-rss/pom.xml
index 9d1539b..723ed9c 100644
--- a/commons/marmotta-sesame-tools/marmotta-rio-rss/pom.xml
+++ b/commons/marmotta-sesame-tools/marmotta-rio-rss/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.2.1-SNAPSHOT</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/5e385b5f/commons/marmotta-sesame-tools/marmotta-rio-vcard/pom.xml
----------------------------------------------------------------------
diff --git a/commons/marmotta-sesame-tools/marmotta-rio-vcard/pom.xml b/commons/marmotta-sesame-tools/marmotta-rio-vcard/pom.xml
index 698037e..8701992 100644
--- a/commons/marmotta-sesame-tools/marmotta-rio-vcard/pom.xml
+++ b/commons/marmotta-sesame-tools/marmotta-rio-vcard/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.2.1-SNAPSHOT</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/5e385b5f/commons/marmotta-sesame-tools/marmotta-sail-contextaware/pom.xml
----------------------------------------------------------------------
diff --git a/commons/marmotta-sesame-tools/marmotta-sail-contextaware/pom.xml b/commons/marmotta-sesame-tools/marmotta-sail-contextaware/pom.xml
index 42128aa..d67a722 100644
--- a/commons/marmotta-sesame-tools/marmotta-sail-contextaware/pom.xml
+++ b/commons/marmotta-sesame-tools/marmotta-sail-contextaware/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.2.1-SNAPSHOT</version>
         <relativePath>../../../parent/</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/5e385b5f/commons/marmotta-sesame-tools/marmotta-sail-transactions/pom.xml
----------------------------------------------------------------------
diff --git a/commons/marmotta-sesame-tools/marmotta-sail-transactions/pom.xml b/commons/marmotta-sesame-tools/marmotta-sail-transactions/pom.xml
index 4a24f91..0c47b6f 100644
--- a/commons/marmotta-sesame-tools/marmotta-sail-transactions/pom.xml
+++ b/commons/marmotta-sesame-tools/marmotta-sail-transactions/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.2.1-SNAPSHOT</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/5e385b5f/commons/marmotta-sesame-tools/marmotta-sesame-matchers/pom.xml
----------------------------------------------------------------------
diff --git a/commons/marmotta-sesame-tools/marmotta-sesame-matchers/pom.xml b/commons/marmotta-sesame-tools/marmotta-sesame-matchers/pom.xml
index f5a9e7a..3cf3e49 100644
--- a/commons/marmotta-sesame-tools/marmotta-sesame-matchers/pom.xml
+++ b/commons/marmotta-sesame-tools/marmotta-sesame-matchers/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.2.1-SNAPSHOT</version>
         <relativePath>../../../parent/</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/5e385b5f/commons/marmotta-sesame-tools/marmotta-util-facading/pom.xml
----------------------------------------------------------------------
diff --git a/commons/marmotta-sesame-tools/marmotta-util-facading/pom.xml b/commons/marmotta-sesame-tools/marmotta-util-facading/pom.xml
index 7babadb..f63c62e 100644
--- a/commons/marmotta-sesame-tools/marmotta-util-facading/pom.xml
+++ b/commons/marmotta-sesame-tools/marmotta-util-facading/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.2.1-SNAPSHOT</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/5e385b5f/commons/marmotta-sesame-tools/marmotta-util-filter/pom.xml
----------------------------------------------------------------------
diff --git a/commons/marmotta-sesame-tools/marmotta-util-filter/pom.xml b/commons/marmotta-sesame-tools/marmotta-util-filter/pom.xml
index 8f585eb..fa498f4 100644
--- a/commons/marmotta-sesame-tools/marmotta-util-filter/pom.xml
+++ b/commons/marmotta-sesame-tools/marmotta-util-filter/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.2.1-SNAPSHOT</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/5e385b5f/commons/marmotta-sesame-tools/marmotta-util-rdfpatch/pom.xml
----------------------------------------------------------------------
diff --git a/commons/marmotta-sesame-tools/marmotta-util-rdfpatch/pom.xml b/commons/marmotta-sesame-tools/marmotta-util-rdfpatch/pom.xml
index 6ed1b35..78ead76 100644
--- a/commons/marmotta-sesame-tools/marmotta-util-rdfpatch/pom.xml
+++ b/commons/marmotta-sesame-tools/marmotta-util-rdfpatch/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.2.1-SNAPSHOT</version>
         <relativePath>../../../parent/</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/5e385b5f/commons/marmotta-sesame-tools/marmotta-util-tripletable/pom.xml
----------------------------------------------------------------------
diff --git a/commons/marmotta-sesame-tools/marmotta-util-tripletable/pom.xml b/commons/marmotta-sesame-tools/marmotta-util-tripletable/pom.xml
index cdde08a..4244ffb 100644
--- a/commons/marmotta-sesame-tools/marmotta-util-tripletable/pom.xml
+++ b/commons/marmotta-sesame-tools/marmotta-util-tripletable/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.2.1-SNAPSHOT</version>
         <relativePath>../../../parent/</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/5e385b5f/commons/marmotta-sesame-tools/pom.xml
----------------------------------------------------------------------
diff --git a/commons/marmotta-sesame-tools/pom.xml b/commons/marmotta-sesame-tools/pom.xml
index edce64c..3b09b0e 100644
--- a/commons/marmotta-sesame-tools/pom.xml
+++ b/commons/marmotta-sesame-tools/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.2.1-SNAPSHOT</version>
         <relativePath>../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/5e385b5f/commons/pom.xml
----------------------------------------------------------------------
diff --git a/commons/pom.xml b/commons/pom.xml
index 3d9355f..fde1685 100644
--- a/commons/pom.xml
+++ b/commons/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.2.1-SNAPSHOT</version>
         <relativePath>../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/5e385b5f/extras/pom.xml
----------------------------------------------------------------------
diff --git a/extras/pom.xml b/extras/pom.xml
index e3b34af..22a5689 100644
--- a/extras/pom.xml
+++ b/extras/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.2.1-SNAPSHOT</version>
         <relativePath>../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/5e385b5f/extras/webjars/codemirror/pom.xml
----------------------------------------------------------------------
diff --git a/extras/webjars/codemirror/pom.xml b/extras/webjars/codemirror/pom.xml
index 0046a6e..efa0269 100644
--- a/extras/webjars/codemirror/pom.xml
+++ b/extras/webjars/codemirror/pom.xml
@@ -22,7 +22,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.2.1-SNAPSHOT</version>
         <relativePath>../../../parent/</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/5e385b5f/extras/webjars/pom.xml
----------------------------------------------------------------------
diff --git a/extras/webjars/pom.xml b/extras/webjars/pom.xml
index fde39f4..d6082af 100644
--- a/extras/webjars/pom.xml
+++ b/extras/webjars/pom.xml
@@ -22,7 +22,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.2.1-SNAPSHOT</version>
         <relativePath>../../parent/</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/5e385b5f/extras/webjars/strftime/pom.xml
----------------------------------------------------------------------
diff --git a/extras/webjars/strftime/pom.xml b/extras/webjars/strftime/pom.xml
index fcf0455..0aecf93 100644
--- a/extras/webjars/strftime/pom.xml
+++ b/extras/webjars/strftime/pom.xml
@@ -22,7 +22,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.2.1-SNAPSHOT</version>
         <relativePath>../../../parent/</relativePath> 
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/5e385b5f/launchers/marmotta-installer/pom.xml
----------------------------------------------------------------------
diff --git a/launchers/marmotta-installer/pom.xml b/launchers/marmotta-installer/pom.xml
index 35ca306..6b3c498 100644
--- a/launchers/marmotta-installer/pom.xml
+++ b/launchers/marmotta-installer/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.2.1-SNAPSHOT</version>
         <relativePath>../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/5e385b5f/launchers/marmotta-splash/pom.xml
----------------------------------------------------------------------
diff --git a/launchers/marmotta-splash/pom.xml b/launchers/marmotta-splash/pom.xml
index 9dbb127..c1bb640 100644
--- a/launchers/marmotta-splash/pom.xml
+++ b/launchers/marmotta-splash/pom.xml
@@ -22,7 +22,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.2.1-SNAPSHOT</version>
         <relativePath>../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/5e385b5f/launchers/marmotta-webapp/pom.xml
----------------------------------------------------------------------
diff --git a/launchers/marmotta-webapp/pom.xml b/launchers/marmotta-webapp/pom.xml
index 5f1ed2e..8bde6bf 100644
--- a/launchers/marmotta-webapp/pom.xml
+++ b/launchers/marmotta-webapp/pom.xml
@@ -22,7 +22,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.2.1-SNAPSHOT</version>
         <relativePath>../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/5e385b5f/launchers/pom.xml
----------------------------------------------------------------------
diff --git a/launchers/pom.xml b/launchers/pom.xml
index e0bbb1b..f6ca912 100644
--- a/launchers/pom.xml
+++ b/launchers/pom.xml
@@ -22,7 +22,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.2.1-SNAPSHOT</version>
         <relativePath>../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/5e385b5f/libraries/kiwi/kiwi-caching-ehcache/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-caching-ehcache/pom.xml b/libraries/kiwi/kiwi-caching-ehcache/pom.xml
index 4cb3dfa..daad581 100644
--- a/libraries/kiwi/kiwi-caching-ehcache/pom.xml
+++ b/libraries/kiwi/kiwi-caching-ehcache/pom.xml
@@ -22,7 +22,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>kiwi-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.2.1-SNAPSHOT</version>
     </parent>
 
     <artifactId>kiwi-caching-ehcache</artifactId>

http://git-wip-us.apache.org/repos/asf/marmotta/blob/5e385b5f/libraries/kiwi/kiwi-caching-hazelcast/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-caching-hazelcast/pom.xml b/libraries/kiwi/kiwi-caching-hazelcast/pom.xml
index b07b6c9..8a6654a 100644
--- a/libraries/kiwi/kiwi-caching-hazelcast/pom.xml
+++ b/libraries/kiwi/kiwi-caching-hazelcast/pom.xml
@@ -22,7 +22,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>kiwi-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.2.1-SNAPSHOT</version>
     </parent>
 
     <artifactId>kiwi-caching-hazelcast</artifactId>

http://git-wip-us.apache.org/repos/asf/marmotta/blob/5e385b5f/libraries/kiwi/kiwi-caching-infinispan/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-caching-infinispan/pom.xml b/libraries/kiwi/kiwi-caching-infinispan/pom.xml
index 61e649a..0353ec4 100644
--- a/libraries/kiwi/kiwi-caching-infinispan/pom.xml
+++ b/libraries/kiwi/kiwi-caching-infinispan/pom.xml
@@ -22,7 +22,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>kiwi-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.2.1-SNAPSHOT</version>
         <relativePath>../</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/5e385b5f/libraries/kiwi/kiwi-loader/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-loader/pom.xml b/libraries/kiwi/kiwi-loader/pom.xml
index d07fe52..b153749 100644
--- a/libraries/kiwi/kiwi-loader/pom.xml
+++ b/libraries/kiwi/kiwi-loader/pom.xml
@@ -14,7 +14,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>kiwi-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.2.1-SNAPSHOT</version>
     </parent>
 
     <artifactId>kiwi-loader</artifactId>

http://git-wip-us.apache.org/repos/asf/marmotta/blob/5e385b5f/libraries/kiwi/kiwi-reasoner/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-reasoner/pom.xml b/libraries/kiwi/kiwi-reasoner/pom.xml
index ddbed48..7618c45 100644
--- a/libraries/kiwi/kiwi-reasoner/pom.xml
+++ b/libraries/kiwi/kiwi-reasoner/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>kiwi-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.2.1-SNAPSHOT</version>
         <relativePath>../</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/5e385b5f/libraries/kiwi/kiwi-sparql/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-sparql/pom.xml b/libraries/kiwi/kiwi-sparql/pom.xml
index 0768ceb..097b13d 100644
--- a/libraries/kiwi/kiwi-sparql/pom.xml
+++ b/libraries/kiwi/kiwi-sparql/pom.xml
@@ -22,7 +22,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>kiwi-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.2.1-SNAPSHOT</version>
         <relativePath>../</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/5e385b5f/libraries/kiwi/kiwi-triplestore/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-triplestore/pom.xml b/libraries/kiwi/kiwi-triplestore/pom.xml
index 8be0f8f..ae484e6 100644
--- a/libraries/kiwi/kiwi-triplestore/pom.xml
+++ b/libraries/kiwi/kiwi-triplestore/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>kiwi-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.2.1-SNAPSHOT</version>
         <relativePath>../</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/5e385b5f/libraries/kiwi/kiwi-versioning/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-versioning/pom.xml b/libraries/kiwi/kiwi-versioning/pom.xml
index cf30946..4c553ea 100644
--- a/libraries/kiwi/kiwi-versioning/pom.xml
+++ b/libraries/kiwi/kiwi-versioning/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>kiwi-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.2.1-SNAPSHOT</version>
         <relativePath>../</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/5e385b5f/libraries/kiwi/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/kiwi/pom.xml b/libraries/kiwi/pom.xml
index 694f270..72dcfdd 100644
--- a/libraries/kiwi/pom.xml
+++ b/libraries/kiwi/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.2.1-SNAPSHOT</version>
         <relativePath>../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/5e385b5f/libraries/ldcache/ldcache-api/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldcache/ldcache-api/pom.xml b/libraries/ldcache/ldcache-api/pom.xml
index fa5bcea..cc946a5 100644
--- a/libraries/ldcache/ldcache-api/pom.xml
+++ b/libraries/ldcache/ldcache-api/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.2.1-SNAPSHOT</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/5e385b5f/libraries/ldcache/ldcache-backend-file/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldcache/ldcache-backend-file/pom.xml b/libraries/ldcache/ldcache-backend-file/pom.xml
index e9abeef..15e8541 100644
--- a/libraries/ldcache/ldcache-backend-file/pom.xml
+++ b/libraries/ldcache/ldcache-backend-file/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.2.1-SNAPSHOT</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/5e385b5f/libraries/ldcache/ldcache-backend-infinispan/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldcache/ldcache-backend-infinispan/pom.xml b/libraries/ldcache/ldcache-backend-infinispan/pom.xml
index 873511e..4951001 100644
--- a/libraries/ldcache/ldcache-backend-infinispan/pom.xml
+++ b/libraries/ldcache/ldcache-backend-infinispan/pom.xml
@@ -22,7 +22,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.2.1-SNAPSHOT</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/5e385b5f/libraries/ldcache/ldcache-backend-kiwi/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldcache/ldcache-backend-kiwi/pom.xml b/libraries/ldcache/ldcache-backend-kiwi/pom.xml
index ca78593..1dec33b 100644
--- a/libraries/ldcache/ldcache-backend-kiwi/pom.xml
+++ b/libraries/ldcache/ldcache-backend-kiwi/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.2.1-SNAPSHOT</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/5e385b5f/libraries/ldcache/ldcache-core/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldcache/ldcache-core/pom.xml b/libraries/ldcache/ldcache-core/pom.xml
index f6c5e27..cccd997 100644
--- a/libraries/ldcache/ldcache-core/pom.xml
+++ b/libraries/ldcache/ldcache-core/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.2.1-SNAPSHOT</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/5e385b5f/libraries/ldcache/ldcache-sail-generic/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldcache/ldcache-sail-generic/pom.xml b/libraries/ldcache/ldcache-sail-generic/pom.xml
index 78ad47f..d955031 100644
--- a/libraries/ldcache/ldcache-sail-generic/pom.xml
+++ b/libraries/ldcache/ldcache-sail-generic/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.2.1-SNAPSHOT</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/5e385b5f/libraries/ldcache/ldcache-sail-kiwi/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldcache/ldcache-sail-kiwi/pom.xml b/libraries/ldcache/ldcache-sail-kiwi/pom.xml
index 34fa855..cceac09 100644
--- a/libraries/ldcache/ldcache-sail-kiwi/pom.xml
+++ b/libraries/ldcache/ldcache-sail-kiwi/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.2.1-SNAPSHOT</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/5e385b5f/libraries/ldcache/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldcache/pom.xml b/libraries/ldcache/pom.xml
index f184f63..eb1489b 100644
--- a/libraries/ldcache/pom.xml
+++ b/libraries/ldcache/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.2.1-SNAPSHOT</version>
         <relativePath>../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/5e385b5f/libraries/ldclient/ldclient-api/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldclient/ldclient-api/pom.xml b/libraries/ldclient/ldclient-api/pom.xml
index c672943..ce4b3e0 100644
--- a/libraries/ldclient/ldclient-api/pom.xml
+++ b/libraries/ldclient/ldclient-api/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.2.1-SNAPSHOT</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/5e385b5f/libraries/ldclient/ldclient-core/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldclient/ldclient-core/pom.xml b/libraries/ldclient/ldclient-core/pom.xml
index ac24d0b..4e02d86 100644
--- a/libraries/ldclient/ldclient-core/pom.xml
+++ b/libraries/ldclient/ldclient-core/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.2.1-SNAPSHOT</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/5e385b5f/libraries/ldclient/ldclient-provider-facebook/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldclient/ldclient-provider-facebook/pom.xml b/libraries/ldclient/ldclient-provider-facebook/pom.xml
index e249a0a..e3258b8 100644
--- a/libraries/ldclient/ldclient-provider-facebook/pom.xml
+++ b/libraries/ldclient/ldclient-provider-facebook/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.2.1-SNAPSHOT</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/5e385b5f/libraries/ldclient/ldclient-provider-freebase/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldclient/ldclient-provider-freebase/pom.xml b/libraries/ldclient/ldclient-provider-freebase/pom.xml
index 59b33ed..ecc3fec 100644
--- a/libraries/ldclient/ldclient-provider-freebase/pom.xml
+++ b/libraries/ldclient/ldclient-provider-freebase/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.2.1-SNAPSHOT</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/5e385b5f/libraries/ldclient/ldclient-provider-html/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldclient/ldclient-provider-html/pom.xml b/libraries/ldclient/ldclient-provider-html/pom.xml
index 3040455..59bd397 100644
--- a/libraries/ldclient/ldclient-provider-html/pom.xml
+++ b/libraries/ldclient/ldclient-provider-html/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.2.1-SNAPSHOT</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/5e385b5f/libraries/ldclient/ldclient-provider-ldap/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldclient/ldclient-provider-ldap/pom.xml b/libraries/ldclient/ldclient-provider-ldap/pom.xml
index 45651fa..be76f60 100644
--- a/libraries/ldclient/ldclient-provider-ldap/pom.xml
+++ b/libraries/ldclient/ldclient-provider-ldap/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.2.1-SNAPSHOT</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/5e385b5f/libraries/ldclient/ldclient-provider-mediawiki/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldclient/ldclient-provider-mediawiki/pom.xml b/libraries/ldclient/ldclient-provider-mediawiki/pom.xml
index a1aca3d..911c09c 100644
--- a/libraries/ldclient/ldclient-provider-mediawiki/pom.xml
+++ b/libraries/ldclient/ldclient-provider-mediawiki/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.2.1-SNAPSHOT</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/5e385b5f/libraries/ldclient/ldclient-provider-phpbb/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldclient/ldclient-provider-phpbb/pom.xml b/libraries/ldclient/ldclient-provider-phpbb/pom.xml
index 7239d64..25307bd 100644
--- a/libraries/ldclient/ldclient-provider-phpbb/pom.xml
+++ b/libraries/ldclient/ldclient-provider-phpbb/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.2.1-SNAPSHOT</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/5e385b5f/libraries/ldclient/ldclient-provider-rdf/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldclient/ldclient-provider-rdf/pom.xml b/libraries/ldclient/ldclient-provider-rdf/pom.xml
index ad1166f..20fb2a4 100644
--- a/libraries/ldclient/ldclient-provider-rdf/pom.xml
+++ b/libraries/ldclient/ldclient-provider-rdf/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.2.1-SNAPSHOT</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/5e385b5f/libraries/ldclient/ldclient-provider-rdfa/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldclient/ldclient-provider-rdfa/pom.xml b/libraries/ldclient/ldclient-provider-rdfa/pom.xml
index f0bdddf..4a1b4fb 100644
--- a/libraries/ldclient/ldclient-provider-rdfa/pom.xml
+++ b/libraries/ldclient/ldclient-provider-rdfa/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.2.1-SNAPSHOT</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/5e385b5f/libraries/ldclient/ldclient-provider-vimeo/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldclient/ldclient-provider-vimeo/pom.xml b/libraries/ldclient/ldclient-provider-vimeo/pom.xml
index e1b12cf..41b9aa9 100644
--- a/libraries/ldclient/ldclient-provider-vimeo/pom.xml
+++ b/libraries/ldclient/ldclient-provider-vimeo/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.2.1-SNAPSHOT</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/5e385b5f/libraries/ldclient/ldclient-provider-xml/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldclient/ldclient-provider-xml/pom.xml b/libraries/ldclient/ldclient-provider-xml/pom.xml
index 8e63562..3f23cae 100644
--- a/libraries/ldclient/ldclient-provider-xml/pom.xml
+++ b/libraries/ldclient/ldclient-provider-xml/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.2.1-SNAPSHOT</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/5e385b5f/libraries/ldclient/ldclient-provider-youtube/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldclient/ldclient-provider-youtube/pom.xml b/libraries/ldclient/ldclient-provider-youtube/pom.xml
index 95727eb..13e25f7 100644
--- a/libraries/ldclient/ldclient-provider-youtube/pom.xml
+++ b/libraries/ldclient/ldclient-provider-youtube/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.2.1-SNAPSHOT</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/5e385b5f/libraries/ldclient/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldclient/pom.xml b/libraries/ldclient/pom.xml
index 0d9a53f..05b191c 100644
--- a/libraries/ldclient/pom.xml
+++ b/libraries/ldclient/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.2.1-SNAPSHOT</version>
         <relativePath>../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/5e385b5f/libraries/ldpath/ldpath-api/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-api/pom.xml b/libraries/ldpath/ldpath-api/pom.xml
index 2c5b5cb..e2078ff 100644
--- a/libraries/ldpath/ldpath-api/pom.xml
+++ b/libraries/ldpath/ldpath-api/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.2.1-SNAPSHOT</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/5e385b5f/libraries/ldpath/ldpath-backend-file/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-backend-file/pom.xml b/libraries/ldpath/ldpath-backend-file/pom.xml
index 6ba19ca..d27ba07 100644
--- a/libraries/ldpath/ldpath-backend-file/pom.xml
+++ b/libraries/ldpath/ldpath-backend-file/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.2.1-SNAPSHOT</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/5e385b5f/libraries/ldpath/ldpath-backend-jena/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-backend-jena/pom.xml b/libraries/ldpath/ldpath-backend-jena/pom.xml
index a5e91d6..14d5cf8 100644
--- a/libraries/ldpath/ldpath-backend-jena/pom.xml
+++ b/libraries/ldpath/ldpath-backend-jena/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.2.1-SNAPSHOT</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/5e385b5f/libraries/ldpath/ldpath-backend-linkeddata/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-backend-linkeddata/pom.xml b/libraries/ldpath/ldpath-backend-linkeddata/pom.xml
index 5848b48..e0856e3 100644
--- a/libraries/ldpath/ldpath-backend-linkeddata/pom.xml
+++ b/libraries/ldpath/ldpath-backend-linkeddata/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.2.1-SNAPSHOT</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/5e385b5f/libraries/ldpath/ldpath-backend-sesame/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-backend-sesame/pom.xml b/libraries/ldpath/ldpath-backend-sesame/pom.xml
index 3262375..3caf49c 100644
--- a/libraries/ldpath/ldpath-backend-sesame/pom.xml
+++ b/libraries/ldpath/ldpath-backend-sesame/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.2.1-SNAPSHOT</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/5e385b5f/libraries/ldpath/ldpath-core-bundle/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-core-bundle/pom.xml b/libraries/ldpath/ldpath-core-bundle/pom.xml
index fb57445..60dbe58 100644
--- a/libraries/ldpath/ldpath-core-bundle/pom.xml
+++ b/libraries/ldpath/ldpath-core-bundle/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.2.1-SNAPSHOT</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/5e385b5f/libraries/ldpath/ldpath-core/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-core/pom.xml b/libraries/ldpath/ldpath-core/pom.xml
index c963b0a..6734af7 100644
--- a/libraries/ldpath/ldpath-core/pom.xml
+++ b/libraries/ldpath/ldpath-core/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.2.1-SNAPSHOT</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/5e385b5f/libraries/ldpath/ldpath-functions-collections/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-functions-collections/pom.xml b/libraries/ldpath/ldpath-functions-collections/pom.xml
index dfa590b..b15e780 100644
--- a/libraries/ldpath/ldpath-functions-collections/pom.xml
+++ b/libraries/ldpath/ldpath-functions-collections/pom.xml
@@ -20,7 +20,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.2.1-SNAPSHOT</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/5e385b5f/libraries/ldpath/ldpath-functions-date/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-functions-date/pom.xml b/libraries/ldpath/ldpath-functions-date/pom.xml
index 98f1121..39efd42 100644
--- a/libraries/ldpath/ldpath-functions-date/pom.xml
+++ b/libraries/ldpath/ldpath-functions-date/pom.xml
@@ -20,7 +20,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.2.1-SNAPSHOT</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/5e385b5f/libraries/ldpath/ldpath-functions-html/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-functions-html/pom.xml b/libraries/ldpath/ldpath-functions-html/pom.xml
index 991f0b3..8740d79 100644
--- a/libraries/ldpath/ldpath-functions-html/pom.xml
+++ b/libraries/ldpath/ldpath-functions-html/pom.xml
@@ -19,7 +19,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.2.1-SNAPSHOT</version>
         <relativePath>../../../parent</relativePath>
     </parent>
     <modelVersion>4.0.0</modelVersion>

http://git-wip-us.apache.org/repos/asf/marmotta/blob/5e385b5f/libraries/ldpath/ldpath-functions-math/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-functions-math/pom.xml b/libraries/ldpath/ldpath-functions-math/pom.xml
index 3231efb..0c13dba 100644
--- a/libraries/ldpath/ldpath-functions-math/pom.xml
+++ b/libraries/ldpath/ldpath-functions-math/pom.xml
@@ -20,7 +20,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.2.1-SNAPSHOT</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/5e385b5f/libraries/ldpath/ldpath-functions-text/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-functions-text/pom.xml b/libraries/ldpath/ldpath-functions-text/pom.xml
index e7d08a0..59d1be7 100644
--- a/libraries/ldpath/ldpath-functions-text/pom.xml
+++ b/libraries/ldpath/ldpath-functions-text/pom.xml
@@ -20,7 +20,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.2.1-SNAPSHOT</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/5e385b5f/libraries/ldpath/ldpath-functions-xml/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-functions-xml/pom.xml b/libraries/ldpath/ldpath-functions-xml/pom.xml
index 7cc029c..91b76a2 100644
--- a/libraries/ldpath/ldpath-functions-xml/pom.xml
+++ b/libraries/ldpath/ldpath-functions-xml/pom.xml
@@ -19,7 +19,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.2.1-SNAPSHOT</version>
         <relativePath>../../../parent</relativePath>
     </parent>
     <modelVersion>4.0.0</modelVersion>

http://git-wip-us.apache.org/repos/asf/marmotta/blob/5e385b5f/libraries/ldpath/ldpath-template-linkeddata/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-template-linkeddata/pom.xml b/libraries/ldpath/ldpath-template-linkeddata/pom.xml
index 1bce32c..5e6b622 100644
--- a/libraries/ldpath/ldpath-template-linkeddata/pom.xml
+++ b/libraries/ldpath/ldpath-template-linkeddata/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.2.1-SNAPSHOT</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/5e385b5f/libraries/ldpath/ldpath-template/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-template/pom.xml b/libraries/ldpath/ldpath-template/pom.xml
index d1917ad..82b9137 100644
--- a/libraries/ldpath/ldpath-template/pom.xml
+++ b/libraries/ldpath/ldpath-template/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.2.1-SNAPSHOT</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/5e385b5f/libraries/ldpath/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldpath/pom.xml b/libraries/ldpath/pom.xml
index fab550e..5477b95 100644
--- a/libraries/ldpath/pom.xml
+++ b/libraries/ldpath/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.2.1-SNAPSHOT</version>
         <relativePath>../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/5e385b5f/libraries/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/pom.xml b/libraries/pom.xml
index 6ed6798..63c8a90 100644
--- a/libraries/pom.xml
+++ b/libraries/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.2.1-SNAPSHOT</version>
         <relativePath>../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/5e385b5f/loader/marmotta-loader-berkeley/pom.xml
----------------------------------------------------------------------
diff --git a/loader/marmotta-loader-berkeley/pom.xml b/loader/marmotta-loader-berkeley/pom.xml
index 5cb346a..0aaf517 100644
--- a/loader/marmotta-loader-berkeley/pom.xml
+++ b/loader/marmotta-loader-berkeley/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.2.1-SNAPSHOT</version>
         <relativePath>../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/5e385b5f/loader/marmotta-loader-core/pom.xml
----------------------------------------------------------------------
diff --git a/loader/marmotta-loader-core/pom.xml b/loader/marmotta-loader-core/pom.xml
index 83cebb4..052c5c2 100644
--- a/loader/marmotta-loader-core/pom.xml
+++ b/loader/marmotta-loader-core/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.2.1-SNAPSHOT</version>
         <relativePath>../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/5e385b5f/loader/marmotta-loader-hbase/pom.xml
----------------------------------------------------------------------
diff --git a/loader/marmotta-loader-hbase/pom.xml b/loader/marmotta-loader-hbase/pom.xml
index 27872d3..7660308 100644
--- a/loader/marmotta-loader-hbase/pom.xml
+++ b/loader/marmotta-loader-hbase/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.2.1-SNAPSHOT</version>
         <relativePath>../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/5e385b5f/loader/marmotta-loader-kiwi/pom.xml
----------------------------------------------------------------------
diff --git a/loader/marmotta-loader-kiwi/pom.xml b/loader/marmotta-loader-kiwi/pom.xml
index 94d8d92..25ce923 100644
--- a/loader/marmotta-loader-kiwi/pom.xml
+++ b/loader/marmotta-loader-kiwi/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.2.1-SNAPSHOT</version>
         <relativePath>../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/5e385b5f/loader/marmotta-loader-titan/pom.xml
----------------------------------------------------------------------
diff --git a/loader/marmotta-loader-titan/pom.xml b/loader/marmotta-loader-titan/pom.xml
index 02358b9..c01d0ee 100644
--- a/loader/marmotta-loader-titan/pom.xml
+++ b/loader/marmotta-loader-titan/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.2.1-SNAPSHOT</version>
         <relativePath>../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/5e385b5f/loader/pom.xml
----------------------------------------------------------------------
diff --git a/loader/pom.xml b/loader/pom.xml
index b1044db..7315b43 100644
--- a/loader/pom.xml
+++ b/loader/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.2.1-SNAPSHOT</version>
         <relativePath>../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/5e385b5f/parent/pom.xml
----------------------------------------------------------------------
diff --git a/parent/pom.xml b/parent/pom.xml
index 3c2f128..36ee34f 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -29,7 +29,7 @@
     <groupId>org.apache.marmotta</groupId>
     <artifactId>marmotta-parent</artifactId>
     <packaging>pom</packaging>
-    <version>3.2.0</version>
+    <version>3.2.1-SNAPSHOT</version>
 
     <name>Apache Marmotta Parent</name>
     <description>Parent POM for the Apache Marmotta project</description>

http://git-wip-us.apache.org/repos/asf/marmotta/blob/5e385b5f/platform/backends/marmotta-backend-bigdata/pom.xml
----------------------------------------------------------------------
diff --git a/platform/backends/marmotta-backend-bigdata/pom.xml b/platform/backends/marmotta-backend-bigdata/pom.xml
index c20e6a7..90ea62a 100644
--- a/platform/backends/marmotta-backend-bigdata/pom.xml
+++ b/platform/backends/marmotta-backend-bigdata/pom.xml
@@ -24,7 +24,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0-SNAPSHOT</version>
+        <version>3.2.1-SNAPSHOT</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/5e385b5f/platform/backends/marmotta-backend-http/pom.xml
----------------------------------------------------------------------
diff --git a/platform/backends/marmotta-backend-http/pom.xml b/platform/backends/marmotta-backend-http/pom.xml
index de6b5c4..fc4174b 100644
--- a/platform/backends/marmotta-backend-http/pom.xml
+++ b/platform/backends/marmotta-backend-http/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0-SNAPSHOT</version>
+        <version>3.2.1-SNAPSHOT</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/5e385b5f/platform/backends/marmotta-backend-kiwi/pom.xml
----------------------------------------------------------------------
diff --git a/platform/backends/marmotta-backend-kiwi/pom.xml b/platform/backends/marmotta-backend-kiwi/pom.xml
index faea6ff..9252f61 100644
--- a/platform/backends/marmotta-backend-kiwi/pom.xml
+++ b/platform/backends/marmotta-backend-kiwi/pom.xml
@@ -22,7 +22,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.2.1-SNAPSHOT</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/5e385b5f/platform/backends/marmotta-backend-memory/pom.xml
----------------------------------------------------------------------
diff --git a/platform/backends/marmotta-backend-memory/pom.xml b/platform/backends/marmotta-backend-memory/pom.xml
index 94a4979..76d85d6 100644
--- a/platform/backends/marmotta-backend-memory/pom.xml
+++ b/platform/backends/marmotta-backend-memory/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.2.1-SNAPSHOT</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/5e385b5f/platform/backends/marmotta-backend-native/pom.xml
----------------------------------------------------------------------
diff --git a/platform/backends/marmotta-backend-native/pom.xml b/platform/backends/marmotta-backend-native/pom.xml
index 09f80fb..313eeb3 100644
--- a/platform/backends/marmotta-backend-native/pom.xml
+++ b/platform/backends/marmotta-backend-native/pom.xml
@@ -22,7 +22,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.2.1-SNAPSHOT</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/5e385b5f/platform/backends/marmotta-backend-sparql/pom.xml
----------------------------------------------------------------------
diff --git a/platform/backends/marmotta-backend-sparql/pom.xml b/platform/backends/marmotta-backend-sparql/pom.xml
index 71fd685..b70005f 100644
--- a/platform/backends/marmotta-backend-sparql/pom.xml
+++ b/platform/backends/marmotta-backend-sparql/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0-SNAPSHOT</version>
+        <version>3.2.1-SNAPSHOT</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/5e385b5f/platform/backends/marmotta-backend-titan/pom.xml
----------------------------------------------------------------------
diff --git a/platform/backends/marmotta-backend-titan/pom.xml b/platform/backends/marmotta-backend-titan/pom.xml
index b3fb632..b75e1cf 100644
--- a/platform/backends/marmotta-backend-titan/pom.xml
+++ b/platform/backends/marmotta-backend-titan/pom.xml
@@ -22,7 +22,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.2.1-SNAPSHOT</version>
         <relativePath>../../../parent/pom.xml</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/5e385b5f/platform/backends/pom.xml
----------------------------------------------------------------------
diff --git a/platform/backends/pom.xml b/platform/backends/pom.xml
index 3f40a2b..37214e9 100644
--- a/platform/backends/pom.xml
+++ b/platform/backends/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.2.1-SNAPSHOT</version>
         <relativePath>../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/5e385b5f/platform/ldcache/marmotta-ldcache-common/pom.xml
----------------------------------------------------------------------
diff --git a/platform/ldcache/marmotta-ldcache-common/pom.xml b/platform/ldcache/marmotta-ldcache-common/pom.xml
index 7fe23a3..d1155fb 100644
--- a/platform/ldcache/marmotta-ldcache-common/pom.xml
+++ b/platform/ldcache/marmotta-ldcache-common/pom.xml
@@ -22,7 +22,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.2.1-SNAPSHOT</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/5e385b5f/platform/ldcache/marmotta-ldcache-file/pom.xml
----------------------------------------------------------------------
diff --git a/platform/ldcache/marmotta-ldcache-file/pom.xml b/platform/ldcache/marmotta-ldcache-file/pom.xml
index a7044d9..ec53907 100644
--- a/platform/ldcache/marmotta-ldcache-file/pom.xml
+++ b/platform/ldcache/marmotta-ldcache-file/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.2.1-SNAPSHOT</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/5e385b5f/platform/ldcache/marmotta-ldcache-kiwi/pom.xml
----------------------------------------------------------------------
diff --git a/platform/ldcache/marmotta-ldcache-kiwi/pom.xml b/platform/ldcache/marmotta-ldcache-kiwi/pom.xml
index 7c7bd68..234101b 100644
--- a/platform/ldcache/marmotta-ldcache-kiwi/pom.xml
+++ b/platform/ldcache/marmotta-ldcache-kiwi/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.2.1-SNAPSHOT</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/5e385b5f/platform/ldcache/pom.xml
----------------------------------------------------------------------
diff --git a/platform/ldcache/pom.xml b/platform/ldcache/pom.xml
index 1b0cbf0..b6244f3 100644
--- a/platform/ldcache/pom.xml
+++ b/platform/ldcache/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.2.1-SNAPSHOT</version>
         <relativePath>../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/5e385b5f/platform/marmotta-core/pom.xml
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/pom.xml b/platform/marmotta-core/pom.xml
index 2f24a13..827c806 100644
--- a/platform/marmotta-core/pom.xml
+++ b/platform/marmotta-core/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.2.1-SNAPSHOT</version>
         <relativePath>../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/5e385b5f/platform/marmotta-ldp/pom.xml
----------------------------------------------------------------------
diff --git a/platform/marmotta-ldp/pom.xml b/platform/marmotta-ldp/pom.xml
index a7a6b88..698254f 100644
--- a/platform/marmotta-ldp/pom.xml
+++ b/platform/marmotta-ldp/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.2.1-SNAPSHOT</version>
         <relativePath>../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/5e385b5f/platform/marmotta-ldpath/pom.xml
----------------------------------------------------------------------
diff --git a/platform/marmotta-ldpath/pom.xml b/platform/marmotta-ldpath/pom.xml
index 95f9eb6..4309626 100644
--- a/platform/marmotta-ldpath/pom.xml
+++ b/platform/marmotta-ldpath/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.2.1-SNAPSHOT</version>
         <relativePath>../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/5e385b5f/platform/marmotta-reasoner-kiwi/pom.xml
----------------------------------------------------------------------
diff --git a/platform/marmotta-reasoner-kiwi/pom.xml b/platform/marmotta-reasoner-kiwi/pom.xml
index 5905919..be9c4d0 100644
--- a/platform/marmotta-reasoner-kiwi/pom.xml
+++ b/platform/marmotta-reasoner-kiwi/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.2.1-SNAPSHOT</version>
         <relativePath>../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/5e385b5f/platform/marmotta-security/pom.xml
----------------------------------------------------------------------
diff --git a/platform/marmotta-security/pom.xml b/platform/marmotta-security/pom.xml
index 847559e..8afaeb7 100644
--- a/platform/marmotta-security/pom.xml
+++ b/platform/marmotta-security/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.2.1-SNAPSHOT</version>
         <relativePath>../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/5e385b5f/platform/marmotta-sparql/pom.xml
----------------------------------------------------------------------
diff --git a/platform/marmotta-sparql/pom.xml b/platform/marmotta-sparql/pom.xml
index 88636d6..95e29fa 100644
--- a/platform/marmotta-sparql/pom.xml
+++ b/platform/marmotta-sparql/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.2.1-SNAPSHOT</version>
         <relativePath>../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/5e385b5f/platform/marmotta-user/pom.xml
----------------------------------------------------------------------
diff --git a/platform/marmotta-user/pom.xml b/platform/marmotta-user/pom.xml
index 08012c5..28b76d7 100644
--- a/platform/marmotta-user/pom.xml
+++ b/platform/marmotta-user/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.2.1-SNAPSHOT</version>
         <relativePath>../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/5e385b5f/platform/marmotta-versioning-common/pom.xml
----------------------------------------------------------------------
diff --git a/platform/marmotta-versioning-common/pom.xml b/platform/marmotta-versioning-common/pom.xml
index cd08d5a..e0926a4 100644
--- a/platform/marmotta-versioning-common/pom.xml
+++ b/platform/marmotta-versioning-common/pom.xml
@@ -22,7 +22,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.2.1-SNAPSHOT</version>
         <relativePath>../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/5e385b5f/platform/marmotta-versioning-kiwi/pom.xml
----------------------------------------------------------------------
diff --git a/platform/marmotta-versioning-kiwi/pom.xml b/platform/marmotta-versioning-kiwi/pom.xml
index 55d4d8b..30999bb 100644
--- a/platform/marmotta-versioning-kiwi/pom.xml
+++ b/platform/marmotta-versioning-kiwi/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.2.1-SNAPSHOT</version>
         <relativePath>../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/5e385b5f/platform/marmotta-zookeeper/pom.xml
----------------------------------------------------------------------
diff --git a/platform/marmotta-zookeeper/pom.xml b/platform/marmotta-zookeeper/pom.xml
index 1a443fa..94a591e 100644
--- a/platform/marmotta-zookeeper/pom.xml
+++ b/platform/marmotta-zookeeper/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.2.1-SNAPSHOT</version>
         <relativePath>../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/5e385b5f/platform/pom.xml
----------------------------------------------------------------------
diff --git a/platform/pom.xml b/platform/pom.xml
index d6b3275..06f1008 100644
--- a/platform/pom.xml
+++ b/platform/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.2.1-SNAPSHOT</version>
         <relativePath>../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/5e385b5f/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index d9979a0..807f48d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0</version>
+        <version>3.2.1-SNAPSHOT</version>
         <relativePath>parent</relativePath>
     </parent>
 


[054/100] [abbrv] git commit: added maven-eclipse.xml to the list of ignored files

Posted by wi...@apache.org.
added maven-eclipse.xml to the list of ignored files


Project: http://git-wip-us.apache.org/repos/asf/marmotta/repo
Commit: http://git-wip-us.apache.org/repos/asf/marmotta/commit/89fe9d42
Tree: http://git-wip-us.apache.org/repos/asf/marmotta/tree/89fe9d42
Diff: http://git-wip-us.apache.org/repos/asf/marmotta/diff/89fe9d42

Branch: refs/heads/ldp
Commit: 89fe9d42e4927000cf55c55000063a7a93933ad2
Parents: 00d37de
Author: Rupert Westenthaler <ru...@gmail.com>
Authored: Tue Apr 8 08:40:19 2014 +0200
Committer: Rupert Westenthaler <ru...@gmail.com>
Committed: Tue Apr 8 08:40:19 2014 +0200

----------------------------------------------------------------------
 .gitignore | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/marmotta/blob/89fe9d42/.gitignore
----------------------------------------------------------------------
diff --git a/.gitignore b/.gitignore
index 7690c4b..be2d30c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -13,3 +13,4 @@
 target/
 .idea/
 .metadata/
+maven-eclipse.xml
\ No newline at end of file


[069/100] [abbrv] git commit: Do a "clean install" instead of a "clean verify" during the release preparation

Posted by wi...@apache.org.
Do a "clean install" instead of a "clean verify" during the release preparation


Project: http://git-wip-us.apache.org/repos/asf/marmotta/repo
Commit: http://git-wip-us.apache.org/repos/asf/marmotta/commit/994caea4
Tree: http://git-wip-us.apache.org/repos/asf/marmotta/tree/994caea4
Diff: http://git-wip-us.apache.org/repos/asf/marmotta/diff/994caea4

Branch: refs/heads/ldp
Commit: 994caea416ff4d932b87da47af6ccd84f89d4a0f
Parents: 4860758
Author: Jakob Frank <ja...@apache.org>
Authored: Tue Apr 8 17:37:01 2014 +0200
Committer: Jakob Frank <ja...@apache.org>
Committed: Tue Apr 8 17:37:01 2014 +0200

----------------------------------------------------------------------
 pom.xml | 3 +++
 1 file changed, 3 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/marmotta/blob/994caea4/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 2753e27..0e53d5c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -196,6 +196,9 @@
                     <!-- the profiles to run for the release -->
                     <arguments>-Pinstaller,marmotta-release,sign,kiwi ${arguments}</arguments>
 
+                    <!-- make sure all dependencies are available -->
+                    <preparationGoals>clean install</preparationGoals>
+
 		    <pushChanges>false</pushChanges>
                 </configuration>
             </plugin>


[100/100] [abbrv] git commit: implemented the restriction on re-using URIs detected while working on MARMOTTA-508

Posted by wi...@apache.org.
implemented the restriction on re-using URIs detected while working on MARMOTTA-508


Project: http://git-wip-us.apache.org/repos/asf/marmotta/repo
Commit: http://git-wip-us.apache.org/repos/asf/marmotta/commit/b61ebf85
Tree: http://git-wip-us.apache.org/repos/asf/marmotta/tree/b61ebf85
Diff: http://git-wip-us.apache.org/repos/asf/marmotta/diff/b61ebf85

Branch: refs/heads/ldp
Commit: b61ebf856f21588d7e6336c19295ddb511e2cee2
Parents: e0834f6
Author: Sergio Fernández <wi...@apache.org>
Authored: Thu Jun 12 20:32:11 2014 +0200
Committer: Sergio Fernández <wi...@apache.org>
Committed: Thu Jun 12 20:32:11 2014 +0200

----------------------------------------------------------------------
 .../apache/marmotta/platform/ldp/services/LdpServiceImpl.java    | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/marmotta/blob/b61ebf85/platform/marmotta-ldp/src/main/java/org/apache/marmotta/platform/ldp/services/LdpServiceImpl.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-ldp/src/main/java/org/apache/marmotta/platform/ldp/services/LdpServiceImpl.java b/platform/marmotta-ldp/src/main/java/org/apache/marmotta/platform/ldp/services/LdpServiceImpl.java
index 8d28aae..9130bca 100644
--- a/platform/marmotta-ldp/src/main/java/org/apache/marmotta/platform/ldp/services/LdpServiceImpl.java
+++ b/platform/marmotta-ldp/src/main/java/org/apache/marmotta/platform/ldp/services/LdpServiceImpl.java
@@ -456,7 +456,9 @@ public class LdpServiceImpl implements LdpService {
         // Delete the resource data
         connection.clear(resource);
 
-        // FIXME: Sec. 5.2.3.11: LDP servers that allow member creation via POST should not re-use URIs.
+        // Sec. 5.2.3.11: LDP servers that allow member creation via POST should not re-use URIs.
+        connection.add(resource, RDF.TYPE, LDP.Resource, ldpContext);
+        //TODO: keep the track if was there work, but is a good idea?
 
         return true;
     }


[089/100] [abbrv] git commit: fix postgres validation query (MARMOTTA-498)

Posted by wi...@apache.org.
fix postgres validation query (MARMOTTA-498)


Project: http://git-wip-us.apache.org/repos/asf/marmotta/repo
Commit: http://git-wip-us.apache.org/repos/asf/marmotta/commit/dfde1a8e
Tree: http://git-wip-us.apache.org/repos/asf/marmotta/tree/dfde1a8e
Diff: http://git-wip-us.apache.org/repos/asf/marmotta/diff/dfde1a8e

Branch: refs/heads/ldp
Commit: dfde1a8ea61dbbd43318af63b7278d42beddc38d
Parents: 2c78494
Author: Sebastian Schaffert <ss...@apache.org>
Authored: Thu May 15 15:16:53 2014 +0200
Committer: Sebastian Schaffert <ss...@apache.org>
Committed: Thu May 15 15:16:53 2014 +0200

----------------------------------------------------------------------
 .../apache/marmotta/kiwi/persistence/pgsql/PostgreSQLDialect.java  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/marmotta/blob/dfde1a8e/libraries/kiwi/kiwi-triplestore/src/main/java/org/apache/marmotta/kiwi/persistence/pgsql/PostgreSQLDialect.java
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-triplestore/src/main/java/org/apache/marmotta/kiwi/persistence/pgsql/PostgreSQLDialect.java b/libraries/kiwi/kiwi-triplestore/src/main/java/org/apache/marmotta/kiwi/persistence/pgsql/PostgreSQLDialect.java
index b5ed078..556a5d5 100644
--- a/libraries/kiwi/kiwi-triplestore/src/main/java/org/apache/marmotta/kiwi/persistence/pgsql/PostgreSQLDialect.java
+++ b/libraries/kiwi/kiwi-triplestore/src/main/java/org/apache/marmotta/kiwi/persistence/pgsql/PostgreSQLDialect.java
@@ -131,7 +131,7 @@ public class PostgreSQLDialect extends KiWiDialect {
      */
     @Override
     public String getValidationQuery() {
-        return "SELECT 1";
+        return "SELECT 1; COMMIT;";
     }
 
     /**


[045/100] [abbrv] [partial] Reverting the erroneous merge by Sebastian according to the instructions in INFRA-6876

Posted by wi...@apache.org.
http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/marmotta-commons/src/ext/java/javolution/util/internal/set/sorted/SortedSetView.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-commons/src/ext/java/javolution/util/internal/set/sorted/SortedSetView.java b/commons/marmotta-commons/src/ext/java/javolution/util/internal/set/sorted/SortedSetView.java
new file mode 100644
index 0000000..e932eb2
--- /dev/null
+++ b/commons/marmotta-commons/src/ext/java/javolution/util/internal/set/sorted/SortedSetView.java
@@ -0,0 +1,60 @@
+/*
+ * 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.util.internal.set.sorted;
+
+import javolution.util.internal.set.SetView;
+import javolution.util.service.SortedSetService;
+
+/**
+ * Sorted Set view implementation; can be used as root class for implementations 
+ * if target is {@code null}.
+ */
+public abstract class SortedSetView<E> extends SetView<E> implements SortedSetService<E> {
+
+    private static final long serialVersionUID = 0x600L; // Version.
+
+    /**
+     * The view constructor or root class constructor if target is {@code null}.
+     */
+    public SortedSetView(SortedSetService<E> target) {
+        super(target);
+    }
+
+    @Override
+    public abstract E first();
+
+    @Override
+    public SortedSetService<E> headSet(E toElement) {
+        return new SubSortedSetImpl<E>(this, null, toElement);
+    }
+
+    @Override
+    public abstract E last();
+
+    @SuppressWarnings("unchecked")
+    @Override
+    public SortedSetService<E>[] split(int n, boolean updateable) { 
+        return new SortedSetService[] { this }; // Split not supported.
+    }
+
+    @Override
+    public SortedSetService<E> subSet(E fromElement, E toElement) {
+        return new SubSortedSetImpl<E>(this, fromElement, toElement);
+    }
+
+    @Override
+    public SortedSetService<E> tailSet(E fromElement) {
+        return new SubSortedSetImpl<E>(this, fromElement, null);
+    }
+ 
+    @Override
+    protected SortedSetService<E> target() {
+        return (SortedSetService<E>) super.target();
+    }
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/marmotta-commons/src/ext/java/javolution/util/internal/set/sorted/SubSortedSetImpl.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-commons/src/ext/java/javolution/util/internal/set/sorted/SubSortedSetImpl.java b/commons/marmotta-commons/src/ext/java/javolution/util/internal/set/sorted/SubSortedSetImpl.java
new file mode 100644
index 0000000..d44ca86
--- /dev/null
+++ b/commons/marmotta-commons/src/ext/java/javolution/util/internal/set/sorted/SubSortedSetImpl.java
@@ -0,0 +1,144 @@
+/*
+ * 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.util.internal.set.sorted;
+
+import javolution.util.function.Equality;
+import javolution.util.service.CollectionService;
+import javolution.util.service.SortedSetService;
+
+import java.util.Iterator;
+import java.util.NoSuchElementException;
+
+/**
+ * A view over a portion of a sorted set. 
+ */
+public class SubSortedSetImpl<E> extends SortedSetView<E> {
+
+    /** Peeking ahead iterator. */
+    private class IteratorImpl implements Iterator<E> {
+
+        private boolean ahead;
+        private final Equality<? super E> cmp = comparator();
+        private E next;
+        private final Iterator<E> targetIterator = target().iterator();
+
+        @Override
+        public boolean hasNext() {
+            if (ahead) return true;
+            while (targetIterator.hasNext()) {
+                next = targetIterator.next();
+                if ((from != null) && (cmp.compare(next, from) < 0)) continue;
+                if ((to != null) && (cmp.compare(next, to) >= 0)) break;
+                ahead = true;
+                return true;
+            }
+            return false;
+        }
+
+        @Override
+        public E next() {
+            hasNext(); // Moves ahead.
+            ahead = false;
+            return next;
+        }
+
+        @Override
+        public void remove() {
+            targetIterator.remove();
+        }
+    }
+
+    private static final long serialVersionUID = 0x600L; // Version.
+    private final E from; // Can be null.
+    private final E to; // Can be null.
+
+    public SubSortedSetImpl(SortedSetService<E> target, E from, E to) {
+        super(target);
+        if ((from != null) && (to != null)
+                && (comparator().compare(from, to) > 0)) throw new IllegalArgumentException(
+                "from: " + from + ", to: " + to); // As per SortedSet contract.
+        this.from = from;
+        this.to = to;
+    }
+
+    @Override
+    public boolean add(E e) {
+        Equality<? super E> cmp = comparator();
+        if ((from != null) && (cmp.compare(e, from) < 0)) throw new IllegalArgumentException(
+                "Element: " + e + " outside of this sub-set bounds");
+        if ((to != null) && (cmp.compare(e, to) >= 0)) throw new IllegalArgumentException(
+                "Element: " + e + " outside of this sub-set bounds");
+        return target().add(e);
+    }
+
+    @Override
+    public Equality<? super E> comparator() {
+        return ((CollectionService<E>)target()).comparator();
+    }
+
+    @SuppressWarnings("unchecked")
+    @Override
+    public boolean contains(Object obj) {
+        Equality<? super E> cmp = comparator();
+        if ((from != null) && (cmp.compare((E) obj, from) < 0)) return false;
+        if ((to != null) && (cmp.compare((E) obj, to) >= 0)) return false;
+        return target().contains(obj);
+    }
+
+    @Override
+    public E first() {
+        if (from == null) return target().first();
+        Iterator<E> it = iterator();
+        if (!it.hasNext()) throw new NoSuchElementException();
+        return it.next();
+    }
+
+    @Override
+    public boolean isEmpty() {
+        return iterator().hasNext();
+    }
+
+    @Override
+    public Iterator<E> iterator() {
+        return new IteratorImpl();
+    }
+
+    @Override
+    public E last() {
+        if (to == null) return target().last();
+        Iterator<E> it = iterator();
+        if (!it.hasNext()) throw new NoSuchElementException();
+        E last = it.next();
+        while (it.hasNext()) {
+            last = it.next();
+        }
+        return last;
+    }
+
+    @SuppressWarnings("unchecked")
+    @Override
+    public boolean remove(Object obj) {
+        Equality<? super E> cmp = comparator();
+        if ((from != null) && (cmp.compare((E) obj, from) < 0)) return false;
+        if ((to != null) && (cmp.compare((E) obj, to) >= 0)) return false;
+        return target().remove(obj);
+    }
+
+    @Override
+    public int size() { // Unfortunately, no choice other than counting.
+        int count = 0;
+        Iterator<E> it = iterator();
+        while (it.hasNext()) {
+            count++;
+            it.next();
+        }
+        return count;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/marmotta-commons/src/ext/java/javolution/util/internal/set/sorted/UnmodifiableSortedSetImpl.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-commons/src/ext/java/javolution/util/internal/set/sorted/UnmodifiableSortedSetImpl.java b/commons/marmotta-commons/src/ext/java/javolution/util/internal/set/sorted/UnmodifiableSortedSetImpl.java
new file mode 100644
index 0000000..028e3ed
--- /dev/null
+++ b/commons/marmotta-commons/src/ext/java/javolution/util/internal/set/sorted/UnmodifiableSortedSetImpl.java
@@ -0,0 +1,67 @@
+/*
+ * 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.util.internal.set.sorted;
+
+import javolution.util.internal.set.UnmodifiableSetImpl;
+import javolution.util.service.SetService;
+import javolution.util.service.SortedSetService;
+
+/**
+ * An unmodifiable view over a set.
+ */
+public class UnmodifiableSortedSetImpl<E> extends UnmodifiableSetImpl<E>
+        implements SortedSetService<E> {
+
+    private static final long serialVersionUID = 0x600L; // Version.
+
+    public UnmodifiableSortedSetImpl(SetService<E> target) {
+        super(target);
+    }
+
+    @Override
+    public E first() {
+        return target().first();
+    }
+
+    @Override
+    public SortedSetService<E> headSet(E toElement) {
+        return new SubSortedSetImpl<E>(this, null, toElement);
+    }
+
+    @Override
+    public E last() {
+        return target().last();
+    }
+
+    @SuppressWarnings("unchecked")
+    @Override
+    public SortedSetService<E>[] split(int n, boolean updateable) {
+        SortedSetService<E>[] subTargets = target().split(n, updateable);
+        SortedSetService<E>[] result = new SortedSetService[subTargets.length];
+        for (int i = 0; i < subTargets.length; i++) {
+            result[i] = new UnmodifiableSortedSetImpl<E>(subTargets[i]);
+        }
+        return result;
+    }
+
+    @Override
+    public SortedSetService<E> subSet(E fromElement, E toElement) {
+        return new SubSortedSetImpl<E>(this, fromElement, toElement);
+    }
+
+    @Override
+    public SortedSetService<E> tailSet(E fromElement) {
+        return new SubSortedSetImpl<E>(this, fromElement, null);
+    }
+    
+    @Override
+    protected SortedSetService<E> target() {
+        return (SortedSetService<E>) super.target();
+    }
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/marmotta-commons/src/ext/java/javolution/util/internal/table/AtomicTableImpl.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-commons/src/ext/java/javolution/util/internal/table/AtomicTableImpl.java b/commons/marmotta-commons/src/ext/java/javolution/util/internal/table/AtomicTableImpl.java
new file mode 100644
index 0000000..4ed8926
--- /dev/null
+++ b/commons/marmotta-commons/src/ext/java/javolution/util/internal/table/AtomicTableImpl.java
@@ -0,0 +1,236 @@
+/*
+ * 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.util.internal.table;
+
+import javolution.util.internal.collection.AtomicCollectionImpl;
+import javolution.util.service.TableService;
+
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.ListIterator;
+
+/**
+ * An atomic view over a table.
+ */
+public class AtomicTableImpl<E> extends AtomicCollectionImpl<E> implements
+        TableService<E> {
+
+    private static final long serialVersionUID = 0x600L; // Version.
+
+    public AtomicTableImpl(TableService<E> target) {
+        super(target);
+    }
+
+    @Override
+    public synchronized void add(int index, E element) {
+        target().add(index, element);
+        if (!updateInProgress()) immutable = cloneTarget();
+    }
+
+    @Override
+    public synchronized boolean addAll(int index, Collection<? extends E> c) {
+        boolean changed = target().addAll(index, c);
+        if (changed && !updateInProgress()) immutable = cloneTarget();
+        return changed;
+    }
+
+    @Override
+    public synchronized void addFirst(E element) {
+        target().addFirst(element);
+        if (!updateInProgress()) immutable = cloneTarget();
+    }
+
+    @Override
+    public synchronized void addLast(E element) {
+        target().addLast(element);
+        if (!updateInProgress()) immutable = cloneTarget();
+    }
+
+    @Override
+    public Iterator<E> descendingIterator() {
+        return new ReversedTableImpl<E>(this).iterator();
+    }
+
+    @Override
+    public E element() {
+        return getFirst();
+    }
+
+    @Override
+    public E get(int index) {
+        return targetView().get(index);
+    }
+
+    @Override
+    public E getFirst() {
+        return targetView().getFirst();
+    }
+
+    @Override
+    public E getLast() {
+        return targetView().getLast();
+    }
+
+    @Override
+    public int indexOf(Object element) {
+        return targetView().indexOf(element);
+    }
+
+    @Override
+    public ListIterator<E> iterator() {
+        return listIterator(0);
+    }
+
+    @Override
+    public int lastIndexOf(Object element) {
+        return targetView().lastIndexOf(element);
+    }
+
+    @Override
+    public ListIterator<E> listIterator() {
+        return listIterator(0);
+    }
+
+    @Override
+    public ListIterator<E> listIterator(int index) {
+        return new TableIteratorImpl<E>(this, index); // Iterator view on this.
+    }
+
+    @Override
+    public boolean offer(E e) {
+        return offerLast(e);
+    }
+
+    @Override
+    public synchronized boolean offerFirst(E e) {
+        boolean changed = target().offerFirst(e);
+        if (changed && !updateInProgress()) immutable = cloneTarget();
+        return changed;
+    }
+
+    @Override
+    public synchronized boolean offerLast(E e) {
+        boolean changed = target().offerLast(e);
+        if (changed && !updateInProgress()) immutable = cloneTarget();
+        return changed;
+    }
+
+    @Override
+    public E peek() {
+        return peekFirst();
+    }
+
+    @Override
+    public E peekFirst() {
+        return targetView().peekFirst();
+    }
+
+    @Override
+    public E peekLast() {
+        return targetView().peekLast();
+    }
+
+    @Override
+    public E poll() {
+        return pollFirst();
+    }
+
+    @Override
+    public synchronized E pollFirst() {
+        E e = target().pollFirst();
+        if ((e != null) && !updateInProgress()) immutable = cloneTarget();
+        return e;
+    }
+
+    @Override
+    public synchronized E pollLast() {
+        E e = target().pollLast();
+        if ((e != null) && !updateInProgress()) immutable = cloneTarget();
+        return e;
+    }
+
+    @Override
+    public E pop() {
+        return removeFirst();
+    }
+
+    @Override
+    public void push(E e) {
+        addFirst(e);
+    }
+
+    @Override
+    public E remove() {
+        return removeFirst();
+    }
+
+    @Override
+    public synchronized E remove(int index) {
+        E e = target().remove(index);
+        if (!updateInProgress()) immutable = cloneTarget();
+        return e;
+    }
+
+    @Override
+    public synchronized E removeFirst() {
+        E e = target().removeFirst();
+        if (!updateInProgress()) immutable = cloneTarget();
+        return e;
+    }
+
+    @Override
+    public synchronized boolean removeFirstOccurrence(Object o) {
+        boolean changed = target().removeFirstOccurrence(o);
+        if (changed && !updateInProgress()) immutable = cloneTarget();
+        return changed;
+    }
+
+    @Override
+    public synchronized E removeLast() {
+        E e = target().removeLast();
+        if (!updateInProgress()) immutable = cloneTarget();
+        return e;
+    }
+
+    @Override
+    public synchronized boolean removeLastOccurrence(Object o) {
+        boolean changed = target().removeLastOccurrence(o);
+        if (changed && !updateInProgress()) immutable = cloneTarget();
+        return changed;
+    }
+
+    @Override
+    public synchronized E set(int index, E element) {
+        E e = target().set(index, element);
+        if (!updateInProgress()) immutable = cloneTarget();
+        return e;
+    }
+ 
+    @Override
+    public TableService<E>[] split(int n, boolean updateable) {
+        return SubTableImpl.splitOf(this, n, false); // Sub-views over this.
+    }
+
+    @Override
+    public TableService<E> subList(int fromIndex, int toIndex) {
+        return new SubTableImpl<E>(this, fromIndex, toIndex); // View on this.
+    }
+
+    /** Returns the actual target */
+    @Override
+    protected TableService<E> target() {
+        return (TableService<E>) super.target();
+    }
+
+    @Override
+    protected TableService<E> targetView() {
+        return (TableService<E>) super.targetView();
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/marmotta-commons/src/ext/java/javolution/util/internal/table/FastTableImpl.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-commons/src/ext/java/javolution/util/internal/table/FastTableImpl.java b/commons/marmotta-commons/src/ext/java/javolution/util/internal/table/FastTableImpl.java
new file mode 100644
index 0000000..dc92d09
--- /dev/null
+++ b/commons/marmotta-commons/src/ext/java/javolution/util/internal/table/FastTableImpl.java
@@ -0,0 +1,210 @@
+/*
+ * 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.util.internal.table;
+
+import javolution.util.function.Equality;
+
+import java.util.Iterator;
+import java.util.NoSuchElementException;
+
+/**
+ * The default {@link javolution.util.FastTable FastTable} implementation 
+ * based on {@link FractalTableImpl fractal tables}. The memory footprint 
+ * is minimal when the table is cleared.
+ */
+public class FastTableImpl<E> extends TableView<E> {
+
+    /** Internal iterator faster than generic TableIteratorImpl. */
+    private class IteratorImpl implements Iterator<E> {
+        private int currentIndex = -1;
+        private int nextIndex;
+
+        @Override
+        public boolean hasNext() {
+            return nextIndex < size;
+        }
+
+        @Override
+        @SuppressWarnings("unchecked")
+        public E next() {
+            if (nextIndex >= size) throw new NoSuchElementException();
+            currentIndex = nextIndex++;
+            return (E) fractal.get(currentIndex);
+        }
+
+        @Override
+        public void remove() {
+            if (currentIndex < 0) throw new IllegalStateException();
+            FastTableImpl.this.remove(currentIndex);
+            nextIndex--;
+            currentIndex = -1;
+        }
+    }
+
+    private static final long serialVersionUID = 0x600L; // Version.
+    private transient int capacity; // Actual memory allocated is usually far less than capacity since inner fractal tables can be null.
+    private final Equality<? super E> comparator;
+    private transient FractalTableImpl fractal; // Null if empty (capacity 0)
+    private transient int size;
+
+    public FastTableImpl(Equality<? super E> comparator) {
+        super(null); // Root class.
+        this.comparator = comparator;
+    }
+
+    @Override
+    public boolean add(E element) {
+        addLast(element);
+        return true;
+    }
+
+    @Override
+    public void add(int index, E element) {
+        if ((index < 0) || (index > size)) indexError(index);
+        checkUpsize();
+        if (index >= (size >> 1)) {
+            fractal.shiftRight(element, index, size - index);
+        } else {
+            fractal.shiftLeft(element, index - 1, index);
+            fractal.offset--;
+        }
+        size++;
+    }
+
+    @Override
+    public void addFirst(E element) {
+        checkUpsize();
+        fractal.offset--;
+        fractal.set(0, element);
+        size++;
+    }
+
+    @Override
+    public void addLast(E element) {
+        checkUpsize();
+        fractal.set(size++, element);
+    }
+
+    @Override
+    public void clear() {
+        fractal = null;
+        capacity = 0;
+        size = 0;
+    }
+
+    @Override
+    public FastTableImpl<E> clone() { // Make a copy.
+        FastTableImpl<E> copy = new FastTableImpl<E>(comparator());
+        copy.addAll(this);
+        return copy;
+    }
+
+    @Override
+    public Equality<? super E> comparator() {
+        return comparator;
+    }
+
+    @SuppressWarnings("unchecked")
+    @Override
+    public E get(int index) {
+        if ((index < 0) && (index >= size)) indexError(index);
+        return (E) fractal.get(index);
+    }
+
+    @Override
+    public E getFirst() {
+        if (size == 0) emptyError();
+        return get(0);
+    }
+
+    @Override
+    public E getLast() {
+        if (size == 0) emptyError();
+        return get(size - 1);
+    }
+
+    @Override
+    public Iterator<E> iterator() {
+        return new IteratorImpl();
+    }
+
+    @SuppressWarnings("unchecked")
+    @Override
+    public E remove(int index) {
+        if ((index < 0) || (index >= size)) indexError(index);
+        E removed = (E) fractal.get(index);
+        if (index >= (size >> 1)) {
+            fractal.shiftLeft(null, size - 1, size - index - 1);
+        } else {
+            fractal.shiftRight(null, 0, index);
+            fractal.offset++;
+        }
+        size--;
+        return removed;
+    }
+
+    @SuppressWarnings("unchecked")
+    @Override
+    public E removeFirst() {
+        if (size == 0) emptyError();
+        E first = (E) fractal.set(0, null);
+        fractal.offset++;
+        size--;
+        return first;
+    }
+
+    @SuppressWarnings("unchecked")
+    @Override
+    public E removeLast() {
+        if (size == 0) emptyError();
+        E last = (E) fractal.set(--size, null);
+        return last;
+    }
+
+    @SuppressWarnings("unchecked")
+    @Override
+    public E set(int index, E element) {
+        if ((index < 0) && (index >= size)) indexError(index);
+        return (E) fractal.set(index, element);
+    }
+
+    @Override
+    public int size() {
+        return size;
+    }
+
+    private void checkUpsize() {
+        if (size >= capacity) upsize();
+    }
+
+    /** For serialization support */
+    @SuppressWarnings("unchecked")
+    private void readObject(java.io.ObjectInputStream s)
+            throws java.io.IOException, ClassNotFoundException {
+        s.defaultReadObject(); // Deserialize comparator.
+        int n = s.readInt();
+        for (int i = 0; i < n; i++)
+            addLast((E) s.readObject());
+    }
+
+    private void upsize() {
+        fractal = (fractal == null) ? new FractalTableImpl() : fractal.upsize();
+        capacity = fractal.capacity();
+    }
+
+    /** For serialization support */
+    private void writeObject(java.io.ObjectOutputStream s)
+            throws java.io.IOException {
+        s.defaultWriteObject(); // Serialize comparator.
+        s.writeInt(size);
+        for (int i = 0; i < size; i++)
+            s.writeObject(fractal.get(i));
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/marmotta-commons/src/ext/java/javolution/util/internal/table/FractalTableImpl.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-commons/src/ext/java/javolution/util/internal/table/FractalTableImpl.java b/commons/marmotta-commons/src/ext/java/javolution/util/internal/table/FractalTableImpl.java
new file mode 100644
index 0000000..66f7782
--- /dev/null
+++ b/commons/marmotta-commons/src/ext/java/javolution/util/internal/table/FractalTableImpl.java
@@ -0,0 +1,172 @@
+/*
+ * 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.util.internal.table;
+
+import javolution.lang.MathLib;
+
+/**
+ * A fractal-based table with fast insertion/deletion capabilities regardless 
+ * of the collection size. It is based on a fractal structure with self-similar
+ * patterns at any scale (large tables have the same structure as smaller tables
+ * which have similar structure as even smaller tables and so on). 
+  */
+final class FractalTableImpl {
+
+    static final int BASE_CAPACITY_MIN = 16;
+    static final int SHIFT = 8;
+    private static final int BASE_CAPACITY_MAX = 1 << SHIFT;
+
+    /** Offset value, it is the index of the first element (modulo data.length). */
+    int offset;
+
+    /** An array of data elements or fractal tables (recursion). 
+     Data length varies from 2 to BASE_CAPACITY_MAX  */
+    private Object[] data;
+
+    /** The index shift, zero if base table. */
+    private final int shift;
+
+    public FractalTableImpl() {
+        this.shift = 0;
+        data = new Object[BASE_CAPACITY_MIN];
+    }
+
+    public FractalTableImpl(int shift) {
+        this.shift = shift;
+        data = new Object[2];
+    }
+
+    public FractalTableImpl(int shift, Object[] data, int offset) {
+        this.shift = shift;
+        this.data = data;
+        this.offset = offset;
+    }
+
+    public int capacity() {
+        // Reports lower capacity to ensure that there is no fractal holding 
+        // wrapping data (head and tail in the same fractal).
+        return (data.length - 1) << shift;
+    }
+
+    public Object get(int index) {
+        Object fractal = data[((index + offset) >> shift) & (data.length - 1)];
+        return (shift == 0) ? fractal : ((FractalTableImpl) fractal).get(index
+                + offset);
+    }
+
+    public Object set(int index, Object element) {
+        int i = ((index + offset) >> shift) & (data.length - 1);
+        if (shift != 0) return F(i).set(index + offset, element);
+        Object previous = data[i];
+        data[i] = element;
+        return previous;
+    }
+
+    /** Shifts the specified elements(]last - length, last] modulo capacity) 
+     one position to the left. No shift if length (modulo capacity) is zero. */
+    public void shiftLeft(Object inserted, int last, int length) {
+        int mask = (data.length << shift) - 1;
+        int tail = (last + offset) & mask;
+        int head = (last + offset - length) & mask;
+        if (shift == 0) {
+            int n = tail - head;
+            if (head > tail) { // Wrapping
+                System.arraycopy(data, head + 1, data, head, mask - head);
+                data[mask] = data[0];
+                n = tail;
+            }
+            System.arraycopy(data, tail - n + 1, data, tail - n, n);
+            data[tail] = inserted;
+        } else if ((head <= tail) && ((head >> shift) == (tail >> shift))) { // Shift local to inner table.
+            F(head >> shift).shiftLeft(inserted, tail, length); // (no wrapping).
+        } else {
+            int low = head >> shift;
+            int high = (low != data.length - 1) ? low + 1 : 0;
+            F(low).shiftLeft(F(high).get(0), -1, mask - head);
+            while (high != (tail >> shift)) {
+                low = high;
+                high = (low != data.length - 1) ? low + 1 : 0;
+                F(low).offset++; // Full shift left.
+                F(low).set(-1, F(high).get(0));
+            }
+            F(high).shiftLeft(inserted, tail, tail);
+        }
+    }
+
+    /** Shifts the specified element ([first, first + length[ modulo capacity) 
+     one position to the right. No shift if length (modulo capacity) is zero. */
+    public void shiftRight(Object inserted, int first, int length) {
+        int mask = (data.length << shift) - 1;
+        int head = (first + offset) & mask;
+        int tail = (first + offset + length) & mask;
+        if (shift == 0) {
+            int n = tail - head;
+            if (head > tail) { // Wrapping
+                System.arraycopy(data, 0, data, 1, tail);
+                data[0] = data[mask];
+                n = mask - head;
+            }
+            System.arraycopy(data, head, data, head + 1, n);
+            data[head] = inserted;
+        } else if ((head <= tail) && ((head >> shift) == (tail >> shift))) { // Shift local to inner table.
+            F(head >> shift).shiftRight(inserted, head, length); // (no wrapping).
+        } else {
+            int high = tail >> shift;
+            int low = (high != 0) ? high - 1 : data.length - 1;
+            F(high).shiftRight(F(low).get(-1), 0, tail);
+            while (low != (head >> shift)) {
+                high = low;
+                low = (high != 0) ? high - 1 : data.length - 1;
+                F(high).offset--; // Full shift right.
+                F(high).set(0, F(low).get(-1));
+            }
+            F(low).shiftRight(inserted, head, mask - head);
+        }
+    }
+
+    public FractalTableImpl upsize() {
+        if (data.length >= BASE_CAPACITY_MAX) { // Creates outer fractal.
+            FractalTableImpl table = new FractalTableImpl(shift + SHIFT);
+            copyTo(table.F(0));
+            return table;
+        } else {
+            FractalTableImpl table = new FractalTableImpl(shift,
+                    new Object[data.length << 1], 0);
+            copyTo(table);
+            return table;
+        }
+    }
+
+    private FractalTableImpl allocate(int i) {
+        FractalTableImpl fractal = new FractalTableImpl(shift - SHIFT,
+                new Object[1 << SHIFT], 0);
+        data[i] = fractal;
+        return fractal;
+    }
+
+    // Copy to the specified table. 
+    private void copyTo(FractalTableImpl that) {
+        int n = MathLib.min(this.data.length, that.data.length);
+        offset &= (data.length << shift) - 1; // Makes it positive.
+        int o = offset >> shift;
+        if ((o + n) > data.length) { // Wrapping.
+            int w = (o + n) - data.length;
+            n -= w;
+            System.arraycopy(data, 0, that.data, n, w);
+        }
+        System.arraycopy(data, o, that.data, 0, n);
+        that.offset = offset - (o << shift);
+    }
+
+    private FractalTableImpl F(int i) {
+        FractalTableImpl table = (FractalTableImpl) data[i];
+        return (table != null) ? table : allocate(i);
+    }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/marmotta-commons/src/ext/java/javolution/util/internal/table/QuickSort.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-commons/src/ext/java/javolution/util/internal/table/QuickSort.java b/commons/marmotta-commons/src/ext/java/javolution/util/internal/table/QuickSort.java
new file mode 100644
index 0000000..4bfd9f8
--- /dev/null
+++ b/commons/marmotta-commons/src/ext/java/javolution/util/internal/table/QuickSort.java
@@ -0,0 +1,75 @@
+/*
+ * 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.util.internal.table;
+
+import javolution.util.service.TableService;
+
+import java.util.Comparator;
+
+/**
+ * A quick sort utility class.
+ * From Wikipedia Quick Sort - http://en.wikipedia.org/wiki/Quicksort
+ */
+public class QuickSort<E> {
+
+    private final Comparator<? super E> comparator;
+    private final TableService<E> table;
+
+    public QuickSort(TableService<E> table, Comparator<? super E> comparator) {
+        this.table = table;
+        this.comparator = comparator;
+    }
+
+    public void sort() {
+        int size = table.size();
+        if (size > 0) quicksort(0, table.size() - 1);
+    }
+
+    public void sort(int first, int last) {
+        if (first < last) {
+            int pivIndex = partition(first, last);
+            sort(first, (pivIndex - 1));
+            sort((pivIndex + 1), last);
+        }
+    }
+
+    // From Wikipedia Quick Sort - http://en.wikipedia.org/wiki/Quicksort
+    //
+    void quicksort(int first, int last) {
+        int pivIndex = 0;
+        if (first < last) {
+            pivIndex = partition(first, last);
+            quicksort(first, (pivIndex - 1));
+            quicksort((pivIndex + 1), last);
+        }
+    }
+
+    private int partition(int f, int l) {
+        int up, down;
+        E piv = table.get(f);
+        up = f;
+        down = l;
+        do {
+            while (comparator.compare(table.get(up), piv) <= 0 && up < l) {
+                up++;
+            }
+            while (comparator.compare(table.get(down), piv) > 0 && down > f) {
+                down--;
+            }
+            if (up < down) { // Swaps.
+                E temp = table.get(up);
+                table.set(up, table.get(down));
+                table.set(down, temp);
+            }
+        } while (down > up);
+        table.set(f, table.get(down));
+        table.set(down, piv);
+        return down;
+    }
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/marmotta-commons/src/ext/java/javolution/util/internal/table/ReversedTableImpl.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-commons/src/ext/java/javolution/util/internal/table/ReversedTableImpl.java b/commons/marmotta-commons/src/ext/java/javolution/util/internal/table/ReversedTableImpl.java
new file mode 100644
index 0000000..3e2de7d
--- /dev/null
+++ b/commons/marmotta-commons/src/ext/java/javolution/util/internal/table/ReversedTableImpl.java
@@ -0,0 +1,76 @@
+/*
+ * 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.util.internal.table;
+
+import javolution.util.function.Equality;
+import javolution.util.service.TableService;
+
+/**
+ * A reverse view over a table.
+ */
+public class ReversedTableImpl<E> extends TableView<E> {
+
+    private static final long serialVersionUID = 0x600L; // Version.
+
+    public ReversedTableImpl(TableService<E> that) {
+        super(that);
+    }
+
+    @Override
+    public boolean add(E e) {
+        target().addFirst(e);
+        return true;
+    }
+
+    @Override
+    public void add(int index, E element) {
+        target().add(size() - index - 1, element);
+    }
+
+    @Override
+    public void clear() {
+        target().clear();
+    }
+
+    @Override
+    public Equality<? super E> comparator() {
+        return target().comparator();
+    }
+
+    @Override
+    public E get(int index) {
+        return target().get(size() - index - 1);
+    }
+
+    @Override
+    public int indexOf(Object o) {
+        return size() - target().lastIndexOf(o) - 1;
+    }
+
+    @Override
+    public int lastIndexOf(Object o) {
+        return size() - target().indexOf(o) - 1;
+    }
+
+    @Override
+    public E remove(int index) {
+        return target().remove(size() - index - 1);
+    }
+
+    @Override
+    public E set(int index, E element) {
+        return target().set(size() - index - 1, element);
+    }
+
+    @Override
+    public int size() {
+        return target().size();
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/marmotta-commons/src/ext/java/javolution/util/internal/table/SharedTableImpl.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-commons/src/ext/java/javolution/util/internal/table/SharedTableImpl.java b/commons/marmotta-commons/src/ext/java/javolution/util/internal/table/SharedTableImpl.java
new file mode 100644
index 0000000..4f77098
--- /dev/null
+++ b/commons/marmotta-commons/src/ext/java/javolution/util/internal/table/SharedTableImpl.java
@@ -0,0 +1,315 @@
+/*
+ * 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.util.internal.table;
+
+import javolution.util.internal.ReadWriteLockImpl;
+import javolution.util.internal.collection.SharedCollectionImpl;
+import javolution.util.service.TableService;
+
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.ListIterator;
+
+/**
+ * A shared view over a table allowing concurrent access and sequential updates.
+ */
+public class SharedTableImpl<E> extends SharedCollectionImpl<E> implements
+        TableService<E> {
+
+    private static final long serialVersionUID = 0x600L; // Version.
+
+    public SharedTableImpl(TableService<E> target) {
+        super(target);
+    }
+
+    public SharedTableImpl(TableService<E> target, ReadWriteLockImpl lock) {
+        super(target, lock);
+    }
+
+    @Override
+    public void add(int index, E element) {
+        lock.writeLock.lock();
+        try {
+            target().add(index, element);
+        } finally {
+            lock.writeLock.unlock();
+        }
+    }
+
+    @Override
+    public boolean addAll(int index, Collection<? extends E> c) {
+        lock.writeLock.lock();
+        try {
+            return target().addAll(index, c);
+        } finally {
+            lock.writeLock.unlock();
+        }
+    }
+
+    @Override
+    public void addFirst(E element) {
+        lock.writeLock.lock();
+        try {
+            target().addFirst(element);
+        } finally {
+            lock.writeLock.unlock();
+        }
+    }
+
+    @Override
+    public void addLast(E element) {
+        lock.writeLock.lock();
+        try {
+            target().addLast(element);
+        } finally {
+            lock.writeLock.unlock();
+        }
+    }
+
+    @Override
+    public Iterator<E> descendingIterator() {
+        return new ReversedTableImpl<E>(this).iterator(); // View on this.
+    }
+
+    @Override
+    public E element() {
+        return getFirst();
+    }
+
+    @Override
+    public E get(int index) {
+        lock.readLock.lock();
+        try {
+            return target().get(index);
+        } finally {
+            lock.readLock.unlock();
+        }
+    }
+
+    @Override
+    public E getFirst() {
+        lock.readLock.lock();
+        try {
+            return target().getFirst();
+        } finally {
+            lock.readLock.unlock();
+        }
+    }
+
+    @Override
+    public E getLast() {
+        lock.readLock.lock();
+        try {
+            return target().getLast();
+        } finally {
+            lock.readLock.unlock();
+        }
+    }
+
+    @Override
+    public int indexOf(Object element) {
+        lock.readLock.lock();
+        try {
+            return target().indexOf(element);
+        } finally {
+            lock.readLock.unlock();
+        }
+    }
+
+    @Override
+    public ListIterator<E> iterator() {
+        return target().listIterator(0);
+    }
+
+    @Override
+    public int lastIndexOf(Object element) {
+        lock.readLock.lock();
+        try {
+            return target().lastIndexOf(element);
+        } finally {
+            lock.readLock.unlock();
+        }
+    }
+
+    @Override
+    public ListIterator<E> listIterator() {
+        return target().listIterator(0);
+    }
+
+    @Override
+    public ListIterator<E> listIterator(int index) {
+        return new TableIteratorImpl<E>(this, index); // View on this.
+    }
+
+    @Override
+    public boolean offer(E e) {
+        return offerLast(e);
+    }
+
+    @Override
+    public boolean offerFirst(E e) {
+        lock.writeLock.lock();
+        try {
+            return target().offerFirst(e);
+        } finally {
+            lock.writeLock.unlock();
+        }
+    }
+
+    @Override
+    public boolean offerLast(E e) {
+        lock.writeLock.lock();
+        try {
+            return target().offerLast(e);
+        } finally {
+            lock.writeLock.unlock();
+        }
+    }
+
+    @Override
+    public E peek() {
+        return peekFirst();
+    }
+
+    @Override
+    public E peekFirst() {
+        lock.readLock.lock();
+        try {
+            return target().peekFirst();
+        } finally {
+            lock.readLock.unlock();
+        }
+    }
+
+    @Override
+    public E peekLast() {
+        lock.readLock.lock();
+        try {
+            return target().peekLast();
+        } finally {
+            lock.readLock.unlock();
+        }
+    }
+
+    @Override
+    public E poll() {
+        return pollFirst();
+    }
+
+    @Override
+    public E pollFirst() {
+        lock.writeLock.lock();
+        try {
+            return target().pollFirst();
+        } finally {
+            lock.writeLock.unlock();
+        }
+    }
+
+    @Override
+    public E pollLast() {
+        lock.writeLock.lock();
+        try {
+            return target().pollLast();
+        } finally {
+            lock.writeLock.unlock();
+        }
+    }
+
+    @Override
+    public E pop() {
+        return removeFirst();
+    }
+
+    @Override
+    public void push(E e) {
+        addFirst(e);
+    }
+
+    @Override
+    public E remove() {
+        return removeFirst();
+    }
+
+    @Override
+    public E remove(int index) {
+        lock.writeLock.lock();
+        try {
+            return target().remove(index);
+        } finally {
+            lock.writeLock.unlock();
+        }
+    }
+
+    @Override
+    public E removeFirst() {
+        lock.writeLock.lock();
+        try {
+            return target().removeFirst();
+        } finally {
+            lock.writeLock.unlock();
+        }
+    }
+
+    @Override
+    public boolean removeFirstOccurrence(Object o) {
+        lock.writeLock.lock();
+        try {
+            return target().removeFirstOccurrence(o);
+        } finally {
+            lock.writeLock.unlock();
+        }
+    }
+
+    @Override
+    public E removeLast() {
+        lock.writeLock.lock();
+        try {
+            return target().removeLast();
+        } finally {
+            lock.writeLock.unlock();
+        }
+    }
+
+    @Override
+    public boolean removeLastOccurrence(Object o) {
+        lock.writeLock.lock();
+        try {
+            return target().removeLastOccurrence(o);
+        } finally {
+            lock.writeLock.unlock();
+        }
+    }
+
+    @Override
+    public E set(int index, E element) {
+        lock.writeLock.lock();
+        try {
+            return target().set(index, element);
+        } finally {
+            lock.writeLock.unlock();
+        }
+    }
+    @Override
+    public TableService<E>[] split(int n, boolean updateable) {
+        return SubTableImpl.splitOf(this, n, false); // Sub-views over this.
+    }
+
+    @Override
+    public TableService<E> subList(int fromIndex, int toIndex) {
+        return new SubTableImpl<E>(this, fromIndex, toIndex); // View on this.
+    }
+
+    /** Returns the actual target */
+    @Override
+    protected TableService<E> target() {
+        return (TableService<E>) super.target();
+    }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/marmotta-commons/src/ext/java/javolution/util/internal/table/SubTableImpl.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-commons/src/ext/java/javolution/util/internal/table/SubTableImpl.java b/commons/marmotta-commons/src/ext/java/javolution/util/internal/table/SubTableImpl.java
new file mode 100644
index 0000000..682a900
--- /dev/null
+++ b/commons/marmotta-commons/src/ext/java/javolution/util/internal/table/SubTableImpl.java
@@ -0,0 +1,101 @@
+/*
+ * 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.util.internal.table;
+
+import javolution.util.function.Equality;
+import javolution.util.service.TableService;
+
+/**
+ * A view over a portion of a table. 
+ */
+public class SubTableImpl<E> extends TableView<E> {
+
+    private static final long serialVersionUID = 0x600L; // Version.
+
+    /** Splits the specified table.  */
+    @SuppressWarnings("unchecked")
+    public static <E> TableService<E>[] splitOf(TableService<E> table,
+            int n, boolean updateable) {
+        if (updateable) table = new SharedTableImpl<E>(table);
+        if (n < 1) throw new IllegalArgumentException("Invalid argument n: "
+                + n);
+        TableService<E>[] subTables = new TableService[n];
+        int minSize = table.size() / n;
+        int start = 0;
+        for (int i = 0; i < n - 1; i++) {
+            subTables[i] = new SubTableImpl<E>(table, start, start + minSize);
+            start += minSize;
+        }
+        subTables[n - 1] = new SubTableImpl<E>(table, start, table.size());
+        return subTables;
+    }
+
+    protected final int fromIndex;
+    protected int toIndex;
+
+    public SubTableImpl(TableService<E> target, int from, int to) {
+        super(target);
+        if ((from < 0) || (to > target.size()) || (from > to)) throw new IndexOutOfBoundsException(
+                "fromIndex: " + from + ", toIndex: " + to + ", size(): "
+                        + target.size()); // As per List.subList contract.
+        fromIndex = from;
+        toIndex = to;
+    }
+
+    @Override
+    public boolean add(E element) {
+        target().add(toIndex++, element);
+        return true;
+    }
+
+    @Override
+    public void add(int index, E element) {
+        if ((index < 0) && (index > size())) indexError(index);
+        target().add(index + fromIndex, element);
+        toIndex++;
+    }
+
+    @Override
+    public void clear() {
+        for (int i = toIndex - 1; i >= fromIndex; i--) { // Better to do it from the end (less shift).
+            target().remove(i);
+        }
+        toIndex = fromIndex;
+    }
+
+    @Override
+    public Equality<? super E> comparator() {
+        return target().comparator();
+    }
+
+    @Override
+    public E get(int index) {
+        if ((index < 0) && (index >= size())) indexError(index);
+        return target().get(index + fromIndex);
+    }
+
+    @Override
+    public E remove(int index) {
+        if ((index < 0) && (index >= size())) indexError(index);
+        toIndex--;
+        return target().remove(index + fromIndex);
+    }
+
+    @Override
+    public E set(int index, E element) {
+        if ((index < 0) && (index >= size())) indexError(index);
+        return target().set(index + fromIndex, element);
+    }
+
+    @Override
+    public int size() {
+        return toIndex - fromIndex;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/marmotta-commons/src/ext/java/javolution/util/internal/table/TableIteratorImpl.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-commons/src/ext/java/javolution/util/internal/table/TableIteratorImpl.java b/commons/marmotta-commons/src/ext/java/javolution/util/internal/table/TableIteratorImpl.java
new file mode 100644
index 0000000..b280181
--- /dev/null
+++ b/commons/marmotta-commons/src/ext/java/javolution/util/internal/table/TableIteratorImpl.java
@@ -0,0 +1,93 @@
+/*
+ * 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.util.internal.table;
+
+import javolution.util.service.TableService;
+
+import java.util.ListIterator;
+import java.util.NoSuchElementException;
+
+/**
+ * A generic iterator over a table.
+ */
+public final class TableIteratorImpl<E> implements ListIterator<E> {
+
+    private int currentIndex = -1;
+    private int end;
+    private int nextIndex;
+    private final TableService<E> table;
+
+    public TableIteratorImpl(TableService<E> table, int index) {
+        this.table = table;
+        this.nextIndex = index;
+        this.end = table.size();
+    }
+
+    @Override
+    public void add(E e) {
+        table.add(nextIndex++, e);
+        end++;
+        currentIndex = -1;
+    }
+
+    @Override
+    public boolean hasNext() {
+        return (nextIndex < end);
+    }
+
+    @Override
+    public boolean hasPrevious() {
+        return nextIndex > 0;
+    }
+
+    @Override
+    public E next() {
+        if (nextIndex >= end) throw new NoSuchElementException();
+        currentIndex = nextIndex++;
+        return table.get(currentIndex);
+    }
+
+    @Override
+    public int nextIndex() {
+        return nextIndex;
+    }
+
+    @Override
+    public E previous() {
+        if (nextIndex <= 0) throw new NoSuchElementException();
+        currentIndex = --nextIndex;
+        return table.get(currentIndex);
+    }
+
+    @Override
+    public int previousIndex() {
+        return nextIndex - 1;
+    }
+
+    @Override
+    public void remove() {
+        if (currentIndex < 0) throw new IllegalStateException();
+        table.remove(currentIndex);
+        end--;
+        if (currentIndex < nextIndex) {
+            nextIndex--;
+        }
+        currentIndex = -1;
+    }
+
+    @Override
+    public void set(E e) {
+        if (currentIndex >= 0) {
+            table.set(currentIndex, e);
+        } else {
+            throw new IllegalStateException();
+        }
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/marmotta-commons/src/ext/java/javolution/util/internal/table/TableView.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-commons/src/ext/java/javolution/util/internal/table/TableView.java b/commons/marmotta-commons/src/ext/java/javolution/util/internal/table/TableView.java
new file mode 100644
index 0000000..e377755
--- /dev/null
+++ b/commons/marmotta-commons/src/ext/java/javolution/util/internal/table/TableView.java
@@ -0,0 +1,259 @@
+/*
+ * 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.util.internal.table;
+
+import javolution.util.function.Equality;
+import javolution.util.internal.collection.CollectionView;
+import javolution.util.service.TableService;
+
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.ListIterator;
+import java.util.NoSuchElementException;
+
+/**
+ * Table view implementation; can be used as root class for implementations 
+ * if target is {@code null}.
+ */
+public abstract class TableView<E> extends CollectionView<E> implements TableService<E> {
+
+    private static final long serialVersionUID = 0x600L; // Version.
+
+    /**
+     * The view constructor or root class constructor if target is {@code null}.
+     */
+    public TableView(TableService<E> target) {
+        super(target);
+    }
+
+    @Override
+    public abstract void add(int index, E element);
+
+    @Override
+    public boolean addAll(int index, Collection<? extends E> c) {
+        return subList(index, index).addAll(c);
+    }
+
+    @Override
+    public void addFirst(E element) {
+        add(0, element);
+    }
+
+    @Override
+    public void addLast(E element) {
+        add(size(), element);
+    }
+
+    @Override
+    public abstract void clear();
+
+    @Override
+    public final boolean contains(Object o) {
+        return indexOf(o) >= 0;
+    }
+
+    @Override
+    public Iterator<E> descendingIterator() {
+        return new ReversedTableImpl<E>(this).iterator();
+    }
+
+    @Override
+    public final E element() {
+        return getFirst();
+    }
+
+    @Override
+    public abstract E get(int index);
+
+    @Override
+    public E getFirst() {
+        if (size() == 0) emptyError();
+        return get(0);
+    }
+
+    @Override
+    public E getLast() {
+        if (size() == 0) emptyError();
+        return get(size() - 1);
+    }
+
+    @SuppressWarnings("unchecked")
+    @Override
+    public int indexOf(Object o) {
+        Equality<Object> cmp = (Equality<Object>) this.comparator();
+        for (int i = 0, n = size(); i < n; i++) {
+            if (cmp.areEqual(o, get(i))) return i;
+        }
+        return -1;
+    }
+
+    @Override
+    public final boolean isEmpty() {
+        return size() == 0;
+    }
+
+    @Override
+    public Iterator<E> iterator() {
+        return listIterator(0);
+    }
+
+    @SuppressWarnings("unchecked")
+    @Override
+    public int lastIndexOf(Object o) {
+        Equality<Object> cmp = (Equality<Object>) this.comparator();
+        for (int i = size() - 1; i >= 0; i--) {
+            if (cmp.areEqual(o, get(i))) return i;
+        }
+        return -1;
+    }
+
+    @Override
+    public final ListIterator<E> listIterator() {
+        return listIterator(0);
+    }
+
+    @Override
+    public ListIterator<E> listIterator(int index) {
+        return new TableIteratorImpl<E>(this, index);
+    }
+
+    @Override
+    public final boolean offer(E e) {
+        return offerLast(e);
+    }
+
+    @Override
+    public final boolean offerFirst(E e) {
+        addFirst(e);
+        return true;
+    }
+
+    @Override
+    public final boolean offerLast(E e) {
+        addLast(e);
+        return true;
+    }
+
+    @Override
+    public final E peek() {
+        return peekFirst();
+    }
+
+    @Override
+    public E peekFirst() {
+        return (size() == 0) ? null : getFirst();
+    }
+
+    @Override
+    public E peekLast() {
+        return (size() == 0) ? null : getLast();
+    }
+
+    @Override
+    public final E poll() {
+        return pollFirst();
+    }
+
+    @Override
+    public E pollFirst() {
+        return (size() == 0) ? null : removeFirst();
+    }
+
+    @Override
+    public E pollLast() {
+        return (size() == 0) ? null : removeLast();
+    }
+
+    @Override
+    public final E pop() {
+        return removeFirst();
+    }
+
+    @Override
+    public final void push(E e) {
+        addFirst(e);
+    }
+
+    @Override
+    public final E remove() {
+        return removeFirst();
+    }
+
+    @Override
+    public abstract E remove(int index);
+
+    @Override
+    public final boolean remove(Object o) {
+        int i = indexOf(o);
+        if (i < 0) return false;
+        remove(i);
+        return true;
+    }
+
+    @Override
+    public E removeFirst() {
+        if (size() == 0) emptyError();
+        return remove(0);
+    }
+
+    @Override
+    public boolean removeFirstOccurrence(Object o) {
+        int i = indexOf(o);
+        if (i < 0) return false;
+        remove(i);
+        return true;
+    }
+
+    @Override
+    public E removeLast() {
+        if (size() == 0) emptyError();
+        return remove(size() - 1);
+    }
+
+    @Override
+    public boolean removeLastOccurrence(Object o) {
+        int i = lastIndexOf(o);
+        if (i < 0) return false;
+        remove(i);
+        return true;
+    }
+
+    @Override
+    public abstract E set(int index, E element);
+
+    @Override
+    public abstract int size();
+
+    @Override
+    public TableService<E>[] split(int n, boolean updateable) {
+        return SubTableImpl.splitOf(this, n, updateable); // Sub-views over this.
+    }
+
+    @Override
+    public TableService<E> subList(int fromIndex, int toIndex) {
+        return new SubTableImpl<E>(this, fromIndex, toIndex);
+    }
+
+    /** Throws NoSuchElementException */
+    protected void emptyError() {
+        throw new NoSuchElementException("Empty Table");
+    }
+
+    /** Throws IndexOutOfBoundsException */
+    protected void indexError(int index) {
+        throw new IndexOutOfBoundsException("index: " + index + ", size: "
+                + size());
+    }
+
+    /** Returns the actual target */
+    @Override
+    protected TableService<E> target() {
+        return (TableService<E>) super.target();
+    }
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/marmotta-commons/src/ext/java/javolution/util/internal/table/UnmodifiableTableImpl.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-commons/src/ext/java/javolution/util/internal/table/UnmodifiableTableImpl.java b/commons/marmotta-commons/src/ext/java/javolution/util/internal/table/UnmodifiableTableImpl.java
new file mode 100644
index 0000000..138723f
--- /dev/null
+++ b/commons/marmotta-commons/src/ext/java/javolution/util/internal/table/UnmodifiableTableImpl.java
@@ -0,0 +1,84 @@
+/*
+ * 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.util.internal.table;
+
+import javolution.util.function.Equality;
+import javolution.util.service.TableService;
+
+/**
+ * An unmodifiable view over a table.
+ */
+public class UnmodifiableTableImpl<E> extends TableView<E> {
+
+    private static final long serialVersionUID = 0x600L; // Version.
+
+    public UnmodifiableTableImpl(TableService<E> target) {
+        super(target);
+    }
+
+    @Override
+    public boolean add(E element) {
+        throw new UnsupportedOperationException("Read-Only Collection.");
+    }
+
+    @Override
+    public void add(int index, E element) {
+        throw new UnsupportedOperationException("Unmodifiable");
+    }
+
+    @Override
+    public void clear() {
+        throw new UnsupportedOperationException("Read-Only Collection.");
+    }
+
+    @Override
+    public Equality<? super E> comparator() {
+        return target().comparator();
+    }
+
+    @Override
+    public E get(int index) {
+        return target().get(index);
+    }
+
+    @Override
+    public int indexOf(Object o) {
+        return target().indexOf(o);
+    }
+
+    @Override
+    public int lastIndexOf(Object o) {
+        return target().lastIndexOf(o);
+    }
+
+    @Override
+    public E remove(int index) {
+        throw new UnsupportedOperationException("Read-Only Collection.");
+    }
+
+    @Override
+    public E set(int index, E element) {
+        throw new UnsupportedOperationException("Read-Only Collection.");
+    }
+
+    @Override
+    public int size() {
+        return target().size();
+    }
+
+    @Override
+    public TableService<E>[] split(int n, boolean updateable) {
+        return SubTableImpl.splitOf(this, n, false); // Sub-views over this.
+    }
+    
+    @Override
+    protected TableService<E> target() {
+        return (TableService<E>) super.target();
+    }
+ }

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/marmotta-commons/src/ext/java/javolution/util/internal/table/sorted/AtomicSortedTableImpl.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-commons/src/ext/java/javolution/util/internal/table/sorted/AtomicSortedTableImpl.java b/commons/marmotta-commons/src/ext/java/javolution/util/internal/table/sorted/AtomicSortedTableImpl.java
new file mode 100644
index 0000000..3e624e4
--- /dev/null
+++ b/commons/marmotta-commons/src/ext/java/javolution/util/internal/table/sorted/AtomicSortedTableImpl.java
@@ -0,0 +1,55 @@
+/*
+ * 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.util.internal.table.sorted;
+
+import javolution.util.internal.table.AtomicTableImpl;
+import javolution.util.service.SortedTableService;
+import javolution.util.service.TableService;
+
+/**
+ * An atomic view over a sorted table.
+ */
+public class AtomicSortedTableImpl<E> extends AtomicTableImpl<E> implements
+        SortedTableService<E> {
+
+    private static final long serialVersionUID = 0x600L; // Version.
+
+    public AtomicSortedTableImpl(TableService<E> target) {
+        super(target);
+    }
+
+    @Override
+    public synchronized boolean addIfAbsent(E element) {
+        boolean changed = target().addIfAbsent(element);
+        if (changed && !updateInProgress()) immutable = cloneTarget();
+        return changed;
+    }
+
+    @Override
+    public int positionOf(E element) {
+        return targetView().positionOf(element);
+    }
+
+    @Override
+    public SortedTableService<E>[] split(int n, boolean updateable) {
+        return SubSortedTableImpl.splitOf(this, n, false); // Sub-views over this.
+    }
+
+    /** Returns the actual target */
+    @Override
+    protected SortedTableService<E> target() {
+        return (SortedTableService<E>) super.target();
+    }
+
+    @Override
+    protected SortedTableService<E> targetView() {
+        return (SortedTableService<E>) super.targetView();
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/marmotta-commons/src/ext/java/javolution/util/internal/table/sorted/FastSortedTableImpl.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-commons/src/ext/java/javolution/util/internal/table/sorted/FastSortedTableImpl.java b/commons/marmotta-commons/src/ext/java/javolution/util/internal/table/sorted/FastSortedTableImpl.java
new file mode 100644
index 0000000..0fbd5ef
--- /dev/null
+++ b/commons/marmotta-commons/src/ext/java/javolution/util/internal/table/sorted/FastSortedTableImpl.java
@@ -0,0 +1,67 @@
+/*
+ * 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.util.internal.table.sorted;
+
+import javolution.util.function.Equality;
+import javolution.util.internal.table.FastTableImpl;
+import javolution.util.service.SortedTableService;
+
+/**
+ * The default {@link javolution.util.FastSortedTable FastSortedTable} implementation.
+ */
+public class FastSortedTableImpl<E> extends FastTableImpl<E> implements
+        SortedTableService<E> {
+
+    private static final long serialVersionUID = 0x600L; // Version.
+
+    public FastSortedTableImpl(Equality<? super E> comparator) {
+        super(comparator);
+    }
+
+    @Override
+    public boolean add(E element) {
+        add(positionOf(element), element);
+        return true;
+    }
+ 
+    @Override
+    public boolean addIfAbsent(E element) {
+        int i = positionOf(element);
+        if ((i < size()) && comparator().areEqual(element, get(i))) return false; // Already there.
+        add(i, element);
+        return true;
+    }
+ 
+    @SuppressWarnings("unchecked")
+    @Override
+    public int indexOf(Object element) {
+        int i = positionOf((E) element);
+        if (i >= size() || !comparator().areEqual(get(i), (E) element)) return -1;
+        return i;
+    }
+
+    @Override
+    public int positionOf(E element) {
+        return positionOf(element, 0, size());
+    }
+
+    @Override
+    public SortedTableService<E>[] split(int n, boolean updateable) {
+        return SubSortedTableImpl.splitOf(this, n, updateable); // Sub-views over this.
+    }
+
+    private int positionOf(E element, int start, int length) {
+        if (length == 0) return start;
+        int half = length >> 1;
+        return (comparator().compare(element, get(start + half)) <= 0) ? positionOf(
+                element, start, half) : positionOf(element, start + half + 1,
+                length - half - 1);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/marmotta-commons/src/ext/java/javolution/util/internal/table/sorted/SharedSortedTableImpl.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-commons/src/ext/java/javolution/util/internal/table/sorted/SharedSortedTableImpl.java b/commons/marmotta-commons/src/ext/java/javolution/util/internal/table/sorted/SharedSortedTableImpl.java
new file mode 100644
index 0000000..8b8ebfe
--- /dev/null
+++ b/commons/marmotta-commons/src/ext/java/javolution/util/internal/table/sorted/SharedSortedTableImpl.java
@@ -0,0 +1,57 @@
+/*
+ * 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.util.internal.table.sorted;
+
+import javolution.util.internal.table.SharedTableImpl;
+import javolution.util.service.SortedTableService;
+
+/**
+ * A shared view over a sorted table allowing concurrent access and sequential updates.
+ */
+public class SharedSortedTableImpl<E> extends SharedTableImpl<E> implements
+        SortedTableService<E> {
+
+    private static final long serialVersionUID = 0x600L; // Version.
+
+    public SharedSortedTableImpl(SortedTableService<E> target) {
+        super(target);
+    }
+
+    @Override
+    public boolean addIfAbsent(E element) {
+        lock.writeLock.lock();
+        try {
+            return target().addIfAbsent(element);
+        } finally {
+            lock.writeLock.unlock();
+        }
+    }
+
+    @Override
+    public int positionOf(E element) {
+        lock.readLock.lock();
+        try {
+            return target().positionOf(element);
+        } finally {
+            lock.readLock.unlock();
+        }
+    }
+
+    @Override
+    public SortedTableService<E>[] split(int n, boolean updateable) {
+        return SubSortedTableImpl.splitOf(this, n, false); // Sub-views over this.
+    }
+
+    /** Returns the actual target */
+    @Override
+    protected SortedTableService<E> target() {
+        return (SortedTableService<E>) super.target();
+    }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/marmotta-commons/src/ext/java/javolution/util/internal/table/sorted/SortedTableView.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-commons/src/ext/java/javolution/util/internal/table/sorted/SortedTableView.java b/commons/marmotta-commons/src/ext/java/javolution/util/internal/table/sorted/SortedTableView.java
new file mode 100644
index 0000000..0c212b3
--- /dev/null
+++ b/commons/marmotta-commons/src/ext/java/javolution/util/internal/table/sorted/SortedTableView.java
@@ -0,0 +1,68 @@
+/*
+ * 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.util.internal.table.sorted;
+
+import javolution.util.internal.table.TableView;
+import javolution.util.service.SortedTableService;
+
+/**
+ * Sorted table view implementation; can be used as root class for implementations 
+ * if target is {@code null}.
+ */
+public abstract class SortedTableView<E> extends TableView<E> implements
+        SortedTableService<E> {
+
+    private static final long serialVersionUID = 0x600L; // Version.
+
+    /**
+     * The view constructor or root class constructor if target is {@code null}.
+     */
+    public SortedTableView(SortedTableService<E> target) {
+        super(target);
+    }
+
+    @Override
+    public boolean addIfAbsent(E element) {
+        if (!contains(element)) return add(element);
+        return false;
+    }
+
+    @SuppressWarnings("unchecked")
+    @Override
+    public int indexOf(Object o) {
+        int i = positionOf((E) o);
+        if ((i >= size()) || !comparator().areEqual((E) o, get(i))) return -1;
+        return i;
+    }
+
+    @SuppressWarnings("unchecked")
+    @Override
+    public int lastIndexOf(Object o) {
+        int i = positionOf((E) o);
+        int result = -1;
+        while ((i < size()) && comparator().areEqual((E) o, get(i))) {
+            result = i++;
+        }
+        return result;
+    }
+
+    @Override
+    public abstract int positionOf(E element);
+
+    @Override
+    public SortedTableService<E>[] split(int n, boolean updateable) {
+        return SubSortedTableImpl.splitOf(this, n, updateable); // Sub-views over this.
+    }
+
+    @Override
+    protected SortedTableService<E> target() {
+        return (SortedTableService<E>) super.target();
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/marmotta-commons/src/ext/java/javolution/util/internal/table/sorted/SubSortedTableImpl.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-commons/src/ext/java/javolution/util/internal/table/sorted/SubSortedTableImpl.java b/commons/marmotta-commons/src/ext/java/javolution/util/internal/table/sorted/SubSortedTableImpl.java
new file mode 100644
index 0000000..7bb9eba
--- /dev/null
+++ b/commons/marmotta-commons/src/ext/java/javolution/util/internal/table/sorted/SubSortedTableImpl.java
@@ -0,0 +1,87 @@
+/*
+ * 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.util.internal.table.sorted;
+
+import javolution.util.internal.table.SubTableImpl;
+import javolution.util.service.SortedTableService;
+import javolution.util.service.TableService;
+
+/**
+ * A view over a portion of a sorted table. 
+ */
+public class SubSortedTableImpl<E> extends SubTableImpl<E> implements SortedTableService<E> {
+
+    private static final long serialVersionUID = 0x600L; // Version.
+
+    /** Splits the specified table.  */
+    @SuppressWarnings("unchecked")
+    public static <E> SortedTableService<E>[] splitOf(SortedTableService<E> table,
+            int n, boolean updateable) {
+        if (updateable) table = new SharedSortedTableImpl<E>(table);
+        if (n < 1) throw new IllegalArgumentException("Invalid argument n: "
+                + n);
+        SortedTableService<E>[] subTables = new SortedTableService[n];
+        int minSize = table.size() / n;
+        int start = 0;
+        for (int i = 0; i < n - 1; i++) {
+            subTables[i] = new SubSortedTableImpl<E>(table, start, start + minSize);
+            start += minSize;
+        }
+        subTables[n - 1] = new SubSortedTableImpl<E>(table, start, table.size());
+        return subTables;
+    }
+
+     public SubSortedTableImpl(TableService<E> target, int from, int to) {
+        super(target, from, to);
+    }
+
+    @Override
+    public boolean addIfAbsent(E element) {
+        if (!contains(element)) return add(element);
+        return false;
+    }
+
+    @SuppressWarnings("unchecked")
+    @Override
+    public int indexOf(Object o) {
+        int i = positionOf((E) o);
+        if ((i >= size()) || !comparator().areEqual((E) o, get(i))) return -1;
+        return i;
+    }
+
+    @SuppressWarnings("unchecked")
+    @Override
+    public int lastIndexOf(Object o) {
+        int i = positionOf((E) o);
+        int result = -1;
+        while ((i < size()) && comparator().areEqual((E) o, get(i))) {
+            result = i++;
+        }
+        return result;
+    }
+    
+    @Override
+    public int positionOf(E element) {
+        int i = target().positionOf(element);
+        if (i < fromIndex) return 0;
+        if (i >= toIndex) return size();
+        return i - fromIndex;
+    }
+    
+    @Override
+    public SortedTableService<E>[] split(int n, boolean updateable) {
+        return SubSortedTableImpl.splitOf(this, n, updateable); // Sub-views over this.
+    }
+
+    @Override
+    protected SortedTableService<E> target() {
+        return (SortedTableService<E>) super.target();
+    }
+    
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/marmotta-commons/src/ext/java/javolution/util/internal/table/sorted/UnmodifiableSortedTableImpl.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-commons/src/ext/java/javolution/util/internal/table/sorted/UnmodifiableSortedTableImpl.java b/commons/marmotta-commons/src/ext/java/javolution/util/internal/table/sorted/UnmodifiableSortedTableImpl.java
new file mode 100644
index 0000000..7c1efff
--- /dev/null
+++ b/commons/marmotta-commons/src/ext/java/javolution/util/internal/table/sorted/UnmodifiableSortedTableImpl.java
@@ -0,0 +1,46 @@
+/*
+ * 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.util.internal.table.sorted;
+
+import javolution.util.internal.table.UnmodifiableTableImpl;
+import javolution.util.service.SortedTableService;
+
+/**
+ * An unmodifiable view over a sorted table.
+ */
+public class UnmodifiableSortedTableImpl<E> extends UnmodifiableTableImpl<E>
+        implements SortedTableService<E> {
+
+    private static final long serialVersionUID = 0x600L; // Version.
+
+    public UnmodifiableSortedTableImpl(SortedTableService<E> target) {
+        super(target);
+    }
+
+    @Override
+    public boolean addIfAbsent(E element) {
+        throw new UnsupportedOperationException("Read-Only Collection.");
+    }
+
+    @Override
+    public int positionOf(E element) {
+        return target().positionOf(element);
+    }
+    
+    @Override
+    public SortedTableService<E>[] split(int n, boolean updateable) {
+        return SubSortedTableImpl.splitOf(this, n, false); // Sub-views over this.
+    }
+
+    /** Returns the actual target */
+    @Override
+    protected SortedTableService<E> target() {
+        return (SortedTableService<E>) super.target();
+    }
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/marmotta-commons/src/ext/java/javolution/util/package-info.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-commons/src/ext/java/javolution/util/package-info.java b/commons/marmotta-commons/src/ext/java/javolution/util/package-info.java
new file mode 100644
index 0000000..697f95f
--- /dev/null
+++ b/commons/marmotta-commons/src/ext/java/javolution/util/package-info.java
@@ -0,0 +1,32 @@
+/**
+<p> High-performance collection classes with {@link javolution.lang.Realtime 
+    worst case execution time behavior} documented.</p>
+<p> Whereas Java current evolution leads to more and more classes being parts of 
+    the standard library; Javolution approach is quite the opposite. It aims to
+    provide only the quintessential classes from which all others can be derived.
+    </p>
+    <img src="doc-files/architecture.png" /> 
+
+<h2><a name="FAQ">FAQ:</a></h2>
+<ol>
+    <li><b>Does <b>J</b>avolution provide immutable collections similar to 
+     the ones provided by Scala or .NET ?</b>
+    <p> Using <b>J</b>avolution you may return an {@link javolution.lang.Immutable Immutable} 
+        reference (const reference) over any object which cannot be modified including collections or maps.
+[code]
+public class UnitSystem {
+    Set<Unit> units;
+    public UnitSystem(Immutable<Set<Unit>> units) {
+       this.units = units.value(); // Defensive copy unnecessary (immutable)
+    }
+}
+...
+Immutable<Set<Unit>> unitsMKSA = new FastSet<Unit>().addAll(M, K, S, A).toImmutable();
+UnitSystem MKSA = new UnitSystem(unitsMKSA);
+[/code]</p>
+    </li>
+</ol>    
+    
+ */
+package javolution.util;
+

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/marmotta-commons/src/ext/java/javolution/util/service/CollectionService.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-commons/src/ext/java/javolution/util/service/CollectionService.java b/commons/marmotta-commons/src/ext/java/javolution/util/service/CollectionService.java
new file mode 100644
index 0000000..f4664a8
--- /dev/null
+++ b/commons/marmotta-commons/src/ext/java/javolution/util/service/CollectionService.java
@@ -0,0 +1,39 @@
+/*
+ * 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.util.service;
+
+import javolution.util.function.Equality;
+import javolution.util.function.Splittable;
+
+import java.io.Serializable;
+import java.util.Collection;
+
+/**
+ * The fundamental set of related functionalities required to implement 
+ * fast collections.
+ * 
+ * @author <a href="mailto:jean-marie@dautelle.com">Jean-Marie Dautelle</a>
+ * @version 6.0, July 21, 2013
+ */
+public interface CollectionService<E> extends Collection<E>,
+        Splittable<CollectionService<E>>, Serializable, Cloneable {
+
+    /** 
+     * Returns a copy of this collection; updates of the copy should not 
+     * impact the original.
+     */
+    CollectionService<E> clone() throws CloneNotSupportedException;
+
+    /** 
+     * Returns the comparator used for element equality or order if the 
+     * collection is sorted.
+     */
+    Equality<? super E> comparator();
+    
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/marmotta-commons/src/ext/java/javolution/util/service/MapService.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-commons/src/ext/java/javolution/util/service/MapService.java b/commons/marmotta-commons/src/ext/java/javolution/util/service/MapService.java
new file mode 100644
index 0000000..c4a8f91
--- /dev/null
+++ b/commons/marmotta-commons/src/ext/java/javolution/util/service/MapService.java
@@ -0,0 +1,73 @@
+/*
+ * 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.util.service;
+
+import javolution.util.function.Equality;
+import javolution.util.function.Splittable;
+
+import java.io.Serializable;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.concurrent.ConcurrentMap;
+
+/**
+ * The set of related map functionalities required to implement fast maps.
+ * 
+ * @author <a href="mailto:jean-marie@dautelle.com">Jean-Marie Dautelle</a>
+ * @version 6.0, July 21, 2013
+ * @see javolution.util.FastMap#FastMap()
+ */
+public interface MapService<K, V> extends 
+        Map<K, V>, ConcurrentMap<K, V>, Splittable<MapService<K, V>>, Serializable, Cloneable {
+
+    /** 
+     * Returns a copy of this map; updates of the copy should not 
+     * impact the original.
+     */
+    MapService<K, V> clone() throws CloneNotSupportedException;
+
+
+    /**
+     * Returns a set view over the entries of this map. The set 
+     * support adding/removing entries. Two entries are considered 
+     * equals if they have the same key regardless of their values.
+     */
+    @Override
+    SetService<Map.Entry<K, V>> entrySet();
+
+    /**
+     *  Returns an iterator over this map entries.
+     */
+    Iterator<Entry<K, V>> iterator();
+
+    /** 
+    * Returns the key comparator used for key equality or order if the 
+    * map is sorted.
+    */
+    Equality<? super K> keyComparator();
+
+    /**
+     * Returns a set view over the key of this map, the set support 
+     * adding new key for which the value is automatically {@code null}.
+     */
+    @Override
+    SetService<K> keySet();
+
+    /** 
+     * Returns the value comparator used for value equality.
+     */
+    Equality<? super V> valueComparator();
+
+    /**
+     * Returns a collection view over the values of this map, the collection 
+     * support value/entry removal but not adding new values.
+     */
+    @Override
+    CollectionService<V> values(); 
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/marmotta-commons/src/ext/java/javolution/util/service/SetService.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-commons/src/ext/java/javolution/util/service/SetService.java b/commons/marmotta-commons/src/ext/java/javolution/util/service/SetService.java
new file mode 100644
index 0000000..7d2049a
--- /dev/null
+++ b/commons/marmotta-commons/src/ext/java/javolution/util/service/SetService.java
@@ -0,0 +1,24 @@
+/*
+ * 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.util.service;
+
+import java.util.Set;
+
+/**
+ * The set of related functionalities used to implement set collections.
+ * 
+ * @author <a href="mailto:jean-marie@dautelle.com">Jean-Marie Dautelle</a>
+ * @version 6.0, July 21, 2013
+ */
+public interface SetService<E> extends CollectionService<E>, Set<E> {
+  
+    @Override
+    SetService<E>[] split(int n, boolean updateable);
+
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/marmotta-commons/src/ext/java/javolution/util/service/SortedMapService.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-commons/src/ext/java/javolution/util/service/SortedMapService.java b/commons/marmotta-commons/src/ext/java/javolution/util/service/SortedMapService.java
new file mode 100644
index 0000000..9febb73
--- /dev/null
+++ b/commons/marmotta-commons/src/ext/java/javolution/util/service/SortedMapService.java
@@ -0,0 +1,41 @@
+/*
+ * 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.util.service;
+
+import java.util.Map;
+import java.util.SortedMap;
+
+/**
+ * The set of related functionalities used to implement sorted map.
+ * 
+ * @author <a href="mailto:jean-marie@dautelle.com">Jean-Marie Dautelle</a>
+ * @version 6.0, July 21, 2013
+ */
+public interface SortedMapService<K, V> extends MapService<K, V>,
+        SortedMap<K, V> {
+
+    @Override
+    SortedSetService<Map.Entry<K, V>> entrySet();
+
+    @Override
+    SortedMapService<K, V> headMap(K toKey);
+
+    @Override
+    SortedSetService<K> keySet();
+
+    @Override
+    SortedMapService<K, V> subMap(K fromKey, K toKey);
+
+    @Override
+    SortedMapService<K, V> tailMap(K fromKey);
+    
+    @Override
+    SortedMapService<K, V>[] split(int n, boolean updateable);
+
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/marmotta-commons/src/ext/java/javolution/util/service/SortedSetService.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-commons/src/ext/java/javolution/util/service/SortedSetService.java b/commons/marmotta-commons/src/ext/java/javolution/util/service/SortedSetService.java
new file mode 100644
index 0000000..5028ae5
--- /dev/null
+++ b/commons/marmotta-commons/src/ext/java/javolution/util/service/SortedSetService.java
@@ -0,0 +1,33 @@
+/*
+ * 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.util.service;
+
+import java.util.SortedSet;
+
+/**
+ * The set of related functionalities used to implement sorted set collections.
+ * 
+ * @author <a href="mailto:jean-marie@dautelle.com">Jean-Marie Dautelle</a>
+ * @version 6.0, July 21, 2013
+ */
+public interface SortedSetService<E> extends SetService<E>, SortedSet<E> {
+
+    @Override
+    SortedSetService<E> headSet(E toElement);
+
+    @Override
+    SortedSetService<E> subSet(E fromElement, E toElement);
+
+    @Override
+    SortedSetService<E> tailSet(E fromElement);
+    
+    @Override
+    SortedSetService<E>[] split(int n, boolean updateable);
+
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/marmotta-commons/src/ext/java/javolution/util/service/SortedTableService.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-commons/src/ext/java/javolution/util/service/SortedTableService.java b/commons/marmotta-commons/src/ext/java/javolution/util/service/SortedTableService.java
new file mode 100644
index 0000000..74e47e2
--- /dev/null
+++ b/commons/marmotta-commons/src/ext/java/javolution/util/service/SortedTableService.java
@@ -0,0 +1,36 @@
+/*
+ * 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.util.service;
+
+/**
+ * The set of related functionalities used to implement sorted tables collections.
+ * 
+ * @author <a href="mailto:jean-marie@dautelle.com">Jean-Marie Dautelle</a>
+ * @version 6.0, July 21, 2013
+ */
+public interface SortedTableService<E> extends TableService<E> {
+
+    /** 
+     * Adds the specified element only if not already present.
+     *  
+     * @return {@code true} if the element has been added; 
+     *         {@code false} otherwise.
+     */
+    boolean addIfAbsent(E element);
+
+    /** 
+     * Returns what would be the index of the specified element if it were
+     * to be added or the index of the specified element if already present.
+     */
+    int positionOf(E element);
+    
+    @Override
+    SortedTableService<E>[] split(int n, boolean updateable);
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/marmotta-commons/src/ext/java/javolution/util/service/TableService.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-commons/src/ext/java/javolution/util/service/TableService.java b/commons/marmotta-commons/src/ext/java/javolution/util/service/TableService.java
new file mode 100644
index 0000000..e338840
--- /dev/null
+++ b/commons/marmotta-commons/src/ext/java/javolution/util/service/TableService.java
@@ -0,0 +1,29 @@
+/*
+ * 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.util.service;
+
+import java.util.Deque;
+import java.util.List;
+import java.util.RandomAccess;
+
+/**
+ * The set of related functionalities used to implement tables collections.
+ * 
+ * @author <a href="mailto:jean-marie@dautelle.com">Jean-Marie Dautelle</a>
+ * @version 6.0, July 21, 2013
+ */
+public interface TableService<E> extends CollectionService<E>, List<E>, Deque<E>, RandomAccess {
+
+    @Override
+    TableService<E> subList(int fromIndex, int toIndex);
+    
+    @Override
+    TableService<E>[] split(int n, boolean updateable);
+
+}


[066/100] [abbrv] git commit: add some more testing add configuration for clover plugin

Posted by wi...@apache.org.
add some more testing
add configuration for clover plugin


Project: http://git-wip-us.apache.org/repos/asf/marmotta/repo
Commit: http://git-wip-us.apache.org/repos/asf/marmotta/commit/a789e499
Tree: http://git-wip-us.apache.org/repos/asf/marmotta/tree/a789e499
Diff: http://git-wip-us.apache.org/repos/asf/marmotta/diff/a789e499

Branch: refs/heads/ldp
Commit: a789e4994d422a691f219543353a3c3a1ad53a66
Parents: 85a5993
Author: Sebastian Schaffert <ss...@apache.org>
Authored: Tue Apr 8 16:41:27 2014 +0200
Committer: Sebastian Schaffert <ss...@apache.org>
Committed: Tue Apr 8 16:41:27 2014 +0200

----------------------------------------------------------------------
 .../collections/BaseEquivalenceHashMapTest.java |  98 +++++++++
 .../collections/BaseEquivalenceHashSetTest.java | 211 +++++++++++++++++++
 .../collections/EquivalenceHashSet2Test.java    |  62 ------
 .../collections/EquivalenceHashSetTest.java     | 138 ------------
 .../collections/FastEquivalenceHashSetTest.java |  62 ++++++
 .../StandardEquivalenceHashMapTest.java         |  35 +++
 .../StandardEquivalenceHashSetTest.java         |  35 +++
 parent/pom.xml                                  |  10 +
 8 files changed, 451 insertions(+), 200 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/marmotta/blob/a789e499/commons/marmotta-commons/src/test/java/org/apache/marmotta/commons/collections/BaseEquivalenceHashMapTest.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-commons/src/test/java/org/apache/marmotta/commons/collections/BaseEquivalenceHashMapTest.java b/commons/marmotta-commons/src/test/java/org/apache/marmotta/commons/collections/BaseEquivalenceHashMapTest.java
new file mode 100644
index 0000000..29d1890
--- /dev/null
+++ b/commons/marmotta-commons/src/test/java/org/apache/marmotta/commons/collections/BaseEquivalenceHashMapTest.java
@@ -0,0 +1,98 @@
+/*
+ * 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.commons.collections;
+
+import com.google.common.base.Equivalence;
+import org.junit.Test;
+
+import java.util.Map;
+
+import static org.hamcrest.Matchers.*;
+import static org.junit.Assert.*;
+
+/**
+ * Add file description here!
+ *
+ * @author Sebastian Schaffert (sschaffert@apache.org)
+ */
+public abstract class BaseEquivalenceHashMapTest {
+
+    // a simple equivalence function on strings, saying they are equal if their first character is the same
+    Equivalence<String> equivalence = new Equivalence<String>() {
+        @Override
+        protected boolean doEquivalent(String a, String b) {
+            return a.charAt(0) == b.charAt(0);
+        }
+
+        @Override
+        protected int doHash(String s) {
+            return s.charAt(0) * 31;
+        }
+    };
+
+    public abstract Map<String,String> createHashMap(Equivalence<String> equivalence);
+
+    @Test
+    public void testPutGet() {
+        Map<String,String> map = createHashMap(equivalence);
+
+        map.put("abc","a");
+        map.put("axy","a");
+        map.put("xyz","x");
+
+        assertEquals(2, map.size());
+        assertTrue(map.containsKey("abc"));
+        assertTrue(map.containsKey("axy"));
+        assertTrue(map.containsKey("aef"));
+
+        assertEquals("a", map.get("abc"));
+        assertEquals("a", map.get("aef"));
+
+        assertTrue(map.containsValue("a"));
+        assertTrue(map.containsValue("x"));
+    }
+
+    @Test
+    public void testKeySet() {
+        Map<String,String> map = createHashMap(equivalence);
+
+        map.put("abc","a");
+        map.put("axy","a");
+        map.put("xyz","x");
+
+        assertThat(map.keySet(), contains(startsWith("a"), startsWith("x")));
+    }
+
+    @Test
+    public void testIteration() {
+        Map<String,String> map = createHashMap(equivalence);
+
+        map.put("abc","a");
+        map.put("axy","a");
+        map.put("xyz","x");
+
+        int count = 0;
+        for(Map.Entry<String,String> e : map.entrySet()) {
+            assertThat(e.getKey(), anyOf(equalTo("abc"), equalTo("axy"), equalTo("xyz")));
+            assertThat(e.getValue(), anyOf(equalTo("a"), equalTo("x")));
+            count++;
+        }
+        assertEquals(2, count);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/a789e499/commons/marmotta-commons/src/test/java/org/apache/marmotta/commons/collections/BaseEquivalenceHashSetTest.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-commons/src/test/java/org/apache/marmotta/commons/collections/BaseEquivalenceHashSetTest.java b/commons/marmotta-commons/src/test/java/org/apache/marmotta/commons/collections/BaseEquivalenceHashSetTest.java
new file mode 100644
index 0000000..95cba91
--- /dev/null
+++ b/commons/marmotta-commons/src/test/java/org/apache/marmotta/commons/collections/BaseEquivalenceHashSetTest.java
@@ -0,0 +1,211 @@
+/*
+ * 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.commons.collections;
+
+import com.google.common.base.Equivalence;
+import com.google.common.collect.Sets;
+import org.junit.Test;
+
+import java.util.Set;
+
+import static org.hamcrest.Matchers.hasItemInArray;
+import static org.hamcrest.Matchers.startsWith;
+import static org.junit.Assert.*;
+
+/**
+ * Add file description here!
+ *
+ * @author Sebastian Schaffert (sschaffert@apache.org)
+ */
+public abstract class BaseEquivalenceHashSetTest {
+
+    // a simple equivalence function on strings, saying they are equal if their first character is the same
+    Equivalence<String> equivalence = new Equivalence<String>() {
+        @Override
+        protected boolean doEquivalent(String a, String b) {
+            return a.charAt(0) == b.charAt(0);
+        }
+
+        @Override
+        protected int doHash(String s) {
+            return s.charAt(0) * 31;
+        }
+    };
+
+    public abstract Set<String> createHashSet(Equivalence<String> equivalence);
+
+    @Test
+    public void testEquivalence() {
+        assertTrue(equivalence.equivalent("abc", "axy"));
+        assertFalse(equivalence.equivalent("abc", "xyz"));
+
+        assertTrue(equivalence.hash("abc") == equivalence.hash("axy"));
+        assertFalse(equivalence.hash("abc") == equivalence.hash("xyz"));
+    }
+
+    @Test
+    public void testSetContains() {
+        String a = "abc";
+        String b = "axy";
+        String c = "xyz";
+
+        Set<String> set = createHashSet(equivalence);
+        set.add(a);
+
+        // set should now also contain b (because first character the same)
+        assertTrue(set.contains(b));
+
+        set.add(b);
+
+        // adding b should not change the set
+        assertEquals(1, set.size());
+
+        set.add(c);
+
+        assertEquals(2, set.size());
+
+        assertTrue(set.containsAll(Sets.newHashSet(a, b, c)));
+    }
+
+
+    @Test
+    public void testSetEquals() {
+        String a1 = "abc";
+        String a2 = "axy";
+        String b1 = "bcd";
+        String b2 = "bxy";
+        String c1 = "cde";
+
+        Set<String> set1 = createHashSet(equivalence);
+        Set<String> set2 = createHashSet(equivalence);
+
+        // test empty sets
+        assertEquals(set1, set2);
+
+        set1.add(a1);
+        set1.add(b1);
+
+        set2.add(b2);
+        set2.add(a2);
+
+
+        assertEquals(2, set1.size());
+        assertEquals(2, set2.size());
+
+
+        // test sets with elements, insertion order different
+        assertEquals(set1, set2);
+        assertEquals(set1.hashCode(), set2.hashCode());
+
+        set1.add(c1);
+
+        assertNotEquals(set1, set2);
+        assertNotEquals(set1.hashCode(), set2.hashCode());
+
+
+    }
+
+    @Test
+    public void testIteration() {
+        String a = "abc";
+        String b = "axy";
+        String c = "xyz";
+
+        Set<String> set = createHashSet(equivalence);
+        set.add(a);
+        set.add(b);
+        set.add(c);
+
+        int count = 0;
+        for(String x : set) {
+            count++;
+        }
+        assertEquals(2, count);
+    }
+
+
+    @Test
+    public void testEmpty() {
+        Set<String> set = createHashSet(equivalence);
+
+        assertTrue(set.isEmpty());
+
+        set.add("abc");
+
+        assertFalse(set.isEmpty());
+    }
+
+
+    @Test
+    public void testToArray() {
+        String a = "abc";
+        String b = "axy";
+        String c = "xyz";
+
+        Set<String> set = createHashSet(equivalence);
+        set.add(a);
+        set.add(b);
+        set.add(c);
+
+        String[] arr = new String[4];
+
+        arr = set.toArray(arr);
+
+        assertEquals(2, countNotNull(arr));
+        assertThat(arr, hasItemInArray(startsWith("a")));
+        assertThat(arr, hasItemInArray(startsWith("x")));
+    }
+
+
+    @Test
+    public void testRemove() {
+        String a = "abc";
+        String b = "axy";
+        String c = "xyz";
+
+        Set<String> set = createHashSet(equivalence);
+        set.add(a);
+        set.add(b);
+        set.add(c);
+
+        assertEquals(2, set.size());
+
+        set.remove(a);
+
+        assertEquals(1, set.size());
+        assertTrue(set.contains(c));
+        assertFalse(set.contains(b));
+
+        set.remove(c);
+
+        assertEquals(0, set.size());
+        assertFalse(set.contains(c));
+        assertFalse(set.contains(b));
+    }
+
+
+    private static <T> int countNotNull(T[] arr) {
+        int count = 0;
+        for(int i=0; i<arr.length; i++) {
+            if(arr[i] != null) {
+                count++;
+            }
+        }
+        return count;
+    }
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/a789e499/commons/marmotta-commons/src/test/java/org/apache/marmotta/commons/collections/EquivalenceHashSet2Test.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-commons/src/test/java/org/apache/marmotta/commons/collections/EquivalenceHashSet2Test.java b/commons/marmotta-commons/src/test/java/org/apache/marmotta/commons/collections/EquivalenceHashSet2Test.java
deleted file mode 100644
index 185b0be..0000000
--- a/commons/marmotta-commons/src/test/java/org/apache/marmotta/commons/collections/EquivalenceHashSet2Test.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * 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.commons.collections;
-
-import com.google.common.base.Equivalence;
-import javolution.util.FastSet;
-import javolution.util.function.Equality;
-
-import java.util.Set;
-
-/**
- * Add file description here!
- *
- * @author Sebastian Schaffert (sschaffert@apache.org)
- */
-public class EquivalenceHashSet2Test extends EquivalenceHashSetTest {
-
-    @Override
-    public Set<String> createHashSet(final Equivalence<String> equivalence) {
-        return new FastSet<>(new Equality<String>() {
-            @Override
-            public int hashCodeOf(String object) {
-                return equivalence.hash(object);
-            }
-
-            @Override
-            public boolean areEqual(String left, String right) {
-                return equivalence.equivalent(left, right);
-            }
-
-            @Override
-            public int compare(String left, String right) {
-                return equivalence.hash(left) - equivalence.hash(right);
-            }
-
-            @Override
-            public int hashCode() {
-                return equivalence.hashCode();
-            }
-
-            @Override
-            public boolean equals(Object obj) {
-                return obj.hashCode() == hashCode();
-            }
-        });
-    }
-}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/a789e499/commons/marmotta-commons/src/test/java/org/apache/marmotta/commons/collections/EquivalenceHashSetTest.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-commons/src/test/java/org/apache/marmotta/commons/collections/EquivalenceHashSetTest.java b/commons/marmotta-commons/src/test/java/org/apache/marmotta/commons/collections/EquivalenceHashSetTest.java
deleted file mode 100644
index a01813c..0000000
--- a/commons/marmotta-commons/src/test/java/org/apache/marmotta/commons/collections/EquivalenceHashSetTest.java
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
- * 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.commons.collections;
-
-import com.google.common.base.Equivalence;
-import org.junit.Assert;
-import org.junit.Test;
-
-import java.util.Set;
-
-/**
- * Add file description here!
- *
- * @author Sebastian Schaffert (sschaffert@apache.org)
- */
-public class EquivalenceHashSetTest {
-
-    // a simple equivalence function on strings, saying they are equal if their first character is the same
-    Equivalence<String> equivalence = new Equivalence<String>() {
-        @Override
-        protected boolean doEquivalent(String a, String b) {
-            return a.charAt(0) == b.charAt(0);
-        }
-
-        @Override
-        protected int doHash(String s) {
-            return s.charAt(0) * 31;
-        }
-    };
-
-    public Set<String> createHashSet(Equivalence<String> equivalence) {
-        return new EquivalenceHashSet<>(equivalence);
-    }
-
-    @Test
-    public void testEquivalence() {
-        Assert.assertTrue(equivalence.equivalent("abc","axy"));
-        Assert.assertFalse(equivalence.equivalent("abc", "xyz"));
-
-        Assert.assertTrue(equivalence.hash("abc") == equivalence.hash("axy"));
-        Assert.assertFalse(equivalence.hash("abc") == equivalence.hash("xyz"));
-    }
-
-    @Test
-    public void testSetContains() {
-        String a = "abc";
-        String b = "axy";
-        String c = "xyz";
-
-        Set<String> set = createHashSet(equivalence);
-        set.add(a);
-
-        // set should now also contain b (because first character the same)
-        Assert.assertTrue(set.contains(b));
-
-        set.add(b);
-
-        // adding b should not change the set
-        Assert.assertEquals(1, set.size());
-
-        set.add(c);
-
-        Assert.assertEquals(2, set.size());
-
-    }
-
-
-    @Test
-    public void testSetEquals() {
-        String a1 = "abc";
-        String a2 = "axy";
-        String b1 = "bcd";
-        String b2 = "bxy";
-        String c1 = "cde";
-
-        Set<String> set1 = createHashSet(equivalence);
-        Set<String> set2 = createHashSet(equivalence);
-
-        // test empty sets
-        Assert.assertEquals(set1,set2);
-
-        set1.add(a1);
-        set1.add(b1);
-
-        set2.add(b2);
-        set2.add(a2);
-
-
-        Assert.assertEquals(2, set1.size());
-        Assert.assertEquals(2, set2.size());
-
-
-        // test sets with elements, insertion order different
-        Assert.assertEquals(set1,set2);
-        Assert.assertEquals(set1.hashCode(), set2.hashCode());
-
-        set1.add(c1);
-
-        Assert.assertNotEquals(set1,set2);
-        Assert.assertNotEquals(set1.hashCode(), set2.hashCode());
-
-
-    }
-
-    @Test
-    public void testIteration() {
-        String a = "abc";
-        String b = "axy";
-        String c = "xyz";
-
-        Set<String> set = createHashSet(equivalence);
-        set.add(a);
-        set.add(b);
-        set.add(c);
-
-        int count = 0;
-        for(String x : set) {
-            count++;
-        }
-        Assert.assertEquals(2,count);
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/a789e499/commons/marmotta-commons/src/test/java/org/apache/marmotta/commons/collections/FastEquivalenceHashSetTest.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-commons/src/test/java/org/apache/marmotta/commons/collections/FastEquivalenceHashSetTest.java b/commons/marmotta-commons/src/test/java/org/apache/marmotta/commons/collections/FastEquivalenceHashSetTest.java
new file mode 100644
index 0000000..232615d
--- /dev/null
+++ b/commons/marmotta-commons/src/test/java/org/apache/marmotta/commons/collections/FastEquivalenceHashSetTest.java
@@ -0,0 +1,62 @@
+/*
+ * 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.commons.collections;
+
+import com.google.common.base.Equivalence;
+import javolution.util.FastSet;
+import javolution.util.function.Equality;
+
+import java.util.Set;
+
+/**
+ * Tests for HashSet with custom equivalence function (FastSet implementation)
+ *
+ * @author Sebastian Schaffert (sschaffert@apache.org)
+ */
+public class FastEquivalenceHashSetTest extends BaseEquivalenceHashSetTest {
+
+    @Override
+    public Set<String> createHashSet(final Equivalence<String> equivalence) {
+        return new FastSet<>(new Equality<String>() {
+            @Override
+            public int hashCodeOf(String object) {
+                return equivalence.hash(object);
+            }
+
+            @Override
+            public boolean areEqual(String left, String right) {
+                return equivalence.equivalent(left, right);
+            }
+
+            @Override
+            public int compare(String left, String right) {
+                return equivalence.hash(left) - equivalence.hash(right);
+            }
+
+            @Override
+            public int hashCode() {
+                return equivalence.hashCode();
+            }
+
+            @Override
+            public boolean equals(Object obj) {
+                return obj.hashCode() == hashCode();
+            }
+        });
+    }
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/a789e499/commons/marmotta-commons/src/test/java/org/apache/marmotta/commons/collections/StandardEquivalenceHashMapTest.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-commons/src/test/java/org/apache/marmotta/commons/collections/StandardEquivalenceHashMapTest.java b/commons/marmotta-commons/src/test/java/org/apache/marmotta/commons/collections/StandardEquivalenceHashMapTest.java
new file mode 100644
index 0000000..ab52f3a
--- /dev/null
+++ b/commons/marmotta-commons/src/test/java/org/apache/marmotta/commons/collections/StandardEquivalenceHashMapTest.java
@@ -0,0 +1,35 @@
+/*
+ * 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.commons.collections;
+
+import com.google.common.base.Equivalence;
+
+import java.util.Map;
+
+/**
+ * Tests for HashSet with custom equivalence function (standard implementation)
+ *
+ * @author Sebastian Schaffert (sschaffert@apache.org)
+ */
+public class StandardEquivalenceHashMapTest extends BaseEquivalenceHashMapTest {
+
+    @Override
+    public Map<String, String> createHashMap(Equivalence<String> equivalence) {
+        return new EquivalenceHashMap<>(equivalence);
+    }
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/a789e499/commons/marmotta-commons/src/test/java/org/apache/marmotta/commons/collections/StandardEquivalenceHashSetTest.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-commons/src/test/java/org/apache/marmotta/commons/collections/StandardEquivalenceHashSetTest.java b/commons/marmotta-commons/src/test/java/org/apache/marmotta/commons/collections/StandardEquivalenceHashSetTest.java
new file mode 100644
index 0000000..04bf93b
--- /dev/null
+++ b/commons/marmotta-commons/src/test/java/org/apache/marmotta/commons/collections/StandardEquivalenceHashSetTest.java
@@ -0,0 +1,35 @@
+/*
+ * 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.commons.collections;
+
+import com.google.common.base.Equivalence;
+
+import java.util.Set;
+
+/**
+ * Tests for HashSet with custom equivalence function (standard implementation)
+ *
+ * @author Sebastian Schaffert (sschaffert@apache.org)
+ */
+public class StandardEquivalenceHashSetTest extends BaseEquivalenceHashSetTest {
+
+    public Set<String> createHashSet(Equivalence<String> equivalence) {
+        return new EquivalenceHashSet<>(equivalence);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/a789e499/parent/pom.xml
----------------------------------------------------------------------
diff --git a/parent/pom.xml b/parent/pom.xml
index 309bc45..5bbfffc 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -146,6 +146,16 @@
                     </configuration>
                 </plugin>
                 <plugin>
+                    <groupId>com.atlassian.maven.plugins</groupId>
+                    <artifactId>maven-clover2-plugin</artifactId>
+                    <version>3.3.0</version>
+                    <configuration>
+                        <excludes>
+                            <exclude>**/org/apache/marmotta/maven/plugins/**</exclude>
+                        </excludes>
+                    </configuration>
+                </plugin>
+                <plugin>
                     <groupId>org.apache.maven.plugins</groupId>
                     <artifactId>maven-failsafe-plugin</artifactId>
                     <version>2.16</version>


[062/100] [abbrv] git commit: fixed RAT configuration

Posted by wi...@apache.org.
fixed RAT configuration


Project: http://git-wip-us.apache.org/repos/asf/marmotta/repo
Commit: http://git-wip-us.apache.org/repos/asf/marmotta/commit/5112274c
Tree: http://git-wip-us.apache.org/repos/asf/marmotta/tree/5112274c
Diff: http://git-wip-us.apache.org/repos/asf/marmotta/diff/5112274c

Branch: refs/heads/ldp
Commit: 5112274cb99426248544c4897ba1c6e34f23189a
Parents: 2983aea
Author: Jakob Frank <ja...@apache.org>
Authored: Tue Apr 8 11:13:47 2014 +0200
Committer: Jakob Frank <ja...@apache.org>
Committed: Tue Apr 8 11:13:47 2014 +0200

----------------------------------------------------------------------
 commons/marmotta-sesame-tools/pom.xml | 2 ++
 1 file changed, 2 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/marmotta/blob/5112274c/commons/marmotta-sesame-tools/pom.xml
----------------------------------------------------------------------
diff --git a/commons/marmotta-sesame-tools/pom.xml b/commons/marmotta-sesame-tools/pom.xml
index 6a6792c..15aa51d 100644
--- a/commons/marmotta-sesame-tools/pom.xml
+++ b/commons/marmotta-sesame-tools/pom.xml
@@ -56,6 +56,8 @@
                         <exclude>marmotta-rio-*/**</exclude>
                         <exclude>marmotta-sail-*/**</exclude>
                         <exclude>marmotta-util-*/**</exclude>
+                        <exclude>marmotta-model-vocabs/**</exclude>
+                        <exclude>marmotta-sesame-matchers/**</exclude>
                     </excludes>
                 </configuration>
             </plugin>


[005/100] [abbrv] [partial] Reverting the erroneous merge by Sebastian according to the instructions in INFRA-6876

Posted by wi...@apache.org.
http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/platform/marmotta-core/src/main/resources/web/admin/js/lib/raphael-dracula.pack.min.js
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/resources/web/admin/js/lib/raphael-dracula.pack.min.js b/platform/marmotta-core/src/main/resources/web/admin/js/lib/raphael-dracula.pack.min.js
deleted file mode 100644
index 1bf619e..0000000
--- a/platform/marmotta-core/src/main/resources/web/admin/js/lib/raphael-dracula.pack.min.js
+++ /dev/null
@@ -1,7 +0,0 @@
-/*
- * Raphael 1.3.1 - JavaScript Vector Library
- *
- * Copyright (c) 2008 - 2009 Dmitry Baranovskiy (http://raphaeljs.com)
- * Licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) license.
- */function log(a){console.log&&console.log(a)}Raphael=function(){function Q(a,b,c){function d(){var e=Array[r].slice.call(arguments,0),f=e[p]("►"),g=d.cache=d.cache||{},h=d.count=d.count||[];return g[o](f)?c?c(g[f]):g[f]:(h[q]>=1e3&&delete g[h.shift()],h[B](f),g[f]=a[i](b,e),c?c(g[f]):g[f])}return d}function bE(){return this.x+l+this.y}function bO(a){return function(b,c,d,e){var g={back:a};return f.is(d,"function")?e=d:g.rot=d,b&&b.constructor==br&&(b=b.attrs.path),b&&(g.along=b),this.animate(g,c,e)}}var a=/[, ]+/,b=/^(circle|rect|path|ellipse|text|image)$/,c=document,d=window,e={was:"Raphael"in d,is:d.Raphael},f=function(){if(f.is(arguments[0],"array")){var a=arguments[0],c=by[i](f,a.splice(0,3+f.is(a[0],w))),d=c.set();for(var e=0,g=a[q];e<g;e++){var h=a[e]||{};b.test(h.type)&&d[B](c[h.type]().attr(h))}return d}return by[i](f,arguments)},g=function(){},h="appendChild",i="apply",j="concat",k="",l=" ",m="split",n="click dblclick mousedown mousemove mouseout mouseover mouseup"[m](l
 ),o="hasOwnProperty",p="join",q="length",r="prototype",s=String[r].toLowerCase,t=Math,u=t.max,v=t.min,w="number",x="toString",y=Object[r][x],z={},A=t.pow,B="push",C=/^(?=[\da-f]$)/,D=/^url\(['"]?([^\)]+)['"]?\)$/i,E=/^\s*((#[a-f\d]{6})|(#[a-f\d]{3})|rgb\(\s*([\d\.]+\s*,\s*[\d\.]+\s*,\s*[\d\.]+)\s*\)|rgb\(\s*([\d\.]+%\s*,\s*[\d\.]+%\s*,\s*[\d\.]+%)\s*\)|hs[bl]\(\s*([\d\.]+\s*,\s*[\d\.]+\s*,\s*[\d\.]+)\s*\)|hs[bl]\(\s*([\d\.]+%\s*,\s*[\d\.]+%\s*,\s*[\d\.]+%)\s*\))\s*$/i,F=t.round,G="setAttribute",H=parseFloat,I=parseInt,J=String[r].toUpperCase,K={"clip-rect":"0 0 1e9 1e9",cursor:"default",cx:0,cy:0,fill:"#fff","fill-opacity":1,font:'10px "Arial"',"font-family":'"Arial"',"font-size":"10","font-style":"normal","font-weight":400,gradient:0,height:0,href:"http://raphaeljs.com/",opacity:1,path:"M0,0",r:0,rotation:0,rx:0,ry:0,scale:"1 1",src:"",stroke:"#000","stroke-dasharray":"","stroke-linecap":"butt","stroke-linejoin":"butt","stroke-miterlimit":0,"stroke-opacity":1,"stroke-width":1,targe
 t:"_blank","text-anchor":"middle",title:"Raphael",translation:"0 0",width:0,x:0,y:0},L={along:"along","clip-rect":"csv",cx:w,cy:w,fill:"colour","fill-opacity":w,"font-size":w,height:w,opacity:w,path:"path",r:w,rotation:"csv",rx:w,ry:w,scale:"csv",stroke:"colour","stroke-opacity":w,"stroke-width":w,translation:"csv",width:w,x:w,y:w},M="replace";f.version="1.3.1",f.type=d.SVGAngle||c.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")?"SVG":"VML";if(f.type=="VML"){var N=document.createElement("div");N.innerHTML="<!--[if vml]><br><br><![endif]-->";if(N.childNodes[q]!=2)return null}f.svg=!(f.vml=f.type=="VML"),g[r]=f[r],f._id=0,f._oid=0,f.fn={},f.is=function(a,b){return b=s.call(b),(b=="object"||b=="undefined")&&typeof a==b||a==null&&b=="null"||s.call(y.call(a).slice(8,-1))==b},f.setWindow=function(a){d=a,c=d.document};var O=function(a){if(f.vml){var b=/^\s+|\s+$/g;O=Q(function(a){var c;a=(a+k)[M](b,k);try{var d=new ActiveXObject("htmlfile");d.write("<bo
 dy>"),d.close(),c=d.body}catch(e){c=createPopup().document.body}var f=c.createTextRange();try{c.style.color=a;var g=f.queryCommandValue("ForeColor");return g=(g&255)<<16|g&65280|(g&16711680)>>>16,"#"+("000000"+g[x](16)).slice(-6)}catch(e){return"none"}})}else{var d=c.createElement("i");d.title="Raphaël Colour Picker",d.style.display="none",c.body[h](d),O=Q(function(a){return d.style.color=a,c.defaultView.getComputedStyle(d,k).getPropertyValue("color")})}return O(a)};f.hsb2rgb=Q(function(a,b,c){f.is(a,"object")&&"h"in a&&"s"in a&&"b"in a&&(c=a.b,b=a.s,a=a.h);var d,e,g;if(c==0)return{r:0,g:0,b:0,hex:"#000"};if(a>1||b>1||c>1)a/=255,b/=255,c/=255;var h=~~(a*6),i=a*6-h,j=c*(1-b),k=c*(1-b*i),l=c*(1-b*(1-i));d=[c,k,j,j,l,c,c][h],e=[l,c,c,k,j,j,l][h],g=[j,j,l,c,c,k,j][h],d*=255,e*=255,g*=255;var m={r:d,g:e,b:g},n=(~~d)[x](16),o=(~~e)[x](16),p=(~~g)[x](16);return n=n[M](C,"0"),o=o[M](C,"0"),p=p[M](C,"0"),m.hex="#"+n+o+p,m},f),f.rgb2hsb=Q(function(a,b,c){f.is(a,"object")&&"r"in a&&"g"in a&&"
 b"in a&&(c=a.b,b=a.g,a=a.r);if(f.is(a,"string")){var d=f.getRGB(a);a=d.r,b=d.g,c=d.b}if(a>1||b>1||c>1)a/=255,b/=255,c/=255;var e=u(a,b,c),g=v(a,b,c),h,i,j=e;if(g==e)return{h:0,s:0,b:e};var k=e-g;return i=k/e,a==e?h=(b-c)/k:b==e?h=2+(c-a)/k:h=4+(a-b)/k,h/=6,h<0&&h++,h>1&&h--,{h:h,s:i,b:j}},f);var P=/,?([achlmqrstvxz]),?/gi;f._path2string=function(){return this.join(",")[M](P,"$1")},f.getRGB=Q(function(a){if(!a||!!((a+=k).indexOf("-")+1))return{r:-1,g:-1,b:-1,hex:"none",error:1};if(a=="none")return{r:-1,g:-1,b:-1,hex:"none"};!{hs:1,rg:1}[o](a.substring(0,2))&&a.charAt()!="#"&&(a=O(a));var b,c,d,e,g,h=a.match(E);if(h){h[2]&&(e=I(h[2].substring(5),16),d=I(h[2].substring(3,5),16),c=I(h[2].substring(1,3),16)),h[3]&&(e=I((g=h[3].charAt(3))+g,16),d=I((g=h[3].charAt(2))+g,16),c=I((g=h[3].charAt(1))+g,16)),h[4]&&(h=h[4][m](/\s*,\s*/),c=H(h[0]),d=H(h[1]),e=H(h[2])),h[5]&&(h=h[5][m](/\s*,\s*/),c=H(h[0])*2.55,d=H(h[1])*2.55,e=H(h[2])*2.55);if(h[6])return h=h[6][m](/\s*,\s*/),c=H(h[0]),d=H(h[1]),
 e=H(h[2]),f.hsb2rgb(c,d,e);if(h[7])return h=h[7][m](/\s*,\s*/),c=H(h[0])*2.55,d=H(h[1])*2.55,e=H(h[2])*2.55,f.hsb2rgb(c,d,e);h={r:c,g:d,b:e};var i=(~~c)[x](16),j=(~~d)[x](16),l=(~~e)[x](16);return i=i[M](C,"0"),j=j[M](C,"0"),l=l[M](C,"0"),h.hex="#"+i+j+l,h}return{r:-1,g:-1,b:-1,hex:"none",error:1}},f),f.getColor=function(a){var b=this.getColor.start=this.getColor.start||{h:0,s:1,b:a||.75},c=this.hsb2rgb(b.h,b.s,b.b);return b.h+=.075,b.h>1&&(b.h=0,b.s-=.2,b.s<=0&&(this.getColor.start={h:0,s:1,b:b.b})),c.hex},f.getColor.reset=function(){delete this.start},f.parsePathString=Q(function(a){if(!a)return null;var b={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},c=[];return f.is(a,"array")&&f.is(a[0],"array")&&(c=S(a)),c[q]||(a+k)[M](/([achlmqstvz])[\s,]*((-?\d*\.?\d*(?:e[-+]?\d+)?\s*,?\s*)+)/ig,function(a,d,e){var f=[],g=s.call(d);e[M](/(-?\d*\.?\d*(?:e[-+]?\d+)?)\s*,?\s*/ig,function(a,b){b&&f[B](+b)});while(f[q]>=b[g]){c[B]([d][j](f.splice(0,b[g])));if(!b[g])break}}),c[x]=f._path2string,c}),f.
 findDotsAtSegment=function(a,b,c,d,e,f,g,h,i){var j=1-i,k=A(j,3)*a+A(j,2)*3*i*c+j*3*i*i*e+A(i,3)*g,l=A(j,3)*b+A(j,2)*3*i*d+j*3*i*i*f+A(i,3)*h,m=a+2*i*(c-a)+i*i*(e-2*c+a),n=b+2*i*(d-b)+i*i*(f-2*d+b),o=c+2*i*(e-c)+i*i*(g-2*e+c),p=d+2*i*(f-d)+i*i*(h-2*f+d),q=(1-i)*a+i*c,r=(1-i)*b+i*d,s=(1-i)*e+i*g,u=(1-i)*f+i*h,v=90-t.atan((m-o)/(n-p))*180/t.PI;return(m>o||n<p)&&(v+=180),{x:k,y:l,m:{x:m,y:n},n:{x:o,y:p},start:{x:q,y:r},end:{x:s,y:u},alpha:v}};var R=Q(function(a){if(!a)return{x:0,y:0,width:0,height:0};a=$(a);var b=0,c=0,d=[],e=[],f;for(var g=0,h=a[q];g<h;g++){f=a[g];if(f[0]=="M")b=f[1],c=f[2],d[B](b),e[B](c);else{var k=Z(b,c,f[1],f[2],f[3],f[4],f[5],f[6]);d=d[j](k.min.x,k.max.x),e=e[j](k.min.y,k.max.y),b=f[5],c=f[6]}}var l=v[i](0,d),m=v[i](0,e);return{x:l,y:m,width:u[i](0,d)-l,height:u[i](0,e)-m}}),S=function(a){var b=[];if(!f.is(a,"array")||!f.is(a&&a[0],"array"))a=f.parsePathString(a);for(var c=0,d=a[q];c<d;c++){b[c]=[];for(var e=0,g=a[c][q];e<g;e++)b[c][e]=a[c][e]}return b[x]=f._path
 2string,b},T=Q(function(a){if(!f.is(a,"array")||!f.is(a&&a[0],"array"))a=f.parsePathString(a);var b=[],c=0,d=0,e=0,g=0,h=0;a[0][0]=="M"&&(c=a[0][1],d=a[0][2],e=c,g=d,h++,b[B](["M",c,d]));for(var i=h,j=a[q];i<j;i++){var k=b[i]=[],l=a[i];if(l[0]!=s.call(l[0])){k[0]=s.call(l[0]);switch(k[0]){case"a":k[1]=l[1],k[2]=l[2],k[3]=l[3],k[4]=l[4],k[5]=l[5],k[6]=+(l[6]-c).toFixed(3),k[7]=+(l[7]-d).toFixed(3);break;case"v":k[1]=+(l[1]-d).toFixed(3);break;case"m":e=l[1],g=l[2];default:for(var m=1,n=l[q];m<n;m++)k[m]=+(l[m]-(m%2?c:d)).toFixed(3)}}else{k=b[i]=[],l[0]=="m"&&(e=l[1]+c,g=l[2]+d);for(var o=0,p=l[q];o<p;o++)b[i][o]=l[o]}var r=b[i][q];switch(b[i][0]){case"z":c=e,d=g;break;case"h":c+=+b[i][r-1];break;case"v":d+=+b[i][r-1];break;default:c+=+b[i][r-2],d+=+b[i][r-1]}}return b[x]=f._path2string,b},0,S),U=Q(function(a){if(!f.is(a,"array")||!f.is(a&&a[0],"array"))a=f.parsePathString(a);var b=[],c=0,d=0,e=0,g=0,h=0;a[0][0]=="M"&&(c=+a[0][1],d=+a[0][2],e=c,g=d,h++,b[0]=["M",c,d]);for(var i=h,j=a[
 q];i<j;i++){var k=b[i]=[],l=a[i];if(l[0]!=J.call(l[0])){k[0]=J.call(l[0]);switch(k[0]){case"A":k[1]=l[1],k[2]=l[2],k[3]=l[3],k[4]=l[4],k[5]=l[5],k[6]=+(l[6]+c),k[7]=+(l[7]+d);break;case"V":k[1]=+l[1]+d;break;case"H":k[1]=+l[1]+c;break;case"M":e=+l[1]+c,g=+l[2]+d;default:for(var m=1,n=l[q];m<n;m++)k[m]=+l[m]+(m%2?c:d)}}else for(var o=0,p=l[q];o<p;o++)b[i][o]=l[o];switch(k[0]){case"Z":c=e,d=g;break;case"H":c=k[1];break;case"V":d=k[1];break;default:c=b[i][b[i][q]-2],d=b[i][b[i][q]-1]}}return b[x]=f._path2string,b},null,S),V=function(a,b,c,d){return[a,b,c,d,c,d]},W=function(a,b,c,d,e,f){var g=1/3,h=2/3;return[g*a+h*c,g*b+h*d,g*e+h*c,g*f+h*d,e,f]},X=function(a,b,c,d,e,f,g,h,i,k){var l=t.PI,n=l*120/180,o=l/180*(+e||0),r=[],s,v=Q(function(a,b,c){var d=a*t.cos(c)-b*t.sin(c),e=a*t.sin(c)+b*t.cos(c);return{x:d,y:e}});if(!k){s=v(a,b,-o),a=s.x,b=s.y,s=v(h,i,-o),h=s.x,i=s.y;var w=t.cos(l/180*e),x=t.sin(l/180*e),y=(a-h)/2,z=(b-i)/2;c=u(c,t.abs(y)),d=u(d,t.abs(z));var A=y*y/(c*c)+z*z/(d*d);A>1&&(c
 =t.sqrt(A)*c,d=t.sqrt(A)*d);var B=c*c,C=d*d,D=(f==g?-1:1)*t.sqrt(t.abs((B*C-B*z*z-C*y*y)/(B*z*z+C*y*y))),E=D*c*z/d+(a+h)/2,F=D*-d*y/c+(b+i)/2,G=t.asin(((b-F)/d).toFixed(7)),H=t.asin(((i-F)/d).toFixed(7));G=a<E?l-G:G,H=h<E?l-H:H,G<0&&(G=l*2+G),H<0&&(H=l*2+H),g&&G>H&&(G-=l*2),!g&&H>G&&(H-=l*2)}else G=k[0],H=k[1],E=k[2],F=k[3];var I=H-G;if(t.abs(I)>n){var J=H,K=h,L=i;H=G+n*(g&&H>G?1:-1),h=E+c*t.cos(H),i=F+d*t.sin(H),r=X(h,i,c,d,e,0,g,K,L,[H,J,E,F])}I=H-G;var M=t.cos(G),N=t.sin(G),O=t.cos(H),P=t.sin(H),R=t.tan(I/4),S=4/3*c*R,T=4/3*d*R,U=[a,b],V=[a+S*N,b-T*M],W=[h+S*P,i-T*O],Y=[h,i];V[0]=2*U[0]-V[0],V[1]=2*U[1]-V[1];if(k)return[V,W,Y][j](r);r=[V,W,Y][j](r)[p]()[m](",");var Z=[];for(var $=0,_=r[q];$<_;$++)Z[$]=$%2?v(r[$-1],r[$],o).y:v(r[$],r[$+1],o).x;return Z},Y=function(a,b,c,d,e,f,g,h,i){var j=1-i;return{x:A(j,3)*a+A(j,2)*3*i*c+j*3*i*i*e+A(i,3)*g,y:A(j,3)*b+A(j,2)*3*i*d+j*3*i*i*f+A(i,3)*h}},Z=Q(function(a,b,c,d,e,f,g,h){var j=e-2*c+a-(g-2*e+c),k=2*(c-a)-2*(e-c),l=a-c,m=(-k+t.sqrt(k*k-4
 *j*l))/2/j,n=(-k-t.sqrt(k*k-4*j*l))/2/j,o=[b,h],p=[a,g],q;return t.abs(m)>1e12&&(m=.5),t.abs(n)>1e12&&(n=.5),m>0&&m<1&&(q=Y(a,b,c,d,e,f,g,h,m),p[B](q.x),o[B](q.y)),n>0&&n<1&&(q=Y(a,b,c,d,e,f,g,h,n),p[B](q.x),o[B](q.y)),j=f-2*d+b-(h-2*f+d),k=2*(d-b)-2*(f-d),l=b-d,m=(-k+t.sqrt(k*k-4*j*l))/2/j,n=(-k-t.sqrt(k*k-4*j*l))/2/j,t.abs(m)>1e12&&(m=.5),t.abs(n)>1e12&&(n=.5),m>0&&m<1&&(q=Y(a,b,c,d,e,f,g,h,m),p[B](q.x),o[B](q.y)),n>0&&n<1&&(q=Y(a,b,c,d,e,f,g,h,n),p[B](q.x),o[B](q.y)),{min:{x:v[i](0,p),y:v[i](0,o)},max:{x:u[i](0,p),y:u[i](0,o)}}}),$=Q(function(a,b){var c=U(a),d=b&&U(b),e={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},f={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},g=function(a,b){var c,d;if(!a)return["C",b.x,b.y,b.x,b.y,b.x,b.y];!(a[0]in{T:1,Q:1})&&(b.qx=b.qy=null);switch(a[0]){case"M":b.X=a[1],b.Y=a[2];break;case"A":a=["C"][j](X[i](0,[b.x,b.y][j](a.slice(1))));break;case"S":c=b.x+(b.x-(b.bx||b.x)),d=b.y+(b.y-(b.by||b.y)),a=["C",c,d][j](a.slice(1));break;case"T":b.qx=b.x+(b.x-(b.qx||b.
 x)),b.qy=b.y+(b.y-(b.qy||b.y)),a=["C"][j](W(b.x,b.y,b.qx,b.qy,a[1],a[2]));break;case"Q":b.qx=a[1],b.qy=a[2],a=["C"][j](W(b.x,b.y,a[1],a[2],a[3],a[4]));break;case"L":a=["C"][j](V(b.x,b.y,a[1],a[2]));break;case"H":a=["C"][j](V(b.x,b.y,a[1],b.y));break;case"V":a=["C"][j](V(b.x,b.y,b.x,a[1]));break;case"Z":a=["C"][j](V(b.x,b.y,b.X,b.Y))}return a},h=function(a,b){if(a[b][q]>7){a[b].shift();var e=a[b];while(e[q])a.splice(b++,0,["C"][j](e.splice(0,6)));a.splice(b,1),m=u(c[q],d&&d[q]||0)}},k=function(a,b,e,f,g){a&&b&&a[g][0]=="M"&&b[g][0]!="M"&&(b.splice(g,0,["M",f.x,f.y]),e.bx=0,e.by=0,e.x=a[g][1],e.y=a[g][2],m=u(c[q],d&&d[q]||0))};for(var l=0,m=u(c[q],d&&d[q]||0);l<m;l++){c[l]=g(c[l],e),h(c,l),d&&(d[l]=g(d[l],f)),d&&h(d,l),k(c,d,e,f,l),k(d,c,f,e,l);var n=c[l],o=d&&d[l],p=n[q],r=d&&o[q];e.x=n[p-2],e.y=n[p-1],e.bx=H(n[p-4])||e.x,e.by=H(n[p-3])||e.y,f.bx=d&&(H(o[r-4])||f.x),f.by=d&&(H(o[r-3])||f.y),f.x=d&&o[r-2],f.y=d&&o[r-1]}return d?[c,d]:c},null,S),_=Q(function(a){var b=[];for(var c=0,d=a
 [q];c<d;c++){var e={},g=a[c].match(/^([^:]*):?([\d\.]*)/);e.color=f.getRGB(g[1]);if(e.color.error)return null;e.color=e.color.hex,g[2]&&(e.offset=g[2]+"%"),b[B](e)}for(var c=1,d=b[q]-1;c<d;c++)if(!b[c].offset){var h=H(b[c-1].offset||0),i=0;for(var j=c+1;j<d;j++)if(b[j].offset){i=b[j].offset;break}i||(i=100,j=d),i=H(i);var k=(i-h)/(j-c+1);for(;c<j;c++)h+=k,b[c].offset=h+"%"}return b}),ba=function(){var a,b,d,e,g;if(f.is(arguments[0],"string")||f.is(arguments[0],"object")){f.is(arguments[0],"string")?a=c.getElementById(arguments[0]):a=arguments[0];if(a.tagName)return arguments[1]==null?{container:a,width:a.style.pixelWidth||a.offsetWidth,height:a.style.pixelHeight||a.offsetHeight}:{container:a,width:arguments[1],height:arguments[2]}}else if(f.is(arguments[0],w)&&arguments[q]>3)return{container:1,x:arguments[0],y:arguments[1],width:arguments[2],height:arguments[3]}},bb=function(a,b){var c=this;for(var d in b)if(b[o](d)&&!(d in a))switch(typeof b[d]){case"function":(function(b){a[d]=a==
 =c?b:function(){return b[i](c,arguments)}})(b[d]);break;case"object":a[d]=a[d]||{},bb.call(this,a[d],b[d]);break;default:a[d]=b[d]}},bc=function(a,b){a==b.top&&(b.top=a.prev),a==b.bottom&&(b.bottom=a.next),a.next&&(a.next.prev=a.prev),a.prev&&(a.prev.next=a.next)},bd=function(a,b){if(b.top===a)return;bc(a,b),a.next=null,a.prev=b.top,b.top.next=a,b.top=a},be=function(a,b){if(b.bottom===a)return;bc(a,b),a.next=b.bottom,a.prev=null,b.bottom.prev=a,b.bottom=a},bf=function(a,b,c){bc(a,c),b==c.top&&(c.top=a),b.next&&(b.next.prev=a),a.next=b.next,a.prev=b,b.next=a},bg=function(a,b,c){bc(a,c),b==c.bottom&&(c.bottom=a),b.prev&&(b.prev.next=a),a.prev=b.prev,b.prev=a,a.next=b},bh=function(a){return function(){throw new Error("Raphaël: you are calling to method “"+a+"” of removed object")}},bi=/^r(?:\(([^,]+?)\s*,\s*([^\)]+?)\))?/;if(f.svg){g[r].svgns="http://www.w3.org/2000/svg",g[r].xlink="http://www.w3.org/1999/xlink";var F=function(a){return+a+(~~a===a)*.5},bj=function(a){for(var b=0,c
 =a[q];b<c;b++)if(s.call(a[b][0])!="a")for(var d=1,e=a[b][q];d<e;d++)a[b][d]=F(a[b][d]);else a[b][6]=F(a[b][6]),a[b][7]=F(a[b][7]);return a},bk=function(a,b){if(!b)return c.createElementNS(g[r].svgns,a);for(var d in b)b[o](d)&&a[G](d,b[d])};f[x]=function(){return"Your browser supports SVG.\nYou are running Raphaël "+this.version};var bl=function(a,b){var c=bk("path");b.canvas&&b.canvas[h](c);var d=new br(c,b);return d.type="path",bo(d,{fill:"none",stroke:"#000",path:a}),d},bm=function(a,b,c){var d="linear",e=.5,g=.5,i=a.style;b=(b+k)[M](bi,function(a,b,c){d="radial";if(b&&c){e=H(b),g=H(c);var f=(g>.5)*2-1;A(e-.5,2)+A(g-.5,2)>.25&&(g=t.sqrt(.25-A(e-.5,2))*f+.5)&&g!=.5&&(g=g.toFixed(5)-1e-5*f)}return k}),b=b[m](/\s*\-\s*/);if(d=="linear"){var j=b.shift();j=-H(j);if(isNaN(j))return null;var l=[0,0,t.cos(j*t.PI/180),t.sin(j*t.PI/180)],n=1/(u(t.abs(l[2]),t.abs(l[3]))||1);l[2]*=n,l[3]*=n,l[2]<0&&(l[0]=-l[2],l[2]=0),l[3]<0&&(l[1]=-l[3],l[3]=0)}var o=_(b);if(!o)return null;var p=bk(d+"Gradi
 ent");p.id="r"+(f._id++)[x](36),bk(p,d=="radial"?{fx:e,fy:g}:{x1:l[0],y1:l[1],x2:l[2],y2:l[3]}),c.defs[h](p);for(var r=0,s=o[q];r<s;r++){var v=bk("stop");bk(v,{offset:o[r].offset?o[r].offset:r?"100%":"0%","stop-color":o[r].color||"#fff"}),p[h](v)}return bk(a,{fill:"url(#"+p.id+")",opacity:1,"fill-opacity":1}),i.fill=k,i.opacity=1,i.fillOpacity=1,1},bn=function(a){var b=a.getBBox();bk(a.pattern,{patternTransform:f.format("translate({0},{1})",b.x,b.y)})},bo=function(b,d){var e={"":[0],none:[0],"-":[3,1],".":[1,1],"-.":[3,1,1,1],"-..":[3,1,1,1,1,1],". ":[1,3],"- ":[4,3],"--":[8,3],"- .":[4,3,1,3],"--.":[8,3,1,3],"--..":[8,3,1,3,1,3]},g=b.node,i=b.attrs,j=b.rotate(),n=function(a,b){b=e[s.call(b)];if(b){var c=a.attrs["stroke-width"]||"1",f={round:c,square:c,butt:0}[a.attrs["stroke-linecap"]||d["stroke-linecap"]]||0,h=[],i=b[q];while(i--)h[i]=b[i]*c+(i%2?1:-1)*f;bk(g,{"stroke-dasharray":h[p](",")})}};d[o]("rotation")&&(j=d.rotation);var r=(j+k)[m](a);r.length-1?(r[1]=+r[1],r[2]=+r[2]):r=n
 ull,H(j)&&b.rotate(0,!0);for(var t in d)if(d[o](t)){if(!K[o](t))continue;var u=d[t];i[t]=u;switch(t){case"rotation":b.rotate(u,!0);break;case"href":case"title":case"target":var v=g.parentNode;if(s.call(v.tagName)!="a"){var w=bk("a");v.insertBefore(w,g),w[h](g),v=w}v.setAttributeNS(b.paper.xlink,t,u);break;case"cursor":g.style.cursor=u;break;case"clip-rect":var y=(u+k)[m](a);if(y[q]==4){b.clip&&b.clip.parentNode.parentNode.removeChild(b.clip.parentNode);var z=bk("clipPath"),A=bk("rect");z.id="r"+(f._id++)[x](36),bk(A,{x:y[0],y:y[1],width:y[2],height:y[3]}),z[h](A),b.paper.defs[h](z),bk(g,{"clip-path":"url(#"+z.id+")"}),b.clip=A}if(!u){var B=c.getElementById(g.getAttribute("clip-path")[M](/(^url\(#|\)$)/g,k));B&&B.parentNode.removeChild(B),bk(g,{"clip-path":k}),delete b.clip}break;case"path":u&&b.type=="path"&&(i.path=bj(U(u)),bk(g,{d:i.path}));break;case"width":g[G](t,u);if(i.fx)t="x",u=i.x;else break;case"x":i.fx&&(u=-i.x-(i.width||0));case"rx":if(t=="rx"&&b.type=="rect")break;case"
 cx":r&&(t=="x"||t=="cx")&&(r[1]+=u-i[t]),g[G](t,F(u)),b.pattern&&bn(b);break;case"height":g[G](t,u);if(i.fy)t="y",u=i.y;else break;case"y":i.fy&&(u=-i.y-(i.height||0));case"ry":if(t=="ry"&&b.type=="rect")break;case"cy":r&&(t=="y"||t=="cy")&&(r[2]+=u-i[t]),g[G](t,F(u)),b.pattern&&bn(b);break;case"r":b.type=="rect"?bk(g,{rx:u,ry:u}):g[G](t,u);break;case"src":b.type=="image"&&g.setAttributeNS(b.paper.xlink,"href",u);break;case"stroke-width":g.style.strokeWidth=u,g[G](t,u),i["stroke-dasharray"]&&n(b,i["stroke-dasharray"]);break;case"stroke-dasharray":n(b,u);break;case"translation":var C=(u+k)[m](a);C[0]=+C[0]||0,C[1]=+C[1]||0,r&&(r[1]+=C[0],r[2]+=C[1]),bN.call(b,C[0],C[1]);break;case"scale":var C=(u+k)[m](a);b.scale(+C[0]||1,+C[1]||+C[0]||1,+C[2]||null,+C[3]||null);break;case"fill":var E=(u+k).match(D);if(E){var z=bk("pattern"),L=bk("image");z.id="r"+(f._id++)[x](36),bk(z,{x:0,y:0,patternUnits:"userSpaceOnUse",height:1,width:1}),bk(L,{x:0,y:0}),L.setAttributeNS(b.paper.xlink,"href",E[1]
 ),z[h](L);var N=c.createElement("img");N.style.cssText="position:absolute;left:-9999em;top-9999em",N.onload=function(){bk(z,{width:this.offsetWidth,height:this.offsetHeight}),bk(L,{width:this.offsetWidth,height:this.offsetHeight}),c.body.removeChild(this),b.paper.safari()},c.body[h](N),N.src=E[1],b.paper.defs[h](z),g.style.fill="url(#"+z.id+")",bk(g,{fill:"url(#"+z.id+")"}),b.pattern=z,b.pattern&&bn(b);break}if(!f.getRGB(u).error)delete d.gradient,delete i.gradient,!f.is(i.opacity,"undefined")&&f.is(d.opacity,"undefined")&&bk(g,{opacity:i.opacity}),!f.is(i["fill-opacity"],"undefined")&&f.is(d["fill-opacity"],"undefined")&&bk(g,{"fill-opacity":i["fill-opacity"]});else if(({circle:1,ellipse:1}[o](b.type)||(u+k).charAt()!="r")&&bm(g,u,b.paper)){i.gradient=u,i.fill="none";break};case"stroke":g[G](t,f.getRGB(u).hex);break;case"gradient":((({circle:1,ellipse:1}))[o](b.type)||(u+k).charAt()!="r")&&bm(g,u,b.paper);break;case"opacity":case"fill-opacity":if(i.gradient){var O=c.getElementById(
 g.getAttribute("fill")[M](/^url\(#|\)$/g,k));if(O){var P=O.getElementsByTagName("stop");P[P[q]-1][G]("stop-opacity",u)}break};default:t=="font-size"&&(u=I(u,10)+"px");var Q=t[M](/(\-.)/g,function(a){return J.call(a.substring(1))});g.style[Q]=u,g[G](t,u)}}bq(b,d),r?b.rotate(r.join(l)):H(j)&&b.rotate(j,!0)},bp=1.2,bq=function(a,b){if(a.type!="text"||!(b[o]("text")||b[o]("font")||b[o]("font-size")||b[o]("x")||b[o]("y")))return;var d=a.attrs,e=a.node,f=e.firstChild?I(c.defaultView.getComputedStyle(e.firstChild,k).getPropertyValue("font-size"),10):10;if(b[o]("text")){d.text=b.text;while(e.firstChild)e.removeChild(e.firstChild);var g=(b.text+k)[m]("\n");for(var i=0,j=g[q];i<j;i++)if(g[i]){var l=bk("tspan");i&&bk(l,{dy:f*bp,x:d.x}),l[h](c.createTextNode(g[i])),e[h](l)}}else{var g=e.getElementsByTagName("tspan");for(var i=0,j=g[q];i<j;i++)i&&bk(g[i],{dy:f*bp,x:d.x})}bk(e,{y:d.y});var n=a.getBBox(),p=d.y-(n.y+n.height/2);p&&isFinite(p)&&bk(e,{y:d.y+p})},br=function(a,b){var c=0,d=0;this[0]=a
 ,this.id=f._oid++,this.node=a,a.raphael=this,this.paper=b,this.attrs=this.attrs||{},this.transformations=[],this._={tx:0,ty:0,rt:{deg:0,cx:0,cy:0},sx:1,sy:1},!b.bottom&&(b.bottom=this),this.prev=b.top,b.top&&(b.top.next=this),b.top=this,this.next=null};br[r].rotate=function(b,c,d){if(this.removed)return this;if(b==null)return this._.rt.cx?[this._.rt.deg,this._.rt.cx,this._.rt.cy][p](l):this._.rt.deg;var e=this.getBBox();return b=(b+k)[m](a),b[q]-1&&(c=H(b[1]),d=H(b[2])),b=H(b[0]),c!=null?this._.rt.deg=b:this._.rt.deg+=b,d==null&&(c=null),this._.rt.cx=c,this._.rt.cy=d,c=c==null?e.x+e.width/2:c,d=d==null?e.y+e.height/2:d,this._.rt.deg?(this.transformations[0]=f.format("rotate({0} {1} {2})",this._.rt.deg,c,d),this.clip&&bk(this.clip,{transform:f.format("rotate({0} {1} {2})",-this._.rt.deg,c,d)})):(this.transformations[0]=k,this.clip&&bk(this.clip,{transform:k})),bk(this.node,{transform:this.transformations[p](l)}),this},br[r].hide=function(){return!this.removed&&(this.node.style.displa
 y="none"),this},br[r].show=function(){return!this.removed&&(this.node.style.display=""),this},br[r].remove=function(){if(this.removed)return;bc(this,this.paper),this.node.parentNode.removeChild(this.node);for(var a in this)delete this[a];this.removed=!0},br[r].getBBox=function(){if(this.removed)return this;if(this.type=="path")return R(this.attrs.path);if(this.node.style.display=="none"){this.show();var a=!0}var b={};try{b=this.node.getBBox()}catch(c){}finally{b=b||{}}if(this.type=="text"){b={x:b.x,y:Infinity,width:0,height:0};for(var d=0,e=this.node.getNumberOfChars();d<e;d++){var f=this.node.getExtentOfChar(d);f.y<b.y&&(b.y=f.y),f.y+f.height-b.y>b.height&&(b.height=f.y+f.height-b.y),f.x+f.width-b.x>b.width&&(b.width=f.x+f.width-b.x)}}return a&&this.hide(),b},br[r].attr=function(){if(this.removed)return this;if(arguments[q]==0){var a={};for(var b in this.attrs)this.attrs[o](b)&&(a[b]=this.attrs[b]);return this._.rt.deg&&(a.rotation=this.rotate()),(this._.sx!=1||this._.sy!=1)&&(a.sc
 ale=this.scale()),a.gradient&&a.fill=="none"&&(a.fill=a.gradient)&&delete a.gradient,a}if(arguments[q]==1&&f.is(arguments[0],"string"))return arguments[0]=="translation"?bN.call(this):arguments[0]=="rotation"?this.rotate():arguments[0]=="scale"?this.scale():arguments[0]=="fill"&&this.attrs.fill=="none"&&this.attrs.gradient?this.attrs.gradient:this.attrs[arguments[0]];if(arguments[q]==1&&f.is(arguments[0],"array")){var c={};for(var d in arguments[0])arguments[0][o](d)&&(c[arguments[0][d]]=this.attrs[arguments[0][d]]);return c}if(arguments[q]==2){var e={};e[arguments[0]]=arguments[1],bo(this,e)}else arguments[q]==1&&f.is(arguments[0],"object")&&bo(this,arguments[0]);return this},br[r].toFront=function(){if(this.removed)return this;this.node.parentNode[h](this.node);var a=this.paper;return a.top!=this&&bd(this,a),this},br[r].toBack=function(){if(this.removed)return this;if(this.node.parentNode.firstChild!=this.node){this.node.parentNode.insertBefore(this.node,this.node.parentNode.first
 Child),be(this,this.paper);var a=this.paper}return this},br[r].insertAfter=function(a){if(this.removed)return this;var b=a.node;return b.nextSibling?b.parentNode.insertBefore(this.node,b.nextSibling):b.parentNode[h](this.node),bf(this,a,this.paper),this},br[r].insertBefore=function(a){if(this.removed)return this;var b=a.node;return b.parentNode.insertBefore(this.node,b),bg(this,a,this.paper),this};var bs=function(a,b,c,d){b=F(b),c=F(c);var e=bk("circle");a.canvas&&a.canvas[h](e);var f=new br(e,a);return f.attrs={cx:b,cy:c,r:d,fill:"none",stroke:"#000"},f.type="circle",bk(e,f.attrs),f},bt=function(a,b,c,d,e,f){b=F(b),c=F(c);var g=bk("rect");a.canvas&&a.canvas[h](g);var i=new br(g,a);return i.attrs={x:b,y:c,width:d,height:e,r:f||0,rx:f||0,ry:f||0,fill:"none",stroke:"#000"},i.type="rect",bk(g,i.attrs),i},bu=function(a,b,c,d,e){b=F(b),c=F(c);var f=bk("ellipse");a.canvas&&a.canvas[h](f);var g=new br(f,a);return g.attrs={cx:b,cy:c,rx:d,ry:e,fill:"none",stroke:"#000"},g.type="ellipse",bk(f
 ,g.attrs),g},bv=function(a,b,c,d,e,f){var g=bk("image");bk(g,{x:c,y:d,width:e,height:f,preserveAspectRatio:"none"}),g.setAttributeNS(a.xlink,"href",b),a.canvas&&a.canvas[h](g);var i=new br(g,a);return i.attrs={x:c,y:d,width:e,height:f,src:b},i.type="image",i},bw=function(a,b,c,d){var e=bk("text");bk(e,{x:b,y:c,"text-anchor":"middle"}),a.canvas&&a.canvas[h](e);var f=new br(e,a);return f.attrs={x:b,y:c,"text-anchor":"middle",text:d,font:K.font,stroke:"none",fill:"#000"},f.type="text",bo(f,f.attrs),f},bx=function(a,b){return this.width=a||this.width,this.height=b||this.height,this.canvas[G]("width",this.width),this.canvas[G]("height",this.height),this},by=function(){var a=ba[i](null,arguments),b=a&&a.container,d=a.x,e=a.y,j=a.width,k=a.height;if(!b)throw new Error("SVG container not found.");var l=bk("svg");return j=j||512,k=k||342,bk(l,{xmlns:"http://www.w3.org/2000/svg",version:1.1,width:j,height:k}),b==1?(l.style.cssText="position:absolute;left:"+d+"px;top:"+e+"px",c.body[h](l)):b.f
 irstChild?b.insertBefore(l,b.firstChild):b[h](l),b=new g,b.width=j,b.height=k,b.canvas=l,bb.call(b,b,f.fn),b.clear(),b};g[r].clear=function(){var a=this.canvas;while(a.firstChild)a.removeChild(a.firstChild);this.bottom=this.top=null,(this.desc=bk("desc"))[h](c.createTextNode("Created with Raphaël")),a[h](this.desc),a[h](this.defs=bk("defs"))},g[r].remove=function(){this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas);for(var a in this)this[a]=bh(a)}}if(f.vml){var bz=function(a){var b=/[ahqstv]/ig,c=U;(a+k).match(b)&&(c=$),b=/[clmz]/g;if(c==U&&!(a+k).match(b)){var d={M:"m",L:"l",C:"c",Z:"x",m:"t",l:"r",c:"v",z:"x"},e=/([clmz]),?([^clmz]*)/gi,f=/-?[^,\s-]+/g,g=(a+k)[M](e,function(a,b,c){var e=[];return c[M](f,function(a){e[B](F(a))}),d[b]+e});return g}var h=c(a),i,g=[],j;for(var m=0,n=h[q];m<n;m++){i=h[m],j=s.call(h[m][0]),j=="z"&&(j="x");for(var o=1,r=i[q];o<r;o++)j+=F(i[o])+(o!=r-1?",":k);g[B](j)}return g[p](l)};f[x]=function(){return"Your browser doesn’t suppo
 rt SVG. Falling down to VML.\nYou are running Raphaël "+this.version};var bl=function(a,b){var c=bA("group");c.style.cssText="position:absolute;left:0;top:0;width:"+b.width+"px;height:"+b.height+"px",c.coordsize=b.coordsize,c.coordorigin=b.coordorigin;var d=bA("shape"),e=d.style;e.width=b.width+"px",e.height=b.height+"px",d.coordsize=this.coordsize,d.coordorigin=this.coordorigin,c[h](d);var f=new br(d,c,b);return f.isAbsolute=!0,f.type="path",f.path=[],f.Path=k,a&&bo(f,{fill:"none",stroke:"#000",path:a}),b.canvas[h](c),f},bo=function(b,d){b.attrs=b.attrs||{};var e=b.node,g=b.attrs,i=e.style,j,l=b;for(var n in d)d[o](n)&&(g[n]=d[n]);d.href&&(e.href=d.href),d.title&&(e.title=d.title),d.target&&(e.target=d.target),d.cursor&&(i.cursor=d.cursor),d.path&&b.type=="path"&&(g.path=d.path,e.path=bz(g.path)),d.rotation!=null&&b.rotate(d.rotation,!0),d.translation&&(j=(d.translation+k)[m](a),bN.call(b,j[0],j[1]),b._.rt.cx!=null&&(b._.rt.cx+=+j[0],b._.rt.cy+=+j[1],b.setBox(b.attrs,j[0],j[1]))),
 d.scale&&(j=(d.scale+k)[m](a),b.scale(+j[0]||1,+j[1]||+j[0]||1,+j[2]||null,+j[3]||null));if("clip-rect"in d){var p=(d["clip-rect"]+k)[m](a);if(p[q]==4){p[2]=+p[2]+ +p[0],p[3]=+p[3]+ +p[1];var r=e.clipRect||c.createElement("div"),s=r.style,t=e.parentNode;s.clip=f.format("rect({1}px {2}px {3}px {0}px)",p),e.clipRect||(s.position="absolute",s.top=0,s.left=0,s.width=b.paper.width+"px",s.height=b.paper.height+"px",t.parentNode.insertBefore(r,t),r[h](t),e.clipRect=r)}d["clip-rect"]||e.clipRect&&(e.clipRect.style.clip=k)}b.type=="image"&&d.src&&(e.src=d.src),b.type=="image"&&d.opacity&&(e.filterOpacity=" progid:DXImageTransform.Microsoft.Alpha(opacity="+d.opacity*100+")",i.filter=(e.filterMatrix||k)+(e.filterOpacity||k)),d.font&&(i.font=d.font),d["font-family"]&&(i.fontFamily='"'+d["font-family"][m](",")[0][M](/^['"]+|['"]+$/g,k)+'"'),d["font-size"]&&(i.fontSize=d["font-size"]),d["font-weight"]&&(i.fontWeight=d["font-weight"]),d["font-style"]&&(i.fontStyle=d["font-style"]);if(d.opacity!=nu
 ll||d["stroke-width"]!=null||d.fill!=null||d.stroke!=null||d["stroke-width"]!=null||d["stroke-opacity"]!=null||d["fill-opacity"]!=null||d["stroke-dasharray"]!=null||d["stroke-miterlimit"]!=null||d["stroke-linejoin"]!=null||d["stroke-linecap"]!=null){e=b.shape||e;var u=e.getElementsByTagName("fill")&&e.getElementsByTagName("fill")[0],v=!1;!u&&(v=u=bA("fill"));if("fill-opacity"in d||"opacity"in d){var w=((+g["fill-opacity"]+1||2)-1)*((+g.opacity+1||2)-1);w<0&&(w=0),w>1&&(w=1),u.opacity=w}d.fill&&(u.on=!0);if(u.on==null||d.fill=="none")u.on=!1;if(u.on&&d.fill){var x=d.fill.match(D);x?(u.src=x[1],u.type="tile"):(u.color=f.getRGB(d.fill).hex,u.src=k,u.type="solid",f.getRGB(d.fill).error&&(l.type in{circle:1,ellipse:1}||(d.fill+k).charAt()!="r")&&bm(l,d.fill)&&(g.fill="none",g.gradient=d.fill))}v&&e[h](u);var y=e.getElementsByTagName("stroke")&&e.getElementsByTagName("stroke")[0],z=!1;!y&&(z=y=bA("stroke"));if(d.stroke&&d.stroke!="none"||d["stroke-width"]||d["stroke-opacity"]!=null||d["st
 roke-dasharray"]||d["stroke-miterlimit"]||d["stroke-linejoin"]||d["stroke-linecap"])y.on=!0;(d.stroke=="none"||y.on==null||d.stroke==0||d["stroke-width"]==0)&&(y.on=!1),y.on&&d.stroke&&(y.color=f.getRGB(d.stroke).hex);var w=((+g["stroke-opacity"]+1||2)-1)*((+g.opacity+1||2)-1),A=(H(d["stroke-width"])||1)*.75;w<0&&(w=0),w>1&&(w=1),d["stroke-width"]==null&&(A=g["stroke-width"]),d["stroke-width"]&&(y.weight=A),A&&A<1&&(w*=A)&&(y.weight=1),y.opacity=w,d["stroke-linejoin"]&&(y.joinstyle=d["stroke-linejoin"]||"miter"),y.miterlimit=d["stroke-miterlimit"]||8,d["stroke-linecap"]&&(y.endcap=d["stroke-linecap"]=="butt"?"flat":d["stroke-linecap"]=="square"?"square":"round");if(d["stroke-dasharray"]){var B={"-":"shortdash",".":"shortdot","-.":"shortdashdot","-..":"shortdashdotdot",". ":"dot","- ":"dash","--":"longdash","- .":"dashdot","--.":"longdashdot","--..":"longdashdotdot"};y.dashstyle=B[o](d["stroke-dasharray"])?B[d["stroke-dasharray"]]:k}z&&e[h](y)}if(l.type=="text"){var i=l.paper.span.st
 yle;g.font&&(i.font=g.font),g["font-family"]&&(i.fontFamily=g["font-family"]),g["font-size"]&&(i.fontSize=g["font-size"]),g["font-weight"]&&(i.fontWeight=g["font-weight"]),g["font-style"]&&(i.fontStyle=g["font-style"]),l.node.string&&(l.paper.span.innerHTML=(l.node.string+k)[M](/</g,"&#60;")[M](/&/g,"&#38;")[M](/\n/g,"<br>")),l.W=g.w=l.paper.span.offsetWidth,l.H=g.h=l.paper.span.offsetHeight,l.X=g.x,l.Y=g.y+F(l.H/2);switch(g["text-anchor"]){case"start":l.node.style["v-text-align"]="left",l.bbx=F(l.W/2);break;case"end":l.node.style["v-text-align"]="right",l.bbx=-F(l.W/2);break;default:l.node.style["v-text-align"]="center"}}},bm=function(a,b){a.attrs=a.attrs||{};var c=a.attrs,d=a.node.getElementsByTagName("fill"),e="linear",f=".5 .5";a.attrs.gradient=b,b=(b+k)[M](bi,function(a,b,c){return e="radial",b&&c&&(b=H(b),c=H(c),A(b-.5,2)+A(c-.5,2)>.25&&(c=t.sqrt(.25-A(b-.5,2))*((c>.5)*2-1)+.5),f=b+l+c),k}),b=b[m](/\s*\-\s*/);if(e=="linear"){var g=b.shift();g=-H(g);if(isNaN(g))return null}var 
 h=_(b);if(!h)return null;a=a.shape||a.node,d=d[0]||bA("fill");if(h[q]){d.on=!0,d.method="none",d.type=e=="radial"?"gradientradial":"gradient",d.color=h[0].color,d.color2=h[h[q]-1].color;var i=[];for(var j=0,n=h[q];j<n;j++)h[j].offset&&i[B](h[j].offset+l+h[j].color);d.colors&&(d.colors.value=i[q]?i[p](","):"0% "+d.color),e=="radial"?(d.focus="100%",d.focussize=f,d.focusposition=f):d.angle=(270-g)%360}return 1},br=function(a,b,c){var d=0,e=0,g=0,h=1;this[0]=a,this.id=f._oid++,this.node=a,a.raphael=this,this.X=0,this.Y=0,this.attrs={},this.Group=b,this.paper=c,this._={tx:0,ty:0,rt:{deg:0},sx:1,sy:1},!c.bottom&&(c.bottom=this),this.prev=c.top,c.top&&(c.top.next=this),c.top=this,this.next=null};br[r].rotate=function(b,c,d){return this.removed?this:b==null?this._.rt.cx?[this._.rt.deg,this._.rt.cx,this._.rt.cy][p](l):this._.rt.deg:(b=(b+k)[m](a),b[q]-1&&(c=H(b[1]),d=H(b[2])),b=H(b[0]),c!=null?this._.rt.deg=b:this._.rt.deg+=b,d==null&&(c=null),this._.rt.cx=c,this._.rt.cy=d,this.setBox(this.
 attrs,c,d),this.Group.style.rotation=this._.rt.deg,this)},br[r].setBox=function(a,b,c){if(this.removed)return this;var d=this.Group.style,e=this.shape&&this.shape.style||this.node.style;a=a||{};for(var f in a)a[o](f)&&(this.attrs[f]=a[f]);b=b||this._.rt.cx,c=c||this._.rt.cy;var g=this.attrs,i,j,l,m;switch(this.type){case"circle":i=g.cx-g.r,j=g.cy-g.r,l=m=g.r*2;break;case"ellipse":i=g.cx-g.rx,j=g.cy-g.ry,l=g.rx*2,m=g.ry*2;break;case"rect":case"image":i=+g.x,j=+g.y,l=g.width||0,m=g.height||0;break;case"text":this.textpath.v=["m",F(g.x),", ",F(g.y-2),"l",F(g.x)+1,", ",F(g.y-2)][p](k),i=g.x-F(this.W/2),j=g.y-this.H/2,l=this.W,m=this.H;break;case"path":if(!this.attrs
-.path)i=0,j=0,l=this.paper.width,m=this.paper.height;else{var n=R(this.attrs.path);i=n.x,j=n.y,l=n.width,m=n.height}break;default:i=0,j=0,l=this.paper.width,m=this.paper.height}b=b==null?i+l/2:b,c=c==null?j+m/2:c;var r=b-this.paper.width/2,s=c-this.paper.height/2;if(this.type=="path"||this.type=="text")d.left!=r+"px"&&(d.left=r+"px"),d.top!=s+"px"&&(d.top=s+"px"),this.X=this.type=="text"?i:-r,this.Y=this.type=="text"?j:-s,this.W=l,this.H=m,e.left!=-r+"px"&&(e.left=-r+"px"),e.top!=-s+"px"&&(e.top=-s+"px");else{d.left!=r+"px"&&(d.left=r+"px"),d.top!=s+"px"&&(d.top=s+"px"),this.X=i,this.Y=j,this.W=l,this.H=m,d.width!=this.paper.width+"px"&&(d.width=this.paper.width+"px"),d.height!=this.paper.height+"px"&&(d.height=this.paper.height+"px"),e.left!=i-r+"px"&&(e.left=i-r+"px"),e.top!=j-s+"px"&&(e.top=j-s+"px"),e.width!=l+"px"&&(e.width=l+"px"),e.height!=m+"px"&&(e.height=m+"px");var t=(+a.r||0)/v(l,m);if(this.type=="rect"&&this.arcsize.toFixed(4)!=t.toFixed(4)&&(t||this.arcsize)){var u=bA(
 "roundrect"),w={},f=0,x=this.events&&this.events[q];u.arcsize=t,u.raphael=this,this.Group[h](u),this.Group.removeChild(this.node),this[0]=this.node=u,this.arcsize=t;for(var f in g)w[f]=g[f];delete w.scale,this.attr(w);if(this.events)for(;f<x;f++)this.events[f].unbind=bC(this.node,this.events[f].name,this.events[f].f,this)}}},br[r].hide=function(){return!this.removed&&(this.Group.style.display="none"),this},br[r].show=function(){return!this.removed&&(this.Group.style.display="block"),this},br[r].getBBox=function(){return this.removed?this:this.type=="path"?R(this.attrs.path):{x:this.X+(this.bbx||0),y:this.Y,width:this.W,height:this.H}},br[r].remove=function(){if(this.removed)return;bc(this,this.paper),this.node.parentNode.removeChild(this.node),this.Group.parentNode.removeChild(this.Group),this.shape&&this.shape.parentNode.removeChild(this.shape);for(var a in this)delete this[a];this.removed=!0},br[r].attr=function(){if(this.removed)return this;if(arguments[q]==0){var a={};for(var b 
 in this.attrs)this.attrs[o](b)&&(a[b]=this.attrs[b]);return this._.rt.deg&&(a.rotation=this.rotate()),(this._.sx!=1||this._.sy!=1)&&(a.scale=this.scale()),a.gradient&&a.fill=="none"&&(a.fill=a.gradient)&&delete a.gradient,a}if(arguments[q]==1&&f.is(arguments[0],"string"))return arguments[0]=="translation"?bN.call(this):arguments[0]=="rotation"?this.rotate():arguments[0]=="scale"?this.scale():arguments[0]=="fill"&&this.attrs.fill=="none"&&this.attrs.gradient?this.attrs.gradient:this.attrs[arguments[0]];if(this.attrs&&arguments[q]==1&&f.is(arguments[0],"array")){var c={};for(var b=0,d=arguments[0][q];b<d;b++)c[arguments[0][b]]=this.attrs[arguments[0][b]];return c}var e;return arguments[q]==2&&(e={},e[arguments[0]]=arguments[1]),arguments[q]==1&&f.is(arguments[0],"object")&&(e=arguments[0]),e&&(e.text&&this.type=="text"&&(this.node.string=e.text),bo(this,e),e.gradient&&({circle:1,ellipse:1}[o](this.type)||(e.gradient+k).charAt()!="r")&&bm(this,e.gradient),(this.type!="path"||this._.rt.
 deg)&&this.setBox(this.attrs)),this},br[r].toFront=function(){return!this.removed&&this.Group.parentNode[h](this.Group),this.paper.top!=this&&bd(this,this.paper),this},br[r].toBack=function(){return this.removed?this:(this.Group.parentNode.firstChild!=this.Group&&(this.Group.parentNode.insertBefore(this.Group,this.Group.parentNode.firstChild),be(this,this.paper)),this)},br[r].insertAfter=function(a){return this.removed?this:(a.Group.nextSibling?a.Group.parentNode.insertBefore(this.Group,a.Group.nextSibling):a.Group.parentNode[h](this.Group),bf(this,a,this.paper),this)},br[r].insertBefore=function(a){return this.removed?this:(a.Group.parentNode.insertBefore(this.Group,a.Group),bg(this,a,this.paper),this)};var bs=function(a,b,c,d){var e=bA("group"),f=bA("oval"),g=f.style;e.style.cssText="position:absolute;left:0;top:0;width:"+a.width+"px;height:"+a.height+"px",e.coordsize=a.coordsize,e.coordorigin=a.coordorigin,e[h](f);var i=new br(f,e,a);return i.type="circle",bo(i,{stroke:"#000",fil
 l:"none"}),i.attrs.cx=b,i.attrs.cy=c,i.attrs.r=d,i.setBox({x:b-d,y:c-d,width:d*2,height:d*2}),a.canvas[h](e),i},bt=function(a,b,c,d,e,f){var g=bA("group"),i=bA("roundrect"),j=(+f||0)/v(d,e);g.style.cssText="position:absolute;left:0;top:0;width:"+a.width+"px;height:"+a.height+"px",g.coordsize=a.coordsize,g.coordorigin=a.coordorigin,g[h](i),i.arcsize=j;var k=new br(i,g,a);return k.type="rect",bo(k,{stroke:"#000"}),k.arcsize=j,k.setBox({x:b,y:c,width:d,height:e,r:f}),a.canvas[h](g),k},bu=function(a,b,c,d,e){var f=bA("group"),g=bA("oval"),i=g.style;f.style.cssText="position:absolute;left:0;top:0;width:"+a.width+"px;height:"+a.height+"px",f.coordsize=a.coordsize,f.coordorigin=a.coordorigin,f[h](g);var j=new br(g,f,a);return j.type="ellipse",bo(j,{stroke:"#000"}),j.attrs.cx=b,j.attrs.cy=c,j.attrs.rx=d,j.attrs.ry=e,j.setBox({x:b-d,y:c-e,width:d*2,height:e*2}),a.canvas[h](f),j},bv=function(a,b,c,d,e,f){var g=bA("group"),i=bA("image"),j=i.style;g.style.cssText="position:absolute;left:0;top:0
 ;width:"+a.width+"px;height:"+a.height+"px",g.coordsize=a.coordsize,g.coordorigin=a.coordorigin,i.src=b,g[h](i);var k=new br(i,g,a);return k.type="image",k.attrs.src=b,k.attrs.x=c,k.attrs.y=d,k.attrs.w=e,k.attrs.h=f,k.setBox({x:c,y:d,width:e,height:f}),a.canvas[h](g),k},bw=function(a,b,c,d){var e=bA("group"),g=bA("shape"),i=g.style,j=bA("path"),l=j.style,m=bA("textpath");e.style.cssText="position:absolute;left:0;top:0;width:"+a.width+"px;height:"+a.height+"px",e.coordsize=a.coordsize,e.coordorigin=a.coordorigin,j.v=f.format("m{0},{1}l{2},{1}",F(b),F(c),F(b)+1),j.textpathok=!0,i.width=a.width,i.height=a.height,m.string=d+k,m.on=!0,g[h](m),g[h](j),e[h](g);var n=new br(m,e,a);return n.shape=g,n.textpath=j,n.type="text",n.attrs.text=d,n.attrs.x=b,n.attrs.y=c,n.attrs.w=1,n.attrs.h=1,bo(n,{font:K.font,stroke:"none",fill:"#000"}),n.setBox(),a.canvas[h](e),n},bx=function(a,b){var c=this.canvas.style;return a==+a&&(a+="px"),b==+b&&(b+="px"),c.width=a,c.height=b,c.clip="rect(0 "+a+" "+b+" 0)"
 ,this},bA;c.createStyleSheet().addRule(".rvml","behavior:url(#default#VML)");try{!c.namespaces.rvml&&c.namespaces.add("rvml","urn:schemas-microsoft-com:vml"),bA=function(a){return c.createElement("<rvml:"+a+' class="rvml">')}}catch(bB){bA=function(a){return c.createElement("<"+a+' xmlns="urn:schemas-microsoft.com:vml" class="rvml">')}}var by=function(){var a=ba[i](null,arguments),b=a.container,d=a.height,e,j=a.width,k=a.x,l=a.y;if(!b)throw new Error("VML container not found.");var m=new g,n=m.canvas=c.createElement("div"),o=n.style;return j=j||512,d=d||342,j==+j&&(j+="px"),d==+d&&(d+="px"),m.width=1e3,m.height=1e3,m.coordsize="1000 1000",m.coordorigin="0 0",m.span=c.createElement("span"),m.span.style.cssText="position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;display:inline;",n[h](m.span),o.cssText=f.format("width:{0};height:{1};position:absolute;clip:rect(0 {0} {1} 0);overflow:hidden",j,d),b==1?(c.body[h](n),o.left=k+"px",o.top=l+"px"):(b.style.width=j,b.st
 yle.height=d,b.firstChild?b.insertBefore(n,b.firstChild):b[h](n)),bb.call(m,m,f.fn),m};g[r].clear=function(){this.canvas.innerHTML=k,this.span=c.createElement("span"),this.span.style.cssText="position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;display:inline;",this.canvas[h](this.span),this.bottom=this.top=null},g[r].remove=function(){this.canvas.parentNode.removeChild(this.canvas);for(var a in this)this[a]=bh(a)}}/^Apple|^Google/.test(navigator.vendor)&&!(navigator.userAgent.indexOf("Version/4.0")+1)?g[r].safari=function(){var a=this.rect(-99,-99,this.width+99,this.height+99);setTimeout(function(){a.remove()})}:g[r].safari=function(){};var bC=function(){if(c.addEventListener)return function(a,b,c,d){var e=function(a){return c.call(d,a)};return a.addEventListener(b,e,!1),function(){return a.removeEventListener(b,e,!1),!0}};if(c.attachEvent)return function(a,b,c,e){var f=function(a){return c.call(e,a||d.event)};a.attachEvent("on"+b,f);var g=function(){return a
 .detachEvent("on"+b,f),!0};return g}}();for(var bD=n[q];bD--;)(function(a){br[r][a]=function(b){return f.is(b,"function")&&(this.events=this.events||[],this.events.push({name:a,f:b,unbind:bC(this.shape||this.node,a,b,this)})),this},br[r]["un"+a]=function(b){var c=this.events,d=c[q];while(d--)if(c[d].name==a&&c[d].f==b)return c[d].unbind(),c.splice(d,1),!c.length&&delete this.events,this;return this}})(n[bD]);br[r].hover=function(a,b){return this.mouseover(a).mouseout(b)},br[r].unhover=function(a,b){return this.unmouseover(a).unmouseout(b)},g[r].circle=function(a,b,c){return bs(this,a||0,b||0,c||0)},g[r].rect=function(a,b,c,d,e){return bt(this,a||0,b||0,c||0,d||0,e||0)},g[r].ellipse=function(a,b,c,d){return bu(this,a||0,b||0,c||0,d||0)},g[r].path=function(a){return a&&!f.is(a,"string")&&!f.is(a[0],"array")&&(a+=k),bl(f.format[i](f,arguments),this)},g[r].image=function(a,b,c,d,e){return bv(this,a||"about:blank",b||0,c||0,d||0,e||0)},g[r].text=function(a,b,c){return bw(this,a||0,b||0,c
 ||k)},g[r].set=function(a){return arguments[q]>1&&(a=Array[r].splice.call(arguments,0,arguments[q])),new bP(a)},g[r].setSize=bx,g[r].top=g[r].bottom=null,g[r].raphael=f,br[r].scale=function(a,b,c,d){if(a==null&&b==null)return{x:this._.sx,y:this._.sy,toString:bE};b=b||a,!+b&&(b=a);var e,f,g,h,i=this.attrs;if(a!=0){var m=this.getBBox(),n=m.x+m.width/2,o=m.y+m.height/2,r=a/this._.sx,s=b/this._.sy;c=+c||c==0?c:n,d=+d||d==0?d:o;var u=~~(a/t.abs(a)),w=~~(b/t.abs(b)),x=this.node.style,y=c+(n-c)*r,z=d+(o-d)*s;switch(this.type){case"rect":case"image":var A=i.width*u*r,B=i.height*w*s;this.attr({height:B,r:i.r*v(u*r,w*s),width:A,x:y-A/2,y:z-B/2});break;case"circle":case"ellipse":this.attr({rx:i.rx*u*r,ry:i.ry*w*s,r:i.r*v(u*r,w*s),cx:y,cy:z});break;case"path":var C=T(i.path),D=!0;for(var E=0,F=C[q];E<F;E++){var H=C[E],I,K=J.call(H[0]);if(K=="M"&&D)continue;D=!1;if(K=="A")H[C[E][q]-2]*=r,H[C[E][q]-1]*=s,H[1]*=u*r,H[2]*=w*s,H[5]=+(u+w?!!+H[5]:!+H[5]);else if(K=="H")for(I=1,jj=H[q];I<jj;I++)H[I]*=
 r;else if(K=="V")for(I=1,jj=H[q];I<jj;I++)H[I]*=s;else for(I=1,jj=H[q];I<jj;I++)H[I]*=I%2?r:s}var L=R(C),e=y-L.x-L.width/2,f=z-L.y-L.height/2;C[0][1]+=e,C[0][2]+=f,this.attr({path:C})}this.type in{text:1,image:1}&&(u!=1||w!=1)?this.transformations?(this.transformations[2]="scale("[j](u,",",w,")"),this.node[G]("transform",this.transformations[p](l)),e=u==-1?-i.x-(A||0):i.x,f=w==-1?-i.y-(B||0):i.y,this.attr({x:e,y:f}),i.fx=u-1,i.fy=w-1):(this.node.filterMatrix=" progid:DXImageTransform.Microsoft.Matrix(M11="[j](u,", M12=0, M21=0, M22=",w,", Dx=0, Dy=0, sizingmethod='auto expand', filtertype='bilinear')"),x.filter=(this.node.filterMatrix||k)+(this.node.filterOpacity||k)):this.transformations?(this.transformations[2]=k,this.node[G]("transform",this.transformations[p](l)),i.fx=0,i.fy=0):(this.node.filterMatrix=k,x.filter=(this.node.filterMatrix||k)+(this.node.filterOpacity||k)),i.scale=[a,b,c,d][p](l),this._.sx=a,this._.sy=b}return this},br[r].clone=function(){var a=this.attr();return de
 lete a.scale,delete a.translation,this.paper[this.type]().attr(a)};var bF=function(a,b){return function(c,d,e){c=$(c);var g,h,i,j,k="",l={},m,n=0;for(var o=0,q=c.length;o<q;o++){i=c[o];if(i[0]=="M")g=+i[1],h=+i[2];else{j=bG(g,h,i[1],i[2],i[3],i[4],i[5],i[6]);if(n+j>d){if(b&&!l.start){m=f.findDotsAtSegment(g,h,i[1],i[2],i[3],i[4],i[5],i[6],(d-n)/j),k+=["C",m.start.x,m.start.y,m.m.x,m.m.y,m.x,m.y];if(e)return k;l.start=k,k=["M",m.x,m.y+"C",m.n.x,m.n.y,m.end.x,m.end.y,i[5],i[6]][p](),n+=j,g=+i[5],h=+i[6];continue}if(!a&&!b)return m=f.findDotsAtSegment(g,h,i[1],i[2],i[3],i[4],i[5],i[6],(d-n)/j),{x:m.x,y:m.y,alpha:m.alpha}}n+=j,g=+i[5],h=+i[6]}k+=i}return l.end=k,m=a?n:b?l:f.findDotsAtSegment(g,h,i[1],i[2],i[3],i[4],i[5],i[6],1),m.alpha&&(m={x:m.x,y:m.y,alpha:m.alpha}),m}},bG=Q(function(a,b,c,d,e,f,g,h){var i={x:0,y:0},j=0;for(var k=0;k<1.01;k+=.01){var l=Y(a,b,c,d,e,f,g,h,k);k&&(j+=t.sqrt(A(i.x-l.x,2)+A(i.y-l.y,2))),i=l}return j}),bH=bF(1),bI=bF(),bJ=bF(0,1);br[r].getTotalLength=functio
 n(){if(this.type!="path")return;return bH(this.attrs.path)},br[r].getPointAtLength=function(a){if(this.type!="path")return;return bI(this.attrs.path,a)},br[r].getSubpath=function(a,b){if(this.type!="path")return;if(t.abs(this.getTotalLength()-b)<1e-6)return bJ(this.attrs.path,a).end;var c=bJ(this.attrs.path,b,1);return a?bJ(c,a).end:c},f.easing_formulas={linear:function(a){return a},"<":function(a){return A(a,3)},">":function(a){return A(a-1,3)+1},"<>":function(a){return a*=2,a<1?A(a,3)/2:(a-=2,(A(a,3)+2)/2)},backIn:function(a){var b=1.70158;return a*a*((b+1)*a-b)},backOut:function(a){a-=1;var b=1.70158;return a*a*((b+1)*a+b)+1},elastic:function(a){if(a==0||a==1)return a;var b=.3,c=b/4;return A(2,-10*a)*t.sin((a-c)*2*t.PI/b)+1},bounce:function(a){var b=7.5625,c=2.75,d;return a<1/c?d=b*a*a:a<2/c?(a-=1.5/c,d=b*a*a+.75):a<2.5/c?(a-=2.25/c,d=b*a*a+.9375):(a-=2.625/c,d=b*a*a+.984375),d}};var bK={length:0},bL=function(){var a=+(new Date);for(var b in bK)if(b!="length"&&bK[o](b)){var c=bK[
 b];if(c.stop){delete bK[b],bK[q]--;continue}var d=a-c.start,e=c.ms,g=c.easing,h=c.from,i=c.diff,j=c.to,m=c.t,n=c.prev||0,r=c.el,s=c.callback,t={},u;if(d<e){var v=f.easing_formulas[g]?f.easing_formulas[g](d/e):d/e;for(var w in h)if(h[o](w)){switch(L[w]){case"along":u=v*e*i[w],j.back&&(u=j.len-u);var x=bI(j[w],u);r.translate(i.sx-i.x||0,i.sy-i.y||0),i.x=x.x,i.y=x.y,r.translate(x.x-i.sx,x.y-i.sy),j.rot&&r.rotate(i.r+x.alpha,x.x,x.y);break;case"number":u=+h[w]+v*e*i[w];break;case"colour":u="rgb("+[bM(F(h[w].r+v*e*i[w].r)),bM(F(h[w].g+v*e*i[w].g)),bM(F(h[w].b+v*e*i[w].b))][p](",")+")";break;case"path":u=[];for(var y=0,z=h[w][q];y<z;y++){u[y]=[h[w][y][0]];for(var A=1,B=h[w][y][q];A<B;A++)u[y][A]=+h[w][y][A]+v*e*i[w][y][A];u[y]=u[y][p](l)}u=u[p](l);break;case"csv":switch(w){case"translation":var C=i[w][0]*(d-n),D=i[w][1]*(d-n);m.x+=C,m.y+=D,u=C+l+D;break;case"rotation":u=+h[w][0]+v*e*i[w][0],h[w][1]&&(u+=","+h[w][1]+","+h[w][2]);break;case"scale":u=[+h[w][0]+v*e*i[w][0],+h[w][1]+v*e*i[w][1
 ],2 in j[w]?j[w][2]:k,3 in j[w]?j[w][3]:k][p](l);break;case"clip-rect":u=[];var y=4;while(y--)u[y]=+h[w][y]+v*e*i[w][y]}}t[w]=u}r.attr(t),r._run&&r._run.call(r)}else{if(j.along){var x=bI(j.along,j.len*!j.back);r.translate(i.sx-(i.x||0)+x.x-i.sx,i.sy-(i.y||0)+x.y-i.sy),j.rot&&r.rotate(i.r+x.alpha,x.x,x.y)}(m.x||m.y)&&r.translate(-m.x,-m.y),j.scale&&(j.scale=j.scale+k),r.attr(j),delete bK[b],bK[q]--,r.in_animation=null,f.is(s,"function")&&s.call(r)}c.prev=d}f.svg&&r&&r.paper.safari(),bK[q]&&setTimeout(bL)},bM=function(a){return a>255?255:a<0?0:a},bN=function(a,b){if(a==null)return{x:this._.tx,y:this._.ty,toString:bE};this._.tx+=+a,this._.ty+=+b;switch(this.type){case"circle":case"ellipse":this.attr({cx:+a+this.attrs.cx,cy:+b+this.attrs.cy});break;case"rect":case"image":case"text":this.attr({x:+a+this.attrs.x,y:+b+this.attrs.y});break;case"path":var c=T(this.attrs.path);c[0][1]+=+a,c[0][2]+=+b,this.attr({path:c})}return this};br[r].animateWith=function(a,b,c,d,e){return bK[a.id]&&(b.st
 art=bK[a.id].start),this.animate(b,c,d,e)},br[r].animateAlong=bO(),br[r].animateAlongBack=bO(1),br[r].onAnimation=function(a){return this._run=a||0,this},br[r].animate=function(b,c,d,e){if(f.is(d,"function")||!d)e=d||null;var g={},h={},i={};for(var j in b)if(b[o](j)&&L[o](j)){g[j]=this.attr(j),g[j]==null&&(g[j]=K[j]),h[j]=b[j];switch(L[j]){case"along":var l=bH(b[j]),n=bI(b[j],l*!!b.back),p=this.getBBox();i[j]=l/c,i.tx=p.x,i.ty=p.y,i.sx=n.x,i.sy=n.y,h.rot=b.rot,h.back=b.back,h.len=l,b.rot&&(i.r=H(this.rotate())||0);break;case"number":i[j]=(h[j]-g[j])/c;break;case"colour":g[j]=f.getRGB(g[j]);var r=f.getRGB(h[j]);i[j]={r:(r.r-g[j].r)/c,g:(r.g-g[j].g)/c,b:(r.b-g[j].b)/c};break;case"path":var s=$(g[j],h[j]);g[j]=s[0];var t=s[1];i[j]=[];for(var u=0,v=g[j][q];u<v;u++){i[j][u]=[0];for(var w=1,x=g[j][u][q];w<x;w++)i[j][u][w]=(t[u][w]-g[j][u][w])/c}break;case"csv":var y=(b[j]+k)[m](a),z=(g[j]+k)[m](a);switch(j){case"translation":g[j]=[0,0],i[j]=[y[0]/c,y[1]/c];break;case"rotation":g[j]=z[1]==
 y[1]&&z[2]==y[2]?z:[0,y[1],y[2]],i[j]=[(y[0]-g[j][0])/c,0,0];break;case"scale":b[j]=y,g[j]=(g[j]+k)[m](a),i[j]=[(y[0]-g[j][0])/c,(y[1]-g[j][1])/c,0,0];break;case"clip-rect":g[j]=(g[j]+k)[m](a),i[j]=[];var u=4;while(u--)i[j][u]=(y[u]-g[j][u])/c}h[j]=y}}return this.stop(),this.in_animation=1,bK[this.id]={start:b.start||+(new Date),ms:c,easing:d,from:g,diff:i,to:h,el:this,callback:e,t:{x:0,y:0}},++bK[q]==1&&bL(),this},br[r].stop=function(){return bK[this.id]&&bK[q]--,delete bK[this.id],this},br[r].translate=function(a,b){return this.attr({translation:a+" "+b})},br[r][x]=function(){return"Raphaël’s object"},f.ae=bK;var bP=function(a){this.items=[],this[q]=0;if(a)for(var b=0,c=a[q];b<c;b++)a[b]&&(a[b].constructor==br||a[b].constructor==bP)&&(this[this.items[q]]=this.items[this.items[q]]=a[b],this[q]++)};bP[r][B]=function(){var a,b;for(var c=0,d=arguments[q];c<d;c++)a=arguments[c],a&&(a.constructor==br||a.constructor==bP)&&(b=this.items[q],this[b]=this.items[b]=a,this[q]++);return this
 },bP[r].pop=function(){return delete this[this[q]--],this.items.pop()};for(var bQ in br[r])br[r][o](bQ)&&(bP[r][bQ]=function(a){return function(){for(var b=0,c=this.items[q];b<c;b++)this.items[b][a][i](this.items[b],arguments);return this}}(bQ));return bP[r].attr=function(a,b){if(a&&f.is(a,"array")&&f.is(a[0],"object"))for(var c=0,d=a[q];c<d;c++)this.items[c].attr(a[c]);else for(var e=0,g=this.items[q];e<g;e++)this.items[e].attr[i](this.items[e],arguments);return this},bP[r].animate=function(a,b,c,d){(f.is(c,"function")||!c)&&(d=c||null);var e=this.items[q],g=e,h=this,i;d&&(i=function(){!--e&&d.call(h)}),this.items[--g].animate(a,b,c||i,i);while(g--)this.items[g].animateWith(this.items[e-1],a,b,c||i,i);return this},bP[r].insertAfter=function(a){var b=this.items[q];while(b--)this.items[b].insertAfter(a);return this},bP[r].getBBox=function(){var a=[],b=[],c=[],d=[];for(var e=this.items[q];e--;){var f=this.items[e].getBBox();a[B](f.x),b[B](f.y),c[B](f.x+f.width),d[B](f.y+f.height)}retu
 rn a=v[i](0,a),b=v[i](0,b),{x:a,y:b,width:u[i](0,c)-a,height:u[i](0,d)-b}},f.registerFont=function(a){if(!a.face)return a;this.fonts=this.fonts||{};var b={w:a.w,face:{},glyphs:{}},c=a.face["font-family"];for(var d in a.face)a.face[o](d)&&(b.face[d]=a.face[d]);this.fonts[c]?this.fonts[c][B](b):this.fonts[c]=[b];if(!a.svg){b.face["units-per-em"]=I(a.face["units-per-em"],10);for(var e in a.glyphs)if(a.glyphs[o](e)){var f=a.glyphs[e];b.glyphs[e]={w:f.w,k:{},d:f.d&&"M"+f.d[M](/[mlcxtrv]/g,function(a){return{l:"L",c:"C",x:"z",t:"m",r:"l",v:"c"}[a]||"M"})+"z"};if(f.k)for(var g in f.k)f[o](g)&&(b.glyphs[e].k[g]=f.k[g])}}return a},g[r].getFont=function(a,b,c,d){d=d||"normal",c=c||"normal",b=+b||{normal:400,bold:700,lighter:300,bolder:800}[b]||400;var e=f.fonts[a];if(!e){var g=new RegExp("(^|\\s)"+a[M](/[^\w\d\s+!~.:_-]/g,k)+"(\\s|$)","i");for(var h in f.fonts)if(f.fonts[o](h)&&g.test(h)){e=f.fonts[h];break}}var i;if(e)for(var j=0,l=e[q];j<l;j++){i=e[j];if(i.face["font-weight"]==b&&(i.face["f
 ont-style"]==c||!i.face["font-style"])&&i.face["font-stretch"]==d)break}return i},g[r].print=function(b,c,d,e,g,h){h=h||"middle";var i=this.set(),j=(d+k)[m](k),l=0,n=k,o;f.is(e,"string")&&(e=this.getFont(e));if(e){o=(g||16)/e.face["units-per-em"];var p=e.face.bbox.split(a),r=+p[0],s=+p[1]+(h=="baseline"?p[3]-p[1]+ +e.face.descent:(p[3]-p[1])/2);for(var t=0,u=j[q];t<u;t++){var v=t&&e.glyphs[j[t-1]]||{},w=e.glyphs[j[t]];l+=t?(v.w||e.w)+(v.k&&v.k[j[t]]||0):0,w&&w.d&&i[B](this.path(w.d).attr({fill:"#000",stroke:"none",translation:[l,0]}))}i.scale(o,o,r,s).translate(b-r,c-s)}return i},f.format=function(a){var b=f.is(arguments[1],"array")?[0][j](arguments[1]):arguments,c=/\{(\d+)\}/g;return a&&f.is(a,"string")&&b[q]-1&&(a=a[M](c,function(a,c){return b[++c]==null?k:b[c]})),a||k},f.ninja=function(){var a=Raphael;return e.was?Raphael=e.is:delete Raphael,a},f.el=br[r],f}();var Graph=function(){this.nodes=[],this.nodelist=[],this.edges=[],this.snapshots=[]};Graph.prototype={addNode:function(a,
 b){return this.nodes[a]==undefined&&(this.nodes[a]=new Graph.Node(a,b||{id:a}),this.nodelist.push(this.nodes[a])),this.nodes[a]},addEdge:function(a,b,c){var d=this.addNode(a),e=this.addNode(b),f={source:d,target:e,style:c,weight:c&&c.weight||1};d.edges.push(f),this.edges.push(f);if(!c||!c.directed){var g={source:e,target:d,style:c,weight:c&&c.weight||1,backedge:f};this.edges.push(g),e.edges.push(g)}},snapShot:function(a,b){var c=new Graph;jQuery.extend(!0,c.nodes,this.nodes),jQuery.extend(!0,c.nodelist,this.nodelist),jQuery.extend(!0,c.edges,this.edges),c.snapShot=null,this.snapshots.push({comment:a,graph:c})}},Graph.Node=function(a,b){return b.id=a,b.edges=[],b},Graph.Node.prototype={},Graph.Renderer={},Graph.Renderer.Raphael=function(a,b,c,d,e){this.width=c||400,this.height=d||400;var f=this;this.r=Raphael(a,this.width,this.height),this.radius=e&&e.noderadius?e.noderadius:40,this.graph=b,this.mouse_in=!1,this.graph.render||(this.graph.render=function(){return}),this.isDrag=!1,this
 .dragger=function(a){this.dx=a.clientX,this.dy=a.clientY,f.isDrag=this,this.set&&this.set.animate({"fill-opacity":.1},200)&&this.set.toFront(),a.preventDefault&&a.preventDefault()},document.onmousemove=function(a){a=a||window.event;if(f.isDrag){var b=f.isDrag.set.getBBox(),c=a.clientX-f.isDrag.dx+(b.x+b.width/2),d=a.clientY-f.isDrag.dy+(b.y+b.height/2),e=a.clientX-(c<20?c-20:c>f.width-20?c-f.width+20:0),g=a.clientY-(d<20?d-20:d>f.height-20?d-f.height+20:0);f.isDrag.set.translate(e-f.isDrag.dx,g-f.isDrag.dy);for(var h in f.graph.edges)f.graph.edges[h].connection&&f.graph.edges[h].connection.draw();f.isDrag.dx=e,f.isDrag.dy=g}},document.onmouseup=function(){f.isDrag&&f.isDrag.set.animate({"fill-opacity":.6},500),f.isDrag=!1}},Graph.Renderer.Raphael.prototype={translate:function(a){return[Math.round((a[0]-this.graph.layoutMinX)*this.factorX+this.radius),Math.round((a[1]-this.graph.layoutMinY)*this.factorY+this.radius)]},rotate:function(a,b,c){var d=b*Math.cos(c),e=b*Math.sin(c);return[
 a[0]+d,a[1]+e]},draw:function(){this.factorX=(this.width-10*this.radius)/(this.graph.layoutMaxX-this.graph.layoutMinX),this.factorY=(this.height-15*this.radius)/(this.graph.layoutMaxY-this.graph.layoutMinY);for(a in this.graph.nodes)this.drawNode(this.graph.nodes[a]);for(var a=0;a<this.graph.edges.length;a++)this.drawEdge(this.graph.edges[a])},drawNode:function(a){var b=this.translate([a.layoutPosX,a.layoutPosY]);a.point=b;if(a.shape){var c=a.shape.getBBox(),d=[c.x+Math.round(c.width/2),c.y+Math.round(c.height/2)];a.shape.translate(b[0]-d[0],b[1]-d[1]),this.r.safari();return}var e;if(a.render)e=a.render(this.r,a);else if(!a.shape){var f=Raphael.getColor();e=this.r.set().push(this.r.ellipse(b[0],b[1],30,20).attr({fill:f,stroke:f,"stroke-width":2})).push(this.r.text(b[0],b[1]+30,a.label||a.id))}e.attr({"fill-opacity":.6}),e.items.forEach(function(a){a.set=e,a.node.style.cursor="pointer"}),e.mousedown(this.dragger),a.shape=e},drawEdge:function(a){if(a.backedge)return;a.connection&&a.co
 nnection.draw(),a.connection||(a.style&&a.style.callback&&a.style.callback(a),a.connection=this.r.connection(a.source.shape,a.target.shape,a.style))}},Graph.Layout={},Graph.Layout.Spring=function(a){this.graph=a,this.iterations=500,this.maxRepulsiveForceDistance=6,this.k=2,this.c=.01,this.maxVertexMovement=.5},Graph.Layout.Spring.prototype={layout:function(){this.layoutPrepare();for(var a=0;a<this.iterations;a++)this.layoutIteration();this.layoutCalcBounds()},layoutPrepare:function(){for(i in this.graph.nodes){var a=this.graph.nodes[i];a.layoutPosX=0,a.layoutPosY=0,a.layoutForceX=0,a.layoutForceY=0}},layoutCalcBounds:function(){var a=Infinity,b=-Infinity,c=Infinity,d=-Infinity;for(i in this.graph.nodes){var e=this.graph.nodes[i].layoutPosX,f=this.graph.nodes[i].layoutPosY;e>b&&(b=e),e<a&&(a=e),f>d&&(d=f),f<c&&(c=f)}this.graph.layoutMinX=a,this.graph.layoutMaxX=b,this.graph.layoutMinY=c,this.graph.layoutMaxY=d},layoutIteration:function(){for(var a=0;a<this.graph.nodelist.length;a++){
 var b=this.graph.nodelist[a];for(var c=a+1;c<this.graph.nodelist.length;c++){var d=this.graph.nodelist[c];this.layoutRepulsive(b,d)}}for(var a=0;a<this.graph.edges.length;a++){var e=this.graph.edges[a];this.layoutAttractive(e)}for(a in this.graph.nodes){var f=this.graph.nodes[a],g=this.c*f.layoutForceX,h=this.c*f.layoutForceY,i=this.maxVertexMovement;g>i&&(g=i),g<-i&&(g=-i),h>i&&(h=i),h<-i&&(h=-i),f.layoutPosX+=g,f.layoutPosY+=h,f.layoutForceX=0,f.layoutForceY=0}},layoutRepulsive:function(a,b){var c=b.layoutPosX-a.layoutPosX,d=b.layoutPosY-a.layoutPosY,e=c*c+d*d;if(e<.01){c=.1*Math.random()+.1,d=.1*Math.random()+.1;var e=c*c+d*d}var f=Math.sqrt(e);if(f<this.maxRepulsiveForceDistance){var g=this.k*this.k/f;b.layoutForceX+=g*c/f,b.layoutForceY+=g*d/f,a.layoutForceX-=g*c/f,a.layoutForceY-=g*d/f}},layoutAttractive:function(a){var b=a.source,c=a.target,d=c.layoutPosX-b.layoutPosX,e=c.layoutPosY-b.layoutPosY,f=d*d+e*e;if(f<.01){d=.1*Math.random()+.1,e=.1*Math.random()+.1;var f=d*d+e*e}var
  g=Math.sqrt(f);g>this.maxRepulsiveForceDistance&&(g=this.maxRepulsiveForceDistance,f=g*g);var h=(f-this.k*this.k)/this.k;a.attraction==undefined&&(a.attraction=1),h*=Math.log(a.attraction)*.5+1,c.layoutForceX-=h*d/g,c.layoutForceY-=h*e/g,b.layoutForceX+=h*d/g,b.layoutForceY+=h*e/g}},Raphael.el.tooltip=function(a){return this.tp=a,this.tp.o={x:0,y:0},this.tp.hide(),this.hover(function(a){this.mousemove(function(a){this.tp.translate(a.clientX-this.tp.o.x,a.clientY-this.tp.o.y),this.tp.o={x:a.clientX,y:a.clientY}}),this.tp.show().toFront()},function(a){this.tp.hide(),this.unmousemove()}),this},Raphael.fn.connection=function(a,b,c){var d=this,e={draw:function(){var f=a.getBBox(),g=b.getBBox(),h=0,i=0,j=[{x:f.x+f.width/2,y:f.y-h},{x:f.x+f.width/2,y:f.y+f.height+h},{x:f.x-h,y:f.y+f.height/2},{x:f.x+f.width+h,y:f.y+f.height/2},{x:g.x+g.width/2,y:g.y-i},{x:g.x+g.width/2,y:g.y+g.height+i},{x:g.x-i,y:g.y+g.height/2},{x:g.x+g.width+i,y:g.y+g.height/2}],k={},l=[];for(var m=0;m<4;m++)for(var n=
 4;n<8;n++){var o=Math.abs(j[m].x-j[n].x),p=Math.abs(j[m].y-j[n].y);if(m==n-4||(m!=3&&n!=6||j[m].x<j[n].x)&&(m!=2&&n!=7||j[m].x>j[n].x)&&(m!=0&&n!=5||j[m].y>j[n].y)&&(m!=1&&n!=4||j[m].y<j[n].y))l.push(o+p),k[l[l.length-1].toFixed(3)]=[m,n]}var q=l.length==0?[0,4]:k[Math.min.apply(Math,l).toFixed(3)],r=j[q[0]].x,s=j[q[0]].y,t=j[q[1]].x,u=j[q[1]].y,o=Math.max(Math.abs(r-t)/2,10),p=Math.max(Math.abs(s-u)/2,10),v=[r,r,r-o,r+o][q[0]].toFixed(3),w=[s-p,s+p,s,s][q[0]].toFixed(3),x=[0,0,0,0,t,t,t-o,t+o][q[1]].toFixed(3),y=[0,0,0,0,s+p,s-p,u,u][q[1]].toFixed(3),z=["M",r.toFixed(3),s.toFixed(3),"C",v,w,x,y,t.toFixed(3),u.toFixed(3)].join(",");if(c&&c.directed){var A=Math.sqrt((u-y)*(u-y)+(t-x)*(t-x)),B=function(a,b){return-a*(b||5)/A},C=[{x:(B(t-x)+B(u-y)+t).toFixed(3),y:(B(u-y)+B(t-x)+u).toFixed(3)},{x:(B(t-x)-B(u-y)+t).toFixed(3),y:(B(u-y)-B(t-x)+u).toFixed(3)}];z=z+",M"+C[0].x+","+C[0].y+",L"+t+","+u+",L"+C[1].x+","+C[1].y}e.fg&&e.fg.attr({path:z})||(e.fg=d.path(z).attr({stroke:c&&c.stroke|
 |"#000",fill:"none"}).toBack()),e.bg&&e.bg.attr({path:z})||c&&c.fill&&(e.bg=c.fill.split&&d.path(z).attr({stroke:c.fill,fill:"none","stroke-width":c.width||3}).toBack()),c&&c.label&&(e.label&&e.label.attr({x:(r+t)/2,y:(s+u)/2})||(e.label=d.text((r+t)/2,(s+u)/2,c.label).attr({fill:"#000","font-size":c.fontsize||"12px"})))}};return e.draw(),e};
\ No newline at end of file


[022/100] [abbrv] [partial] Reverting the erroneous merge by Sebastian according to the instructions in INFRA-6876

Posted by wi...@apache.org.
http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/kiwi/kiwi-reasoner/src/test/java/org/apache/marmotta/kiwi/reasoner/test/persistence/JustificationPersistenceTest.java
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-reasoner/src/test/java/org/apache/marmotta/kiwi/reasoner/test/persistence/JustificationPersistenceTest.java b/libraries/kiwi/kiwi-reasoner/src/test/java/org/apache/marmotta/kiwi/reasoner/test/persistence/JustificationPersistenceTest.java
index 5470661..4c68dc6 100644
--- a/libraries/kiwi/kiwi-reasoner/src/test/java/org/apache/marmotta/kiwi/reasoner/test/persistence/JustificationPersistenceTest.java
+++ b/libraries/kiwi/kiwi-reasoner/src/test/java/org/apache/marmotta/kiwi/reasoner/test/persistence/JustificationPersistenceTest.java
@@ -17,14 +17,25 @@
  */
 package org.apache.marmotta.kiwi.reasoner.test.persistence;
 
+import static org.hamcrest.Matchers.allOf;
+import static org.hamcrest.Matchers.hasItem;
+import static org.hamcrest.Matchers.hasItems;
+import static org.hamcrest.Matchers.not;
 import info.aduna.iteration.CloseableIteration;
-import org.apache.commons.lang.RandomStringUtils;
+
+import java.sql.BatchUpdateException;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import org.apache.commons.lang3.RandomStringUtils;
+import org.apache.marmotta.kiwi.config.KiWiConfiguration;
 import org.apache.marmotta.kiwi.model.rdf.KiWiTriple;
-import org.apache.marmotta.kiwi.persistence.KiWiDialect;
 import org.apache.marmotta.kiwi.persistence.KiWiPersistence;
-import org.apache.marmotta.kiwi.persistence.h2.H2Dialect;
-import org.apache.marmotta.kiwi.persistence.mysql.MySQLDialect;
-import org.apache.marmotta.kiwi.persistence.pgsql.PostgreSQLDialect;
 import org.apache.marmotta.kiwi.reasoner.model.program.Justification;
 import org.apache.marmotta.kiwi.reasoner.model.program.Program;
 import org.apache.marmotta.kiwi.reasoner.parser.KWRLProgramParser;
@@ -33,8 +44,7 @@ import org.apache.marmotta.kiwi.reasoner.persistence.KiWiReasoningConnection;
 import org.apache.marmotta.kiwi.reasoner.persistence.KiWiReasoningPersistence;
 import org.apache.marmotta.kiwi.sail.KiWiStore;
 import org.apache.marmotta.kiwi.sail.KiWiValueFactory;
-import org.apache.marmotta.kiwi.test.RepositoryTest;
-import org.apache.marmotta.kiwi.test.helper.DBConnectionChecker;
+import org.apache.marmotta.kiwi.test.junit.KiWiDatabaseRunner;
 import org.junit.After;
 import org.junit.Assert;
 import org.junit.Before;
@@ -43,7 +53,6 @@ import org.junit.Test;
 import org.junit.rules.TestWatcher;
 import org.junit.runner.Description;
 import org.junit.runner.RunWith;
-import org.junit.runners.Parameterized;
 import org.openrdf.model.Statement;
 import org.openrdf.model.URI;
 import org.openrdf.repository.Repository;
@@ -52,119 +61,38 @@ import org.openrdf.repository.sail.SailRepository;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import java.sql.BatchUpdateException;
-import java.sql.PreparedStatement;
-import java.sql.ResultSet;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import static org.hamcrest.Matchers.*;
-
 /**
  * This test verifies the persistence functionality of the reasoning component regarding storing, loading and deleting
  * reasoning programs.
  *
- * It will try running over all available databases. Except for in-memory databases like H2 or Derby, database
- * URLs must be passed as system property, or otherwise the test is skipped for this database. Available system properties:
- * <ul>
- *     <li>PostgreSQL:
- *     <ul>
- *         <li>postgresql.url, e.g. jdbc:postgresql://localhost:5433/kiwitest?prepareThreshold=3</li>
- *         <li>postgresql.user (default: lmf)</li>
- *         <li>postgresql.pass (default: lmf)</li>
- *     </ul>
- *     </li>
- *     <li>MySQL:
- *     <ul>
- *         <li>mysql.url, e.g. jdbc:mysql://localhost:3306/kiwitest?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull</li>
- *         <li>mysql.user (default: lmf)</li>
- *         <li>mysql.pass (default: lmf</li>
- *     </ul>
- *     </li>
- *     <li>H2:
- *     <ul>
- *         <li>h2.url, e.g. jdbc:h2:mem;MVCC=true;DB_CLOSE_ON_EXIT=FALSE;DB_CLOSE_DELAY=10</li>
- *         <li>h2.user (default: lmf)</li>
- *         <li>h2.pass (default: lmf</li>
- *     </ul>
- *     </li>
- * </ul>
- *
  * @see org.apache.marmotta.kiwi.persistence.KiWiConnection
  * @see org.apache.marmotta.kiwi.persistence.KiWiPersistence
- * <p/>
- * Author: Sebastian Schaffert
+ * @author Sebastian Schaffert (sschaffert@apache.org)
  */
-@RunWith(Parameterized.class)
+@RunWith(KiWiDatabaseRunner.class)
 public class JustificationPersistenceTest {
 
-    /**
-     * Return database configurations if the appropriate parameters have been set.
-     *
-     * @return an array (database name, url, user, password)
-     */
-    @Parameterized.Parameters(name="Database Test {index}: {0} at {1}")
-    public static Iterable<Object[]> databases() {
-        String[] databases = {"H2", "PostgreSQL", "MySQL"};
-
-        List<Object[]> result = new ArrayList<Object[]>(databases.length);
-        for(String database : databases) {
-            if(System.getProperty(database.toLowerCase()+".url") != null) {
-                result.add(new Object[] {
-                        database,
-                        System.getProperty(database.toLowerCase()+".url"),
-                        System.getProperty(database.toLowerCase()+".user","lmf"),
-                        System.getProperty(database.toLowerCase()+".pass","lmf")
-                });
-            }
-        }
-        return result;
-    }
-
-
-    private KiWiDialect dialect;
-
-    private String jdbcUrl;
-
-    private String jdbcUser;
-
-    private String jdbcPass;
-
     private KiWiPersistence persistence;
     private KiWiReasoningPersistence rpersistence;
 
     private Repository repository;
+    private final KiWiConfiguration config;
 
 
-    public JustificationPersistenceTest(String database, String jdbcUrl, String jdbcUser, String jdbcPass) {
-        this.jdbcPass = jdbcPass;
-        this.jdbcUrl = jdbcUrl;
-        this.jdbcUser = jdbcUser;
-
-        if("H2".equals(database)) {
-            this.dialect = new H2Dialect();
-        } else if("MySQL".equals(database)) {
-            this.dialect = new MySQLDialect();
-        } else if("PostgreSQL".equals(database)) {
-            this.dialect = new PostgreSQLDialect();
-        }
-
-        DBConnectionChecker.checkDatabaseAvailability(jdbcUrl, jdbcUser, jdbcPass, dialect);
+    public JustificationPersistenceTest(KiWiConfiguration config) {
+      this.config = config;
     }
 
 
     @Before
     public void initDatabase() throws Exception {
+        KiWiStore store = new KiWiStore(config);
 
-        persistence = new KiWiPersistence("test",jdbcUrl,jdbcUser,jdbcPass,dialect);
-        persistence.initDatabase();
-
-        repository = new SailRepository(new KiWiStore("test",jdbcUrl,jdbcUser,jdbcPass,dialect, "http://localhost/context/default", "http://localhost/context/inferred"));
+        repository = new SailRepository(store);
         repository.initialize();
 
+        persistence = store.getPersistence();
+
         rpersistence = new KiWiReasoningPersistence(persistence, repository.getValueFactory());
         rpersistence.initDatabase();
 
@@ -173,26 +101,13 @@ public class JustificationPersistenceTest {
     @After
     public void dropDatabase() throws Exception {
         rpersistence.dropDatabase();
-
         persistence.dropDatabase();
-        persistence.shutdown();
-
         repository.shutDown();
     }
 
     final Logger logger =
             LoggerFactory.getLogger(JustificationPersistenceTest.class);
 
-    @Rule
-    public TestWatcher watchman = new TestWatcher() {
-        /**
-         * Invoked when a test is about to start
-         */
-        @Override
-        protected void starting(Description description) {
-            logger.info("{} being run...", description.getMethodName());
-        }
-    };
 
     /**
      * Test 1: create some triples through a repository connection (some inferred, some base), load a program, and
@@ -251,8 +166,8 @@ public class JustificationPersistenceTest {
         connection = rpersistence.getConnection();
         try {
             // retrieve the persisted triples and put them into two sets to build justifications
-            List<Statement> baseTriples = asList(connection.listTriples(null,null,null,v.convert(ctxb),false));
-            List<Statement> infTriples = asList(connection.listTriples(null,null,null,v.convert(ctxi),true));
+            List<Statement> baseTriples = asList(connection.listTriples(null,null,null,v.convert(ctxb),false, true));
+            List<Statement> infTriples = asList(connection.listTriples(null,null,null,v.convert(ctxi),true, true));
 
             Assert.assertEquals("number of base triples was not 3", 3, baseTriples.size());
             Assert.assertEquals("number of inferred triples was not 3", 3, infTriples.size());

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/kiwi/kiwi-reasoner/src/test/java/org/apache/marmotta/kiwi/reasoner/test/persistence/KWRLProgramPersistenceTest.java
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-reasoner/src/test/java/org/apache/marmotta/kiwi/reasoner/test/persistence/KWRLProgramPersistenceTest.java b/libraries/kiwi/kiwi-reasoner/src/test/java/org/apache/marmotta/kiwi/reasoner/test/persistence/KWRLProgramPersistenceTest.java
index 4120df0..b945334 100644
--- a/libraries/kiwi/kiwi-reasoner/src/test/java/org/apache/marmotta/kiwi/reasoner/test/persistence/KWRLProgramPersistenceTest.java
+++ b/libraries/kiwi/kiwi-reasoner/src/test/java/org/apache/marmotta/kiwi/reasoner/test/persistence/KWRLProgramPersistenceTest.java
@@ -17,20 +17,23 @@
  */
 package org.apache.marmotta.kiwi.reasoner.test.persistence;
 
+import static org.hamcrest.Matchers.hasItems;
 import info.aduna.iteration.CloseableIteration;
+
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.marmotta.kiwi.config.KiWiConfiguration;
 import org.apache.marmotta.kiwi.persistence.KiWiConnection;
-import org.apache.marmotta.kiwi.persistence.KiWiDialect;
 import org.apache.marmotta.kiwi.persistence.KiWiPersistence;
-import org.apache.marmotta.kiwi.persistence.h2.H2Dialect;
-import org.apache.marmotta.kiwi.persistence.mysql.MySQLDialect;
-import org.apache.marmotta.kiwi.persistence.pgsql.PostgreSQLDialect;
 import org.apache.marmotta.kiwi.reasoner.model.program.Program;
 import org.apache.marmotta.kiwi.reasoner.parser.KWRLProgramParser;
 import org.apache.marmotta.kiwi.reasoner.parser.KWRLProgramParserBase;
 import org.apache.marmotta.kiwi.reasoner.persistence.KiWiReasoningConnection;
 import org.apache.marmotta.kiwi.reasoner.persistence.KiWiReasoningPersistence;
-import org.apache.marmotta.kiwi.test.RepositoryTest;
-import org.apache.marmotta.kiwi.test.helper.DBConnectionChecker;
+import org.apache.marmotta.kiwi.test.junit.KiWiDatabaseRunner;
 import org.junit.After;
 import org.junit.Assert;
 import org.junit.Before;
@@ -39,110 +42,33 @@ import org.junit.Test;
 import org.junit.rules.TestWatcher;
 import org.junit.runner.Description;
 import org.junit.runner.RunWith;
-import org.junit.runners.Parameterized;
 import org.openrdf.repository.Repository;
 import org.openrdf.repository.sail.SailRepository;
 import org.openrdf.sail.memory.MemoryStore;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import java.sql.PreparedStatement;
-import java.sql.ResultSet;
-import java.util.ArrayList;
-import java.util.List;
-
-import static org.hamcrest.Matchers.hasItems;
-
 /**
  * This test verifies the persistence functionality of the reasoning component regarding storing, loading and deleting
  * reasoning programs.
  *
- * It will try running over all available databases. Except for in-memory databases like H2 or Derby, database
- * URLs must be passed as system property, or otherwise the test is skipped for this database. Available system properties:
- * <ul>
- *     <li>PostgreSQL:
- *     <ul>
- *         <li>postgresql.url, e.g. jdbc:postgresql://localhost:5433/kiwitest?prepareThreshold=3</li>
- *         <li>postgresql.user (default: lmf)</li>
- *         <li>postgresql.pass (default: lmf)</li>
- *     </ul>
- *     </li>
- *     <li>MySQL:
- *     <ul>
- *         <li>mysql.url, e.g. jdbc:mysql://localhost:3306/kiwitest?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull</li>
- *         <li>mysql.user (default: lmf)</li>
- *         <li>mysql.pass (default: lmf</li>
- *     </ul>
- *     </li>
- *     <li>H2:
- *     <ul>
- *         <li>h2.url, e.g. jdbc:h2:mem;MVCC=true;DB_CLOSE_ON_EXIT=FALSE;DB_CLOSE_DELAY=10</li>
- *         <li>h2.user (default: lmf)</li>
- *         <li>h2.pass (default: lmf</li>
- *     </ul>
- *     </li>
- * </ul>
- *
  * @see org.apache.marmotta.kiwi.persistence.KiWiConnection
  * @see org.apache.marmotta.kiwi.persistence.KiWiPersistence
- * <p/>
- * Author: Sebastian Schaffert
+ * @author Sebastian Schaffert (sschaffert@apache.org)
  */
-@RunWith(Parameterized.class)
+@RunWith(KiWiDatabaseRunner.class)
 public class KWRLProgramPersistenceTest {
 
-    /**
-     * Return database configurations if the appropriate parameters have been set.
-     *
-     * @return an array (database name, url, user, password)
-     */
-    @Parameterized.Parameters(name="Database Test {index}: {0} at {1}")
-    public static Iterable<Object[]> databases() {
-        String[] databases = {"H2", "PostgreSQL", "MySQL"};
-
-        List<Object[]> result = new ArrayList<Object[]>(databases.length);
-        for(String database : databases) {
-            if(System.getProperty(database.toLowerCase()+".url") != null) {
-                result.add(new Object[] {
-                        database,
-                        System.getProperty(database.toLowerCase()+".url"),
-                        System.getProperty(database.toLowerCase()+".user","lmf"),
-                        System.getProperty(database.toLowerCase()+".pass","lmf")
-                });
-            }
-        }
-        return result;
-    }
-
-
-    private KiWiDialect dialect;
-
-    private String jdbcUrl;
-
-    private String jdbcUser;
-
-    private String jdbcPass;
-
     private KiWiPersistence persistence;
     private KiWiReasoningPersistence rpersistence;
 
     private Repository repository;
+    private final KiWiConfiguration config;
 
 
-    public KWRLProgramPersistenceTest(String database, String jdbcUrl, String jdbcUser, String jdbcPass) {
-        this.jdbcPass = jdbcPass;
-        this.jdbcUrl = jdbcUrl;
-        this.jdbcUser = jdbcUser;
-
-        if("H2".equals(database)) {
-            this.dialect = new H2Dialect();
-        } else if("MySQL".equals(database)) {
-            this.dialect = new MySQLDialect();
-        } else if("PostgreSQL".equals(database)) {
-            this.dialect = new PostgreSQLDialect();
-        }
-
-        DBConnectionChecker.checkDatabaseAvailability(jdbcUrl, jdbcUser, jdbcPass, dialect);
+    public KWRLProgramPersistenceTest(KiWiConfiguration config) {
+        this.config = config;
+        
     }
 
 
@@ -151,7 +77,8 @@ public class KWRLProgramPersistenceTest {
         repository = new SailRepository(new MemoryStore());
         repository.initialize();
 
-        persistence = new KiWiPersistence("test",jdbcUrl,jdbcUser,jdbcPass,dialect);
+        persistence = new KiWiPersistence(config);
+        persistence.initialise();
         persistence.initDatabase();
 
         rpersistence = new KiWiReasoningPersistence(persistence, repository.getValueFactory());
@@ -172,16 +99,6 @@ public class KWRLProgramPersistenceTest {
     final Logger logger =
             LoggerFactory.getLogger(KWRLProgramPersistenceTest.class);
 
-    @Rule
-    public TestWatcher watchman = new TestWatcher() {
-        /**
-         * Invoked when a test is about to start
-         */
-        @Override
-        protected void starting(Description description) {
-            logger.info("{} being run...", description.getMethodName());
-        }
-    };
 
 
     @Test
@@ -192,7 +109,7 @@ public class KWRLProgramPersistenceTest {
             Assert.assertThat(connection.getDatabaseTables(), hasItems(
                     "reasoner_programs", "reasoner_program_namespaces", "reasoner_program_rules",
                     "reasoner_rules", "reasoner_justifications", "reasoner_just_supp_triples", "reasoner_just_supp_rules"));
-            Assert.assertEquals(1, connection.getDatabaseVersion());
+            Assert.assertEquals(2, connection.getDatabaseVersion());
 
             connection.commit();
         } finally {

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/kiwi/kiwi-reasoner/src/test/java/org/apache/marmotta/kiwi/reasoner/test/persistence/PatternQueryTest.java
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-reasoner/src/test/java/org/apache/marmotta/kiwi/reasoner/test/persistence/PatternQueryTest.java b/libraries/kiwi/kiwi-reasoner/src/test/java/org/apache/marmotta/kiwi/reasoner/test/persistence/PatternQueryTest.java
index c2462b0..2fab9f2 100644
--- a/libraries/kiwi/kiwi-reasoner/src/test/java/org/apache/marmotta/kiwi/reasoner/test/persistence/PatternQueryTest.java
+++ b/libraries/kiwi/kiwi-reasoner/src/test/java/org/apache/marmotta/kiwi/reasoner/test/persistence/PatternQueryTest.java
@@ -17,14 +17,15 @@
  */
 package org.apache.marmotta.kiwi.reasoner.test.persistence;
 
-import com.google.common.collect.ImmutableSet;
 import info.aduna.iteration.CloseableIteration;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.apache.marmotta.kiwi.config.KiWiConfiguration;
 import org.apache.marmotta.kiwi.model.rdf.KiWiTriple;
-import org.apache.marmotta.kiwi.persistence.KiWiDialect;
 import org.apache.marmotta.kiwi.persistence.KiWiPersistence;
-import org.apache.marmotta.kiwi.persistence.h2.H2Dialect;
-import org.apache.marmotta.kiwi.persistence.mysql.MySQLDialect;
-import org.apache.marmotta.kiwi.persistence.pgsql.PostgreSQLDialect;
 import org.apache.marmotta.kiwi.reasoner.model.program.LiteralField;
 import org.apache.marmotta.kiwi.reasoner.model.program.Pattern;
 import org.apache.marmotta.kiwi.reasoner.model.program.ResourceField;
@@ -33,7 +34,7 @@ import org.apache.marmotta.kiwi.reasoner.model.query.QueryResult;
 import org.apache.marmotta.kiwi.reasoner.persistence.KiWiReasoningConnection;
 import org.apache.marmotta.kiwi.reasoner.persistence.KiWiReasoningPersistence;
 import org.apache.marmotta.kiwi.sail.KiWiStore;
-import org.apache.marmotta.kiwi.test.helper.DBConnectionChecker;
+import org.apache.marmotta.kiwi.test.junit.KiWiDatabaseRunner;
 import org.junit.After;
 import org.junit.Assert;
 import org.junit.Before;
@@ -42,7 +43,6 @@ import org.junit.Test;
 import org.junit.rules.TestWatcher;
 import org.junit.runner.Description;
 import org.junit.runner.RunWith;
-import org.junit.runners.Parameterized;
 import org.openrdf.model.Literal;
 import org.openrdf.model.URI;
 import org.openrdf.model.ValueFactory;
@@ -52,46 +52,17 @@ import org.openrdf.repository.sail.SailRepository;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
+import com.google.common.collect.ImmutableSet;
 
 /**
  * This test verifies the persistence functionality of the reasoning component regarding storing, loading and deleting
  * reasoning programs.
  *
- * It will try running over all available databases. Except for in-memory databases like H2 or Derby, database
- * URLs must be passed as system property, or otherwise the test is skipped for this database. Available system properties:
- * <ul>
- *     <li>PostgreSQL:
- *     <ul>
- *         <li>postgresql.url, e.g. jdbc:postgresql://localhost:5433/kiwitest?prepareThreshold=3</li>
- *         <li>postgresql.user (default: lmf)</li>
- *         <li>postgresql.pass (default: lmf)</li>
- *     </ul>
- *     </li>
- *     <li>MySQL:
- *     <ul>
- *         <li>mysql.url, e.g. jdbc:mysql://localhost:3306/kiwitest?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull</li>
- *         <li>mysql.user (default: lmf)</li>
- *         <li>mysql.pass (default: lmf</li>
- *     </ul>
- *     </li>
- *     <li>H2:
- *     <ul>
- *         <li>h2.url, e.g. jdbc:h2:mem;MVCC=true;DB_CLOSE_ON_EXIT=FALSE;DB_CLOSE_DELAY=10</li>
- *         <li>h2.user (default: lmf)</li>
- *         <li>h2.pass (default: lmf</li>
- *     </ul>
- *     </li>
- * </ul>
- *
  * @see org.apache.marmotta.kiwi.persistence.KiWiConnection
  * @see org.apache.marmotta.kiwi.persistence.KiWiPersistence
- * <p/>
- * Author: Sebastian Schaffert
+ * @author Sebastian Schaffert (sschaffert@apache.org)
  */
-@RunWith(Parameterized.class)
+@RunWith(KiWiDatabaseRunner.class)
 public class PatternQueryTest {
 
     // string constants for RDF values
@@ -106,72 +77,28 @@ public class PatternQueryTest {
     private static final String OBJECT4  = "Literal Value 2";
     private static final String OBJECT5  = "Literal Value 3";
 
-
-
-    /**
-     * Return database configurations if the appropriate parameters have been set.
-     *
-     * @return an array (database name, url, user, password)
-     */
-    @Parameterized.Parameters(name="Database Test {index}: {0} at {1}")
-    public static Iterable<Object[]> databases() {
-        String[] databases = {"H2", "PostgreSQL", "MySQL"};
-
-        List<Object[]> result = new ArrayList<Object[]>(databases.length);
-        for(String database : databases) {
-            if(System.getProperty(database.toLowerCase()+".url") != null) {
-                result.add(new Object[] {
-                        database,
-                        System.getProperty(database.toLowerCase()+".url"),
-                        System.getProperty(database.toLowerCase()+".user","lmf"),
-                        System.getProperty(database.toLowerCase()+".pass","lmf")
-                });
-            }
-        }
-        return result;
-    }
-
-
-    private KiWiDialect dialect;
-
-    private String jdbcUrl;
-
-    private String jdbcUser;
-
-    private String jdbcPass;
-
     private KiWiPersistence persistence;
     private KiWiReasoningPersistence rpersistence;
 
     private Repository repository;
+    private final KiWiConfiguration config;
 
 
-    public PatternQueryTest(String database, String jdbcUrl, String jdbcUser, String jdbcPass) {
-        this.jdbcPass = jdbcPass;
-        this.jdbcUrl = jdbcUrl;
-        this.jdbcUser = jdbcUser;
-
-        if("H2".equals(database)) {
-            this.dialect = new H2Dialect();
-        } else if("MySQL".equals(database)) {
-            this.dialect = new MySQLDialect();
-        } else if("PostgreSQL".equals(database)) {
-            this.dialect = new PostgreSQLDialect();
-        }
-
-        DBConnectionChecker.checkDatabaseAvailability(jdbcUrl, jdbcUser, jdbcPass, dialect);
+    public PatternQueryTest(KiWiConfiguration config) {
+        this.config = config;
     }
 
 
     @Before
     public void initDatabase() throws Exception {
+        KiWiStore store = new KiWiStore(config);
 
-        persistence = new KiWiPersistence("test",jdbcUrl,jdbcUser,jdbcPass,dialect);
-        persistence.initDatabase();
-
-        repository = new SailRepository(new KiWiStore("test",jdbcUrl,jdbcUser,jdbcPass,dialect, "http://localhost/context/default", "http://localhost/context/inferred"));
+        repository = new SailRepository(store);
         repository.initialize();
 
+        persistence = store.getPersistence();
+
+
         rpersistence = new KiWiReasoningPersistence(persistence, repository.getValueFactory());
         rpersistence.initDatabase();
 
@@ -196,26 +123,13 @@ public class PatternQueryTest {
     @After
     public void dropDatabase() throws Exception {
         rpersistence.dropDatabase();
-
         persistence.dropDatabase();
-        persistence.shutdown();
-
         repository.shutDown();
     }
 
     final Logger logger =
             LoggerFactory.getLogger(PatternQueryTest.class);
 
-    @Rule
-    public TestWatcher watchman = new TestWatcher() {
-        /**
-         * Invoked when a test is about to start
-         */
-        @Override
-        protected void starting(Description description) {
-            logger.info("{} being run...", description.getMethodName());
-        }
-    };
 
     // test the method for querying patterns by:
     // - evaluating a single pattern without variables (no bindings but justifications non-empty)

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/kiwi/kiwi-reasoner/src/test/java/org/apache/marmotta/kiwi/reasoner/test/sail/ReasoningSailTest.java
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-reasoner/src/test/java/org/apache/marmotta/kiwi/reasoner/test/sail/ReasoningSailTest.java b/libraries/kiwi/kiwi-reasoner/src/test/java/org/apache/marmotta/kiwi/reasoner/test/sail/ReasoningSailTest.java
index 9410394..64da3c1 100644
--- a/libraries/kiwi/kiwi-reasoner/src/test/java/org/apache/marmotta/kiwi/reasoner/test/sail/ReasoningSailTest.java
+++ b/libraries/kiwi/kiwi-reasoner/src/test/java/org/apache/marmotta/kiwi/reasoner/test/sail/ReasoningSailTest.java
@@ -17,6 +17,7 @@
  */
 package org.apache.marmotta.kiwi.reasoner.test.sail;
 
+import org.apache.marmotta.kiwi.config.KiWiConfiguration;
 import org.apache.marmotta.kiwi.persistence.KiWiDialect;
 import org.apache.marmotta.kiwi.persistence.h2.H2Dialect;
 import org.apache.marmotta.kiwi.persistence.mysql.MySQLDialect;
@@ -26,6 +27,7 @@ import org.apache.marmotta.kiwi.reasoner.sail.KiWiReasoningSail;
 import org.apache.marmotta.kiwi.sail.KiWiStore;
 import org.apache.marmotta.kiwi.test.RepositoryTest;
 import org.apache.marmotta.kiwi.test.helper.DBConnectionChecker;
+import org.apache.marmotta.kiwi.test.junit.KiWiDatabaseRunner;
 import org.apache.marmotta.kiwi.transactions.sail.KiWiTransactionalSail;
 import org.junit.After;
 import org.junit.Assert;
@@ -49,104 +51,35 @@ import java.util.List;
 
 /**
  * Test the reasoning sail with small sample datasets. It will test both full and incremental reasoning.
- * <p/>
- * It will try running over all available databases. Except for in-memory databases like H2 or Derby, database
- * URLs must be passed as system property, or otherwise the test is skipped for this database. Available system properties:
- * <ul>
- *     <li>PostgreSQL:
- *     <ul>
- *         <li>postgresql.url, e.g. jdbc:postgresql://localhost:5433/kiwitest?prepareThreshold=3</li>
- *         <li>postgresql.user (default: lmf)</li>
- *         <li>postgresql.pass (default: lmf)</li>
- *     </ul>
- *     </li>
- *     <li>MySQL:
- *     <ul>
- *         <li>mysql.url, e.g. jdbc:mysql://localhost:3306/kiwitest?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull</li>
- *         <li>mysql.user (default: lmf)</li>
- *         <li>mysql.pass (default: lmf</li>
- *     </ul>
- *     </li>
- *     <li>H2:
- *     <ul>
- *         <li>h2.url, e.g. jdbc:h2:mem;MVCC=true;DB_CLOSE_ON_EXIT=FALSE;DB_CLOSE_DELAY=10</li>
- *         <li>h2.user (default: lmf)</li>
- *         <li>h2.pass (default: lmf</li>
- *     </ul>
- *     </li>
- * </ul>
- *
+ * 
  * @see org.apache.marmotta.kiwi.persistence.KiWiConnection
  * @see org.apache.marmotta.kiwi.persistence.KiWiPersistence
- * <p/>
- * Author: Sebastian Schaffert
+ * @author Sebastian Schaffert (sschaffert@apache.org)
  */
-@RunWith(Parameterized.class)
+@RunWith(KiWiDatabaseRunner.class)
 public class ReasoningSailTest {
 
     private static Logger log = LoggerFactory.getLogger(ReasoningSailTest.class);
 
     private static final String NS = "http://localhost/resource/";
 
-    /**
-     * Return database configurations if the appropriate parameters have been set.
-     *
-     * @return an array (database name, url, user, password)
-     */
-    @Parameterized.Parameters(name="Database Test {index}: {0} at {1}")
-    public static Iterable<Object[]> databases() {
-        String[] databases = {"H2", "PostgreSQL", "MySQL"};
-
-        List<Object[]> result = new ArrayList<Object[]>(databases.length);
-        for(String database : databases) {
-            if(System.getProperty(database.toLowerCase()+".url") != null) {
-                result.add(new Object[] {
-                        database,
-                        System.getProperty(database.toLowerCase()+".url"),
-                        System.getProperty(database.toLowerCase()+".user","lmf"),
-                        System.getProperty(database.toLowerCase()+".pass","lmf")
-                });
-            }
-        }
-        return result;
-    }
-
-
-    private KiWiDialect dialect;
-
-    private String jdbcUrl;
-
-    private String jdbcUser;
-
-    private String jdbcPass;
-
     private KiWiStore store;
     private KiWiTransactionalSail tsail;
     private KiWiReasoningSail     rsail;
 
     private Repository repository;
 
+    private final KiWiConfiguration config;
 
-    public ReasoningSailTest(String database, String jdbcUrl, String jdbcUser, String jdbcPass) {
-        this.jdbcPass = jdbcPass;
-        this.jdbcUrl = jdbcUrl;
-        this.jdbcUser = jdbcUser;
 
-        if("H2".equals(database)) {
-            this.dialect = new H2Dialect();
-        } else if("MySQL".equals(database)) {
-            this.dialect = new MySQLDialect();
-        } else if("PostgreSQL".equals(database)) {
-            this.dialect = new PostgreSQLDialect();
-        }
-
-        DBConnectionChecker.checkDatabaseAvailability(jdbcUrl, jdbcUser, jdbcPass, dialect);
+    public ReasoningSailTest(KiWiConfiguration config) {
+        this.config = config;
     }
 
 
     @Before
     public void initDatabase() throws Exception {
-        store = new KiWiStore("test",jdbcUrl,jdbcUser,jdbcPass,dialect, "http://localhost/context/default", "http://localhost/context/inferred");
+        store = new KiWiStore(config);
         tsail = new KiWiTransactionalSail(store);
         rsail = new KiWiReasoningSail(tsail, new ReasoningConfiguration());
         repository = new SailRepository(rsail);
@@ -155,22 +88,12 @@ public class ReasoningSailTest {
 
     @After
     public void dropDatabase() throws Exception {
+        rsail.getEngine().shutdown(true);
         rsail.getPersistence().dropDatabase();
         store.getPersistence().dropDatabase();
         repository.shutDown();
     }
 
-    @Rule
-    public TestWatcher watchman = new TestWatcher() {
-        /**
-         * Invoked when a test is about to start
-         */
-        @Override
-        protected void starting(Description description) {
-            log.info("{} being run...", description.getMethodName());
-        }
-    };
-
     /**
      * Test incremental reasoning with a small sample program. This test will carry out the following steps in order:
      * - load the program "simple.kwrl" into the reasoning engine

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/kiwi/kiwi-reasoner/src/test/java/org/apache/marmotta/kiwi/reasoner/test/sesame/KiWiRDFSchemaRepositoryConnectionTest.java
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-reasoner/src/test/java/org/apache/marmotta/kiwi/reasoner/test/sesame/KiWiRDFSchemaRepositoryConnectionTest.java b/libraries/kiwi/kiwi-reasoner/src/test/java/org/apache/marmotta/kiwi/reasoner/test/sesame/KiWiRDFSchemaRepositoryConnectionTest.java
new file mode 100644
index 0000000..c5a0854
--- /dev/null
+++ b/libraries/kiwi/kiwi-reasoner/src/test/java/org/apache/marmotta/kiwi/reasoner/test/sesame/KiWiRDFSchemaRepositoryConnectionTest.java
@@ -0,0 +1,179 @@
+/*
+ * 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.kiwi.reasoner.test.sesame;
+
+import org.apache.marmotta.kiwi.config.KiWiConfiguration;
+import org.apache.marmotta.kiwi.persistence.h2.H2Dialect;
+import org.apache.marmotta.kiwi.reasoner.engine.ReasoningConfiguration;
+import org.apache.marmotta.kiwi.reasoner.sail.KiWiReasoningSail;
+import org.apache.marmotta.kiwi.sail.KiWiStore;
+import org.apache.marmotta.kiwi.test.junit.KiWiDatabaseRunner;
+import org.apache.marmotta.kiwi.transactions.sail.KiWiTransactionalSail;
+import org.junit.Before;
+import org.junit.Ignore;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.openrdf.model.vocabulary.RDF;
+import org.openrdf.model.vocabulary.RDFS;
+import org.openrdf.repository.RDFSchemaRepositoryConnectionTest;
+import org.openrdf.repository.Repository;
+import org.openrdf.repository.RepositoryConnection;
+import org.openrdf.repository.RepositoryException;
+import org.openrdf.repository.base.RepositoryConnectionWrapper;
+import org.openrdf.repository.base.RepositoryWrapper;
+import org.openrdf.repository.sail.SailRepository;
+import org.openrdf.sail.Sail;
+import org.openrdf.sail.SailException;
+import org.openrdf.sail.helpers.SailWrapper;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.sql.SQLException;
+
+import static org.junit.Assert.fail;
+
+/**
+ * Run the {@link KiWiRDFSchemaRepositoryConnectionTest}s.
+ * @author Jakob Frank <ja...@apache.org>
+ * @author Sebastian Schaffert <ss...@apache.org>
+ *
+ */
+@RunWith(KiWiDatabaseRunner.class)
+//@KiWiDatabaseRunner.ForDialects(dialect = H2Dialect.class)
+public class KiWiRDFSchemaRepositoryConnectionTest extends RDFSchemaRepositoryConnectionTest {
+
+    public Logger log = LoggerFactory.getLogger(this.getClass());
+
+    private final KiWiConfiguration config;
+    private KiWiReasoningSail rsail;
+
+    public KiWiRDFSchemaRepositoryConnectionTest(KiWiConfiguration config) {
+        this.config = config;
+    }
+
+    /* (non-Javadoc)
+     * @see org.openrdf.repository.RepositoryConnectionTest#createRepository()
+     */
+    @Override
+    protected Repository createRepository() throws Exception {
+        config.setDefaultContext(null);
+
+        final KiWiStore sail = new KiWiStore(config);
+        KiWiTransactionalSail tsail = new KiWiTransactionalSail(sail);
+        rsail = new KiWiReasoningSail(tsail, new ReasoningConfiguration());
+
+        Sail wsail = new SailWrapper(rsail) {
+            @Override
+            public void shutDown() throws SailException {
+                rsail.getEngine().shutdown(true);
+
+                try {
+                    rsail.getPersistence().dropDatabase();
+                    sail.getPersistence().dropDatabase();
+                } catch (SQLException e) {
+                    fail("SQL exception while deleting database");
+                }
+
+                super.shutDown();
+            }
+        };
+
+        return new RepositoryWrapper(new SailRepository(wsail)) {
+            @Override
+            public RepositoryConnection getConnection()
+                    throws RepositoryException {
+                return new RepositoryConnectionWrapper(this, super.getConnection()) {
+                    @Override
+                    public void commit() throws RepositoryException {
+                        super.commit();
+
+                        // wait for the reasoner to finish
+                        try {
+                            while(rsail.getEngine().isRunning()) {
+                                log.info("sleeping for 500ms to let engine finish processing ... ");
+                                Thread.sleep(500);
+                            }
+                            log.info("sleeping for 100ms to let engine finish processing ... ");
+                            Thread.sleep(100);
+                        } catch (InterruptedException e) {
+                            throw new RepositoryException("Could not finish reasoning", e);
+                        }
+                    }
+                };
+            }
+        };
+    }
+
+    @Override
+    @Before
+    public void setUp() throws Exception {
+        super.setUp();
+
+        log.info("Setting up reasoning for RDFS");
+        rsail.addProgram("rdfs", this.getClass().getResourceAsStream("rdfs.skwrl"));
+    }
+
+    @Override
+    @Test
+    public void testExplicitFlag() throws Exception {
+        // We need at least _some_ data to infer... 
+        testCon.begin();
+        testCon.add(bob, RDF.TYPE, RDFS.RESOURCE);
+        testCon.commit();
+
+        super.testExplicitFlag();
+    }
+
+    @Override
+    @Test
+    @Ignore("in KiWi, inferencing is triggered on commit")
+    public void testInferencerQueryDuringTransaction() throws Exception {
+    }
+
+    @Override
+    @Test
+    @Ignore("in KiWi, inferencing is triggered on commit")
+    public void testInferencerTransactionIsolation() throws Exception {
+    }
+
+
+    @Override
+    @Test
+    @Ignore("in KiWi, inferencing is triggered on commit")
+    public void testClear() throws Exception {
+    }
+
+    @Override
+    @Test
+    @Ignore("in KiWi, inferencing is triggered on commit")
+    public void testDeleteDefaultGraph() throws Exception {
+    }
+
+    @Override
+    @Test
+    @Ignore("asynchronous reasoning takes too long for this test")
+    public void testOrderByQueriesAreInterruptable() throws Exception {
+    }
+
+    @Override
+    @Test
+    @Ignore("KiWi creates a separate context for inferred statements")
+    public void testGetContextIDs() throws Exception {
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/kiwi/kiwi-reasoner/src/test/resources/org/apache/marmotta/kiwi/reasoner/test/parser/test-002.kwrl
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-reasoner/src/test/resources/org/apache/marmotta/kiwi/reasoner/test/parser/test-002.kwrl b/libraries/kiwi/kiwi-reasoner/src/test/resources/org/apache/marmotta/kiwi/reasoner/test/parser/test-002.kwrl
index 8f1800d..4c7158e 100644
--- a/libraries/kiwi/kiwi-reasoner/src/test/resources/org/apache/marmotta/kiwi/reasoner/test/parser/test-002.kwrl
+++ b/libraries/kiwi/kiwi-reasoner/src/test/resources/org/apache/marmotta/kiwi/reasoner/test/parser/test-002.kwrl
@@ -13,6 +13,6 @@
  *  See the License for the specific language governing permissions and
  *  limitations under the License.
  */
-($1 http://www.w3.org/2000/01/rdf-schema#subClassOf $2), ($2 http://www.w3.org/2000/01/rdf-schema#subClassOf $3) -> ($1 http://www.w3.org/2000/01/rdf-schema#subClassOf $3)
-($1 http://www.w3.org/2000/01/rdf-schema#subPropertyOf $2), ($2 http://www.w3.org/2000/01/rdf-schema#subPropertyOf $3) -> ($1 http://www.w3.org/2000/01/rdf-schema#subPropertyOf $3)
-($1 http://www.w3.org/1999/02/22-rdf-syntax-ns#type $2), ($2 http://www.w3.org/2000/01/rdf-schema#subClassOf $3) -> ($1 http://www.w3.org/1999/02/22-rdf-syntax-ns#type $3)
+($1 <http://www.w3.org/2000/01/rdf-schema#subClassOf> $2), ($2 <http://www.w3.org/2000/01/rdf-schema#subClassOf> $3) -> ($1 <http://www.w3.org/2000/01/rdf-schema#subClassOf> $3)
+($1 <http://www.w3.org/2000/01/rdf-schema#subPropertyOf> $2), ($2 <http://www.w3.org/2000/01/rdf-schema#subPropertyOf> $3) -> ($1 <http://www.w3.org/2000/01/rdf-schema#subPropertyOf> $3)
+($1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> $2), ($2 <http://www.w3.org/2000/01/rdf-schema#subClassOf> $3) -> ($1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> $3)

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/kiwi/kiwi-reasoner/src/test/resources/org/apache/marmotta/kiwi/reasoner/test/persistence/test-002.kwrl
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-reasoner/src/test/resources/org/apache/marmotta/kiwi/reasoner/test/persistence/test-002.kwrl b/libraries/kiwi/kiwi-reasoner/src/test/resources/org/apache/marmotta/kiwi/reasoner/test/persistence/test-002.kwrl
index 8f1800d..4c7158e 100644
--- a/libraries/kiwi/kiwi-reasoner/src/test/resources/org/apache/marmotta/kiwi/reasoner/test/persistence/test-002.kwrl
+++ b/libraries/kiwi/kiwi-reasoner/src/test/resources/org/apache/marmotta/kiwi/reasoner/test/persistence/test-002.kwrl
@@ -13,6 +13,6 @@
  *  See the License for the specific language governing permissions and
  *  limitations under the License.
  */
-($1 http://www.w3.org/2000/01/rdf-schema#subClassOf $2), ($2 http://www.w3.org/2000/01/rdf-schema#subClassOf $3) -> ($1 http://www.w3.org/2000/01/rdf-schema#subClassOf $3)
-($1 http://www.w3.org/2000/01/rdf-schema#subPropertyOf $2), ($2 http://www.w3.org/2000/01/rdf-schema#subPropertyOf $3) -> ($1 http://www.w3.org/2000/01/rdf-schema#subPropertyOf $3)
-($1 http://www.w3.org/1999/02/22-rdf-syntax-ns#type $2), ($2 http://www.w3.org/2000/01/rdf-schema#subClassOf $3) -> ($1 http://www.w3.org/1999/02/22-rdf-syntax-ns#type $3)
+($1 <http://www.w3.org/2000/01/rdf-schema#subClassOf> $2), ($2 <http://www.w3.org/2000/01/rdf-schema#subClassOf> $3) -> ($1 <http://www.w3.org/2000/01/rdf-schema#subClassOf> $3)
+($1 <http://www.w3.org/2000/01/rdf-schema#subPropertyOf> $2), ($2 <http://www.w3.org/2000/01/rdf-schema#subPropertyOf> $3) -> ($1 <http://www.w3.org/2000/01/rdf-schema#subPropertyOf> $3)
+($1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> $2), ($2 <http://www.w3.org/2000/01/rdf-schema#subClassOf> $3) -> ($1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> $3)

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/kiwi/kiwi-reasoner/src/test/resources/org/apache/marmotta/kiwi/reasoner/test/sesame/rdfs.skwrl
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-reasoner/src/test/resources/org/apache/marmotta/kiwi/reasoner/test/sesame/rdfs.skwrl b/libraries/kiwi/kiwi-reasoner/src/test/resources/org/apache/marmotta/kiwi/reasoner/test/sesame/rdfs.skwrl
new file mode 100644
index 0000000..75294d8
--- /dev/null
+++ b/libraries/kiwi/kiwi-reasoner/src/test/resources/org/apache/marmotta/kiwi/reasoner/test/sesame/rdfs.skwrl
@@ -0,0 +1,36 @@
+/*
+ * 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.
+ */
+/* rules taken from http://www.w3.org/TR/2004/REC-rdf-mt-20040210/#RDFRules */
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
+@prefix rdf:  <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
+@prefix xsd:  <http://www.w3.org/2001/XMLSchema#>
+@prefix foaf: <http://xmlns.com/foaf/0.1/>
+
+rdf1   : ($u $a $y) -> ($a rdf:type rdf:Property)
+rdfs2  : ($a rdfs:domain $x), ($u $a $y) -> ($u rdf:type $x)
+rdfs3  : ($a rdfs:range $x),  ($u $a $v) -> ($v rdf:type $x)
+rdfs4a : ($u $a $x) -> ($u rdf:type rdfs:Resource)
+rdfs5  : ($u rdfs:subPropertyOf $v), ($v rdfs:subPropertyOf $x) -> ($u rdfs:subPropertyOf $x)
+rdfs6  : ($u rdf:type rdf:Property) -> ($u rdfs:subPropertyOf $u)
+rdfs7  : ($a rdfs:subPropertyOf $b), ($u $a $y) -> ($u $b $y)
+rdfs8  : ($u rdf:type rdfs:Class) -> ($u rdfs:subClassOf rdfs:Resource)
+rdfs9  : ($u rdfs:subClassOf $x), ($v rdf:type $u) -> ($v rdf:type $x)
+rdfs10 : ($u rdf:type rdfs:Class) -> ($u rdfs:subClassOf $u)
+rdfs11 : ($u rdfs:subClassOf $v), ($v rdfs:subClassOf $x) -> ($u rdfs:subClassOf $x)
+rdfs12 : ($u rdf:type rdfs:ContainerMembershipProperty) -> ($u rdfs:subPropertyOf rdfs:member)
+rdfs13 : ($u rdf:type rdfs:Datatype) -> ($u rdfs:subClassOf rdfs:Literal)

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/kiwi/kiwi-sparql/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-sparql/pom.xml b/libraries/kiwi/kiwi-sparql/pom.xml
new file mode 100644
index 0000000..3ddd37d
--- /dev/null
+++ b/libraries/kiwi/kiwi-sparql/pom.xml
@@ -0,0 +1,180 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ 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.
+  -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>org.apache.marmotta</groupId>
+        <artifactId>kiwi-parent</artifactId>
+        <version>3.1.0-incubating</version>
+        <relativePath>../</relativePath>
+    </parent>
+
+    <artifactId>kiwi-sparql</artifactId>
+    <name>KiWi Triplestore: SPARQL</name>
+
+    <description>
+        Provides enhanced SPARQL evaluation support by translating certain query patterns directly into SQL.
+        SPARQL operation is then a mixed in-memory and native evaluation with better performance than pure
+        in-memory.
+    </description>
+
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.marmotta</groupId>
+            <artifactId>kiwi-triplestore</artifactId>
+        </dependency>
+
+        <!-- Logging -->
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>log4j-over-slf4j</artifactId>
+        </dependency>
+
+        <!-- Sesame dependencies -->
+        <dependency>
+            <groupId>org.openrdf.sesame</groupId>
+            <artifactId>sesame-model</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.openrdf.sesame</groupId>
+            <artifactId>sesame-sail-api</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.openrdf.sesame</groupId>
+            <artifactId>sesame-repository-sail</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.openrdf.sesame</groupId>
+            <artifactId>sesame-query</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.openrdf.sesame</groupId>
+            <artifactId>sesame-queryparser-api</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.openrdf.sesame</groupId>
+            <artifactId>sesame-queryparser-sparql</artifactId>
+        </dependency>
+
+        <!-- Utilities -->
+        <dependency>
+            <groupId>com.google.guava</groupId>
+            <artifactId>guava</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.commons</groupId>
+            <artifactId>commons-lang3</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.marmotta</groupId>
+            <artifactId>marmotta-commons</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.marmotta</groupId>
+            <artifactId>sesame-filter</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>commons-io</groupId>
+            <artifactId>commons-io</artifactId>
+        </dependency>
+
+
+        <!-- Testing -->
+        <dependency>
+            <artifactId>junit</artifactId>
+            <groupId>junit</groupId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.marmotta</groupId>
+            <artifactId>kiwi-triplestore</artifactId>
+            <type>test-jar</type>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <artifactId>hamcrest-core</artifactId>
+            <groupId>org.hamcrest</groupId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <artifactId>hamcrest-library</artifactId>
+            <groupId>org.hamcrest</groupId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>ch.qos.logback</groupId>
+            <artifactId>logback-core</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>ch.qos.logback</groupId>
+            <artifactId>logback-classic</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>com.h2database</groupId>
+            <artifactId>h2</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.postgresql</groupId>
+            <artifactId>postgresql</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>mysql</groupId>
+            <artifactId>mysql-connector-java</artifactId>
+            <scope>test</scope>
+            <optional>true</optional> <!-- GPL licensed, no dependency -->
+        </dependency>
+        <dependency>
+            <groupId>org.openrdf.sesame</groupId>
+            <artifactId>sesame-sail-memory</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.openrdf.sesame</groupId>
+            <artifactId>sesame-rio-api</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.openrdf.sesame</groupId>
+            <artifactId>sesame-rio-rdfxml</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>commons-collections</groupId>
+            <artifactId>commons-collections</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.openrdf.sesame</groupId>
+            <artifactId>sesame-sparql-testsuite</artifactId>
+            <scope>test</scope>
+        </dependency>
+
+    </dependencies>
+
+</project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/kiwi/kiwi-sparql/src/main/java/org/apache/marmotta/kiwi/sparql/evaluation/KiWiEvaluationStatistics.java
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-sparql/src/main/java/org/apache/marmotta/kiwi/sparql/evaluation/KiWiEvaluationStatistics.java b/libraries/kiwi/kiwi-sparql/src/main/java/org/apache/marmotta/kiwi/sparql/evaluation/KiWiEvaluationStatistics.java
new file mode 100644
index 0000000..fc434e9
--- /dev/null
+++ b/libraries/kiwi/kiwi-sparql/src/main/java/org/apache/marmotta/kiwi/sparql/evaluation/KiWiEvaluationStatistics.java
@@ -0,0 +1,52 @@
+/*
+ * 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.kiwi.sparql.evaluation;
+
+import org.openrdf.model.Value;
+import org.openrdf.query.algebra.StatementPattern;
+import org.openrdf.query.algebra.Var;
+import org.openrdf.query.algebra.evaluation.impl.EvaluationStatistics;
+
+/**
+ * Add file description here!
+ *
+ * @author Sebastian Schaffert (sschaffert@apache.org)
+ */
+public class KiWiEvaluationStatistics extends EvaluationStatistics {
+
+    public KiWiEvaluationStatistics() {
+    }
+
+    @Override
+    protected CardinalityCalculator createCardinalityCalculator() {
+        return new KiWiCardinalityCalculator();
+    }
+
+    protected class KiWiCardinalityCalculator extends CardinalityCalculator {
+
+        @Override
+        protected double getCardinality(StatementPattern sp) {
+            return super.getCardinality(sp);
+        }
+
+        protected Value getConstantValue(Var var) {
+            return (var != null) ? var.getValue() : null;
+        }
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/kiwi/kiwi-sparql/src/main/java/org/apache/marmotta/kiwi/sparql/evaluation/KiWiEvaluationStrategyImpl.java
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-sparql/src/main/java/org/apache/marmotta/kiwi/sparql/evaluation/KiWiEvaluationStrategyImpl.java b/libraries/kiwi/kiwi-sparql/src/main/java/org/apache/marmotta/kiwi/sparql/evaluation/KiWiEvaluationStrategyImpl.java
new file mode 100644
index 0000000..b6cb5e6
--- /dev/null
+++ b/libraries/kiwi/kiwi-sparql/src/main/java/org/apache/marmotta/kiwi/sparql/evaluation/KiWiEvaluationStrategyImpl.java
@@ -0,0 +1,192 @@
+/*
+ * 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.kiwi.sparql.evaluation;
+
+import info.aduna.iteration.CloseableIteration;
+import info.aduna.iteration.ExceptionConvertingIteration;
+import org.apache.marmotta.kiwi.sparql.persistence.KiWiSparqlConnection;
+import org.openrdf.query.BindingSet;
+import org.openrdf.query.Dataset;
+import org.openrdf.query.QueryEvaluationException;
+import org.openrdf.query.QueryInterruptedException;
+import org.openrdf.query.algebra.*;
+import org.openrdf.query.algebra.evaluation.TripleSource;
+import org.openrdf.query.algebra.evaluation.impl.EvaluationStrategyImpl;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.sql.SQLException;
+
+/**
+ * An implementation of the SPARQL query evaluation strategy with specific extensions and optimizations. The KiWi
+ * evaluation strategy is able to apply optimizations to certain frequently found query patterns by directly translating
+ * them into SQL queries. Currently, the following constructs are supported:
+ * <ul>
+ *     <li>JOINs of statement patterns are translated into SQL joins (no OPTIONAL and no path expressions supporterd)</li>
+ *     <li>FILTERs are translated to SQL where conditions, in case the FILTER conditions are supported (no aggregation constructs are supported)</li>
+ * </ul>
+ * In case a query is not completely supported by the optimizer, the optimizer might still improve performance by
+ * evaluating the optimizable components of the query and then letting the in-memory implementation take over
+ * (e.g. for aggregation constructs, distinct, path expressions, optional).
+ *
+ * @author Sebastian Schaffert (sschaffert@apache.org)
+ */
+public class KiWiEvaluationStrategyImpl extends EvaluationStrategyImpl{
+
+    private static Logger log = LoggerFactory.getLogger(KiWiEvaluationStrategyImpl.class);
+
+    /**
+     * The database connection offering specific SPARQL-SQL optimizations.
+     */
+    private KiWiSparqlConnection connection;
+
+    public KiWiEvaluationStrategyImpl(TripleSource tripleSource, KiWiSparqlConnection connection) {
+        super(tripleSource);
+        this.connection = connection;
+    }
+
+    public KiWiEvaluationStrategyImpl(TripleSource tripleSource, Dataset dataset, KiWiSparqlConnection connection) {
+        super(tripleSource, dataset);
+        this.connection = connection;
+    }
+
+    @Override
+    public CloseableIteration<BindingSet, QueryEvaluationException> evaluate(Join join, BindingSet bindings) throws QueryEvaluationException {
+        if(Thread.currentThread().isInterrupted()) {
+            throw new QueryEvaluationException("SPARQL evaluation has already been cancelled");
+        }
+
+        if(isSupported(join)) {
+            log.debug("applying KiWi JOIN optimizations on SPARQL query ...");
+
+            try {
+                return new ExceptionConvertingIteration<BindingSet, QueryEvaluationException>(connection.evaluateJoin(join, bindings)) {
+                    @Override
+                    protected QueryEvaluationException convert(Exception e) {
+                        return new QueryEvaluationException(e);
+                    }
+                };
+            } catch (SQLException e) {
+                throw new QueryEvaluationException(e.getMessage(),e);
+            } catch (IllegalArgumentException e) {
+                throw new QueryEvaluationException(e.getMessage(),e);
+            } catch (InterruptedException e) {
+                throw new QueryInterruptedException(e.getMessage());
+            }
+        } else {
+            return super.evaluate(join, bindings);
+        }
+    }
+
+    @Override
+    public CloseableIteration<BindingSet, QueryEvaluationException> evaluate(Filter join, BindingSet bindings) throws QueryEvaluationException {
+        if(isSupported(join)) {
+            log.debug("applying KiWi FILTER optimizations on SPARQL query ...");
+
+            try {
+                return new ExceptionConvertingIteration<BindingSet, QueryEvaluationException>(connection.evaluateJoin(join, bindings)) {
+                    @Override
+                    protected QueryEvaluationException convert(Exception e) {
+                        return new QueryEvaluationException(e);
+                    }
+                };
+            } catch (SQLException e) {
+                throw new QueryEvaluationException(e);
+            } catch (IllegalArgumentException e) {
+                throw new QueryEvaluationException(e);
+            } catch (InterruptedException e) {
+                throw new QueryInterruptedException(e);
+            }
+        } else {
+            return super.evaluate(join, bindings);
+        }
+    }
+
+
+    /**
+     * Test if a tuple expression is supported nby the optimized evaluation; in this case we can apply a specific optimization.
+     * @param expr
+     * @return
+     */
+    private static boolean isSupported(TupleExpr expr) {
+        if(expr instanceof Join) {
+            return isSupported(((Join) expr).getLeftArg()) && isSupported(((Join) expr).getRightArg());
+        } else if(expr instanceof Filter) {
+            return isSupported(((Filter) expr).getArg()) && isSupported(((Filter) expr).getCondition());
+        } else if(expr instanceof StatementPattern) {
+            return true;
+        } else {
+            return false;
+        }
+    }
+
+    /**
+     * Test if the value expression construct and all its subexpressions are supported by the optimized evaluation
+     * strategy. Returns true if yes, false otherwise.
+     *
+     * @param expr
+     * @return
+     */
+    private static boolean isSupported(ValueExpr expr) {
+        if(expr instanceof Compare) {
+            return isSupported(((Compare) expr).getLeftArg()) && isSupported(((Compare) expr).getRightArg());
+        } else if(expr instanceof MathExpr) {
+            return isSupported(((MathExpr) expr).getLeftArg()) && isSupported(((MathExpr) expr).getRightArg());
+        } else if(expr instanceof And) {
+            return isSupported(((And) expr).getLeftArg()) && isSupported(((And) expr).getRightArg());
+        } else if(expr instanceof Or) {
+            return isSupported(((Or) expr).getLeftArg()) && isSupported(((Or) expr).getRightArg());
+        } else if(expr instanceof Not) {
+            return isSupported(((Not) expr).getArg());
+        } else if(expr instanceof ValueConstant) {
+            return true;
+        } else if(expr instanceof Var) {
+            return true;
+        } else if(expr instanceof Str) {
+            return isAtomic(((Str) expr).getArg());
+        } else if(expr instanceof Label) {
+            return isAtomic(((UnaryValueOperator) expr).getArg());
+        } else if(expr instanceof IsResource) {
+            return isAtomic(((UnaryValueOperator) expr).getArg());
+        } else if(expr instanceof IsURI) {
+            return isAtomic(((UnaryValueOperator) expr).getArg());
+        } else if(expr instanceof IsBNode) {
+            return isAtomic(((UnaryValueOperator) expr).getArg());
+        } else if(expr instanceof IsLiteral) {
+            return isAtomic(((UnaryValueOperator) expr).getArg());
+        } else if(expr instanceof Lang) {
+            return isAtomic(((Lang) expr).getArg());
+        } else if(expr instanceof LangMatches) {
+            return isSupported(((LangMatches) expr).getLeftArg()) && isConstant(((LangMatches) expr).getRightArg());
+        } else if(expr instanceof Regex) {
+            return isSupported(((Regex) expr).getArg()) && isAtomic(((Regex) expr).getPatternArg()) && ((Regex) expr).getFlagsArg() == null;
+        } else {
+            return false;
+        }
+    }
+
+
+    private static boolean isAtomic(ValueExpr expr) {
+        return expr instanceof Var || expr instanceof ValueConstant;
+    }
+
+    private static boolean isConstant(ValueExpr expr) {
+        return expr instanceof ValueConstant;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/kiwi/kiwi-sparql/src/main/java/org/apache/marmotta/kiwi/sparql/evaluation/KiWiTripleSource.java
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-sparql/src/main/java/org/apache/marmotta/kiwi/sparql/evaluation/KiWiTripleSource.java b/libraries/kiwi/kiwi-sparql/src/main/java/org/apache/marmotta/kiwi/sparql/evaluation/KiWiTripleSource.java
new file mode 100644
index 0000000..0a601c0
--- /dev/null
+++ b/libraries/kiwi/kiwi-sparql/src/main/java/org/apache/marmotta/kiwi/sparql/evaluation/KiWiTripleSource.java
@@ -0,0 +1,106 @@
+/*
+ * 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.kiwi.sparql.evaluation;
+
+import info.aduna.iteration.CloseableIteration;
+import info.aduna.iteration.ExceptionConvertingIteration;
+import org.apache.marmotta.kiwi.sparql.sail.KiWiSparqlSailConnection;
+import org.openrdf.model.*;
+import org.openrdf.query.QueryEvaluationException;
+import org.openrdf.query.QueryInterruptedException;
+import org.openrdf.query.algebra.evaluation.TripleSource;
+import org.openrdf.sail.SailException;
+
+import java.io.IOException;
+import java.nio.channels.ClosedByInterruptException;
+
+/**
+ * TripleSource implementation based on a KiWi triple store.
+ *
+ * @author Sebastian Schaffert (sschaffert@apache.org)
+ */
+public class KiWiTripleSource implements TripleSource {
+    private ValueFactory factory;
+    private boolean inferred;
+    private KiWiSparqlSailConnection connection;
+
+    public KiWiTripleSource(KiWiSparqlSailConnection connection, ValueFactory factory, boolean inferred) {
+        this.factory = factory;
+        this.inferred   = inferred;
+        this.connection = connection;
+    }
+
+    /**
+     * Gets all statements that have a specific subject, predicate and/or object.
+     * All three parameters may be null to indicate wildcards. Optionally a (set
+     * of) context(s) may be specified in which case the result will be
+     * restricted to statements matching one or more of the specified contexts.
+     *
+     * @param subj     A Resource specifying the subject, or <tt>null</tt> for a
+     *                 wildcard.
+     * @param pred     A URI specifying the predicate, or <tt>null</tt> for a wildcard.
+     * @param obj      A Value specifying the object, or <tt>null</tt> for a wildcard.
+     * @param contexts The context(s) to get the statements from. Note that this parameter
+     *                 is a vararg and as such is optional. If no contexts are supplied
+     *                 the method operates on the entire repository.
+     * @return An iterator over the relevant statements.
+     * @throws org.openrdf.query.QueryEvaluationException
+     *          If the triple source failed to get the statements.
+     */
+    @Override
+    public CloseableIteration<? extends Statement, QueryEvaluationException> getStatements(Resource subj, URI pred, Value obj, Resource... contexts) throws QueryEvaluationException {
+        try {
+            return new ExceptionConvertingIteration<Statement, QueryEvaluationException>(
+                    connection.getStatements(subj, pred, obj, inferred, contexts)
+            ) {
+                @Override
+                protected QueryEvaluationException convert(Exception e) {
+                    if (e instanceof ClosedByInterruptException) {
+                        return new QueryInterruptedException(e);
+                    }
+                    else if (e instanceof IOException) {
+                        return new QueryEvaluationException(e);
+                    }
+                    else if (e instanceof RuntimeException) {
+                        throw (RuntimeException)e;
+                    }
+                    else if (e == null) {
+                        throw new IllegalArgumentException("e must not be null");
+                    }
+                    else {
+                        throw new IllegalArgumentException("Unexpected exception type: " + e.getClass());
+                    }
+                }
+            };
+        } catch (SailException ex) {
+            throw new QueryEvaluationException(ex);
+        }
+    }
+
+    /**
+     * Gets a ValueFactory object that can be used to create URI-, blank node-
+     * and literal objects.
+     *
+     * @return a ValueFactory object for this TripleSource.
+     */
+    @Override
+    public ValueFactory getValueFactory() {
+        return factory;
+    }
+
+}


[031/100] [abbrv] [partial] Reverting the erroneous merge by Sebastian according to the instructions in INFRA-6876

Posted by wi...@apache.org.
http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/extras/webjars/sgvizler/src/main/resources/lib/d3.v2.min.js
----------------------------------------------------------------------
diff --git a/extras/webjars/sgvizler/src/main/resources/lib/d3.v2.min.js b/extras/webjars/sgvizler/src/main/resources/lib/d3.v2.min.js
new file mode 100644
index 0000000..521c420
--- /dev/null
+++ b/extras/webjars/sgvizler/src/main/resources/lib/d3.v2.min.js
@@ -0,0 +1,4 @@
+(function(){function e(a,b){try{for(var c in b)Object.defineProperty(a.prototype,c,{value:b[c],enumerable:!1})}catch(d){a.prototype=b}}function g(a){var b=-1,c=a.length,d=[];while(++b<c)d.push(a[b]);return d}function h(a){return Array.prototype.slice.call(a)}function k(){}function n(a){return a}function o(){return this}function p(){return!0}function q(a){return typeof a=="function"?a:function(){return a}}function r(a,b,c){return function(){var d=c.apply(b,arguments);return arguments.length?a:d}}function s(a){return a!=null&&!isNaN(a)}function t(a){return a.length}function v(a){return a==null}function w(a){return a.replace(/(^\s+)|(\s+$)/g,"").replace(/\s+/g," ")}function x(a){var b=1;while(a*b%1)b*=10;return b}function A(){}function B(a){function d(){var c=b,d=-1,e=c.length,f;while(++d<e)(f=c[d].on)&&f.apply(this,arguments);return a}var b=[],c=new k;return d.on=function(d,e){var f=c.get(d),g;return arguments.length<2?f&&f.on:(f&&(f.on=null,b=b.slice(0,g=b.indexOf(f)).concat(b.slice(
 g+1)),c.remove(d)),e&&b.push(c.set(d,{on:e})),a)},d}function E(a,b){return b-(a?1+Math.floor(Math.log(a+Math.pow(10,1+Math.floor(Math.log(a)/Math.LN10)-b))/Math.LN10):1)}function F(a){return a+""}function G(a){var b=a.lastIndexOf("."),c=b>=0?a.substring(b):(b=a.length,""),d=[];while(b>0)d.push(a.substring(b-=3,b+3));return d.reverse().join(",")+c}function I(a,b){return{scale:Math.pow(10,(8-b)*3),symbol:a}}function O(a){return function(b){return b<=0?0:b>=1?1:a(b)}}function P(a){return function(b){return 1-a(1-b)}}function Q(a){return function(b){return.5*(b<.5?a(2*b):2-a(2-2*b))}}function R(a){return a}function S(a){return function(b){return Math.pow(b,a)}}function T(a){return 1-Math.cos(a*Math.PI/2)}function U(a){return Math.pow(2,10*(a-1))}function V(a){return 1-Math.sqrt(1-a*a)}function W(a,b){var c;return arguments.length<2&&(b=.45),arguments.length<1?(a=1,c=b/4):c=b/(2*Math.PI)*Math.asin(1/a),function(d){return 1+a*Math.pow(2,10*-d)*Math.sin((d-c)*2*Math.PI/b)}}function X(a){re
 turn a||(a=1.70158),function(b){return b*b*((a+1)*b-a)}}function Y(a){return a<1/2.75?7.5625*a*a:a<2/2.75?7.5625*(a-=1.5/2.75)*a+.75:a<2.5/2.75?7.5625*(a-=2.25/2.75)*a+.9375:7.5625*(a-=2.625/2.75)*a+.984375}function Z(){d3.event.stopPropagation(),d3.event.preventDefault()}function $(){var a=d3.event,b;while(b=a.sourceEvent)a=b;return a}function _(a){var b=new A,c=0,d=arguments.length;while(++c<d)b[arguments[c]]=B(b);return b.of=function(c,d){return function(e){try{var f=e.sourceEvent=d3.event;e.target=a,d3.event=e,b[e.type].apply(c,d)}finally{d3.event=f}}},b}function bb(a){return a=="transform"?d3.interpolateTransform:d3.interpolate}function bc(a,b){return b=b-(a=+a)?1/(b-a):0,function(c){return(c-a)*b}}function bd(a,b){return b=b-(a=+a)?1/(b-a):0,function(c){return Math.max(0,Math.min(1,(c-a)*b))}}function be(a,b,c){return new bf(a,b,c)}function bf(a,b,c){this.r=a,this.g=b,this.b=c}function bg(a){return a<16?"0"+Math.max(0,a).toString(16):Math.min(255,a).toString(16)}function bh(a,
 b,c){var d=0,e=0,f=0,g,h,i;g=/([a-z]+)\((.*)\)/i.exec(a);if(g){h=g[2].split(",");switch(g[1]){case"hsl":return c(parseFloat(h[0]),parseFloat(h[1])/100,parseFloat(h[2])/100);case"rgb":return b(bj(h[0]),bj(h[1]),bj(h[2]))}}return(i=bk.get(a))?b(i.r,i.g,i.b):(a!=null&&a.charAt(0)==="#"&&(a.length===4?(d=a.charAt(1),d+=d,e=a.charAt(2),e+=e,f=a.charAt(3),f+=f):a.length===7&&(d=a.substring(1,3),e=a.substring(3,5),f=a.substring(5,7)),d=parseInt(d,16),e=parseInt(e,16),f=parseInt(f,16)),b(d,e,f))}function bi(a,b,c){var d=Math.min(a/=255,b/=255,c/=255),e=Math.max(a,b,c),f=e-d,g,h,i=(e+d)/2;return f?(h=i<.5?f/(e+d):f/(2-e-d),a==e?g=(b-c)/f+(b<c?6:0):b==e?g=(c-a)/f+2:g=(a-b)/f+4,g*=60):h=g=0,bl(g,h,i)}function bj(a){var b=parseFloat(a);return a.charAt(a.length-1)==="%"?Math.round(b*2.55):b}function bl(a,b,c){return new bm(a,b,c)}function bm(a,b,c){this.h=a,this.s=b,this.l=c}function bn(a,b,c){function f(a){return a>360?a-=360:a<0&&(a+=360),a<60?d+(e-d)*a/60:a<180?e:a<240?d+(e-d)*(240-a)/60:d}fu
 nction g(a){return Math.round(f(a)*255)}var d,e;return a%=360,a<0&&(a+=360),b=b<0?0:b>1?1:b,c=c<0?0:c>1?1:c,e=c<=.5?c*(1+b):c+b-c*b,d=2*c-e,be(g(a+120),g(a),g(a-120))}function bo(a){return j(a,bu),a}function bv(a){return function(){return bp(a,this)}}function bw(a){return function(){return bq(a,this)}}function by(a,b){function f(){if(b=this.classList)return b.add(a);var b=this.className,d=b.baseVal!=null,e=d?b.baseVal:b;c.lastIndex=0,c.test(e)||(e=w(e+" "+a),d?b.baseVal=e:this.className=e)}function g(){if(b=this.classList)return b.remove(a);var b=this.className,d=b.baseVal!=null,e=d?b.baseVal:b;e=w(e.replace(c," ")),d?b.baseVal=e:this.className=e}function h(){(b.apply(this,arguments)?f:g).call(this)}var c=new RegExp("(^|\\s+)"+d3.requote(a)+"(\\s+|$)","g");if(arguments.length<2){var d=this.node();if(e=d.classList)return e.contains(a);var e=d.className;return c.lastIndex=0,c.test(e.baseVal!=null?e.baseVal:e)}return this.each(typeof b=="function"?h:b?f:g)}function bz(a){return{__data_
 _:a}}function bA(a){return function(){return bt(this,a)}}function bB(a){return arguments.length||(a=d3.ascending),function(b,c){return a(b&&b.__data__,c&&c.__data__)}}function bD(a){return j(a,bE),a}function bF(a,b,c){j(a,bJ);var d=new k,e=d3.dispatch("start","end"),f=bR;return a.id=b,a.time=c,a.tween=function(b,c){return arguments.length<2?d.get(b):(c==null?d.remove(b):d.set(b,c),a)},a.ease=function(b){return arguments.length?(f=typeof b=="function"?b:d3.ease.apply(d3,arguments),a):f},a.each=function(b,c){return arguments.length<2?bS.call(a,b):(e.on(b,c),a)},d3.timer(function(g){return a.each(function(h,i,j){function p(a){return o.active>b?r():(o.active=b,d.forEach(function(a,b){(b=b.call(l,h,i))&&k.push(b)}),e.start.call(l,h,i),q(a)||d3.timer(q,0,c),1)}function q(a){if(o.active!==b)return r();var c=(a-m)/n,d=f(c),g=k.length;while(g>0)k[--g].call(l,d);if(c>=1)return r(),bL=b,e.end.call(l,h,i),bL=0,1}function r(){return--o.count||delete l.__transition__,1}var k=[],l=this,m=a[j][i].d
 elay,n=a[j][i].duration,o=l.__transition__||(l.__transition__={active:0,count:0});++o.count,m<=g?p(g):d3.timer(p,m,c)}),1},0,c),a}function bH(a,b,c){return c!=""&&bG}function bI(a,b){function d(a,d,e){var f=b.call(this,a,d);return f==null?e!=""&&bG:e!=f&&c(e,f)}function e(a,d,e){return e!=b&&c(e,b)}var c=bb(a);return typeof b=="function"?d:b==null?bH:(b+="",e)}function bS(a){var b=bL,c=bR,d=bP,e=bQ;bL=this.id,bR=this.ease();for(var f=0,g=this.length;f<g;f++)for(var h=this[f],i=0,j=h.length;i<j;i++){var k=h[i];k&&(bP=this[f][i].delay,bQ=this[f][i].duration,a.call(k=k.node,k.__data__,i,f))}return bL=b,bR=c,bP=d,bQ=e,this}function bW(){var a,b=Date.now(),c=bT;while(c)a=b-c.then,a>=c.delay&&(c.flush=c.callback(a)),c=c.next;var d=bX()-b;d>24?(isFinite(d)&&(clearTimeout(bV),bV=setTimeout(bW,d)),bU=0):(bU=1,bY(bW))}function bX(){var a=null,b=bT,c=Infinity;while(b)b.flush?b=a?a.next=b.next:bT=b.next:(c=Math.min(c,b.then+b.delay),b=(a=b).next);return c}function bZ(a){var b=[a.a,a.b],c=[a.c,a
 .d],d=b_(b),e=b$(b,c),f=b_(ca(c,b,-e))||0;b[0]*c[1]<c[0]*b[1]&&(b[0]*=-1,b[1]*=-1,d*=-1,e*=-1),this.rotate=(d?Math.atan2(b[1],b[0]):Math.atan2(-c[0],c[1]))*cb,this.translate=[a.e,a.f],this.scale=[d,f],this.skew=f?Math.atan2(e,f)*cb:0}function b$(a,b){return a[0]*b[0]+a[1]*b[1]}function b_(a){var b=Math.sqrt(b$(a,a));return b&&(a[0]/=b,a[1]/=b),b}function ca(a,b,c){return a[0]+=c*b[0],a[1]+=c*b[1],a}function cd(a,b){var c=a.ownerSVGElement||a;if(c.createSVGPoint){var d=c.createSVGPoint();if(cc<0&&(window.scrollX||window.scrollY)){c=d3.select(document.body).append("svg").style("position","absolute").style("top",0).style("left",0);var e=c[0][0].getScreenCTM();cc=!e.f&&!e.e,c.remove()}return cc?(d.x=b.pageX,d.y=b.pageY):(d.x=b.clientX,d.y=b.clientY),d=d.matrixTransform(a.getScreenCTM().inverse()),[d.x,d.y]}var f=a.getBoundingClientRect();return[b.clientX-f.left-a.clientLeft,b.clientY-f.top-a.clientTop]}function ce(){}function cf(a){var b=a[0],c=a[a.length-1];return b<c?[b,c]:[c,b]}funct
 ion cg(a){return a.rangeExtent?a.rangeExtent():cf(a.range())}function ch(a,b){var c=0,d=a.length-1,e=a[c],f=a[d],g;f<e&&(g=c,c=d,d=g,g=e,e=f,f=g);if(g=f-e)b=b(g),a[c]=b.floor(e),a[d]=b.ceil(f);return a}function ci(){return Math}function cj(a,b,c,d){function g(){var g=Math.min(a.length,b.length)>2?cq:cp,i=d?bd:bc;return e=g(a,b,i,c),f=g(b,a,i,d3.interpolate),h}function h(a){return e(a)}var e,f;return h.invert=function(a){return f(a)},h.domain=function(b){return arguments.length?(a=b.map(Number),g()):a},h.range=function(a){return arguments.length?(b=a,g()):b},h.rangeRound=function(a){return h.range(a).interpolate(d3.interpolateRound)},h.clamp=function(a){return arguments.length?(d=a,g()):d},h.interpolate=function(a){return arguments.length?(c=a,g()):c},h.ticks=function(b){return cn(a,b)},h.tickFormat=function(b){return co(a,b)},h.nice=function(){return ch(a,cl),g()},h.copy=function(){return cj(a,b,c,d)},g()}function ck(a,b){return d3.rebind(a,b,"range","rangeRound","interpolate","clam
 p")}function cl(a){return a=Math.pow(10,Math.round(Math.log(a)/Math.LN10)-1),{floor:function(b){return Math.floor(b/a)*a},ceil:function(b){return Math.ceil(b/a)*a}}}function cm(a,b){var c=cf(a),d=c[1]-c[0],e=Math.pow(10,Math.floor(Math.log(d/b)/Math.LN10)),f=b/d*e;return f<=.15?e*=10:f<=.35?e*=5:f<=.75&&(e*=2),c[0]=Math.ceil(c[0]/e)*e,c[1]=Math.floor(c[1]/e)*e+e*.5,c[2]=e,c}function cn(a,b){return d3.range.apply(d3,cm(a,b))}function co(a,b){return d3.format(",."+Math.max(0,-Math.floor(Math.log(cm(a,b)[2])/Math.LN10+.01))+"f")}function cp(a,b,c,d){var e=c(a[0],a[1]),f=d(b[0],b[1]);return function(a){return f(e(a))}}function cq(a,b,c,d){var e=[],f=[],g=0,h=Math.min(a.length,b.length)-1;a[h]<a[0]&&(a=a.slice().reverse(),b=b.slice().reverse());while(++g<=h)e.push(c(a[g-1],a[g])),f.push(d(b[g-1],b[g]));return function(b){var c=d3.bisect(a,b,1,h)-1;return f[c](e[c](b))}}function cr(a,b){function d(c){return a(b(c))}var c=b.pow;return d.invert=function(b){return c(a.invert(b))},d.domain=fu
 nction(e){return arguments.length?(b=e[0]<0?cu:ct,c=b.pow,a.domain(e.map(b)),d):a.domain().map(c)},d.nice=function(){return a.domain(ch(a.domain(),ci)),d},d.ticks=function(){var d=cf(a.domain()),e=[];if(d.every(isFinite)){var f=Math.floor(d[0]),g=Math.ceil(d[1]),h=c(d[0]),i=c(d[1]);if(b===cu){e.push(c(f));for(;f++<g;)for(var j=9;j>0;j--)e.push(c(f)*j)}else{for(;f<g;f++)for(var j=1;j<10;j++)e.push(c(f)*j);e.push(c(f))}for(f=0;e[f]<h;f++);for(g=e.length;e[g-1]>i;g--);e=e.slice(f,g)}return e},d.tickFormat=function(a,e){arguments.length<2&&(e=cs);if(arguments.length<1)return e;var f=a/d.ticks().length,g=b===cu?(h=-1e-12,Math.floor):(h=1e-12,Math.ceil),h;return function(a){return a/c(g(b(a)+h))<f?e(a):""}},d.copy=function(){return cr(a.copy(),b)},ck(d,a)}function ct(a){return Math.log(a<0?0:a)/Math.LN10}function cu(a){return-Math.log(a>0?0:-a)/Math.LN10}function cv(a,b){function e(b){return a(c(b))}var c=cw(b),d=cw(1/b);return e.invert=function(b){return d(a.invert(b))},e.domain=function
 (b){return arguments.length?(a.domain(b.map(c)),e):a.domain().map(d)},e.ticks=function(a){return cn(e.domain(),a)},e.tickFormat=function(a){return co(e.domain(),a)},e.nice=function(){return e.domain(ch(e.domain(),cl))},e.exponent=function(a){if(!arguments.length)return b;var f=e.domain();return c=cw(b=a),d=cw(1/b),e.domain(f)},e.copy=function(){return cv(a.copy(),b)},ck(e,a)}function cw(a){return function(b){return b<0?-Math.pow(-b,a):Math.pow(b,a)}}function cx(a,b){function f(b){return d[((c.get(b)||c.set(b,a.push(b)))-1)%d.length]}function g(b,c){return d3.range(a.length).map(function(a){return b+c*a})}var c,d,e;return f.domain=function(d){if(!arguments.length)return a;a=[],c=new k;var e=-1,g=d.length,h;while(++e<g)c.has(h=d[e])||c.set(h,a.push(h));return f[b.t](b.x,b.p)},f.range=function(a){return arguments.length?(d=a,e=0,b={t:"range",x:a},f):d},f.rangePoints=function(c,h){arguments.length<2&&(h=0);var i=c[0],j=c[1],k=(j-i)/(a.length-1+h);return d=g(a.length<2?(i+j)/2:i+k*h/2,k)
 ,e=0,b={t:"rangePoints",x:c,p:h},f},f.rangeBands=function(c,h){arguments.length<2&&(h=0);var i=c[1]<c[0],j=c[i-0],k=c[1-i],l=(k-j)/(a.length+h);return d=g(j+l*h,l),i&&d.reverse(),e=l*(1-h),b={t:"rangeBands",x:c,p:h},f},f.rangeRoundBands=function(c,h){arguments.length<2&&(h=0);var i=c[1]<c[0],j=c[i-0],k=c[1-i],l=Math.floor((k-j)/(a.length+h)),m=k-j-(a.length-h)*l;return d=g(j+Math.round(m/2),l),i&&d.reverse(),e=Math.round(l*(1-h)),b={t:"rangeRoundBands",x:c,p:h},f},f.rangeBand=function(){return e},f.rangeExtent=function(){return cf(b.x)},f.copy=function(){return cx(a,b)},f.domain(a)}function cC(a,b){function d(){var d=0,f=a.length,g=b.length;c=[];while(++d<g)c[d-1]=d3.quantile(a,d/g);return e}function e(a){return isNaN(a=+a)?NaN:b[d3.bisect(c,a)]}var c;return e.domain=function(b){return arguments.length?(a=b.filter(function(a){return!isNaN(a)}).sort(d3.ascending),d()):a},e.range=function(a){return arguments.length?(b=a,d()):b},e.quantiles=function(){return c},e.copy=function(){return
  cC(a,b)},d()}function cD(a,b,c){function f(b){return c[Math.max(0,Math.min(e,Math.floor(d*(b-a))))]}function g(){return d=c.length/(b-a),e=c.length-1,f}var d,e;return f.domain=function(c){return arguments.length?(a=+c[0],b=+c[c.length-1],g()):[a,b]},f.range=function(a){return arguments.length?(c=a,g()):c},f.copy=function(){return cD(a,b,c)},g()}function cE(a){function b(a){return+a}return b.invert=b,b.domain=b.range=function(c){return arguments.length?(a=c.map(b),b):a},b.ticks=function(b){return cn(a,b)},b.tickFormat=function(b){return co(a,b)},b.copy=function(){return cE(a)},b}function cH(a){return a.innerRadius}function cI(a){return a.outerRadius}function cJ(a){return a.startAngle}function cK(a){return a.endAngle}function cL(a){function h(e){function o(){h.push("M",f(a(i),g))}var h=[],i=[],j=-1,k=e.length,l,m=q(b),n=q(c);while(++j<k)d.call(this,l=e[j],j)?i.push([+m.call(this,l,j),+n.call(this,l,j)]):i.length&&(o(),i=[]);return i.length&&o(),h.length?h.join(""):null}var b=cM,c=cN,
 d=p,e=cO,f=cQ,g=.7;return h.x=function(a){return arguments.length?(b=a,h):b},h.y=function(a){return arguments.length?(c=a,h):c},h.defined=function(a){return arguments.length?(d=a,h):d},h.interpolate=function(a){return arguments.length?(cP.has(a+="")||(a=cO),f=cP.get(e=a),h):e},h.tension=function(a){return arguments.length?(g=a,h):g},h}function cM(a){return a[0]}function cN(a){return a[1]}function cQ(a){var b=0,c=a.length,d=a[0],e=[d[0],",",d[1]];while(++b<c)e.push("L",(d=a[b])[0],",",d[1]);return e.join("")}function cR(a){var b=0,c=a.length,d=a[0],e=[d[0],",",d[1]];while(++b<c)e.push("V",(d=a[b])[1],"H",d[0]);return e.join("")}function cS(a){var b=0,c=a.length,d=a[0],e=[d[0],",",d[1]];while(++b<c)e.push("H",(d=a[b])[0],"V",d[1]);return e.join("")}function cT(a,b){return a.length<4?cQ(a):a[1]+cW(a.slice(1,a.length-1),cX(a,b))}function cU(a,b){return a.length<3?cQ(a):a[0]+cW((a.push(a[0]),a),cX([a[a.length-2]].concat(a,[a[1]]),b))}function cV(a,b,c){return a.length<3?cQ(a):a[0]+cW(a,c
 X(a,b))}function cW(a,b){if(b.length<1||a.length!=b.length&&a.length!=b.length+2)return cQ(a);var c=a.length!=b.length,d="",e=a[0],f=a[1],g=b[0],h=g,i=1;c&&(d+="Q"+(f[0]-g[0]*2/3)+","+(f[1]-g[1]*2/3)+","+f[0]+","+f[1],e=a[1],i=2);if(b.length>1){h=b[1],f=a[i],i++,d+="C"+(e[0]+g[0])+","+(e[1]+g[1])+","+(f[0]-h[0])+","+(f[1]-h[1])+","+f[0]+","+f[1];for(var j=2;j<b.length;j++,i++)f=a[i],h=b[j],d+="S"+(f[0]-h[0])+","+(f[1]-h[1])+","+f[0]+","+f[1]}if(c){var k=a[i];d+="Q"+(f[0]+h[0]*2/3)+","+(f[1]+h[1]*2/3)+","+k[0]+","+k[1]}return d}function cX(a,b){var c=[],d=(1-b)/2,e,f=a[0],g=a[1],h=1,i=a.length;while(++h<i)e=f,f=g,g=a[h],c.push([d*(g[0]-e[0]),d*(g[1]-e[1])]);return c}function cY(a){if(a.length<3)return cQ(a);var b=1,c=a.length,d=a[0],e=d[0],f=d[1],g=[e,e,e,(d=a[1])[0]],h=[f,f,f,d[1]],i=[e,",",f];de(i,g,h);while(++b<c)d=a[b],g.shift(),g.push(d[0]),h.shift(),h.push(d[1]),de(i,g,h);b=-1;while(++b<2)g.shift(),g.push(d[0]),h.shift(),h.push(d[1]),de(i,g,h);return i.join("")}function cZ(a){i
 f(a.length<4)return cQ(a);var b=[],c=-1,d=a.length,e,f=[0],g=[0];while(++c<3)e=a[c],f.push(e[0]),g.push(e[1]);b.push(da(dd,f)+","+da(dd,g)),--c;while(++c<d)e=a[c],f.shift(),f.push(e[0]),g.shift(),g.push(e[1]),de(b,f,g);return b.join("")}function c$(a){var b,c=-1,d=a.length,e=d+4,f,g=[],h=[];while(++c<4)f=a[c%d],g.push(f[0]),h.push(f[1]);b=[da(dd,g),",",da(dd,h)],--c;while(++c<e)f=a[c%d],g.shift(),g.push(f[0]),h.shift(),h.push(f[1]),de(b,g,h);return b.join("")}function c_(a,b){var c=a.length-1,d=a[0][0],e=a[0][1],f=a[c][0]-d,g=a[c][1]-e,h=-1,i,j;while(++h<=c)i=a[h],j=h/c,i[0]=b*i[0]+(1-b)*(d+j*f),i[1]=b*i[1]+(1-b)*(e+j*g);return cY(a)}function da(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]+a[3]*b[3]}function de(a,b,c){a.push("C",da(db,b),",",da(db,c),",",da(dc,b),",",da(dc,c),",",da(dd,b),",",da(dd,c))}function df(a,b){return(b[1]-a[1])/(b[0]-a[0])}function dg(a){var b=0,c=a.length-1,d=[],e=a[0],f=a[1],g=d[0]=df(e,f);while(++b<c)d[b]=g+(g=df(e=f,f=a[b+1]));return d[b]=g,d}function dh(a
 ){var b=[],c,d,e,f,g=dg(a),h=-1,i=a.length-1;while(++h<i)c=df(a[h],a[h+1]),Math.abs(c)<1e-6?g[h]=g[h+1]=0:(d=g[h]/c,e=g[h+1]/c,f=d*d+e*e,f>9&&(f=c*3/Math.sqrt(f),g[h]=f*d,g[h+1]=f*e));h=-1;while(++h<=i)f=(a[Math.min(i,h+1)][0]-a[Math.max(0,h-1)][0])/(6*(1+g[h]*g[h])),b.push([f||0,g[h]*f||0]);return b}function di(a){return a.length<3?cQ(a):a[0]+cW(a,dh(a))}function dj(a){var b,c=-1,d=a.length,e,f;while(++c<d)b=a[c],e=b[0],f=b[1]+cF,b[0]=e*Math.cos(f),b[1]=e*Math.sin(f);return a}function dk(a){function l(g){function y(){l.push("M",h(a(n),k),j,i(a(m.reverse()),k),"Z")}var l=[],m=[],n=[],o=-1,p=g.length,r,s=q(b),t=q(d),u=b===c?function(){return w}:q(c),v=d===e?function(){return x}:q(e),w,x;while(++o<p)f.call(this,r=g[o],o)?(m.push([w=+s.call(this,r,o),x=+t.call(this,r,o)]),n.push([+u.call(this,r,o),+v.call(this,r,o)])):m.length&&(y(),m=[],n=[]);return m.length&&y(),l.length?l.join(""):null}var b=cM,c=cM,d=0,e=cN,f=p,g=cO,h=cQ,i=cQ,j="L",k=.7;return l.x=function(a){return arguments.lengt
 h?(b=c=a,l):c},l.x0=function(a){return arguments.length?(b=a,l):b},l.x1=function(a){return arguments.length?(c=a,l):c},l.y=function(a){return arguments.length?(d=e=a,l):e},l.y0=function(a){return arguments.length?(d=a,l):d},l.y1=function(a){return arguments.length?(e=a,l):e},l.defined=function(a){return arguments.length?(f=a,l):f},l.interpolate=function(a){return arguments.length?(cP.has(a+="")||(a=cO),h=cP.get(g=a),i=h.reverse||h,j=/-closed$/.test(a)?"M":"L",l):g},l.tension=function(a){return arguments.length?(k=a,l):k},l}function dl(a){return a.source}function dm(a){return a.target}function dn(a){return a.radius}function dp(a){return a.startAngle}function dq(a){return a.endAngle}function dr(a){return[a.x,a.y]}function ds(a){return function(){var b=a.apply(this,arguments),c=b[0],d=b[1]+cF;return[c*Math.cos(d),c*Math.sin(d)]}}function dt(){return 64}function du(){return"circle"}function dv(a){var b=Math.sqrt(a/Math.PI);return"M0,"+b+"A"+b+","+b+" 0 1,1 0,"+ -b+"A"+b+","+b+" 0 1,1 0,
 "+b+"Z"}function dz(a,b){a.attr("transform",function(a){return"translate("+b(a)+",0)"})}function dA(a,b){a.attr("transform",function(a){return"translate(0,"+b(a)+")"})}function dB(a,b,c){e=[];if(c&&b.length>1){var d=cf(a.domain()),e,f=-1,g=b.length,h=(b[1]-b[0])/++c,i,j;while(++f<g)for(i=c;--i>0;)(j=+b[f]-i*h)>=d[0]&&e.push(j);for(--f,i=0;++i<c&&(j=+b[f]+i*h)<d[1];)e.push(j)}return e}function dG(){dE||(dE=d3.select("body").append("div").style("visibility","hidden").style("top",0).style("height",0).style("width",0).style("overflow-y","scroll").append("div").style("height","2000px").node().parentNode);var a=d3.event,b;try{dE.scrollTop=1e3,dE.dispatchEvent(a),b=1e3-dE.scrollTop}catch(c){b=a.wheelDelta||-a.detail*5}return b}function dH(a){var b=a.source,c=a.target,d=dJ(b,c),e=[b];while(b!==d)b=b.parent,e.push(b);var f=e.length;while(c!==d)e.splice(f,0,c),c=c.parent;return e}function dI(a){var b=[],c=a.parent;while(c!=null)b.push(a),a=c,c=c.parent;return b.push(a),b}function dJ(a,b){if(a
 ===b)return a;var c=dI(a),d=dI(b),e=c.pop(),f=d.pop(),g=null;while(e===f)g=e,e=c.pop(),f=d.pop();return g}function dM(a){a.fixed|=2}function dN(a){a!==dL&&(a.fixed&=1)}function dO(){dL.fixed&=1,dK=dL=null}function dP(){dL.px=d3.event.x,dL.py=d3.event.y,dK.resume()}function dQ(a,b,c){var d=0,e=0;a.charge=0;if(!a.leaf){var f=a.nodes,g=f.length,h=-1,i;while(++h<g){i=f[h];if(i==null)continue;dQ(i,b,c),a.charge+=i.charge,d+=i.charge*i.cx,e+=i.charge*i.cy}}if(a.point){a.leaf||(a.point.x+=Math.random()-.5,a.point.y+=Math.random()-.5);var j=b*c[a.point.index];a.charge+=a.pointCharge=j,d+=j*a.point.x,e+=j*a.point.y}a.cx=d/a.charge,a.cy=e/a.charge}function dR(a){return 20}function dS(a){return 1}function dU(a){return a.x}function dV(a){return a.y}function dW(a,b,c){a.y0=b,a.y=c}function dZ(a){return d3.range(a.length)}function d$(a){var b=-1,c=a[0].length,d=[];while(++b<c)d[b]=0;return d}function d_(a){var b=1,c=0,d=a[0][1],e,f=a.length;for(;b<f;++b)(e=a[b][1])>d&&(c=b,d=e);return c}function 
 ea(a){return a.reduce(eb,0)}function eb(a,b){return a+b[1]}function ec(a,b){return ed(a,Math.ceil(Math.log(b.length)/Math.LN2+1))}function ed(a,b){var c=-1,d=+a[0],e=(a[1]-d)/b,f=[];while(++c<=b)f[c]=e*c+d;return f}function ee(a){return[d3.min(a),d3.max(a)]}function ef(a,b){return d3.rebind(a,b,"sort","children","value"),a.links=ej,a.nodes=function(b){return ek=!0,(a.nodes=a)(b)},a}function eg(a){return a.children}function eh(a){return a.value}function ei(a,b){return b.value-a.value}function ej(a){return d3.merge(a.map(function(a){return(a.children||[]).map(function(b){return{source:a,target:b}})}))}function el(a,b){return a.value-b.value}function em(a,b){var c=a._pack_next;a._pack_next=b,b._pack_prev=a,b._pack_next=c,c._pack_prev=b}function en(a,b){a._pack_next=b,b._pack_prev=a}function eo(a,b){var c=b.x-a.x,d=b.y-a.y,e=a.r+b.r;return e*e-c*c-d*d>.001}function ep(a){function l(a){b=Math.min(a.x-a.r,b),c=Math.max(a.x+a.r,c),d=Math.min(a.y-a.r,d),e=Math.max(a.y+a.r,e)}var b=Infinity,
 c=-Infinity,d=Infinity,e=-Infinity,f=a.length,g,h,i,j,k;a.forEach(eq),g=a[0],g.x=-g.r,g.y=0,l(g);if(f>1){h=a[1],h.x=h.r,h.y=0,l(h);if(f>2){i=a[2],eu(g,h,i),l(i),em(g,i),g._pack_prev=i,em(i,h),h=g._pack_next;for(var m=3;m<f;m++){eu(g,h,i=a[m]);var n=0,o=1,p=1;for(j=h._pack_next;j!==h;j=j._pack_next,o++)if(eo(j,i)){n=1;break}if(n==1)for(k=g._pack_prev;k!==j._pack_prev;k=k._pack_prev,p++)if(eo(k,i))break;n?(o<p||o==p&&h.r<g.r?en(g,h=j):en(g=k,h),m--):(em(g,i),h=i,l(i))}}}var q=(b+c)/2,r=(d+e)/2,s=0;for(var m=0;m<f;m++){var t=a[m];t.x-=q,t.y-=r,s=Math.max(s,t.r+Math.sqrt(t.x*t.x+t.y*t.y))}return a.forEach(er),s}function eq(a){a._pack_next=a._pack_prev=a}function er(a){delete a._pack_next,delete a._pack_prev}function es(a){var b=a.children;b&&b.length?(b.forEach(es),a.r=ep(b)):a.r=Math.sqrt(a.value)}function et(a,b,c,d){var e=a.children;a.x=b+=d*a.x,a.y=c+=d*a.y,a.r*=d;if(e){var f=-1,g=e.length;while(++f<g)et(e[f],b,c,d)}}function eu(a,b,c){var d=a.r+c.r,e=b.x-a.x,f=b.y-a.y;if(d&&(e||f))
 {var g=b.r+c.r,h=Math.sqrt(e*e+f*f),i=Math.max(-1,Math.min(1,(d*d+h*h-g*g)/(2*d*h))),j=Math.acos(i),k=i*(d/=h),l=Math.sin(j)*d;c.x=a.x+k*e+l*f,c.y=a.y+k*f-l*e}else c.x=a.x+d,c.y=a.y}function ev(a){return 1+d3.max(a,function(a){return a.y})}function ew(a){return a.reduce(function(a,b){return a+b.x},0)/a.length}function ex(a){var b=a.children;return b&&b.length?ex(b[0]):a}function ey(a){var b=a.children,c;return b&&(c=b.length)?ey(b[c-1]):a}function ez(a,b){return a.parent==b.parent?1:2}function eA(a){var b=a.children;return b&&b.length?b[0]:a._tree.thread}function eB(a){var b=a.children,c;return b&&(c=b.length)?b[c-1]:a._tree.thread}function eC(a,b){var c=a.children;if(c&&(e=c.length)){var d,e,f=-1;while(++f<e)b(d=eC(c[f],b),a)>0&&(a=d)}return a}function eD(a,b){return a.x-b.x}function eE(a,b){return b.x-a.x}function eF(a,b){return a.depth-b.depth}function eG(a,b){function c(a,d){var e=a.children;if(e&&(i=e.length)){var f,g=null,h=-1,i;while(++h<i)f=e[h],c(f,g),g=f}b(a,d)}c(a,null)}f
 unction eH(a){var b=0,c=0,d=a.children,e=d.length,f;while(--e>=0)f=d[e]._tree,f.prelim+=b,f.mod+=b,b+=f.shift+(c+=f.change)}function eI(a,b,c){a=a._tree,b=b._tree;var d=c/(b.number-a.number);a.change+=d,b.change-=d,b.shift+=c,b.prelim+=c,b.mod+=c}function eJ(a,b,c){return a._tree.ancestor.parent==b.parent?a._tree.ancestor:c}function eK(a){return{x:a.x,y:a.y,dx:a.dx,dy:a.dy}}function eL(a,b){var c=a.x+b[3],d=a.y+b[0],e=a.dx-b[1]-b[3],f=a.dy-b[0]-b[2];return e<0&&(c+=e/2,e=0),f<0&&(d+=f/2,f=0),{x:c,y:d,dx:e,dy:f}}function eM(a){return a.map(eN).join(",")}function eN(a){return/[",\n]/.test(a)?'"'+a.replace(/\"/g,'""')+'"':a}function eP(a,b){return function(c){return c&&a.hasOwnProperty(c.type)?a[c.type](c):b}}function eQ(a){return"m0,"+a+"a"+a+","+a+" 0 1,1 0,"+ -2*a+"a"+a+","+a+" 0 1,1 0,"+2*a+"z"}function eR(a,b){eS.hasOwnProperty(a.type)&&eS[a.type](a,b)}function eT(a,b){eR(a.geometry,b)}function eU(a,b){for(var c=a.features,d=0,e=c.length;d<e;d++)eR(c[d].geometry,b)}function eV(a,b
 ){for(var c=a.geometries,d=0,e=c.length;d<e;d++)eR(c[d],b)}function eW(a,b){for(var c=a.coordinates,d=0,e=c.length;d<e;d++)b.apply(null,c[d])}function eX(a,b){for(var c=a.coordinates,d=0,e=c.length;d<e;d++)for(var f=c[d],g=0,h=f.length;g<h;g++)b.apply(null,f[g])}function eY(a,b){for(var c=a.coordinates,d=0,e=c.length;d<e;d++)for(var f=c[d][0],g=0,h=f.length;g<h;g++)b.apply(null,f[g])}function eZ(a,b){b.apply(null,a.coordinates)}function e$(a,b){for(var c=a.coordinates[0],d=0,e=c.length;d<e;d++)b.apply(null,c[d])}function e_(a){return a.source}function fa(a){return a.target}function fb(a,b){function q(a){var b=Math.sin(o-(a*=o))/p,c=Math.sin(a)/p,f=b*g*d+c*m*j,i=b*g*e+c*m*k,l=b*h+c*n;return[Math.atan2(i,f)/eO,Math.atan2(l,Math.sqrt(f*f+i*i))/eO]}var c=a[0]*eO,d=Math.cos(c),e=Math.sin(c),f=a[1]*eO,g=Math.cos(f),h=Math.sin(f),i=b[0]*eO,j=Math.cos(i),k=Math.sin(i),l=b[1]*eO,m=Math.cos(l),n=Math.sin(l),o=q.d=Math.acos(Math.max(-1,Math.min(1,h*n+g*m*Math.cos(i-c)))),p=Math.sin(o);return q
 }function fe(a){var b=0,c=0;for(;;){if(a(b,c))return[b,c];b===0?(b=c+1,c=0):(b-=1,c+=1)}}function ff(a,b,c,d){var e,f,g,h,i,j,k;return e=d[a],f=e[0],g=e[1],e=d[b],h=e[0],i=e[1],e=d[c],j=e[0],k=e[1],(k-g)*(h-f)-(i-g)*(j-f)>0}function fg(a,b,c){return(c[0]-b[0])*(a[1]-b[1])<(c[1]-b[1])*(a[0]-b[0])}function fh(a,b,c,d){var e=a[0],f=b[0],g=c[0],h=d[0],i=a[1],j=b[1],k=c[1],l=d[1],m=e-g,n=f-e,o=h-g,p=i-k,q=j-i,r=l-k,s=(o*p-r*m)/(r*n-o*q);return[e+s*n,i+s*q]}function fj(a,b){var c={list:a.map(function(a,b){return{index:b,x:a[0],y:a[1]}}).sort(function(a,b){return a.y<b.y?-1:a.y>b.y?1:a.x<b.x?-1:a.x>b.x?1:0}),bottomSite:null},d={list:[],leftEnd:null,rightEnd:null,init:function(){d.leftEnd=d.createHalfEdge(null,"l"),d.rightEnd=d.createHalfEdge(null,"l"),d.leftEnd.r=d.rightEnd,d.rightEnd.l=d.leftEnd,d.list.unshift(d.leftEnd,d.rightEnd)},createHalfEdge:function(a,b){return{edge:a,side:b,vertex:null,l:null,r:null}},insert:function(a,b){b.l=a,b.r=a.r,a.r.l=b,a.r=b},leftBound:function(a){var b=d.
 leftEnd;do b=b.r;while(b!=d.rightEnd&&e.rightOf(b,a));return b=b.l,b},del:function(a){a.l.r=a.r,a.r.l=a.l,a.edge=null},right:function(a){return a.r},left:function(a){return a.l},leftRegion:function(a){return a.edge==null?c.bottomSite:a.edge.region[a.side]},rightRegion:function(a){return a.edge==null?c.bottomSite:a.edge.region[fi[a.side]]}},e={bisect:function(a,b){var c={region:{l:a,r:b},ep:{l:null,r:null}},d=b.x-a.x,e=b.y-a.y,f=d>0?d:-d,g=e>0?e:-e;return c.c=a.x*d+a.y*e+(d*d+e*e)*.5,f>g?(c.a=1,c.b=e/d,c.c/=d):(c.b=1,c.a=d/e,c.c/=e),c},intersect:function(a,b){var c=a.edge,d=b.edge;if(!c||!d||c.region.r==d.region.r)return null;var e=c.a*d.b-c.b*d.a;if(Math.abs(e)<1e-10)return null;var f=(c.c*d.b-d.c*c.b)/e,g=(d.c*c.a-c.c*d.a)/e,h=c.region.r,i=d.region.r,j,k;h.y<i.y||h.y==i.y&&h.x<i.x?(j=a,k=c):(j=b,k=d);var l=f>=k.region.r.x;return l&&j.side==="l"||!l&&j.side==="r"?null:{x:f,y:g}},rightOf:function(a,b){var c=a.edge,d=c.region.r,e=b.x>d.x;if(e&&a.side==="l")return 1;if(!e&&a.side==="r"
 )return 0;if(c.a===1){var f=b.y-d.y,g=b.x-d.x,h=0,i=0;!e&&c.b<0||e&&c.b>=0?i=h=f>=c.b*g:(i=b.x+b.y*c.b>c.c,c.b<0&&(i=!i),i||(h=1));if(!h){var j=d.x-c.region.l.x;i=c.b*(g*g-f*f)<j*f*(1+2*g/j+c.b*c.b),c.b<0&&(i=!i)}}else{var k=c.c-c.a*b.x,l=b.y-k,m=b.x-d.x,n=k-d.y;i=l*l>m*m+n*n}return a.side==="l"?i:!i},endPoint:function(a,c,d){a.ep[c]=d;if(!a.ep[fi[c]])return;b(a)},distance:function(a,b){var c=a.x-b.x,d=a.y-b.y;return Math.sqrt(c*c+d*d)}},f={list:[],insert:function(a,b,c){a.vertex=b,a.ystar=b.y+c;for(var d=0,e=f.list,g=e.length;d<g;d++){var h=e[d];if(a.ystar>h.ystar||a.ystar==h.ystar&&b.x>h.vertex.x)continue;break}e.splice(d,0,a)},del:function(a){for(var b=0,c=f.list,d=c.length;b<d&&c[b]!=a;++b);c.splice(b,1)},empty:function(){return f.list.length===0},nextEvent:function(a){for(var b=0,c=f.list,d=c.length;b<d;++b)if(c[b]==a)return c[b+1];return null},min:function(){var a=f.list[0];return{x:a.vertex.x,y:a.ystar}},extractMin:function(){return f.list.shift()}};d.init(),c.bottomSite=c.li
 st.shift();var g=c.list.shift(),h,i,j,k,l,m,n,o,p,q,r,s,t;for(;;){f.empty()||(h=f.min());if(g&&(f.empty()||g.y<h.y||g.y==h.y&&g.x<h.x))i=d.leftBound(g),j=d.right(i),n=d.rightRegion(i),s=e.bisect(n,g),m=d.createHalfEdge(s,"l"),d.insert(i,m),q=e.intersect(i,m),q&&(f.del(i),f.insert(i,q,e.distance(q,g))),i=m,m=d.createHalfEdge(s,"r"),d.insert(i,m),q=e.intersect(m,j),q&&f.insert(m,q,e.distance(q,g)),g=c.list.shift();else if(!f.empty())i=f.extractMin(),k=d.left(i),j=d.right(i),l=d.right(j),n=d.leftRegion(i),o=d.rightRegion(j),r=i.vertex,e.endPoint(i.edge,i.side,r),e.endPoint(j.edge,j.side,r),d.del(i),f.del(j),d.del(j),t="l",n.y>o.y&&(p=n,n=o,o=p,t="r"),s=e.bisect(n,o),m=d.createHalfEdge(s,t),d.insert(k,m),e.endPoint(s,fi[t],r),q=e.intersect(k,m),q&&(f.del(k),f.insert(k,q,e.distance(q,n))),q=e.intersect(m,l),q&&f.insert(m,q,e.distance(q,n));else break}for(i=d.right(d.leftEnd);i!=d.rightEnd;i=d.right(i))b(i.edge)}function fk(){return{leaf:!0,nodes:[],point:null}}function fl(a,b,c,d,e,f){if
 (!a(b,c,d,e,f)){var g=(c+e)*.5,h=(d+f)*.5,i=b.nodes;i[0]&&fl(a,i[0],c,d,g,h),i[1]&&fl(a,i[1],g,d,e,h),i[2]&&fl(a,i[2],c,h,g,f),i[3]&&fl(a,i[3],g,h,e,f)}}function fm(a){return{x:a[0],y:a[1]}}function fo(){this._=new Date(arguments.length>1?Date.UTC.apply(this,arguments):arguments[0])}function fq(a,b,c,d){var e,f,g=0,h=b.length,i=c.length;while(g<h){if(d>=i)return-1;e=b.charCodeAt(g++);if(e==37){f=fw[b.charAt(g++)];if(!f||(d=f(a,c,d))<0)return-1}else if(e!=c.charCodeAt(d++))return-1}return d}function fx(a,b,c){return fz.test(b.substring(c,c+=3))?c:-1}function fy(a,b,c){fA.lastIndex=0;var d=fA.exec(b.substring(c,c+10));return d?c+=d[0].length:-1}function fC(a,b,c){var d=fD.get(b.substring(c,c+=3).toLowerCase());return d==null?-1:(a.m=d,c)}function fE(a,b,c){fF.lastIndex=0;var d=fF.exec(b.substring(c,c+12));return d?(a.m=fG.get(d[0].toLowerCase()),c+=d[0].length):-1}function fI(a,b,c){return fq(a,fv.c.toString(),b,c)}function fJ(a,b,c){return fq(a,fv.x.toString(),b,c)}function fK(a,b,c)
 {return fq(a,fv.X.toString(),b,c)}function fL(a,b,c){fU.lastIndex=0;var d=fU.exec(b.substring(c,c+4));return d?(a.y=+d[0],c+=d[0].length):-1}function fM(a,b,c){fU.lastIndex=0;var d=fU.exec(b.substring(c,c+2));return d?(a.y=fN()+ +d[0],c+=d[0].length):-1}function fN(){return~~((new Date).getFullYear()/1e3)*1e3}function fO(a,b,c){fU.lastIndex=0;var d=fU.exec(b.substring(c,c+2));return d?(a.m=d[0]-1,c+=d[0].length):-1}function fP(a,b,c){fU.lastIndex=0;var d=fU.exec(b.substring(c,c+2));return d?(a.d=+d[0],c+=d[0].length):-1}function fQ(a,b,c){fU.lastIndex=0;var d=fU.exec(b.substring(c,c+2));return d?(a.H=+d[0],c+=d[0].length):-1}function fR(a,b,c){fU.lastIndex=0;var d=fU.exec(b.substring(c,c+2));return d?(a.M=+d[0],c+=d[0].length):-1}function fS(a,b,c){fU.lastIndex=0;var d=fU.exec(b.substring(c,c+2));return d?(a.S=+d[0],c+=d[0].length):-1}function fT(a,b,c){fU.lastIndex=0;var d=fU.exec(b.substring(c,c+3));return d?(a.L=+d[0],c+=d[0].length):-1}function fV(a,b,c){var d=fW.get(b.substring
 (c,c+=2).toLowerCase());return d==null?-1:(a.p=d,c)}function fX(a){var b=a.getTimezoneOffset(),c=b>0?"-":"+",d=~~(Math.abs(b)/60),e=Math.abs(b)%60;return c+fr(d)+fr(e)}function fZ(a){return a.toISOString()}function f$(a,b,c){function d(b){var c=a(b),d=f(c,1);return b-c<d-b?c:d}function e(c){return b(c=a(new fn(c-1)),1),c}function f(a,c){return b(a=new fn(+a),c),a}function g(a,d,f){var g=e(a),h=[];if(f>1)while(g<d)c(g)%f||h.push(new Date(+g)),b(g,1);else while(g<d)h.push(new Date(+g)),b(g,1);return h}function h(a,b,c){try{fn=fo;var d=new fo;return d._=a,g(d,b,c)}finally{fn=Date}}a.floor=a,a.round=d,a.ceil=e,a.offset=f,a.range=g;var i=a.utc=f_(a);return i.floor=i,i.round=f_(d),i.ceil=f_(e),i.offset=f_(f),i.range=h,a}function f_(a){return function(b,c){try{fn=fo;var d=new fo;return d._=b,a(d,c)._}finally{fn=Date}}}function ga(a,b,c){function d(b){return a(
+b)}return d.invert=function(b){return gc(a.invert(b))},d.domain=function(b){return arguments.length?(a.domain(b),d):a.domain().map(gc)},d.nice=function(a){var b=gb(d.domain());return d.domain([a.floor(b[0]),a.ceil(b[1])])},d.ticks=function(c,e){var f=gb(d.domain());if(typeof c!="function"){var g=f[1]-f[0],h=g/c,i=d3.bisect(gg,h);if(i==gg.length)return b.year(f,c);if(!i)return a.ticks(c).map(gc);Math.log(h/gg[i-1])<Math.log(gg[i]/h)&&--i,c=b[i],e=c[1],c=c[0].range}return c(f[0],new Date(+f[1]+1),e)},d.tickFormat=function(){return c},d.copy=function(){return ga(a.copy(),b,c)},d3.rebind(d,a,"range","rangeRound","interpolate","clamp")}function gb(a){var b=a[0],c=a[a.length-1];return b<c?[b,c]:[c,b]}function gc(a){return new Date(a)}function gd(a){return function(b){var c=a.length-1,d=a[c];while(!d[1](b))d=a[--c];return d[0](b)}}function ge(a){var b=new Date(a,0,1);return b.setFullYear(a),b}function gf(a){var b=a.getFullYear(),c=ge(b),d=ge(b+1);return b+(a-c)/(d-c)}function go(a){var b=n
 ew Date(Date.UTC(a,0,1));return b.setUTCFullYear(a),b}function gp(a){var b=a.getUTCFullYear(),c=go(b),d=go(b+1);return b+(a-c)/(d-c)}Date.now||(Date.now=function(){return+(new Date)});try{document.createElement("div").style.setProperty("opacity",0,"")}catch(a){var b=CSSStyleDeclaration.prototype,c=b.setProperty;b.setProperty=function(a,b,d){c.call(this,a,b+"",d)}}d3={version:"2.9.1"};var f=h;try{f(document.documentElement.childNodes)[0].nodeType}catch(i){f=g}var j=[].__proto__?function(a,b){a.__proto__=b}:function(a,b){for(var c in b)a[c]=b[c]};d3.map=function(a){var b=new k;for(var c in a)b.set(c,a[c]);return b},e(k,{has:function(a){return l+a in this},get:function(a){return this[l+a]},set:function(a,b){return this[l+a]=b},remove:function(a){return a=l+a,a in this&&delete this[a]},keys:function(){var a=[];return this.forEach(function(b){a.push(b)}),a},values:function(){var a=[];return this.forEach(function(b,c){a.push(c)}),a},entries:function(){var a=[];return this.forEach(function
 (b,c){a.push({key:b,value:c})}),a},forEach:function(a){for(var b in this)b.charCodeAt(0)===m&&a.call(this,b.substring(1),this[b])}});var l="\0",m=l.charCodeAt(0);d3.functor=q,d3.rebind=function(a,b){var c=1,d=arguments.length,e;while(++c<d)a[e=arguments[c]]=r(a,b,b[e]);return a},d3.ascending=function(a,b){return a<b?-1:a>b?1:a>=b?0:NaN},d3.descending=function(a,b){return b<a?-1:b>a?1:b>=a?0:NaN},d3.mean=function(a,b){var c=a.length,d,e=0,f=-1,g=0;if(arguments.length===1)while(++f<c)s(d=a[f])&&(e+=(d-e)/++g);else while(++f<c)s(d=b.call(a,a[f],f))&&(e+=(d-e)/++g);return g?e:undefined},d3.median=function(a,b){return arguments.length>1&&(a=a.map(b)),a=a.filter(s),a.length?d3.quantile(a.sort(d3.ascending),.5):undefined},d3.min=function(a,b){var c=-1,d=a.length,e,f;if(arguments.length===1){while(++c<d&&((e=a[c])==null||e!=e))e=undefined;while(++c<d)(f=a[c])!=null&&e>f&&(e=f)}else{while(++c<d&&((e=b.call(a,a[c],c))==null||e!=e))e=undefined;while(++c<d)(f=b.call(a,a[c],c))!=null&&e>f&&(e=f)
 }return e},d3.max=function(a,b){var c=-1,d=a.length,e,f;if(arguments.length===1){while(++c<d&&((e=a[c])==null||e!=e))e=undefined;while(++c<d)(f=a[c])!=null&&f>e&&(e=f)}else{while(++c<d&&((e=b.call(a,a[c],c))==null||e!=e))e=undefined;while(++c<d)(f=b.call(a,a[c],c))!=null&&f>e&&(e=f)}return e},d3.extent=function(a,b){var c=-1,d=a.length,e,f,g;if(arguments.length===1){while(++c<d&&((e=g=a[c])==null||e!=e))e=g=undefined;while(++c<d)(f=a[c])!=null&&(e>f&&(e=f),g<f&&(g=f))}else{while(++c<d&&((e=g=b.call(a,a[c],c))==null||e!=e))e=undefined;while(++c<d)(f=b.call(a,a[c],c))!=null&&(e>f&&(e=f),g<f&&(g=f))}return[e,g]},d3.random={normal:function(a,b){return arguments.length<2&&(b=1),arguments.length<1&&(a=0),function(){var c,d,e;do c=Math.random()*2-1,d=Math.random()*2-1,e=c*c+d*d;while(!e||e>1);return a+b*c*Math.sqrt(-2*Math.log(e)/e)}}},d3.sum=function(a,b){var c=0,d=a.length,e,f=-1;if(arguments.length===1)while(++f<d)isNaN(e=+a[f])||(c+=e);else while(++f<d)isNaN(e=+b.call(a,a[f],f))||(c+=e
 );return c},d3.quantile=function(a,b){var c=(a.length-1)*b+1,d=Math.floor(c),e=a[d-1],f=c-d;return f?e+f*(a[d]-e):e},d3.transpose=function(a){return d3.zip.apply(d3,a)},d3.zip=function(){if(!(e=arguments.length))return[];for(var a=-1,b=d3.min(arguments,t),c=new Array(b);++a<b;)for(var d=-1,e,f=c[a]=new Array(e);++d<e;)f[d]=arguments[d][a];return c},d3.bisector=function(a){return{left:function(b,c,d,e){arguments.length<3&&(d=0),arguments.length<4&&(e=b.length);while(d<e){var f=d+e>>1;a.call(b,b[f],f)<c?d=f+1:e=f}return d},right:function(b,c,d,e){arguments.length<3&&(d=0),arguments.length<4&&(e=b.length);while(d<e){var f=d+e>>1;c<a.call(b,b[f],f)?e=f:d=f+1}return d}}};var u=d3.bisector(function(a){return a});d3.bisectLeft=u.left,d3.bisect=d3.bisectRight=u.right,d3.first=function(a,b){var c=0,d=a.length,e=a[0],f;arguments.length===1&&(b=d3.ascending);while(++c<d)b.call(a,e,f=a[c])>0&&(e=f);return e},d3.last=function(a,b){var c=0,d=a.length,e=a[0],f;arguments.length===1&&(b=d3.ascending
 );while(++c<d)b.call(a,e,f=a[c])<=0&&(e=f);return e},d3.nest=function(){function f(c,g){if(g>=b.length)return e?e.call(a,c):d?c.sort(d):c;var h=-1,i=c.length,j=b[g++],l,m,n=new k,o,p={};while(++h<i)(o=n.get(l=j(m=c[h])))?o.push(m):n.set(l,[m]);return n.forEach(function(a){p[a]=f(n.get(a),g)}),p}function g(a,d){if(d>=b.length)return a;var e=[],f=c[d++],h;for(h in a)e.push({key:h,values:g(a[h],d)});return f&&e.sort(function(a,b){return f(a.key,b.key)}),e}var a={},b=[],c=[],d,e;return a.map=function(a){return f(a,0)},a.entries=function(a){return g(f(a,0),0)},a.key=function(c){return b.push(c),a},a.sortKeys=function(d){return c[b.length-1]=d,a},a.sortValues=function(b){return d=b,a},a.rollup=function(b){return e=b,a},a},d3.keys=function(a){var b=[];for(var c in a)b.push(c);return b},d3.values=function(a){var b=[];for(var c in a)b.push(a[c]);return b},d3.entries=function(a){var b=[];for(var c in a)b.push({key:c,value:a[c]});return b},d3.permute=function(a,b){var c=[],d=-1,e=b.length;whil
 e(++d<e)c[d]=a[b[d]];return c},d3.merge=function(a){return Array.prototype.concat.apply([],a)},d3.split=function(a,b){var c=[],d=[],e,f=-1,g=a.length;arguments.length<2&&(b=v);while(++f<g)b.call(d,e=a[f],f)?d=[]:(d.length||c.push(d),d.push(e));return c},d3.range=function(a,b,c){arguments.length<3&&(c=1,arguments.length<2&&(b=a,a=0));if((b-a)/c===Infinity)throw new Error("infinite range");var d=[],e=x(Math.abs(c)),f=-1,g;a*=e,b*=e,c*=e;if(c<0)while((g=a+c*++f)>b)d.push(g/e);else while((g=a+c*++f)<b)d.push(g/e);return d},d3.requote=function(a){return a.replace(y,"\\$&")};var y=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g;d3.round=function(a,b){return b?Math.round(a*(b=Math.pow(10,b)))/b:Math.round(a)},d3.xhr=function(a,b,c){var d=new XMLHttpRequest;arguments.length<3?(c=b,b=null):b&&d.overrideMimeType&&d.overrideMimeType(b),d.open("GET",a,!0),b&&d.setRequestHeader("Accept",b),d.onreadystatechange=function(){if(d.readyState===4){var a=d.status;c(a>=200&&a<300||a===304?d:null)}},d.send(null)},d3.t
 ext=function(a,b,c){function d(a){c(a&&a.responseText)}arguments.length<3&&(c=b,b=null),d3.xhr(a,b,d)},d3.json=function(a,b){d3.text(a,"application/json",function(a){b(a?JSON.parse(a):null)})},d3.html=function(a,b){d3.text(a,"text/html",function(a){if(a!=null){var c=document.createRange();c.selectNode(document.body),a=c.createContextualFragment(a)}b(a)})},d3.xml=function(a,b,c){function d(a){c(a&&a.responseXML)}arguments.length<3&&(c=b,b=null),d3.xhr(a,b,d)};var z={svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};d3.ns={prefix:z,qualify:function(a){var b=a.indexOf(":"),c=a;return b>=0&&(c=a.substring(0,b),a=a.substring(b+1)),z.hasOwnProperty(c)?{space:z[c],local:a}:a}},d3.dispatch=function(){var a=new A,b=-1,c=arguments.length;while(++b<c)a[arguments[b]]=B(a);return a},A.prototype.on=function(a,b){var c=a.indexOf("."),d="";return c>0&&(d=a.subst
 ring(c+1),a=a.substring(0,c)),arguments.length<2?this[a].on(d):this[a].on(d,b)},d3.format=function(a){var b=C.exec(a),c=b[1]||" ",d=b[3]||"",e=b[5],f=+b[6],g=b[7],h=b[8],i=b[9],j=1,k="",l=!1;h&&(h=+h.substring(1)),e&&(c="0",g&&(f-=Math.floor((f-1)/4)));switch(i){case"n":g=!0,i="g";break;case"%":j=100,k="%",i="f";break;case"p":j=100,k="%",i="r";break;case"d":l=!0,h=0;break;case"s":j=-1,i="r"}return i=="r"&&!h&&(i="g"),i=D.get(i)||F,function(a){if(l&&a%1)return"";var b=a<0&&(a=-a)?"−":d;if(j<0){var m=d3.formatPrefix(a,h);a*=m.scale,k=m.symbol}else a*=j;a=i(a,h);if(e){var n=a.length+b.length;n<f&&(a=(new Array(f-n+1)).join(c)+a),g&&(a=G(a)),a=b+a}else{g&&(a=G(a)),a=b+a;var n=a.length;n<f&&(a=(new Array(f-n+1)).join(c)+a)}return a+k}};var C=/(?:([^{])?([<>=^]))?([+\- ])?(#)?(0)?([0-9]+)?(,)?(\.[0-9]+)?([a-zA-Z%])?/,D=d3.map({g:function(a,b){return a.toPrecision(b)},e:function(a,b){return a.toExponential(b)},f:function(a,b){return a.toFixed(b)},r:function(a,b){return d3.round(a,b=E(a,b
 )).toFixed(Math.max(0,Math.min(20,b)))}}),H=["y","z","a","f","p","n","μ","m","","k","M","G","T","P","E","Z","Y"].map(I);d3.formatPrefix=function(a,b){var c=0;return a&&(a<0&&(a*=-1),b&&(a=d3.round(a,E(a,b))),c=1+Math.floor(1e-12+Math.log(a)/Math.LN10),c=Math.max(-24,Math.min(24,Math.floor((c<=0?c+1:c-1)/3)*3))),H[8+c/3]};var J=S(2),K=S(3),L=function(){return R},M=d3.map({linear:L,poly:S,quad:function(){return J},cubic:function(){return K},sin:function(){return T},exp:function(){return U},circle:function(){return V},elastic:W,back:X,bounce:function(){return Y}}),N=d3.map({"in":R,out:P,"in-out":Q,"out-in":function(a){return Q(P(a))}});d3.ease=function(a){var b=a.indexOf("-"),c=b>=0?a.substring(0,b):a,d=b>=0?a.substring(b+1):"in";return c=M.get(c)||L,d=N.get(d)||R,O(d(c.apply(null,Array.prototype.slice.call(arguments,1))))},d3.event=null,d3.interpolate=function(a,b){var c=d3.interpolators.length,d;while(--c>=0&&!(d=d3.interpolators[c](a,b)));return d},d3.interpolateNumber=function(a,b
 ){return b-=a,function(c){return a+b*c}},d3.interpolateRound=function(a,b){return b-=a,function(c){return Math.round(a+b*c)}},d3.interpolateString=function(a,b){var c,d,e,f=0,g=0,h=[],i=[],j,k;ba.lastIndex=0;for(d=0;c=ba.exec(b);++d)c.index&&h.push(b.substring(f,g=c.index)),i.push({i:h.length,x:c[0]}),h.push(null),f=ba.lastIndex;f<b.length&&h.push(b.substring(f));for(d=0,j=i.length;(c=ba.exec(a))&&d<j;++d){k=i[d];if(k.x==c[0]){if(k.i)if(h[k.i+1]==null){h[k.i-1]+=k.x,h.splice(k.i,1);for(e=d+1;e<j;++e)i[e].i--}else{h[k.i-1]+=k.x+h[k.i+1],h.splice(k.i,2);for(e=d+1;e<j;++e)i[e].i-=2}else if(h[k.i+1]==null)h[k.i]=k.x;else{h[k.i]=k.x+h[k.i+1],h.splice(k.i+1,1);for(e=d+1;e<j;++e)i[e].i--}i.splice(d,1),j--,d--}else k.x=d3.interpolateNumber(parseFloat(c[0]),parseFloat(k.x))}while(d<j)k=i.pop(),h[k.i+1]==null?h[k.i]=k.x:(h[k.i]=k.x+h[k.i+1],h.splice(k.i+1,1)),j--;return h.length===1?h[0]==null?i[0].x:function(){return b}:function(a){for(d=0;d<j;++d)h[(k=i[d]).i]=k.x(a);return h.join("")}},d3.
 interpolateTransform=function(a,b){var c=[],d=[],e,f=d3.transform(a),g=d3.transform(b),h=f.translate,i=g.translate,j=f.rotate,k=g.rotate,l=f.skew,m=g.skew,n=f.scale,o=g.scale;return h[0]!=i[0]||h[1]!=i[1]?(c.push("translate(",null,",",null,")"),d.push({i:1,x:d3.interpolateNumber(h[0],i[0])},{i:3,x:d3.interpolateNumber(h[1],i[1])})):i[0]||i[1]?c.push("translate("+i+")"):c.push(""),j!=k?d.push({i:c.push(c.pop()+"rotate(",null,")")-2,x:d3.interpolateNumber(j,k)}):k&&c.push(c.pop()+"rotate("+k+")"),l!=m?d.push({i:c.push(c.pop()+"skewX(",null,")")-2,x:d3.interpolateNumber(l,m)}):m&&c.push(c.pop()+"skewX("+m+")"),n[0]!=o[0]||n[1]!=o[1]?(e=c.push(c.pop()+"scale(",null,",",null,")"),d.push({i:e-4,x:d3.interpolateNumber(n[0],o[0])},{i:e-2,x:d3.interpolateNumber(n[1],o[1])})):(o[0]!=1||o[1]!=1)&&c.push(c.pop()+"scale("+o+")"),e=d.length,function(a){var b=-1,f;while(++b<e)c[(f=d[b]).i]=f.x(a);return c.join("")}},d3.interpolateRgb=function(a,b){a=d3.rgb(a),b=d3.rgb(b);var c=a.r,d=a.g,e=a.b,f=b.
 r-c,g=b.g-d,h=b.b-e;return function(a){return"#"+bg(Math.round(c+f*a))+bg(Math.round(d+g*a))+bg(Math.round(e+h*a))}},d3.interpolateHsl=function(a,b){a=d3.hsl(a),b=d3.hsl(b);var c=a.h,d=a.s,e=a.l,f=b.h-c,g=b.s-d,h=b.l-e;return function(a){return bn(c+f*a,d+g*a,e+h*a).toString()}},d3.interpolateArray=function(a,b){var c=[],d=[],e=a.length,f=b.length,g=Math.min(a.length,b.length),h;for(h=0;h<g;++h)c.push(d3.interpolate(a[h],b[h]));for(;h<e;++h)d[h]=a[h];for(;h<f;++h)d[h]=b[h];return function(a){for(h=0;h<g;++h)d[h]=c[h](a);return d}},d3.interpolateObject=function(a,b){var c={},d={},e;for(e in a)e in b?c[e]=bb(e)(a[e],b[e]):d[e]=a[e];for(e in b)e in a||(d[e]=b[e]);return function(a){for(e in c)d[e]=c[e](a);return d}};var ba=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g;d3.interpolators=[d3.interpolateObject,function(a,b){return b instanceof Array&&d3.interpolateArray(a,b)},function(a,b){return(typeof a=="string"||typeof b=="string")&&d3.interpolateString(a+"",b+"")},function(a,b){return
 (typeof b=="string"?bk.has(b)||/^(#|rgb\(|hsl\()/.test(b):b instanceof bf||b instanceof bm)&&d3.interpolateRgb(a,b)},function(a,b){return!isNaN(a=+a)&&!isNaN(b=+b)&&d3.interpolateNumber(a,b)}],d3.rgb=function(a,b,c){return arguments.length===1?a instanceof bf?be(a.r,a.g,a.b):bh(""+a,be,bn):be(~~a,~~b,~~c)},bf.prototype.brighter=function(a){a=Math.pow(.7,arguments.length?a:1);var b=this.r,c=this.g,d=this.b,e=30;return!b&&!c&&!d?be(e,e,e):(b&&b<e&&(b=e),c&&c<e&&(c=e),d&&d<e&&(d=e),be(Math.min(255,Math.floor(b/a)),Math.min(255,Math.floor(c/a)),Math.min(255,Math.floor(d/a))))},bf.prototype.darker=function(a){return a=Math.pow(.7,arguments.length?a:1),be(Math.floor(a*this.r),Math.floor(a*this.g),Math.floor(a*this.b))},bf.prototype.hsl=function(){return bi(this.r,this.g,this.b)},bf.prototype.toString=function(){return"#"+bg(this.r)+bg(this.g)+bg(this.b)};var bk=d3.map({aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#f
 fe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"
 #808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#8
 08000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"});bk.forEach(function(a,b){bk.set(a,bh(b,be,bn))}),d3.hsl=function(a,b,c){return arguments.length===1?a instanceof bm?bl(a.h,a.s,a.l):bh(""+a,bi,bl):bl(+a,+b,+c)},bm.prototype.brighter=f
 unction(a){return a=Math.pow(.7,arguments.length?a:1),bl(this.h,this.s,this.l/a)},bm.prototype.darker=function(a){return a=Math.pow(.7,arguments.length?a:1),bl(this.h,this.s,a*this.l)},bm.prototype.rgb=function(){return bn(this.h,this.s,this.l)},bm.prototype.toString=function(){return this.rgb().toString()};var bp=function(a,b){return b.querySelector(a)},bq=function(a,b){return b.querySelectorAll(a)},br=document.documentElement,bs=br.matchesSelector||br.webkitMatchesSelector||br.mozMatchesSelector||br.msMatchesSelector||br.oMatchesSelector,bt=function(a,b){return bs.call(a,b)};typeof Sizzle=="function"&&(bp=function(a,b){return Sizzle(a,b)[0]},bq=function(a,b){return Sizzle.uniqueSort(Sizzle(a,b))},bt=Sizzle.matchesSelector);var bu=[];d3.selection=function(){return bC},d3.selection.prototype=bu,bu.select=function(a){var b=[],c,d,e,f;typeof a!="function"&&(a=bv(a));for(var g=-1,h=this.length;++g<h;){b.push(c=[]),c.parentNode=(e=this[g]).parentNode;for(var i=-1,j=e.length;++i<j;)(f=e[
 i])?(c.push(d=a.call(f,f.__data__,i)),d&&"__data__"in f&&(d.__data__=f.__data__)):c.push(null)}return bo(b)},bu.selectAll=function(a){var b=[],c,d;typeof a!="function"&&(a=bw(a));for(var e=-1,g=this.length;++e<g;)for(var h=this[e],i=-1,j=h.length;++i<j;)if(d=h[i])b.push(c=f(a.call(d,d.__data__,i))),c.parentNode=d;return bo(b)},bu.attr=function(a,b){function d(){this.removeAttribute(a)}function e(){this.removeAttributeNS(a.space,a.local)}function f(){this.setAttribute(a,b)}function g(){this.setAttributeNS(a.space,a.local,b)}function h(){var c=b.apply(this,arguments);c==null?this.removeAttribute(a):this.setAttribute(a,c)}function i(){var c=b.apply(this,arguments);c==null?this.removeAttributeNS(a.space,a.local):this.setAttributeNS(a.space,a.local,c)}a=d3.ns.qualify(a);if(arguments.length<2){var c=this.node();return a.local?c.getAttributeNS(a.space,a.local):c.getAttribute(a)}return this.each(b==null?a.local?e:d:typeof b=="function"?a.local?i:h:a.local?g:f)},bu.classed=function(a,b){var 
 c=a.split(bx),d=c.length,e=-1;if(arguments.length>1){while(++e<d)by.call(this,c[e],b);return this}while(++e<d)if(!by.call(this,c[e]))return!1;return!0};var bx=/\s+/g;bu.style=function(a,b,c){function d(){this.style.removeProperty(a)}function e(){this.style.setProperty(a,b,c)}function f(){var d=b.apply(this,arguments);d==null?this.style.removeProperty(a):this.style.setProperty(a,d,c)}return arguments.length<3&&(c=""),arguments.length<2?window.getComputedStyle(this.node(),null).getPropertyValue(a):this.each(b==null?d:typeof b=="function"?f:e)},bu.property=function(a,b){function c(){delete this[a]}function d(){this[a]=b}function e(){var c=b.apply(this,arguments);c==null?delete this[a]:this[a]=c}return arguments.length<2?this.node()[a]:this.each(b==null?c:typeof b=="function"?e:d)},bu.text=function(a){return arguments.length<1?this.node().textContent:this.each(typeof a=="function"?function(){var b=a.apply(this,arguments);this.textContent=b==null?"":b}:a==null?function(){this.textContent
 =""}:function(){this.textContent=a})},bu.html=function(a){return arguments.length<1?this.node().innerHTML:this.each(typeof a=="function"?function(){var b=a.apply(this,arguments);this.innerHTML=b==null?"":b}:a==null?function(){this.innerHTML=""}:function(){this.innerHTML=a})},bu.append=function(a){function b(){return this.appendChild(document.createElementNS(this.namespaceURI,a))}function c(){return this.appendChild(document.createElementNS(a.space,a.local))}return a=d3.ns.qualify(a),this.select(a.local?c:b)},bu.insert=function(a,b){function c(){return this.insertBefore(document.createElementNS(this.namespaceURI,a),bp(b,this))}function d(){return this.insertBefore(document.createElementNS(a.space,a.local),bp(b,this))}return a=d3.ns.qualify(a),this.select(a.local?d:c)},bu.remove=function(){return this.each(function(){var a=this.parentNode;a&&a.removeChild(this)})},bu.data=function(a,b){function g(a,c){var d,e=a.length,f=c.length,g=Math.min(e,f),l=Math.max(e,f),m=[],n=[],o=[],p,q;if(b)
 {var r=new k,s=[],t,u=c.length;for(d=-1;++d<e;)t=b.call(p=a[d],p.__data__,d),r.has(t)?o[u++]=p:r.set(t,p),s.push(t);for(d=-1;++d<f;)t=b.call(c,q=c[d],d),r.has(t)?(m[d]=p=r.get(t),p.__data__=q,n[d]=o[d]=null):(n[d]=bz(q),m[d]=o[d]=null),r.remove(t);for(d=-1;++d<e;)r.has(s[d])&&(o[d]=a[d])}else{for(d=-1;++d<g;)p=a[d],q=c[d],p?(p.__data__=q,m[d]=p,n[d]=o[d]=null):(n[d]=bz(q),m[d]=o[d]=null);for(;d<f;++d)n[d]=bz(c[d]),m[d]=o[d]=null;for(;d<l;++d)o[d]=a[d],n[d]=m[d]=null}n.update=m,n.parentNode=m.parentNode=o.parentNode=a.parentNode,h.push(n),i.push(m),j.push(o)}var c=-1,d=this.length,e,f;if(!arguments.length){a=new Array(d=(e=this[0]).length);while(++c<d)if(f=e[c])a[c]=f.__data__;return a}var h=bD([]),i=bo([]),j=bo([]);if(typeof a=="function")while(++c<d)g(e=this[c],a.call(e,e.parentNode.__data__,c));else while(++c<d)g(e=this[c],a);return i.enter=function(){return h},i.exit=function(){return j},i},bu.datum=bu.map=function(a){return arguments.length<1?this.property("__data__"):this.prope
 rty("__data__",a)},bu.filter=function(a){var b=[],c,d,e;typeof a!="function"&&(a=bA(a));for(var f=0,g=this.length;f<g;f++){b.push(c=[]),c.parentNode=(d=this[f]).parentNode;for(var h=0,i=d.length;h<i;h++)(e=d[h])&&a.call(e,e.__data__,h)&&c.push(e)}return bo(b)},bu.order=function(){for(var a=-1,b=this.length;++a<b;)for(var c=this[a],d=c.length-1,e=c[d],f;--d>=0;)if(f=c[d])e&&e!==f.nextSibling&&e.parentNode.insertBefore(f,e),e=f;return this},bu.sort=function(a){a=bB.apply(this,arguments);for(var b=-1,c=this.length;++b<c;)this[b].sort(a);return this.order()},bu.on=function(a,b,c){arguments.length<3&&(c=!1);var d="__on"+a,e=a.indexOf(".");return e>0&&(a=a.substring(0,e)),arguments.length<2?(e=this.node()[d])&&e._:this.each(function(e,f){function i(a){var c=d3.event;d3.event=a;try{b.call(g,g.__data__,f)}finally{d3.event=c}}var g=this,h=g[d];h&&(g.removeEventListener(a,h,h.$),delete g[d]),b&&(g.addEventListener(a,g[d]=i,i.$=c),i._=b)})},bu.each=function(a){for(var b=-1,c=this.length;++b<c;
 )for(var d=this[b],e=-1,f=d.length;++e<f;){var g=d[e];g&&a.call(g,g.__data__,e,b)}return this},bu.call=function(a){return a.apply(this,(arguments[0]=this,arguments)),this},bu.empty=function(){return!this.node()},bu.node=function(a){for(var b=0,c=this.length;b<c;b++)for(var d=this[b],e=0,f=d.length;e<f;e++){var g=d[e];if(g)return g}return null},bu.transition=function(){var a=[],b,c;for(var d=-1,e=this.length;++d<e;){a.push(b=[]);for(var f=this[d],g=-1,h=f.length;++g<h;)b.push((c=f[g])?{node:c,delay:bP,duration:bQ}:null)}return bF(a,bL||++bK,Date.now())};var bC=bo([[document]]);bC[0].parentNode=br,d3.select=function(a){return typeof a=="string"?bC.select(a):bo([[a]])},d3.selectAll=function(a){return typeof a=="string"?bC.selectAll(a):bo([f(a)])};var bE=[];d3.selection.enter=bD,d3.selection.enter.prototype=bE,bE.append=bu.append,bE.insert=bu.insert,bE.empty=bu.empty,bE.node=bu.node,bE.select=function(a){var b=[],c,d,e,f,g;for(var h=-1,i=this.length;++h<i;){e=(f=this[h]).update,b.push(c
 =[]),c.parentNode=f.parentNode;for(var j=-1,k=f.length;++j<k;)(g=f[j])?(c.push(e[j]=d=a.call(f.parentNode,g.__data__,j)),d.__data__=g.__data__):c.push(null)}return bo(b)};var bG={},bJ=[],bK=0,bL=0,bM=0,bN=250,bO=d3.ease("cubic-in-out"),bP=bM,bQ=bN,bR=bO;bJ.call=bu.call,d3.transition=function(a){return arguments.length?bL?a.transition():a:bC.transition()},d3.transition.prototype=bJ,bJ.select=function(a){var b=[],c,d,e;typeof a!="function"&&(a=bv(a));for(var f=-1,g=this.length;++f<g;){b.push(c=[]);for(var h=this[f],i=-1,j=h.length;++i<j;)(e=h[i])&&(d=a.call(e.node,e.node.__data__,i))?("__data__"in e.node&&(d.__data__=e.node.__data__),c.push({node:d,delay:e.delay,duration:e.duration})):c.push(null)}return bF(b,this.id,this.time).ease(this.ease())},bJ.selectAll=function(a){var b=[],c,d,e;typeof a!="function"&&(a=bw(a));for(var f=-1,g=this.length;++f<g;)for(var h=this[f],i=-1,j=h.length;++i<j;)if(e=h[i]){d=a.call(e.node,e.node.__data__,i),b.push(c=[]);for(var k=-1,l=d.length;++k<l;)c.pus
 h({node:d[k],delay:e.delay,duration:e.duration})}return bF(b,this.id,this.time).ease(this.ease())},bJ.attr=function(a,b){return this.attrTween(a,bI(a,b))},bJ.attrTween=function(a,b){function d(a,d){var e=b.call(this,a,d,this.getAttribute(c));return e===bG?(this.removeAttribute(c),null):e&&function(a){this.setAttribute(c,e(a))}}function e(a,d){var e=b.call(this,a,d,this.getAttributeNS(c.space,c.local));return e===bG?(this.removeAttributeNS(c.space,c.local),null):e&&function(a){this.setAttributeNS(c.space,c.local,e(a))}}var c=d3.ns.qualify(a);return this.tween("attr."+a,c.local?e:d)},bJ.style=function(a,b,c){return arguments.length<3&&(c=""),this.styleTween(a,bI(a,b),c)},bJ.styleTween=function(a,b,c){return arguments.length<3&&(c=""),this.tween("style."+a,function(d,e){var f=b.call(this,d,e,window.getComputedStyle(this,null).getPropertyValue(a));return f===bG?(this.style.removeProperty(a),null):f&&function(b){this.style.setProperty(a,f(b),c)}})},bJ.text=function(a){return this.tween("
 text",function(b,c){this.textContent=typeof a=="function"?a.call(this,b,c):a})},bJ.remove=function(){return this.each("end.transition",function(){var a;!this.__transition__&&(a=this.parentNode)&&a.removeChild(this)})},bJ.delay=function(a){var b=this;return b.each(typeof a=="function"?function(c,d,e){b[e][d].delay=a.apply(this,arguments)|0}:(a|=0,function(c,d,e){b[e][d].delay=a}))},bJ.duration=function(a){var b=this;return b.each(typeof a=="function"?function(c,d,e){b[e][d].duration=Math.max(1,a.apply(this,arguments)|0)}:(a=Math.max(1,a|0),function(c,d,e){b[e][d].duration=a}))},bJ.transition=function(){return this.select(o)};var bT=null,bU,bV;d3.timer=function(a,b,c){var d=!1,e,f=bT;if(arguments.length<3){if(arguments.length<2)b=0;else if(!isFinite(b))return;c=Date.now()}while(f){if(f.callback===a){f.then=c,f.delay=b,d=!0;break}e=f,f=f.next}d||(bT={callback:a,then:c,delay:b,next:bT}),bU||(bV=clearTimeout(bV),bU=1,bY(bW))},d3.timer.flush=function(){var a,b=Date.now(),c=bT;while(c)a=b-
 c.then,c.delay||(c.flush=c.callback(a)),c=c.next;bX()};var bY=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(a){setTimeout(a,17)};d3.transform=function(a){var b=document.createElementNS(d3.ns.prefix.svg,"g"),c={a:1,b:0,c:0,d:1,e:0,f:0};return(d3.transform=function(a){b.setAttribute("transform",a);var d=b.transform.baseVal.consolidate();return new bZ(d?d.matrix:c)})(a)},bZ.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var cb=180/Math.PI;d3.mouse=function(a){return cd(a,$())};var cc=/WebKit/.test(navigator.userAgent)?-1:0;d3.touches=function(a,b){return arguments.length<2&&(b=$().touches),b?f(b).map(function(b){var c=cd(a,b);return c.identifier=b.identifier,c}):[]},d3.scale={},d3.scale.linear=function(){return cj([0,1],[0,1],d3.interpolate,!1)},d3.scale.log=function(){return cr
 (d3.scale.linear(),ct)};var cs=d3.format(".0e");ct.pow=function(a){return Math.pow(10,a)},cu.pow=function(a){return-Math.pow(10,-a)},d3.scale.pow=function(){return cv(d3.scale.linear(),1)},d3.scale.sqrt=function(){return d3.scale.pow().exponent(.5)},d3.scale.ordinal=function(){return cx([],{t:"range",x:[]})},d3.scale.category10=function(){return d3.scale.ordinal().range(cy)},d3.scale.category20=function(){return d3.scale.ordinal().range(cz)},d3.scale.category20b=function(){return d3.scale.ordinal().range(cA)},d3.scale.category20c=function(){return d3.scale.ordinal().range(cB)};var cy=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],cz=["#1f77b4","#aec7e8","#ff7f0e","#ffbb78","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5","#8c564b","#c49c94","#e377c2","#f7b6d2","#7f7f7f","#c7c7c7","#bcbd22","#dbdb8d","#17becf","#9edae5"],cA=["#393b79","#5254a3","#6b6ecf","#9c9ede","#637939","#8ca252","#b5cf6b","#cedb9c","#8c6d31","#bd9
 e39","#e7ba52","#e7cb94","#843c39","#ad494a","#d6616b","#e7969c","#7b4173","#a55194","#ce6dbd","#de9ed6"],cB=["#3182bd","#6baed6","#9ecae1","#c6dbef","#e6550d","#fd8d3c","#fdae6b","#fdd0a2","#31a354","#74c476","#a1d99b","#c7e9c0","#756bb1","#9e9ac8","#bcbddc","#dadaeb","#636363","#969696","#bdbdbd","#d9d9d9"];d3.scale.quantile=function(){return cC([],[])},d3.scale.quantize=function(){return cD(0,1,[0,1])},d3.scale.identity=function(){return cE([0,1])},d3.svg={},d3.svg.arc=function(){function e(){var e=a.apply(this,arguments),f=b.apply(this,arguments),g=c.apply(this,arguments)+cF,h=d.apply(this,arguments)+cF,i=(h<g&&(i=g,g=h,h=i),h-g),j=i<Math.PI?"0":"1",k=Math.cos(g),l=Math.sin(g),m=Math.cos(h),n=Math.sin(h);return i>=cG?e?"M0,"+f+"A"+f+","+f+" 0 1,1 0,"+ -f+"A"+f+","+f+" 0 1,1 0,"+f+"M0,"+e+"A"+e+","+e+" 0 1,0 0,"+ -e+"A"+e+","+e+" 0 1,0 0,"+e+"Z":"M0,"+f+"A"+f+","+f+" 0 1,1 0,"+ -f+"A"+f+","+f+" 0 1,1 0,"+f+"Z":e?"M"+f*k+","+f*l+"A"+f+","+f+" 0 "+j+",1 "+f*m+","+f*n+"L"+e*m+","+e*
 n+"A"+e+","+e+" 0 "+j+",0 "+e*k+","+e*l+"Z":"M"+f*k+","+f*l+"A"+f+","+f+" 0 "+j+",1 "+f*m+","+f*n+"L0,0"+"Z"}var a=cH,b=cI,c=cJ,d=cK;return e.innerRadius=function(b){return arguments.length?(a=q(b),e):a},e.outerRadius=function(a){return arguments.length?(b=q(a),e):b},e.startAngle=function(a){return arguments.length?(c=q(a),e):c},e.endAngle=function(a){return arguments.length?(d=q(a),e):d},e.centroid=function(){var e=(a.apply(this,arguments)+b.apply(this,arguments))/2,f=(c.apply(this,arguments)+d.apply(this,arguments))/2+cF;return[Math.cos(f)*e,Math.sin(f)*e]},e};var cF=-Math.PI/2,cG=2*Math.PI-1e-6;d3.svg.line=function(){return cL(n)};var cO="linear",cP=d3.map({linear:cQ,"step-before":cR,"step-after":cS,basis:cY,"basis-open":cZ,"basis-closed":c$,bundle:c_,cardinal:cV,"cardinal-open":cT,"cardinal-closed":cU,monotone:di}),db=[0,2/3,1/3,0],dc=[0,1/3,2/3,0],dd=[0,1/6,2/3,1/6];d3.svg.line.radial=function(){var a=cL(dj);return a.radius=a.x,delete a.x,a.angle=a.y,delete a.y,a},cR.reverse=cS
 ,cS.reverse=cR,d3.svg.area=function(){return dk(Object)},d3.svg.area.radial=function(){var a=dk(dj);return a.radius=a.x,delete a.x,a.innerRadius=a.x0,delete a.x0,a.outerRadius=a.x1,delete a.x1,a.angle=a.y,delete a.y,a.startAngle=a.y0,delete a.y0,a.endAngle=a.y1,delete a.y1,a},d3.svg.chord=function(){function f(c,d){var e=g(this,a,c,d),f=g(this,b,c,d);return"M"+e.p0+i(e.r,e.p1,e.a1-e.a0)+(h(e,f)?j(e.r,e.p1,e.r,e.p0):j(e.r,e.p1,f.r,f.p0)+i(f.r,f.p1,f.a1-f.a0)+j(f.r,f.p1,e.r,e.p0))+"Z"}function g(a,b,f,g){var h=b.call(a,f,g),i=c.call(a,h,g),j=d.call(a,h,g)+cF,k=e.call(a,h,g)+cF;return{r:i,a0:j,a1:k,p0:[i*Math.cos(j),i*Math.sin(j)],p1:[i*Math.cos(k),i*Math.sin(k)]}}function h(a,b){return a.a0==b.a0&&a.a1==b.a1}function i(a,b,c){return"A"+a+","+a+" 0 "+ +(c>Math.PI)+",1 "+b}function j(a,b,c,d){return"Q 0,0 "+d}var a=dl,b=dm,c=dn,d=cJ,e=cK;return f.radius=function(a){return arguments.length?(c=q(a),f):c},f.source=function(b){return arguments.length?(a=q(b),f):a},f.target=function(a){retur
 n arguments.length?(b=q(a),f):b},f.startAngle=function(a){return arguments.length?(d=q(a),f):d},f.endAngle=function(a){return arguments.length?(e=q(a),f):e},f},d3.svg.diagonal=function(){function d(d,e){var f=a.call(this,d,e),g=b.call(this,d,e),h=(f.y+g.y)/2,i=[f,{x:f.x,y:h},{x:g.x,y:h},g];return i=i.map(c),"M"+i[0]+"C"+i[1]+" "+i[2]+" "+i[3]}var a=dl,b=dm,c=dr;return d.source=function(b){return arguments.length?(a=q(b),d):a},d.target=function(a){return arguments.length?(b=q(a),d):b},d.projection=function(a){return arguments.length?(c=a,d):c},d},d3.svg.diagonal.radial=function(){var a=d3.svg.diagonal(),b=dr,c=a.projection;return a.projection=function(a){return arguments.length?c(ds(b=a)):b},a},d3.svg.mouse=d3.mouse,d3.svg.touches=d3.touches,d3.svg.symbol=function(){function c(c,d){return(dw.get(a.call(this,c,d))||dv)(b.call(this,c,d))}var a=du,b=dt;return c
+.type=function(b){return arguments.length?(a=q(b),c):a},c.size=function(a){return arguments.length?(b=q(a),c):b},c};var dw=d3.map({circle:dv,cross:function(a){var b=Math.sqrt(a/5)/2;return"M"+ -3*b+","+ -b+"H"+ -b+"V"+ -3*b+"H"+b+"V"+ -b+"H"+3*b+"V"+b+"H"+b+"V"+3*b+"H"+ -b+"V"+b+"H"+ -3*b+"Z"},diamond:function(a){var b=Math.sqrt(a/(2*dy)),c=b*dy;return"M0,"+ -b+"L"+c+",0"+" 0,"+b+" "+ -c+",0"+"Z"},square:function(a){var b=Math.sqrt(a)/2;return"M"+ -b+","+ -b+"L"+b+","+ -b+" "+b+","+b+" "+ -b+","+b+"Z"},"triangle-down":function(a){var b=Math.sqrt(a/dx),c=b*dx/2;return"M0,"+c+"L"+b+","+ -c+" "+ -b+","+ -c+"Z"},"triangle-up":function(a){var b=Math.sqrt(a/dx),c=b*dx/2;return"M0,"+ -c+"L"+b+","+c+" "+ -b+","+c+"Z"}});d3.svg.symbolTypes=dw.keys();var dx=Math.sqrt(3),dy=Math.tan(30*Math.PI/180);d3.svg.axis=function(){function k(k){k.each(function(){var k=d3.select(this),l=h==null?a.ticks?a.ticks.apply(a,g):a.domain():h,m=i==null?a.tickFormat?a.tickFormat.apply(a,g):String:i,n=dB(a,l,j),o=k
 .selectAll(".minor").data(n,String),p=o.enter().insert("line","g").attr("class","tick minor").style("opacity",1e-6),q=d3.transition(o.exit()).style("opacity",1e-6).remove(),r=d3.transition(o).style("opacity",1),s=k.selectAll("g").data(l,String),t=s.enter().insert("g","path").style("opacity",1e-6),u=d3.transition(s.exit()).style("opacity",1e-6).remove(),v=d3.transition(s).style("opacity",1),w,x=cg(a),y=k.selectAll(".domain").data([0]),z=y.enter().append("path").attr("class","domain"),A=d3.transition(y),B=a.copy(),C=this.__chart__||B;this.__chart__=B,t.append("line").attr("class","tick"),t.append("text"),v.select("text").text(m);switch(b){case"bottom":w=dz,p.attr("y2",d),r.attr("x2",0).attr("y2",d),t.select("line").attr("y2",c),t.select("text").attr("y",Math.max(c,0)+f),v.select("line").attr("x2",0).attr("y2",c),v.select("text").attr("x",0).attr("y",Math.max(c,0)+f).attr("dy",".71em").attr("text-anchor","middle"),A.attr("d","M"+x[0]+","+e+"V0H"+x[1]+"V"+e);break;case"top":w=dz,p.attr(
 "y2",-d),r.attr("x2",0).attr("y2",-d),t.select("line").attr("y2",-c),t.select("text").attr("y",-(Math.max(c,0)+f)),v.select("line").attr("x2",0).attr("y2",-c),v.select("text").attr("x",0).attr("y",-(Math.max(c,0)+f)).attr("dy","0em").attr("text-anchor","middle"),A.attr("d","M"+x[0]+","+ -e+"V0H"+x[1]+"V"+ -e);break;case"left":w=dA,p.attr("x2",-d),r.attr("x2",-d).attr("y2",0),t.select("line").attr("x2",-c),t.select("text").attr("x",-(Math.max(c,0)+f)),v.select("line").attr("x2",-c).attr("y2",0),v.select("text").attr("x",-(Math.max(c,0)+f)).attr("y",0).attr("dy",".32em").attr("text-anchor","end"),A.attr("d","M"+ -e+","+x[0]+"H0V"+x[1]+"H"+ -e);break;case"right":w=dA,p.attr("x2",d),r.attr("x2",d).attr("y2",0),t.select("line").attr("x2",c),t.select("text").attr("x",Math.max(c,0)+f),v.select("line").attr("x2",c).attr("y2",0),v.select("text").attr("x",Math.max(c,0)+f).attr("y",0).attr("dy",".32em").attr("text-anchor","start"),A.attr("d","M"+e+","+x[0]+"H0V"+x[1]+"H"+e)}if(a.ticks)t.call(w
 ,C),v.call(w,B),u.call(w,B),p.call(w,C),r.call(w,B),q.call(w,B);else{var D=B.rangeBand()/2,E=function(a){return B(a)+D};t.call(w,E),v.call(w,E)}})}var a=d3.scale.linear(),b="bottom",c=6,d=6,e=6,f=3,g=[10],h=null,i,j=0;return k.scale=function(b){return arguments.length?(a=b,k):a},k.orient=function(a){return arguments.length?(b=a,k):b},k.ticks=function(){return arguments.length?(g=arguments,k):g},k.tickValues=function(a){return arguments.length?(h=a,k):h},k.tickFormat=function(a){return arguments.length?(i=a,k):i},k.tickSize=function(a,b,f){if(!arguments.length)return c;var g=arguments.length-1;return c=+a,d=g>1?+b:c,e=g>0?+arguments[g]:c,k},k.tickPadding=function(a){return arguments.length?(f=+a,k):f},k.tickSubdivide=function(a){return arguments.length?(j=+a,k):j},k},d3.svg.brush=function(){function g(a){a.each(function(){var a=d3.select(this),e=a.selectAll(".background").data([0]),f=a.selectAll(".extent").data([0]),l=a.selectAll(".resize").data(d,String),m;a.style("pointer-events","
 all").on("mousedown.brush",k).on("touchstart.brush",k),e.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair"),f.enter().append("rect").attr("class","extent").style("cursor","move"),l.enter().append("g").attr("class",function(a){return"resize "+a}).style("cursor",function(a){return dC[a]}).append("rect").attr("x",function(a){return/[ew]$/.test(a)?-3:null}).attr("y",function(a){return/^[ns]/.test(a)?-3:null}).attr("width",6).attr("height",6).style("visibility","hidden"),l.style("display",g.empty()?"none":null),l.exit().remove(),b&&(m=cg(b),e.attr("x",m[0]).attr("width",m[1]-m[0]),i(a)),c&&(m=cg(c),e.attr("y",m[0]).attr("height",m[1]-m[0]),j(a)),h(a)})}function h(a){a.selectAll(".resize").attr("transform",function(a){return"translate("+e[+/e$/.test(a)][0]+","+e[+/^s/.test(a)][1]+")"})}function i(a){a.select(".extent").attr("x",e[0][0]),a.selectAll(".extent,.n>rect,.s>rect").attr("width",e[1][0]-e[0][0])}function j(a){a.select(".exte
 nt").attr("y",e[0][1]),a.selectAll(".extent,.e>rect,.w>rect").attr("height",e[1][1]-e[0][1])}function k(){function x(){var a=d3.event.changedTouches;return a?d3.touches(d,a)[0]:d3.mouse(d)}function y(){d3.event.keyCode==32&&(q||(r=null,s[0]-=e[1][0],s[1]-=e[1][1],q=2),Z())}function z(){d3.event.keyCode==32&&q==2&&(s[0]+=e[1][0],s[1]+=e[1][1],q=0,Z())}function A(){var a=x(),d=!1;t&&(a[0]+=t[0],a[1]+=t[1]),q||(d3.event.altKey?(r||(r=[(e[0][0]+e[1][0])/2,(e[0][1]+e[1][1])/2]),s[0]=e[+(a[0]<r[0])][0],s[1]=e[+(a[1]<r[1])][1]):r=null),o&&B(a,b,0)&&(i(m),d=!0),p&&B(a,c,1)&&(j(m),d=!0),d&&(h(m),l({type:"brush",mode:q?"move":"resize"}))}function B(a,b,c){var d=cg(b),g=d[0],h=d[1],i=s[c],j=e[1][c]-e[0][c],k,l;q&&(g-=i,h-=j+i),k=Math.max(g,Math.min(h,a[c])),q?l=(k+=i)+j:(r&&(i=Math.max(g,Math.min(h,2*r[c]-k))),i<k?(l=k,k=i):l=i);if(e[0][c]!==k||e[1][c]!==l)return f=null,e[0][c]=k,e[1][c]=l,!0}function C(){A(),m.style("pointer-events","all").selectAll(".resize").style("display",g.empty()?"none"
 :null),d3.select("body").style("cursor",null),u.on("mousemove.brush",null).on("mouseup.brush",null).on("touchmove.brush",null).on("touchend.brush",null).on("keydown.brush",null).on("keyup.brush",null),l({type:"brushend"}),Z()}var d=this,k=d3.select(d3.event.target),l=a.of(d,arguments),m=d3.select(d),n=k.datum(),o=!/^(n|s)$/.test(n)&&b,p=!/^(e|w)$/.test(n)&&c,q=k.classed("extent"),r,s=x(),t,u=d3.select(window).on("mousemove.brush",A).on("mouseup.brush",C).on("touchmove.brush",A).on("touchend.brush",C).on("keydown.brush",y).on("keyup.brush",z);if(q)s[0]=e[0][0]-s[0],s[1]=e[0][1]-s[1];else if(n){var v=+/w$/.test(n),w=+/^n/.test(n);t=[e[1-v][0]-s[0],e[1-w][1]-s[1]],s[0]=e[v][0],s[1]=e[w][1]}else d3.event.altKey&&(r=s.slice());m.style("pointer-events","none").selectAll(".resize").style("display",null),d3.select("body").style("cursor",k.style("cursor")),l({type:"brushstart"}),A(),Z()}var a=_(g,"brushstart","brush","brushend"),b=null,c=null,d=dD[0],e=[[0,0],[0,0]],f;return g.x=function(a){
 return arguments.length?(b=a,d=dD[!b<<1|!c],g):b},g.y=function(a){return arguments.length?(c=a,d=dD[!b<<1|!c],g):c},g.extent=function(a){var d,h,i,j,k;return arguments.length?(f=[[0,0],[0,0]],b&&(d=a[0],h=a[1],c&&(d=d[0],h=h[0]),f[0][0]=d,f[1][0]=h,b.invert&&(d=b(d),h=b(h)),h<d&&(k=d,d=h,h=k),e[0][0]=d|0,e[1][0]=h|0),c&&(i=a[0],j=a[1],b&&(i=i[1],j=j[1]),f[0][1]=i,f[1][1]=j,c.invert&&(i=c(i),j=c(j)),j<i&&(k=i,i=j,j=k),e[0][1]=i|0,e[1][1]=j|0),g):(a=f||e,b&&(d=a[0][0],h=a[1][0],f||(d=e[0][0],h=e[1][0],b.invert&&(d=b.invert(d),h=b.invert(h)),h<d&&(k=d,d=h,h=k))),c&&(i=a[0][1],j=a[1][1],f||(i=e[0][1],j=e[1][1],c.invert&&(i=c.invert(i),j=c.invert(j)),j<i&&(k=i,i=j,j=k))),b&&c?[[d,i],[h,j]]:b?[d,h]:c&&[i,j])},g.clear=function(){return f=null,e[0][0]=e[0][1]=e[1][0]=e[1][1]=0,g},g.empty=function(){return b&&e[0][0]===e[1][0]||c&&e[0][1]===e[1][1]},d3.rebind(g,a,"on")};var dC={n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw
 -resize"},dD=[["n","e","s","w","nw","ne","se","sw"],["e","w"],["n","s"],[]];d3.behavior={},d3.behavior.drag=function(){function c(){this.on("mousedown.drag",d).on("touchstart.drag",d)}function d(){function j(){var a=c.parentNode,b=d3.event.changedTouches;return b?d3.touches(a,b)[0]:d3.mouse(a)}function k(){if(!c.parentNode)return l();var a=j(),b=a[0]-g[0],e=a[1]-g[1];h|=b|e,g=a,Z(),d({type:"drag",x:a[0]+f[0],y:a[1]+f[1],dx:b,dy:e})}function l(){d({type:"dragend"}),h&&(Z(),d3.event.target===e&&i.on("click.drag",m,!0)),i.on("mousemove.drag",null).on("touchmove.drag",null).on("mouseup.drag",null).on("touchend.drag",null)}function m(){Z(),i.on("click.drag",null)}var c=this,d=a.of(c,arguments),e=d3.event.target,f,g=j(),h=0,i=d3.select(window).on("mousemove.drag",k).on("touchmove.drag",k).on("mouseup.drag",l,!0).on("touchend.drag",l,!0);b?(f=b.apply(c,arguments),f=[f.x-g[0],f.y-g[1]]):f=[0,0],Z(),d({type:"dragstart"})}var a=_(c,"drag","dragstart","dragend"),b=null;return c.origin=function
 (a){return arguments.length?(b=a,c):b},d3.rebind(c,a,"on")},d3.behavior.zoom=function(){function l(){this.on("mousedown.zoom",r).on("mousewheel.zoom",s).on("mousemove.zoom",t).on("DOMMouseScroll.zoom",s).on("dblclick.zoom",u).on("touchstart.zoom",v).on("touchmove.zoom",w).on("touchend.zoom",v)}function m(b){return[(b[0]-a[0])/c,(b[1]-a[1])/c]}function n(b){return[b[0]*c+a[0],b[1]*c+a[1]]}function o(a){c=Math.max(e[0],Math.min(e[1],a))}function p(b,c){c=n(c),a[0]+=b[0]-c[0],a[1]+=b[1]-c[1]}function q(b){h&&h.domain(g.range().map(function(b){return(b-a[0])/c}).map(g.invert)),j&&j.domain(i.range().map(function(b){return(b-a[1])/c}).map(i.invert)),d3.event.preventDefault(),b({type:"zoom",scale:c,translate:a})}function r(){function h(){d=1,p(d3.mouse(a),g),q(b)}function i(){d&&Z(),e.on("mousemove.zoom",null).on("mouseup.zoom",null),d&&d3.event.target===c&&e.on("click.zoom",j,!0)}function j(){Z(),e.on("click.zoom",null)}var a=this,b=f.of(a,arguments),c=d3.event.target,d=0,e=d3.select(wind
 ow).on("mousemove.zoom",h).on("mouseup.zoom",i),g=m(d3.mouse(a));window.focus(),Z()}function s(){b||(b=m(d3.mouse(this))),o(Math.pow(2,dG()*.002)*c),p(d3.mouse(this),b),q(f.of(this,arguments))}function t(){b=null}function u(){var a=d3.mouse(this),b=m(a);o(d3.event.shiftKey?c/2:c*2),p(a,b),q(f.of(this,arguments))}function v(){var a=d3.touches(this),e=Date.now();d=c,b={},a.forEach(function(a){b[a.identifier]=m(a)}),Z();if(a.length===1&&e-k<500){var g=a[0],h=m(a[0]);o(c*2),p(g,h),q(f.of(this,arguments))}k=e}function w(){var a=d3.touches(this),c=a[0],e=b[c.identifier];if(g=a[1]){var g,h=b[g.identifier];c=[(c[0]+g[0])/2,(c[1]+g[1])/2],e=[(e[0]+h[0])/2,(e[1]+h[1])/2],o(d3.event.scale*d)}p(c,e),q(f.of(this,arguments))}var a=[0,0],b,c=1,d,e=dF,f=_(l,"zoom"),g,h,i,j,k;return l.translate=function(b){return arguments.length?(a=b.map(Number),l):a},l.scale=function(a){return arguments.length?(c=+a,l):c},l.scaleExtent=function(a){return arguments.length?(e=a==null?dF:a.map(Number),l):e},l.x=funct
 ion(a){return arguments.length?(h=a,g=a.copy(),l):h},l.y=function(a){return arguments.length?(j=a,i=a.copy(),l):j},d3.rebind(l,f,"on")};var dE,dF=[0,Infinity];d3.layout={},d3.layout.bundle=function(){return function(a){var b=[],c=-1,d=a.length;while(++c<d)b.push(dH(a[c]));return b}},d3.layout.chord=function(){function j(){var a={},j=[],l=d3.range(e),m=[],n,o,p,q,r;b=[],c=[],n=0,q=-1;while(++q<e){o=0,r=-1;while(++r<e)o+=d[q][r];j.push(o),m.push(d3.range(e)),n+=o}g&&l.sort(function(a,b){return g(j[a],j[b])}),h&&m.forEach(function(a,b){a.sort(function(a,c){return h(d[b][a],d[b][c])})}),n=(2*Math.PI-f*e)/n,o=0,q=-1;while(++q<e){p=o,r=-1;while(++r<e){var s=l[q],t=m[s][r],u=d[s][t],v=o,w=o+=u*n;a[s+"-"+t]={index:s,subindex:t,startAngle:v,endAngle:w,value:u}}c[s]={index:s,startAngle:p,endAngle:o,value:(o-p)/n},o+=f}q=-1;while(++q<e){r=q-1;while(++r<e){var x=a[q+"-"+r],y=a[r+"-"+q];(x.value||y.value)&&b.push(x.value<y.value?{source:y,target:x}:{source:x,target:y})}}i&&k()}function k(){b.sor
 t(function(a,b){return i((a.source.value+a.target.value)/2,(b.source.value+b.target.value)/2)})}var a={},b,c,d,e,f=0,g,h,i;return a.matrix=function(f){return arguments.length?(e=(d=f)&&d.length,b=c=null,a):d},a.padding=function(d){return arguments.length?(f=d,b=c=null,a):f},a.sortGroups=function(d){return arguments.length?(g=d,b=c=null,a):g},a.sortSubgroups=function(c){return arguments.length?(h=c,b=null,a):h},a.sortChords=function(c){return arguments.length?(i=c,b&&k(),a):i},a.chords=function(){return b||j(),b},a.groups=function(){return c||j(),c},a},d3.layout.force=function(){function t(a){return function(b,c,d,e,f){if(b.point!==a){var g=b.cx-a.x,h=b.cy-a.y,i=1/Math.sqrt(g*g+h*h);if((e-c)*i<k){var j=b.charge*i*i;return a.px-=g*j,a.py-=h*j,!0}if(b.point&&isFinite(i)){var j=b.pointCharge*i*i;a.px-=g*j,a.py-=h*j}}return!b.charge}}function u(b){dM(dL=b),dK=a}var a={},b=d3.dispatch("start","tick","end"),c=[1,1],d,e,f=.9,g=dR,h=dS,i=-30,j=.1,k=.8,l,m=[],o=[],p,r,s;return a.tick=function
 (){if((e*=.99)<.005)return b.end({type:"end",alpha:e=0}),!0;var a=m.length,d=o.length,g,h,k,l,n,q,u,v,w;for(h=0;h<d;++h){k=o[h],l=k.source,n=k.target,v=n.x-l.x,w=n.y-l.y;if(q=v*v+w*w)q=e*r[h]*((q=Math.sqrt(q))-p[h])/q,v*=q,w*=q,n.x-=v*(u=l.weight/(n.weight+l.weight)),n.y-=w*u,l.x+=v*(u=1-u),l.y+=w*u}if(u=e*j){v=c[0]/2,w=c[1]/2,h=-1;if(u)while(++h<a)k=m[h],k.x+=(v-k.x)*u,k.y+=(w-k.y)*u}if(i){dQ(g=d3.geom.quadtree(m),e,s),h=-1;while(++h<a)(k=m[h]).fixed||g.visit(t(k))}h=-1;while(++h<a)k=m[h],k.fixed?(k.x=k.px,k.y=k.py):(k.x-=(k.px-(k.px=k.x))*f,k.y-=(k.py-(k.py=k.y))*f);b.tick({type:"tick",alpha:e})},a.nodes=function(b){return arguments.length?(m=b,a):m},a.links=function(b){return arguments.length?(o=b,a):o},a.size=function(b){return arguments.length?(c=b,a):c},a.linkDistance=function(b){return arguments.length?(g=q(b),a):g},a.distance=a.linkDistance,a.linkStrength=function(b){return arguments.length?(h=q(b),a):h},a.friction=function(b){return arguments.length?(f=b,a):f},a.charge=func
 tion(b){return arguments.length?(i=typeof b=="function"?b:+b,a):i},a.gravity=function(b){return arguments.length?(j=b,a):j},a.theta=function(b){return arguments.length?(k=b,a):k},a.alpha=function(c){return arguments.length?(e?c>0?e=c:e=0:c>0&&(b.start({type:"start",alpha:e=c}),d3.timer(a.tick)),a):e},a.start=function(){function q(a,c){var d=t(b),e=-1,f=d.length,g;while(++e<f)if(!isNaN(g=d[e][a]))return g;return Math.random()*c}function t(){if(!l){l=[];for(d=0;d<e;++d)l[d]=[];for(d=0;d<f;++d){var a=o[d];l[a.source.index].push(a.target),l[a.target.index].push(a.source)}}return l[b]}var b,d,e=m.length,f=o.length,j=c[0],k=c[1],l,n;for(b=0;b<e;++b)(n=m[b]).index=b,n.weight=0;p=[],r=[];for(b=0;b<f;++b)n=o[b],typeof n.source=="number"&&(n.source=m[n.source]),typeof n.target=="number"&&(n.target=m[n.target]),p[b]=g.call(this,n,b),r[b]=h.call(this,n,b),++n.source.weight,++n.target.weight;for(b=0;b<e;++b)n=m[b],isNaN(n.x)&&(n.x=q("x",j)),isNaN(n.y)&&(n.y=q("y",k)),isNaN(n.px)&&(n.px=n.x),isNa
 N(n.py)&&(n.py=n.y);s=[];if(typeof i=="function")for(b=0;b<e;++b)s[b]=+i.call(this,m[b],b);else for(b=0;b<e;++b)s[b]=i;return a.resume()},a.resume=function(){return a.alpha(.1)},a.stop=function(){return a.alpha(0)},a.drag=function(){d||(d=d3.behavior.drag().origin(n).on("dragstart",u).on("drag",dP).on("dragend",dO)),this.on("mouseover.force",dM).on("mouseout.force",dN).call(d)},d3.rebind(a,b,"on")};var dK,dL;d3.layout.partition=function(){function c(a,b,d,e){var f=a.children;a.x=b,a.y=a.depth*e,a.dx=d,a.dy=e;if(f&&(h=f.length)){var g=-1,h,i,j;d=a.value?d/a.value:0;while(++g<h)c(i=f[g],b,j=i.value*d,e),b+=j}}function d(a){var b=a.children,c=0;if(b&&(f=b.length)){var e=-1,f;while(++e<f)c=Math.max(c,d(b[e]))}return 1+c}function e(e,f){var g=a.call(this,e,f);return c(g[0],0,b[0],b[1]/d(g[0])),g}var a=d3.layout.hierarchy(),b=[1,1];return e.size=function(a){return arguments.length?(b=a,e):b},ef(e,a)},d3.layout.pie=function(){function f(g,h){var i=g.map(function(b,c){return+a.call(f,b,c)})
 ,j=+(typeof c=="function"?c.apply(this,arguments):c),k=((typeof e=="function"?e.apply(this,arguments):e)-c)/d3.sum(i),l=d3.range(g.length);b!=null&&l.sort(b===dT?function(a,b){return i[b]-i[a]}:function(a,c){return b(g[a],g[c])});var m=[];return l.forEach(function(a){m[a]={data:g[a],value:d=i[a],startAngle:j,endAngle:j+=d*k}}),m}var a=Number,b=dT,c=0,e=2*Math.PI;return f.value=function(b){return arguments.length?(a=b,f):a},f.sort=function(a){return arguments.length?(b=a,f):b},f.startAngle=function(a){return arguments.length?(c=a,f):c},f.endAngle=function(a){return arguments.length?(e=a,f):e},f};var dT={};d3.layout.stack=function(){function g(h,i){var j=h.map(function(b,c){return a.call(g,b,c)}),k=j.map(function(a,b){return a.map(function(a,b){return[e.call(g,a,b),f.call(g,a,b)]})}),l=b.call(g,k,i);j=d3.permute(j,l),k=d3.permute(k,l);var m=c.call(g,k,i),n=j.length,o=j[0].length,p,q,r;for(q=0;q<o;++q){d.call(g,j[0][q],r=m[q],k[0][q][1]);for(p=1;p<n;++p)d.call(g,j[p][q],r+=k[p-1][q][1]
 ,k[p][q][1])}return h}var a=n,b=dZ,c=d$,d=dW,e=dU,f=dV;return g.values=function(b){return arguments.length?(a=b,g):a},g.order=function(a){return arguments.length?(b=typeof a=="function"?a:dX.get(a)||dZ,g):b},g.offset=function(a){return arguments.length?(c=typeof a=="function"?a:dY.get(a)||d$,g):c},g.x=function(a){return arguments.length?(e=a,g):e},g.y=function(a){return arguments.length?(f=a,g):f},g.out=function(a){return arguments.length?(d=a,g):d},g};var dX=d3.map({"inside-out":function(a){var b=a.length,c,d,e=a.map(d_),f=a.map(ea),g=d3.range(b).sort(function(a,b){return e[a]-e[b]}),h=0,i=0,j=[],k=[];for(c=0;c<b;++c)d=g[c],h<i?(h+=f[d],j.push(d)):(i+=f[d],k.push(d));return k.reverse().concat(j)},reverse:function(a){return d3.range(a.length).reverse()},"default":dZ}),dY=d3.map({silhouette:function(a){var b=a.length,c=a[0].length,d=[],e=0,f,g,h,i=[];for(g=0;g<c;++g){for(f=0,h=0;f<b;f++)h+=a[f][g][1];h>e&&(e=h),d.push(h)}for(g=0;g<c;++g)i[g]=(e-d[g])/2;return i},wiggle:function(a){va
 r b=a.length,c=a[0],d=c.length,e=0,f,g,h,i,j,k,l,m,n,o=[];o[0]=m=n=0;for(g=1;g<d;++g){for(f=0,i=0;f<b;++f)i+=a[f][g][1];for(f=0,j=0,l=c[g][0]-c[g-1][0];f<b;++f){for(h=0,k=(a[f][g][1]-a[f][g-1][1])/(2*l);h<f;++h)k+=(a[h][g][1]-a[h][g-1][1])/l;j+=k*a[f][g][1]}o[g]=m-=i?j/i*l:0,m<n&&(n=m)}for(g=0;g<d;++g)o[g]-=n;return o},expand:function(a){var b=a.length,c=a[0].length,d=1/b,e,f,g,h=[];for(f=0;f<c;++f){for(e=0,g=0;e<b;e++)g+=a[e][f][1];if(g)for(e=0;e<b;e++)a[e][f][1]/=g;else for(e=0;e<b;e++)a[e][f][1]=d}for(f=0;f<c;++f)h[f]=0;return h},zero:d$});d3.layout.histogram=function(){function e(e,f){var g=[],h=e.map(b,this),i=c.call(this,h,f),j=d.call(this,i,h,f),k,f=-1,l=h.length,m=j.length-1,n=a?1:1/l,o;while(++f<m)k=g[f]=[],k.dx=j[f+1]-(k.x=j[f]),k.y=0;if(m>0){f=-1;while(++f<l)o=h[f],o>=i[0]&&o<=i[1]&&(k=g[d3.bisect(j,o,1,m)-1],k.y+=n,k.push(e[f]))}return g}var a=!0,b=Number,c=ee,d=ec;return e.value=function(a){return arguments.length?(b=a,e):b},e.range=function(a){return arguments.length?(
 c=q(a),e):c},e.bins=function(a){return arguments.length?(d=typeof a=="number"?function(b){return ed(b,a)}:q(a),e):d},e.frequency=function(b){return arguments.length?(a=!!b,e):a},e},d3.layout.hierarchy=function(){function e(f,h,i){var j=b.call(g,f,h),k=ek?f:{data:f};k.depth=h,i.push(k);if(j&&(m=j.length)){var l=-1,m,n=k.children=[],o=0,p=h+1;while(++l<m)d=e(j[l],p,i),d.parent=k,n.push(d),o+=d.value;a&&n.sort(a),c&&(k.value=o)}else c&&(k.value=+c.call(g,f,h)||0);return k}function f(a,b){var d=a.children,e=0;if(d&&(i=d.length)){var h=-1,i,j=b+1;while(++h<i)e+=f(d[h],j)}else c&&(e=+c.call(g,ek?a:a.data,b)||0);return c&&(a.value=e),e}function g(a){var b=[];return e(a,0,b),b}var a=ei,b=eg,c=eh;return g.sort=function(b){return arguments.length?(a=b,g):a},g.children=function(a){return arguments.length?(b=a,g):b},g.value=function(a){return arguments.length?(c=a,g):c},g.revalue=function(a){return f(a,0),a},g};var ek=!1;d3.layout.pack=function(){function c(c,d){var e=a.call(this,c,d),f=e[0];f.
 x=0,f.y=0,es(f);var g=b[0],h=b[1],i=1/Math.max(2*f.r/g,2*f.r/h);return et(f,g/2,h/2,i),e}var a=d3.layout.hierarchy().sort(el),b=[1,1];return c.size=function(a){return arguments.length?(b=a,c):b},ef(c,a)},d3.layout.cluster=function(){function d(d,e){var f=a.call(this,d,e),g=f[0],h,i=0,j,k;eG(g,function(a){var c=a.children;c&&c.length?(a.x=ew(c),a.y=ev(c)):(a.x=h?i+=b(a,h):0,a.y=0,h=a)});var l=ex(g),m=ey(g),n=l.x-b(l,m)/2,o=m.x+b(m,l)/2;return eG(g,function(a){a.x=(a.x-n)/(o-n)*c[0],a.y=(1-(g.y?a.y/g.y:1))*c[1]}),f}var a=d3.layout.hierarchy().sort(null).value(null),b=ez,c=[1,1];return d.separation=function(a){return arguments.length?(b=a,d):b},d.size=function(a){return arguments.length?(c=a,d):c},ef(d,a)},d3.layout.tree=function(){function d(d,e){function h(a,c){var d=a.children,e=a._tree;if(d&&(f=d.length)){var f,g=d[0],i,k=g,l,m=-1;while(++m<f)l=d[m],h(l,i),k=j(l,i,k),i=l;eH(a);var n=.5*(g._tree.prelim+l._tree.prelim);c?(e.prelim=c._tree.prelim+b(a,c),e.mod=e.prelim-n):e.prelim=n}el
 se c&&(e.prelim=c._tree.prelim+b(a,c))}function i(a,b){a.x=a._tree.prelim+b;var c=a.children;if(c&&(e=c.length)){var d=-1,e;b+=a._tree.mod;while(++d<e)i(c[d],b)}}function j(a,c,d){if(c){var e=a,f=a,g=c,h=a.parent.children[0],i=e._tree.mod,j=f._tree.mod,k=g._tree.mod,l=h._tree.mod,m;while(g=eB(g),e=eA(e),g&&e)h=eA(h),f=eB(f),f._tree.ancestor=a,m=g._tree.prelim+k-e._tree.prelim-i+b(g,e),m>0&&(eI(eJ(g,a,d),a,m),i+=m,j+=m),k+=g._tree.mod,i+=e._tree.mod,l+=h._tree.mod,j+=f._tree.mod;g&&!eB(f)&&(f._tree.thread=g,f._tree.mod+=k-j),e&&!eA(h)&&(h._tree.thread=e,h._tree.mod+=i-l,d=a)}return d}var f=a.call(this,d,e),g=f[0];eG(g,function(a,b){a._tree={ancestor:a,prelim:0,mod:0,change:0,shift:0,number:b?b._tree.number+1:0}}),h(g),i(g,-g._tree.prelim);var k=eC(g,eE),l=eC(g,eD),m=eC(g,eF),n=k.x-b(k,l)/2,o=l.x+b(l,k)/2,p=m.depth||1;return eG(g,function(a){a.x=(a.x-n)/(o-n)*c[0],a.y=a.depth/p*c[1],delete a._tree}),f}var a=d3.layout.hierarchy().sort(null).value(null),b=ez,c=[1,1];return d.separation=
 function(a){return arguments.length?(b=a,d):b},d.size=function(a){return arguments.length?(c=a,d):c},ef(d,a)},d3.layout.treemap=function(){function i(a,b){var c=-1,d=a.length,e,f;while(++c<d)f=(e=a[c]).value*(b<0?0:b),e.area=isNaN(f)||f<=0?0:f}function j(a){var b=a.children;if(b&&b.length){var c=e(a),d=[],f=b.slice(),g,h=Infinity,k,n=Math.min(c.dx,c.dy),o;i(f,c.dx*c.dy/a.value),d.area=0;while((o=f.length)>0)d.push(g=f[o-1]),d.area+=g.area,(k=l(d,n))<=h?(f.pop(),h=k):(d.area-=d.pop().area,m(d,n,c,!1),n=Math.min(c.dx,c.dy),d.length=d.area=0,h=Infinity);d.length&&(m(d,n,c,!0),d.length=d.area=0),b.forEach(j)}}function k(a){var b=a.children;if(b&&b.length){var c=e(a),d=b.slice(),f,g=[];i(d,c.dx*c.dy/a.value),g.area=0;while(f=d.pop())g.push(f),g.area+=f.area,f.z!=null&&(m(g,f.z?c.dx:c.dy,c,!d.length),g.length=g.area=0);b.forEach(k)}}function l(a,b){var c=a.area,d,e=0,f=Infinity,g=-1,i=a.length;while(++g<i){if(!(d=a[g].area))continue;d<f&&(f=d),d>e&&(e=d)}return c*=c,b*=b,c?Math.max(b*e*h/
 c,c/(b*f*h)):Infinity}function m(a,c,d,e){var f=-1,g=a.length,h=d.x,i=d.y,j=c?b(a.area/c):0,k;if(c==d.dx){if(e||j>d.dy)j=d.dy;while(++f<g)k=a[f],k.x=h,k.y=i,k.dy=j,h+=k.dx=Math.min(d.x+d.dx-h,j?b(k.area/j):0);k.z=!0,k.dx+=d.x+d.dx-h,d.y+=j,d.dy-=j}else{if(e||j>d.dx)j=d.dx;while(++f<g)k=a[f],k.x=h,k.y=i,k.dx=j,i+=k.dy=Math.min(d.y+d.dy-i,j?b(k.area/j):0);k.z=!1,k.dy+=d.y+d.dy-i,d.x+=j,d.dx-=j}}function n(b){var d=g||a(b),e=d[0];return e.x=0,e.y=0,e.dx=c[0],e.dy=c[1],g&&a.revalue(e),i([e],e.dx*e.dy/e.value),(g?k:j)(e),f&&(g=d),d}var a=d3.lay

<TRUNCATED>

[061/100] [abbrv] git commit: Updated to Sesame 2.7.11

Posted by wi...@apache.org.
Updated to Sesame 2.7.11

Ignoring some tests from the sesame-testsuite because KiWi supports transaction isolation.


Project: http://git-wip-us.apache.org/repos/asf/marmotta/repo
Commit: http://git-wip-us.apache.org/repos/asf/marmotta/commit/4804829b
Tree: http://git-wip-us.apache.org/repos/asf/marmotta/tree/4804829b
Diff: http://git-wip-us.apache.org/repos/asf/marmotta/diff/4804829b

Branch: refs/heads/ldp
Commit: 4804829bad0a5a25656554adc7520a2f72399286
Parents: 9740329
Author: Jakob Frank <ja...@apache.org>
Authored: Mon Apr 7 15:19:13 2014 +0200
Committer: Jakob Frank <ja...@apache.org>
Committed: Tue Apr 8 11:05:47 2014 +0200

----------------------------------------------------------------------
 .../test/caching/EHCacheRepositoryConnectionTest.java  | 12 ++++++++++++
 .../cluster/HazelcastRepositoryConnectionTest.java     | 12 ++++++++++++
 .../embedded/EmbeddedRepositoryConnectionTest.java     | 13 +++++++++++++
 .../test/remote/HotRodRepositoryConnectionTest.java    | 13 +++++++++++++
 .../repository/KiWiRepositoryConnectionTest.java       | 13 +++++++++++++
 parent/pom.xml                                         |  2 +-
 6 files changed, 64 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/marmotta/blob/4804829b/libraries/kiwi/kiwi-caching-ehcache/src/test/java/org/apache/marmotta/kiwi/test/caching/EHCacheRepositoryConnectionTest.java
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-caching-ehcache/src/test/java/org/apache/marmotta/kiwi/test/caching/EHCacheRepositoryConnectionTest.java b/libraries/kiwi/kiwi-caching-ehcache/src/test/java/org/apache/marmotta/kiwi/test/caching/EHCacheRepositoryConnectionTest.java
index 80f54ad..0686a7c 100644
--- a/libraries/kiwi/kiwi-caching-ehcache/src/test/java/org/apache/marmotta/kiwi/test/caching/EHCacheRepositoryConnectionTest.java
+++ b/libraries/kiwi/kiwi-caching-ehcache/src/test/java/org/apache/marmotta/kiwi/test/caching/EHCacheRepositoryConnectionTest.java
@@ -60,4 +60,16 @@ public class EHCacheRepositoryConnectionTest extends RepositoryConnectionTest {
     @Override
     public void testOrderByQueriesAreInterruptable() throws Exception {
     }
+    @Ignore("KiWi supports transaction isolation")
+    @Test
+    @Override
+    public void testReadOfAddedStatement1() throws Exception {
+    }
+
+    @Ignore("KiWi supports transaction isolation")
+    @Test
+    @Override
+    public void testReadOfAddedStatement2() throws Exception {
+    }
+
 }

http://git-wip-us.apache.org/repos/asf/marmotta/blob/4804829b/libraries/kiwi/kiwi-caching-hazelcast/src/test/java/org/apache/marmotta/kiwi/test/cluster/HazelcastRepositoryConnectionTest.java
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-caching-hazelcast/src/test/java/org/apache/marmotta/kiwi/test/cluster/HazelcastRepositoryConnectionTest.java b/libraries/kiwi/kiwi-caching-hazelcast/src/test/java/org/apache/marmotta/kiwi/test/cluster/HazelcastRepositoryConnectionTest.java
index 7b0be4b..c9c50e6 100644
--- a/libraries/kiwi/kiwi-caching-hazelcast/src/test/java/org/apache/marmotta/kiwi/test/cluster/HazelcastRepositoryConnectionTest.java
+++ b/libraries/kiwi/kiwi-caching-hazelcast/src/test/java/org/apache/marmotta/kiwi/test/cluster/HazelcastRepositoryConnectionTest.java
@@ -63,4 +63,16 @@ public class HazelcastRepositoryConnectionTest extends RepositoryConnectionTest
     @Override
     public void testOrderByQueriesAreInterruptable() throws Exception {
     }
+    @Ignore("KiWi supports transaction isolation")
+    @Test
+    @Override
+    public void testReadOfAddedStatement1() throws Exception {
+    }
+
+    @Ignore("KiWi supports transaction isolation")
+    @Test
+    @Override
+    public void testReadOfAddedStatement2() throws Exception {
+    }
+
 }

http://git-wip-us.apache.org/repos/asf/marmotta/blob/4804829b/libraries/kiwi/kiwi-caching-infinispan/src/test/java/org/apache/marmotta/kiwi/test/embedded/EmbeddedRepositoryConnectionTest.java
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-caching-infinispan/src/test/java/org/apache/marmotta/kiwi/test/embedded/EmbeddedRepositoryConnectionTest.java b/libraries/kiwi/kiwi-caching-infinispan/src/test/java/org/apache/marmotta/kiwi/test/embedded/EmbeddedRepositoryConnectionTest.java
index 910d16f..a44212b 100644
--- a/libraries/kiwi/kiwi-caching-infinispan/src/test/java/org/apache/marmotta/kiwi/test/embedded/EmbeddedRepositoryConnectionTest.java
+++ b/libraries/kiwi/kiwi-caching-infinispan/src/test/java/org/apache/marmotta/kiwi/test/embedded/EmbeddedRepositoryConnectionTest.java
@@ -64,4 +64,17 @@ public class EmbeddedRepositoryConnectionTest extends RepositoryConnectionTest {
     @Override
     public void testOrderByQueriesAreInterruptable() throws Exception {
     }
+
+    @Ignore("KiWi supports transaction isolation")
+    @Test
+    @Override
+    public void testReadOfAddedStatement1() throws Exception {
+    }
+
+    @Ignore("KiWi supports transaction isolation")
+    @Test
+    @Override
+    public void testReadOfAddedStatement2() throws Exception {
+    }
+
 }

http://git-wip-us.apache.org/repos/asf/marmotta/blob/4804829b/libraries/kiwi/kiwi-caching-infinispan/src/test/java/org/apache/marmotta/kiwi/test/remote/HotRodRepositoryConnectionTest.java
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-caching-infinispan/src/test/java/org/apache/marmotta/kiwi/test/remote/HotRodRepositoryConnectionTest.java b/libraries/kiwi/kiwi-caching-infinispan/src/test/java/org/apache/marmotta/kiwi/test/remote/HotRodRepositoryConnectionTest.java
index b28c79b..268341f 100644
--- a/libraries/kiwi/kiwi-caching-infinispan/src/test/java/org/apache/marmotta/kiwi/test/remote/HotRodRepositoryConnectionTest.java
+++ b/libraries/kiwi/kiwi-caching-infinispan/src/test/java/org/apache/marmotta/kiwi/test/remote/HotRodRepositoryConnectionTest.java
@@ -70,4 +70,17 @@ public class HotRodRepositoryConnectionTest extends RepositoryConnectionTest {
     @Override
     public void testOrderByQueriesAreInterruptable() throws Exception {
     }
+
+    @Ignore("KiWi supports transaction isolation")
+    @Test
+    @Override
+    public void testReadOfAddedStatement1() throws Exception {
+    }
+
+    @Ignore("KiWi supports transaction isolation")
+    @Test
+    @Override
+    public void testReadOfAddedStatement2() throws Exception {
+    }
+
 }

http://git-wip-us.apache.org/repos/asf/marmotta/blob/4804829b/libraries/kiwi/kiwi-triplestore/src/test/java/org/apache/marmotta/kiwi/test/sesame/repository/KiWiRepositoryConnectionTest.java
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-triplestore/src/test/java/org/apache/marmotta/kiwi/test/sesame/repository/KiWiRepositoryConnectionTest.java b/libraries/kiwi/kiwi-triplestore/src/test/java/org/apache/marmotta/kiwi/test/sesame/repository/KiWiRepositoryConnectionTest.java
index bb1f687..0ee4d63 100644
--- a/libraries/kiwi/kiwi-triplestore/src/test/java/org/apache/marmotta/kiwi/test/sesame/repository/KiWiRepositoryConnectionTest.java
+++ b/libraries/kiwi/kiwi-triplestore/src/test/java/org/apache/marmotta/kiwi/test/sesame/repository/KiWiRepositoryConnectionTest.java
@@ -56,4 +56,17 @@ public class KiWiRepositoryConnectionTest extends RepositoryConnectionTest {
     @Override
     public void testOrderByQueriesAreInterruptable() throws Exception {
     }
+
+    @Ignore("KiWi supports transaction isolation")
+    @Test
+    @Override
+    public void testReadOfAddedStatement1() throws Exception {
+    }
+
+    @Ignore("KiWi supports transaction isolation")
+    @Test
+    @Override
+    public void testReadOfAddedStatement2() throws Exception {
+    }
+
 }

http://git-wip-us.apache.org/repos/asf/marmotta/blob/4804829b/parent/pom.xml
----------------------------------------------------------------------
diff --git a/parent/pom.xml b/parent/pom.xml
index 309bc45..8d853ec 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -36,7 +36,7 @@
     <url>http://marmotta.apache.org</url>
 
     <properties>
-        <sesame.version>2.7.10</sesame.version>
+        <sesame.version>2.7.11</sesame.version>
         <junit.version>4.11</junit.version>
         <weld.version>2.1.Final</weld.version>
         <weld.core.version>2.1.2.Final</weld.core.version>


[090/100] [abbrv] git commit: Merge remote-tracking branch 'origin/develop' into develop

Posted by wi...@apache.org.
Merge remote-tracking branch 'origin/develop' into develop


Project: http://git-wip-us.apache.org/repos/asf/marmotta/repo
Commit: http://git-wip-us.apache.org/repos/asf/marmotta/commit/8b6ebc1a
Tree: http://git-wip-us.apache.org/repos/asf/marmotta/tree/8b6ebc1a
Diff: http://git-wip-us.apache.org/repos/asf/marmotta/diff/8b6ebc1a

Branch: refs/heads/ldp
Commit: 8b6ebc1aca99a40792134654718ef6e0371eca74
Parents: dfde1a8 b5cfb0a
Author: Sebastian Schaffert <ss...@apache.org>
Authored: Thu May 15 15:17:07 2014 +0200
Committer: Sebastian Schaffert <ss...@apache.org>
Committed: Thu May 15 15:17:07 2014 +0200

----------------------------------------------------------------------
 .../marmotta/commons/util/StringUtils.java      |  40 ++++
 launchers/marmotta-installer/pom.xml            |   4 +-
 launchers/marmotta-webapp/pom.xml               |   1 -
 .../test/provider/ProviderTestBase.java         |   2 +-
 .../ldclient/ldclient-provider-freebase/pom.xml |   4 +
 .../provider/freebase/FreebaseProvider.java     |  20 +-
 .../services/logging/LoggingServiceImpl.java    |  11 +-
 .../core/test/base/AbstractMarmotta.java        |  15 +-
 .../core/test/base/EmbeddedMarmotta.java        |   9 +-
 .../platform/core/test/base/JettyMarmotta.java  |   6 +-
 platform/marmotta-ldp/pom.xml                   |  19 --
 .../platform/ldp/services/LdpServiceImpl.java   |   1 +
 .../platform/ldp/testsuite/LdpManifestTest.java |  73 --------
 .../platform/ldp/testsuite/LdpTestCase.java     | 185 -------------------
 .../ldp/testsuite/LdpTestCaseRunner.java        |  61 ------
 .../platform/ldp/testsuite/LdpTestCases.java    |  80 --------
 .../ldp/testsuite/LdpTestCasesRunner.java       | 100 ----------
 .../ldp/testsuite/LdpTestCasesUtils.java        | 130 -------------
 .../src/main/resources/kiwi-module.properties   |   8 +-
 19 files changed, 75 insertions(+), 694 deletions(-)
----------------------------------------------------------------------



[007/100] [abbrv] [partial] Reverting the erroneous merge by Sebastian according to the instructions in INFRA-6876

Posted by wi...@apache.org.
http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/triplestore/SesameServiceImpl.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/triplestore/SesameServiceImpl.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/triplestore/SesameServiceImpl.java
index ca7e00a..29061c3 100644
--- a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/triplestore/SesameServiceImpl.java
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/triplestore/SesameServiceImpl.java
@@ -17,6 +17,8 @@
  */
 package org.apache.marmotta.platform.core.services.triplestore;
 
+import edu.emory.mathcs.backport.java.util.concurrent.locks.ReentrantReadWriteLock;
+import org.apache.marmotta.kiwi.config.KiWiConfiguration;
 import org.apache.marmotta.platform.core.api.config.ConfigurationService;
 import org.apache.marmotta.platform.core.api.triplestore.NotifyingSailProvider;
 import org.apache.marmotta.platform.core.api.triplestore.SesameService;
@@ -37,9 +39,11 @@ import org.apache.marmotta.kiwi.transactions.sail.KiWiTransactionalSail;
 import org.openrdf.model.ValueFactory;
 import org.openrdf.repository.RepositoryConnection;
 import org.openrdf.repository.RepositoryException;
+import org.openrdf.repository.base.RepositoryConnectionWrapper;
 import org.openrdf.repository.sail.SailRepository;
 import org.openrdf.sail.NotifyingSail;
 import org.openrdf.sail.Sail;
+import org.openrdf.sail.SailException;
 import org.slf4j.Logger;
 
 import javax.annotation.PreDestroy;
@@ -117,79 +121,93 @@ public class SesameServiceImpl implements SesameService {
 
     private SailRepository repository;
 
+    private ReentrantReadWriteLock restartLock = new ReentrantReadWriteLock();
+
     /**
      * Initialise the Sesame repository. Should be called on service activation.
      */
     @Override
     public synchronized void initialise() {
-        log.info("Apache Marmotta Sesame Repository Service starting up ...");
+        restartLock.writeLock().lock();
+        try {
+            log.info("Apache Marmotta Sesame Repository Service starting up ...");
 
-        if(repository != null) {
-            log.warn("RDF repository has already been initialized");
-        }
+            if(repository != null) {
+                log.warn("RDF repository has already been initialized");
+            }
 
-        String database = configurationService.getStringConfiguration("database.type");
-        KiWiDialect dialect;
-        if("h2".equalsIgnoreCase(database)) {
-            dialect = new H2Dialect();
-        } else if("mysql".equalsIgnoreCase(database)) {
-            dialect = new MySQLDialect();
-        } else if("postgres".equalsIgnoreCase(database)) {
-            dialect = new PostgreSQLDialect();
-        } else
-            throw new IllegalStateException("database type "+database+" currently not supported!");
-        String jdbcUrl = configurationService.getStringConfiguration("database.url");
-        String dbUser  = configurationService.getStringConfiguration("database.user");
-        String dbPass  = configurationService.getStringConfiguration("database.password");
-
-        store = new KiWiStore("lmf", jdbcUrl, dbUser, dbPass, dialect, configurationService.getDefaultContext(), configurationService.getInferredContext());
-
-        tsail = new KiWiTransactionalSail(store);
-
-        log.info("initialising repository plugins ...");
-
-        // wrap all stackable transactional sails
-        TransactionalSail transactionalSail = tsail;
-        for(TransactionalSailProvider provider : transactionalSailProviders) {
-            if(provider.isEnabled()) {
-                log.info("- transaction plugin: {}",provider.getName());
-                transactionalSail = provider.createSail(transactionalSail);
-            } else {
-                log.info("- transaction plugin: {} (DISABLED)", provider.getName());
+            String database = configurationService.getStringConfiguration("database.type");
+            KiWiDialect dialect;
+            if("h2".equalsIgnoreCase(database)) {
+                dialect = new H2Dialect();
+            } else if("mysql".equalsIgnoreCase(database)) {
+                dialect = new MySQLDialect();
+            } else if("postgres".equalsIgnoreCase(database)) {
+                dialect = new PostgreSQLDialect();
+            } else
+                throw new IllegalStateException("database type "+database+" currently not supported!");
+            String jdbcUrl = configurationService.getStringConfiguration("database.url");
+            String dbUser  = configurationService.getStringConfiguration("database.user");
+            String dbPass  = configurationService.getStringConfiguration("database.password");
+            boolean batchCommit = configurationService.getBooleanConfiguration("database.batchcommit", true);
+
+            KiWiConfiguration configuration = new KiWiConfiguration("lmf", jdbcUrl, dbUser, dbPass, dialect, configurationService.getDefaultContext(), configurationService.getInferredContext());
+            configuration.setQueryLoggingEnabled(configurationService.getBooleanConfiguration("database.debug.slowqueries",false));
+            configuration.setBatchCommit(batchCommit);
+            configuration.setBatchSize(configurationService.getIntConfiguration("database.batchsize",10000));
+            configuration.setMemorySequences(configurationService.getBooleanConfiguration("database.memsequences",true));
+
+            store = new KiWiStore(configuration);
+
+            tsail = new KiWiTransactionalSail(store);
+
+            log.info("initialising repository plugins ...");
+
+            // wrap all stackable transactional sails
+            TransactionalSail transactionalSail = tsail;
+            for(TransactionalSailProvider provider : transactionalSailProviders) {
+                if(provider.isEnabled()) {
+                    log.info("- transaction plugin: {}",provider.getName());
+                    transactionalSail = provider.createSail(transactionalSail);
+                } else {
+                    log.info("- transaction plugin: {} (DISABLED)", provider.getName());
+                }
             }
-        }
 
-        // wrap all stackable notifying sails
-        NotifyingSail notifyingSail = transactionalSail;
-        for(NotifyingSailProvider provider : notifyingSailProviders) {
-            if(provider.isEnabled()) {
-                log.info("- notifying plugin: {}",provider.getName());
-                notifyingSail = provider.createSail(notifyingSail);
-            } else {
-                log.info("- notifying plugin: {} (DISABLED)", provider.getName());
+            // wrap all stackable notifying sails
+            NotifyingSail notifyingSail = transactionalSail;
+            for(NotifyingSailProvider provider : notifyingSailProviders) {
+                if(provider.isEnabled()) {
+                    log.info("- notifying plugin: {}",provider.getName());
+                    notifyingSail = provider.createSail(notifyingSail);
+                } else {
+                    log.info("- notifying plugin: {} (DISABLED)", provider.getName());
+                }
             }
-        }
 
-        // wrap all standard sails
-        Sail standardSail = notifyingSail;
-        for(StandardSailProvider provider : standardSailProviders) {
-            if(provider.isEnabled()) {
-                log.info("- standard plugin: {}",provider.getName());
-                standardSail = provider.createSail(standardSail);
-            } else {
-                log.info("- standard plugin: {} (DISABLED)", provider.getName());
+            // wrap all standard sails
+            Sail standardSail = notifyingSail;
+            for(StandardSailProvider provider : standardSailProviders) {
+                if(provider.isEnabled()) {
+                    log.info("- standard plugin: {}",provider.getName());
+                    standardSail = provider.createSail(standardSail);
+                } else {
+                    log.info("- standard plugin: {} (DISABLED)", provider.getName());
+                }
             }
-        }
 
-        // the CDI events should be triggered once all internal events have been handled, so register the transaction listener last
-        tsail.addTransactionListener(new LMFTransactionEventProxy());
+            // the CDI events should be triggered once all internal events have been handled, so register the transaction listener last
+            tsail.addTransactionListener(new LMFTransactionEventProxy());
 
-        repository = new SailRepository(standardSail);
+            repository = new SailRepository(standardSail);
 
-        try {
-            repository.initialize();
-        } catch (RepositoryException e) {
-            log.error("error while initialising Apache Marmotta Sesame repository",e);
+            try {
+                repository.initialize();
+            } catch (RepositoryException e) {
+                log.error("error while initialising Apache Marmotta Sesame repository",e);
+            }
+        } finally {
+            restartLock.writeLock().unlock();
         }
     }
 
@@ -199,14 +217,33 @@ public class SesameServiceImpl implements SesameService {
     @Override
     @PreDestroy
     public synchronized void shutdown() {
-        if(repository != null) {
-            log.info("Apache Marmotta Sesame Repository Service shutting down ...");
-            try {
-                repository.shutDown();
-            } catch (RepositoryException e) {
-                log.error("error while shutting down Apache Marmotta Sesame repository",e);
+        restartLock.writeLock().lock();
+        try {
+            if(repository != null) {
+                log.info("Apache Marmotta Sesame Repository Service shutting down ...");
+                try {
+                    repository.shutDown();
+                } catch (RepositoryException e) {
+                    log.error("error while shutting down Apache Marmotta Sesame repository",e);
+                }
+                repository = null;
             }
-            repository = null;
+        } finally {
+            restartLock.writeLock().unlock();
+        }
+    }
+
+    /**
+     * Restart the Sesame Service.
+     */
+    @Override
+    public void restart() {
+        restartLock.writeLock().lock();
+        try {
+            shutdown();
+            initialise();
+        } finally {
+            restartLock.writeLock().unlock();
         }
     }
 
@@ -245,9 +282,15 @@ public class SesameServiceImpl implements SesameService {
     @Override
     @Produces
     public RepositoryConnection getConnection() throws RepositoryException {
+        restartLock.readLock().lock();
         RepositoryConnection connection = repository.getConnection();
-        // connection.setAutoCommit(false);
-        return connection;
+        return new RepositoryConnectionWrapper(repository,connection) {
+            @Override
+            public void close() throws RepositoryException {
+                super.close();
+                restartLock.readLock().unlock();
+            }
+        };
     }
 
     /**
@@ -261,6 +304,17 @@ public class SesameServiceImpl implements SesameService {
         return repository.getValueFactory();
     }
 
+    /**
+     * Run the triple store garbage collector manually and clean up unreferenced nodes and triples.
+     * @throws SailException
+     */
+    @Override
+    public void garbageCollect() throws SailException {
+        if(store != null) {
+            store.garbageCollect();
+        }
+    }
+
     private class LMFTransactionEventProxy implements TransactionListener {
 
         /**

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/user/UserServiceImpl.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/user/UserServiceImpl.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/user/UserServiceImpl.java
index ace5c2c..6fcd12f 100644
--- a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/user/UserServiceImpl.java
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/user/UserServiceImpl.java
@@ -271,29 +271,32 @@ public class UserServiceImpl implements UserService {
 
                 try {
                     RepositoryConnection conn = sesameService.getConnection();
-
-                    URI webId = conn.getValueFactory().createURI(webId_str);
-
-                    log.info("creating user with webId: {} ", webId.stringValue());
-
-                    if (!login.equals(ANONYMOUS_LOGIN) && !login.equals(ADMIN_LOGIN)) {
-                        MarmottaUser u = FacadingFactory.createFacading(conn).createFacade(webId, MarmottaUser.class);
-                        u.setFirstName(firstName);
-                        u.setLastName(lastName);
-                        u.setNick(login);
-                    }
-
-                    if(login.equals(ANONYMOUS_LOGIN)) {
-                        anonUser = webId;
-                    }
-                    if(login.equals(ADMIN_LOGIN)) {
-                        adminUser = webId;
+                    try {
+                        conn.begin();
+                        URI webId = conn.getValueFactory().createURI(webId_str);
+
+                        log.info("creating user with webId: {} ", webId.stringValue());
+
+                        if (!login.equals(ANONYMOUS_LOGIN) && !login.equals(ADMIN_LOGIN)) {
+                            MarmottaUser u = FacadingFactory.createFacading(conn).createFacade(webId, MarmottaUser.class);
+                            u.setFirstName(firstName);
+                            u.setLastName(lastName);
+                            u.setNick(login);
+                        }
+
+                        if(login.equals(ANONYMOUS_LOGIN)) {
+                            anonUser = webId;
+                        }
+                        if(login.equals(ADMIN_LOGIN)) {
+                            adminUser = webId;
+                        }
+
+                        conn.commit();
+                        
+                        return webId;
+                    } finally {
+                        conn.close();
                     }
-
-                    conn.commit();
-                    conn.close();
-
-                    return webId;
                 } catch(RepositoryException ex) {
                     handleRepositoryException(ex);
                     return null;

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/servlet/MarmottaOptionsFilter.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/servlet/MarmottaOptionsFilter.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/servlet/MarmottaOptionsFilter.java
index e81eb1b..d14209e 100644
--- a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/servlet/MarmottaOptionsFilter.java
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/servlet/MarmottaOptionsFilter.java
@@ -65,7 +65,7 @@ public class MarmottaOptionsFilter implements Filter {
      */
     @Override
     public void init(FilterConfig filterConfig) throws ServletException {
-        ResteasyProviderFactory.getInstance().addExceptionMapper(new OptionsMapper());
+        ResteasyProviderFactory.getInstance().registerProviderInstance(new OptionsMapper());
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/servlet/MarmottaPostStartupFilter.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/servlet/MarmottaPostStartupFilter.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/servlet/MarmottaPostStartupFilter.java
index 6c27bb9..b7095a5 100644
--- a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/servlet/MarmottaPostStartupFilter.java
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/servlet/MarmottaPostStartupFilter.java
@@ -30,10 +30,8 @@ import javax.servlet.ServletRequest;
 import javax.servlet.ServletResponse;
 
 import org.apache.marmotta.platform.core.api.config.ConfigurationService;
-import org.apache.marmotta.platform.core.api.user.UserService;
 import org.apache.marmotta.platform.core.events.SystemStartupEvent;
 import org.apache.marmotta.platform.core.model.module.ModuleConfiguration;
-
 import org.slf4j.Logger;
 
 /**
@@ -50,9 +48,6 @@ public class MarmottaPostStartupFilter implements Filter {
     private ConfigurationService configurationService;
 
     @Inject
-    private UserService userService;
-
-    @Inject
     private ModuleConfiguration moduleConfiguration;
 
     @Inject @Any

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/servlet/MarmottaPreStartupListener.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/servlet/MarmottaPreStartupListener.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/servlet/MarmottaPreStartupListener.java
index 9487a1e..7124578 100644
--- a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/servlet/MarmottaPreStartupListener.java
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/servlet/MarmottaPreStartupListener.java
@@ -17,8 +17,13 @@
  */
 package org.apache.marmotta.platform.core.servlet;
 
+import org.apache.commons.configuration.ConfigurationException;
+import org.apache.commons.configuration.FileConfiguration;
+import org.apache.commons.configuration.PropertiesConfiguration;
 import org.apache.marmotta.platform.core.startup.MarmottaStartupService;
 import org.apache.marmotta.platform.core.util.CDIContext;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import javax.servlet.ServletContextEvent;
 import javax.servlet.ServletContextListener;
@@ -29,6 +34,8 @@ import javax.servlet.ServletContextListener;
  */
 public class MarmottaPreStartupListener implements ServletContextListener {
 
+    private static Logger log = LoggerFactory.getLogger(MarmottaPreStartupListener.class);
+
     private MarmottaStartupService lmfStartupService;
 
     /**
@@ -45,7 +52,19 @@ public class MarmottaPreStartupListener implements ServletContextListener {
             lmfStartupService = CDIContext.getInstance(MarmottaStartupService.class);
         }
 
-        lmfStartupService.startupConfiguration(null,null,sce.getServletContext());
+        // we check for the presence of the configuration.override init parameter; if it exists, we load this
+        // configuration file and pass it as configuration override to the startup
+        PropertiesConfiguration override = null;
+
+        if(sce.getServletContext().getInitParameter("configuration.override") != null) {
+            try {
+                override = new PropertiesConfiguration(sce.getServletContext().getInitParameter("configuration.override"));
+            } catch (ConfigurationException e) {
+                log.warn("could not load configuration override file from {}", sce.getServletContext().getInitParameter("configuration.override"));
+            }
+        }
+
+        lmfStartupService.startupConfiguration(null,override,sce.getServletContext());
 
     }
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/startup/MarmottaStartupService.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/startup/MarmottaStartupService.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/startup/MarmottaStartupService.java
index 612ca3d..f0b4ca5 100644
--- a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/startup/MarmottaStartupService.java
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/startup/MarmottaStartupService.java
@@ -40,7 +40,7 @@ import org.apache.marmotta.platform.core.model.module.ModuleConfiguration;
 import org.apache.marmotta.platform.core.util.CDIContext;
 
 import org.apache.commons.configuration.Configuration;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -250,7 +250,10 @@ public class MarmottaStartupService {
 
             hostStarted = true;
 
+            configurationService.setInitialising(false);
+
             startupEvent.fire(new SystemStartupEvent());
+            
         } finally {
             lock.unlock();
         }
@@ -261,4 +264,12 @@ public class MarmottaStartupService {
         log.info("Apache Marmotta Core shutting down ...");
     }
 
+    public boolean isConfigurationStarted() {
+        return configurationStarted;
+    }
+
+    public boolean isHostStarted() {
+        return hostStarted;
+    }
+    
 }

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/util/WebServiceUtil.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/util/WebServiceUtil.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/util/WebServiceUtil.java
index a484cf9..f39a4b0 100644
--- a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/util/WebServiceUtil.java
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/util/WebServiceUtil.java
@@ -17,7 +17,7 @@
  */
 package org.apache.marmotta.platform.core.util;
 
-import org.apache.commons.lang.exception.ExceptionUtils;
+import org.apache.commons.lang3.exception.ExceptionUtils;
 import org.codehaus.jackson.map.ObjectMapper;
 
 import java.io.IOException;

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/webservices/config/ConfigurationWebService.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/webservices/config/ConfigurationWebService.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/webservices/config/ConfigurationWebService.java
index 464132e..1da3836 100644
--- a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/webservices/config/ConfigurationWebService.java
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/webservices/config/ConfigurationWebService.java
@@ -121,7 +121,7 @@ public class ConfigurationWebService {
         ObjectMapper mapper = new ObjectMapper();
         try {
             //log.info(getContentData(request.getReader()));
-            Map<String,String> values = mapper.readValue(request.getInputStream(), new TypeReference<HashMap<String,String>>(){});
+            Map<String,Object> values = mapper.readValue(request.getInputStream(), new TypeReference<HashMap<String,Object>>(){});
             configurationService.setConfigurations(values);
         } catch (IOException e) {
             return Response.serverError().build();

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/webservices/io/ImportWebService.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/webservices/io/ImportWebService.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/webservices/io/ImportWebService.java
index 26ca893..9b0b36d 100644
--- a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/webservices/io/ImportWebService.java
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/webservices/io/ImportWebService.java
@@ -272,6 +272,7 @@ public class ImportWebService {
     }
 
     protected static class Status {
+    	
         boolean isRunning;
         String status;
         String message;
@@ -307,6 +308,7 @@ public class ImportWebService {
         public void setStatus(String status) {
             this.status = status;
         }
+        
     }
 
 }

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/webservices/prefix/PrefixWebService.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/webservices/prefix/PrefixWebService.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/webservices/prefix/PrefixWebService.java
index 7c94692..740d53d 100644
--- a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/webservices/prefix/PrefixWebService.java
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/webservices/prefix/PrefixWebService.java
@@ -18,12 +18,13 @@
 package org.apache.marmotta.platform.core.webservices.prefix;
 
 import org.apache.marmotta.platform.core.api.prefix.PrefixService;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.slf4j.Logger;
 
 import javax.enterprise.context.ApplicationScoped;
 import javax.inject.Inject;
 import javax.validation.constraints.NotNull;
+import javax.ws.rs.DELETE;
 import javax.ws.rs.GET;
 import javax.ws.rs.POST;
 import javax.ws.rs.Path;
@@ -31,6 +32,7 @@ import javax.ws.rs.PathParam;
 import javax.ws.rs.Produces;
 import javax.ws.rs.QueryParam;
 import javax.ws.rs.core.Response;
+import javax.ws.rs.core.Response.Status;
 
 import java.net.URISyntaxException;
 import java.util.HashMap;
@@ -85,6 +87,22 @@ public class PrefixWebService {
             return Response.status(Response.Status.NOT_FOUND).entity("prefix " + prefix + " mapping not found").build();
         }
     }
+    
+    /**
+     * Removes a prefix
+     * 
+     * @param prefix prefix
+     * @return Response with the result of the operation
+     */
+    @DELETE
+    @Path("/" + PREFIX_PATTERN)
+    public Response deleteMapping(@PathParam("prefix") String prefix) {
+        if (prefixService.remove(prefix)) {
+            return Response.status(Status.NO_CONTENT).build();
+        } else {
+            return Response.status(Response.Status.NOT_FOUND).entity("prefix " + prefix + " mapping not found").build();
+        }
+    }    
 
     /**
      * Add new mapping

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/webservices/resource/InspectionWebService.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/webservices/resource/InspectionWebService.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/webservices/resource/InspectionWebService.java
index 56a0c98..e80a8c3 100644
--- a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/webservices/resource/InspectionWebService.java
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/webservices/resource/InspectionWebService.java
@@ -174,7 +174,7 @@ public class InspectionWebService {
 
     private List<TriplePoJo> buildResultList(RepositoryConnection conn, URI s, URI p, URI o, URI c, long start, int limit) throws RepositoryException {
         List<TriplePoJo> result = new ArrayList<InspectionWebService.TriplePoJo>();
-        RepositoryResult<Statement> triples = conn.getStatements(s,p,o,true,c);
+        RepositoryResult<Statement> triples = c != null ? conn.getStatements(s,p,o,true,c) : conn.getStatements(s,p,o,true);
         // skip until start
         for(int i = 0; i<start && triples.hasNext(); i++) {
             triples.next();

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/webservices/resource/MetaWebService.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/webservices/resource/MetaWebService.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/webservices/resource/MetaWebService.java
index 022fb31..27785c6 100644
--- a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/webservices/resource/MetaWebService.java
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/webservices/resource/MetaWebService.java
@@ -40,8 +40,10 @@ import javax.ws.rs.core.Response;
 import javax.ws.rs.core.Response.Status;
 import javax.ws.rs.core.StreamingOutput;
 
+import org.apache.commons.lang3.StringUtils;
 import org.apache.marmotta.commons.collections.CollectionUtils;
 import org.apache.marmotta.commons.http.ETagGenerator;
+import org.apache.marmotta.commons.http.UriUtil;
 import org.apache.marmotta.commons.sesame.repository.ResourceUtils;
 import org.apache.marmotta.platform.core.api.config.ConfigurationService;
 import org.apache.marmotta.platform.core.api.content.ContentService;
@@ -52,7 +54,6 @@ import org.apache.marmotta.platform.core.api.triplestore.SesameService;
 import org.apache.marmotta.platform.core.services.sesame.KiWiSesameUtil;
 import org.apache.marmotta.platform.core.services.sesame.ResourceSubjectMetadata;
 import org.openrdf.model.Resource;
-import org.openrdf.model.URI;
 import org.openrdf.repository.RepositoryConnection;
 import org.openrdf.repository.RepositoryException;
 import org.openrdf.repository.event.InterceptingRepositoryConnection;
@@ -112,8 +113,14 @@ public class MetaWebService {
      */
     @GET
     @Path(ResourceWebService.MIME_PATTERN)
-    public Response getMetaRemote(@QueryParam("uri") @NotNull String uri, @PathParam("mimetype") String mimetype) throws UnsupportedEncodingException {
-        return getMeta(URLDecoder.decode(uri, "utf-8"), mimetype);
+    public Response getMetaRemote(@QueryParam("uri") String uri, @QueryParam("genid") String genid, @PathParam("mimetype") String mimetype) throws UnsupportedEncodingException {
+    	if (StringUtils.isNotBlank(uri)) {
+    		return getMeta(URLDecoder.decode(uri, "utf-8"), mimetype);
+    	} else if (StringUtils.isNotBlank(genid)) {
+    		return getMeta(URLDecoder.decode(genid, "utf-8"), mimetype);
+    	} else {
+    		return ResourceWebServiceHelper.buildErrorPage(uri, configurationService.getBaseUri(), Status.BAD_REQUEST, "Invalid Request", configurationService, templatingService);
+    	}
     }
 
     /**
@@ -227,9 +234,8 @@ public class MetaWebService {
     /**
      * Delete metadata of local resource with given uuid
      *
-     * @param uuid
-     *            , a unique identifier (must not contain url specific
-     *            characters like /,# etc.)
+     * @param uuid a unique identifier (must not contain url specific
+     *             characters like /,# etc.)
      * @return HTTP response (success or error)
      * @HTTP 200 resource content deleted
      * @HTTP 404 resource or resource metadata not found
@@ -241,19 +247,24 @@ public class MetaWebService {
         return deleteMetaRemote(uri);
     }
 
-    private Response getMeta(String uri, String mimetype) throws UnsupportedEncodingException {
+    private Response getMeta(String resource, String mimetype) throws UnsupportedEncodingException {
         try {
             RepositoryConnection conn = sesameService.getConnection();
-            
-            if (!ResourceUtils.existsResource(conn, uri)) {
-            	return ResourceWebServiceHelper.buildErrorPage(uri, configurationService.getBaseUri(), Response.Status.NOT_FOUND, "the requested resource could not be found in LMF right now, but may be available again in the future", configurationService, templatingService);
-            }
 
             try {
                 conn.begin();
-                // FIXME String appendix = uuid == null ? "?uri=" + URLEncoder.encode(uri, "utf-8") :
-                // "/" + uuid;
-                URI resource = conn.getValueFactory().createURI(uri);
+                
+                Resource r = null;
+            	if (UriUtil.validate(resource)) {
+                    r = ResourceUtils.getUriResource(conn, resource);
+            	} else {
+            		r = ResourceUtils.getAnonResource(conn, resource);
+            	}
+            	
+                if (r == null || !ResourceUtils.isUsed(conn, r)) {
+                	return ResourceWebServiceHelper.buildErrorPage(resource, configurationService.getBaseUri(), Response.Status.NOT_FOUND, "the requested resource could not be found in LMF right now, but may be available again in the future", configurationService, templatingService);
+                }
+            	
                 // create parser
                 final RDFFormat serializer = kiWiIOService.getSerializer(mimetype);
                 if (serializer == null) {
@@ -262,9 +273,9 @@ public class MetaWebService {
                     return response;
                 }
 
-                if(resource != null) {
+                if(r != null) {
 
-                    final Resource subject = resource;
+                    final Resource subject = r;
 
                     StreamingOutput entity = new StreamingOutput() {
                         @Override
@@ -290,15 +301,15 @@ public class MetaWebService {
                     };
 
                     // build response
-                    Response response = Response.ok(entity).lastModified(KiWiSesameUtil.lastModified(resource, conn)).build();
-                    response.getMetadata().add("ETag", "W/\"" + ETagGenerator.getWeakETag(conn, resource) + "\"");
+                    Response response = Response.ok(entity).lastModified(KiWiSesameUtil.lastModified(r, conn)).build();
+                    response.getMetadata().add("ETag", "W/\"" + ETagGenerator.getWeakETag(conn, r) + "\"");
                     
                     if (!mimetype.contains("html")) { // then create a proper filename
 	                    String[] components;
-	                    if (uri.contains("#")) {
-	                    	components = uri.split("#");	                    	
+	                    if (resource.contains("#")) {
+	                    	components = resource.split("#");	                    	
 	                    } else {
-	                    	components = uri.split("/");
+	                    	components = resource.split("/");
 	                    }
 	                    final String fileName = components[components.length-1] + "." + serializer.getDefaultFileExtension();   
 	                    response.getMetadata().add("Content-Disposition", "attachment; filename=\""+fileName+"\"");
@@ -315,7 +326,7 @@ public class MetaWebService {
                     List<String> links = new LinkedList<String>();
 
                     // build the link to the human readable content of this resource (if it exists)
-                    String contentLink = ResourceWebServiceHelper.buildContentLink(resource, contentService.getContentType(resource), configurationService);
+                    String contentLink = ResourceWebServiceHelper.buildContentLink(r, contentService.getContentType(r), configurationService);
                     if(!"".equals(contentLink)) {
                         links.add(contentLink);
                     }
@@ -325,7 +336,7 @@ public class MetaWebService {
                     }
                     return response;
                 } else {
-                    return Response.status(Response.Status.NOT_FOUND).entity("resource with URI "+uri+" does not exist").build();
+                    return Response.status(Response.Status.NOT_FOUND).entity("resource with URI "+resource+" does not exist").build();
                 }
             } finally {
                 if (conn.isOpen()) {
@@ -334,7 +345,7 @@ public class MetaWebService {
                 }
             }
         } catch (RepositoryException e) {
-            return ResourceWebServiceHelper.buildErrorPage(uri, configurationService.getBaseUri(), Status.INTERNAL_SERVER_ERROR, e.getMessage(), configurationService, templatingService);
+            return ResourceWebServiceHelper.buildErrorPage(resource, configurationService.getBaseUri(), Status.INTERNAL_SERVER_ERROR, e.getMessage(), configurationService, templatingService);
         }
     }
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/webservices/resource/ResourceWebService.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/webservices/resource/ResourceWebService.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/webservices/resource/ResourceWebService.java
index 1ad5512..f2e76eb 100644
--- a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/webservices/resource/ResourceWebService.java
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/webservices/resource/ResourceWebService.java
@@ -43,10 +43,11 @@ import javax.ws.rs.core.Response;
 import javax.ws.rs.core.Response.ResponseBuilder;
 import javax.ws.rs.core.Response.Status;
 
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.apache.marmotta.commons.http.ContentType;
 import org.apache.marmotta.commons.http.ETagGenerator;
 import org.apache.marmotta.commons.http.LMFHttpUtils;
+import org.apache.marmotta.commons.http.UriUtil;
 import org.apache.marmotta.commons.sesame.repository.ResourceUtils;
 import org.apache.marmotta.platform.core.api.config.ConfigurationService;
 import org.apache.marmotta.platform.core.api.content.ContentService;
@@ -336,37 +337,55 @@ public class ResourceWebService {
      *                 (content and meta)
      */
     @GET
-    public Response getRemote(@QueryParam("uri") String uri, @QueryParam("format") String format, @HeaderParam("Accept") String types)
+    public Response getRemote(@QueryParam("uri") String uri, @QueryParam("genid") String genid, @QueryParam("format") String format, @HeaderParam("Accept") String types)
             throws UnsupportedEncodingException {
         try {
-            if (uri != null) {
+            if (StringUtils.isNotBlank(uri)) {
                 if (format != null && StringUtils.isNotBlank(format)) {
                     types = format;
                 }
                 //TODO: add 'If-None-Match' support, sending a '304 Not Modified' when the ETag matches
                 return get(uri, types);
-            } else
-                return Response.status(400).entity("uri may not be null").build();
+            } else if (StringUtils.isNotBlank(genid)) {
+                if (format != null && StringUtils.isNotBlank(format)) {
+                    types = format;
+                }
+                //TODO: add 'If-None-Match' support, sending a '304 Not Modified' when the ETag matches
+                return get(genid, types);
+            } else {
+                return Response.status(400).entity("resource not identified").build();
+            }
         } catch (URISyntaxException e) {
             return Response.serverError().entity(e.getMessage()).build();
         }
     }
 
-    private Response get(String uri, String types) throws URISyntaxException, UnsupportedEncodingException {
+    private Response get(String resource, String types) throws URISyntaxException, UnsupportedEncodingException {
         try {
 
             RepositoryConnection conn = sesameService.getConnection();
             try {
                 conn.begin();
-                URI resource;
-                try {
-                	resource = ResourceUtils.getUriResource(conn, uri);
-                } catch (Exception e) {
-                	log.error("Error retrieving the URI <{}>: {}", uri, e.getMessage());
-                	log.debug("So redirecting directly to it...");
-                	return Response.seeOther(new java.net.URI(uri)).build();
-                }
-                if (resource == null) return ResourceWebServiceHelper.buildErrorPage(uri, configurationService.getBaseUri(), Response.Status.NOT_FOUND, "the requested resource could not be found in LMF right now, but may be available again in the future", configurationService, templatingService);
+                Resource r = null;
+            	if (UriUtil.validate(resource)) {
+                    try {
+                    	if(ResourceUtils.isSubject(conn, resource)) {  //tests if a resource is used as subject
+                            r = ResourceUtils.getUriResource(conn, resource);
+                        }
+                    } catch (Exception e) {
+                    	log.error("Error retrieving the resource <{}>: {}", resource, e.getMessage());
+                    	log.debug("So redirecting directly to it...");
+                    	return Response.seeOther(new java.net.URI(resource)).build();
+                    }
+            	} else {
+            		try {
+            			r = ResourceUtils.getAnonResource(conn, resource);
+	                } catch (Exception e) {
+	                	log.error("Error retrieving the blank node <{}>: {}", resource, e.getMessage());
+	                	return Response.status(Status.NOT_FOUND).entity("blank node id "  + resource + " not found").build();
+	                }
+            	}
+                if (r == null) return ResourceWebServiceHelper.buildErrorPage(resource, configurationService.getBaseUri(), Response.Status.NOT_FOUND, "the requested resource could not be found in LMF right now, but may be available again in the future", configurationService, templatingService);
                 // FIXME String appendix = uuid == null ? "?uri=" + URLEncoder.encode(uri, "utf-8") :
                 // "/" + uuid;
 
@@ -374,7 +393,7 @@ public class ResourceWebService {
                 for(ContentType t : offeredTypes) {
                 	t.setParameter("rel", "meta");
                 }
-                String contentmime = contentService.getContentType(resource);
+                String contentmime = contentService.getContentType(r);
                 if(contentmime != null) {
                 	ContentType tContent = LMFHttpUtils.parseContentType(contentmime);
                 	tContent.setParameter("rel", "content");
@@ -391,9 +410,9 @@ public class ResourceWebService {
                 log.debug("identified best type: {}",bestType);
 
                 if(bestType != null) {
-                    Response response = buildGetResponse(resource, bestType);
-                    response.getMetadata().add("Last-Modified", KiWiSesameUtil.lastModified(resource, conn));
-                    response.getMetadata().add("ETag", "W/\"" + ETagGenerator.getWeakETag(conn, resource) + "\"");
+                    Response response = buildGetResponse(r, bestType);
+                    response.getMetadata().add("Last-Modified", KiWiSesameUtil.lastModified(r, conn));
+                    response.getMetadata().add("ETag", "W/\"" + ETagGenerator.getWeakETag(conn, r) + "\"");
                     return response;
                 } else {
                     return build406(acceptedTypes, offeredTypes);
@@ -608,7 +627,7 @@ public class ResourceWebService {
         return deleteResourceRemote(uri);
     }
 
-    private Response buildGetResponse(URI resource, ContentType type) {
+    private Response buildGetResponse(Resource resource, ContentType type) {
         try {
 
             return Response

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/webservices/resource/ResourceWebServiceHelper.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/webservices/resource/ResourceWebServiceHelper.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/webservices/resource/ResourceWebServiceHelper.java
index 1dd21cf..15abd70 100644
--- a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/webservices/resource/ResourceWebServiceHelper.java
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/webservices/resource/ResourceWebServiceHelper.java
@@ -20,10 +20,12 @@ package org.apache.marmotta.platform.core.webservices.resource;
 import org.apache.marmotta.platform.core.api.config.ConfigurationService;
 import org.apache.marmotta.platform.core.api.templating.TemplatingService;
 import org.apache.marmotta.commons.http.ContentType;
+import org.openrdf.model.Resource;
 import org.openrdf.model.URI;
 
 import javax.ws.rs.core.Response;
 import javax.ws.rs.core.Response.Status;
+
 import java.io.UnsupportedEncodingException;
 import java.net.URLEncoder;
 import java.util.HashMap;
@@ -78,7 +80,7 @@ public class ResourceWebServiceHelper {
         return buildContentLink(resource, mime, configurationService);
     }
 
-    public static String buildContentLink(URI resource, String mime, ConfigurationService configurationService) {
+    public static String buildContentLink(Resource resource, String mime, ConfigurationService configurationService) {
         //TODO: test if there is content
         StringBuffer b = new StringBuffer();
         if (mime != null) {
@@ -124,25 +126,23 @@ public class ResourceWebServiceHelper {
                 cType.getMime(), configurationService);
     }
 
-    public static String buildResourceLink(URI resource, String rel, String mime, ConfigurationService configurationService) {
-        final String src = configurationService.getServerUri(), base = configurationService
-                .getBaseUri();
-
-        if (src.equals(base)
-                && resource.stringValue().startsWith(base + ConfigurationService.RESOURCE_PATH + "/")) {
+    public static String buildResourceLink(Resource resource, String rel, String mime, ConfigurationService configurationService) {
+        final String src = configurationService.getServerUri();
+        final String base = configurationService.getBaseUri();
+        if (src.equals(base) && resource.stringValue().startsWith(base + ConfigurationService.RESOURCE_PATH + "/")) {
             final String uuid;
-            uuid = resource.stringValue().substring(
-                    (base + "resource/").length());
+            uuid = resource.stringValue().substring((base + "resource/").length());
             return String.format("%s%s/%s/%s", base, rel, mime, uuid);
-
         } else {
-            try {
-                return String.format("%s%s/%s?uri=%s", src, rel, mime,
-                        URLEncoder.encode(resource.stringValue(), ResourceWebService.CHARSET));
-            } catch (UnsupportedEncodingException e) {
-                return String.format("%s%s/%s?uri=%s", src, rel, mime,
-                        resource.stringValue());
-            }
+	    	if (resource instanceof URI) {
+	            try {  
+	                return String.format("%s%s/%s?uri=%s", src, rel, mime, URLEncoder.encode(resource.stringValue(), ResourceWebService.CHARSET));
+	            } catch (UnsupportedEncodingException e) {
+	                return String.format("%s%s/%s?uri=%s", src, rel, mime, resource.stringValue());
+	            }                    
+	    	} else {
+	    		return String.format("%s%s/%s?genid=%s", src, rel, mime, resource.stringValue());
+	    	}      
         }
     }
     

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/webservices/system/SystemWebService.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/webservices/system/SystemWebService.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/webservices/system/SystemWebService.java
index c5c51ce..7c0dd35 100644
--- a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/webservices/system/SystemWebService.java
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/webservices/system/SystemWebService.java
@@ -19,6 +19,7 @@ package org.apache.marmotta.platform.core.webservices.system;
 
 import org.apache.marmotta.platform.core.api.config.ConfigurationService;
 import org.apache.marmotta.platform.core.api.triplestore.SesameService;
+import org.apache.marmotta.platform.core.jaxrs.ErrorResponse;
 import org.slf4j.Logger;
 
 import javax.enterprise.context.ApplicationScoped;
@@ -66,11 +67,33 @@ public class SystemWebService {
             return Response.ok().entity("database reinitialised successfully").build();
         } catch(Exception ex) {
             log.error("Error while reinitalising database ...",ex);
-            return Response.status(500).entity("error while reinitialising database").build();
+            return ErrorResponse.errorResponse(Response.Status.INTERNAL_SERVER_ERROR, ex);
         }
     }
 
-	@POST
+    /**
+     * Manually trigger the garbage collector.
+     *
+     * @return ok if successful, 500 if not
+     * @HTTP 200 if garbage collection completed successfully
+     * @HTTP 500 if there was an error while running garbage collection (see log)
+     */
+    @POST
+    @Path("/database/gc")
+    public Response garbageCollector() {
+        log.info("Running triple store garbage collection after admin user request ...");
+        try {
+            sesameService.garbageCollect();
+
+            return Response.ok().entity("garbage collection completed successfully").build();
+        } catch(Exception ex) {
+            log.error("Error while running garbage collection ...",ex);
+            return ErrorResponse.errorResponse(Response.Status.INTERNAL_SERVER_ERROR, ex);
+        }
+    }
+
+
+    @POST
     @Path("/database/ping")
 	public Response pingDatabase(@QueryParam("type")String type,@QueryParam("url")String url,@QueryParam("user")String user,@QueryParam("pwd")String pwd) {
 		if(type==null||url==null||user==null||pwd==null) {
@@ -80,12 +103,12 @@ public class SystemWebService {
 		//get driver
 		String db_driver = configurationService.getStringConfiguration("database."+type+".driver");
 		if(db_driver==null) {
-			return Response.serverError().entity("driver for "+type+" not defined").build();
+			return ErrorResponse.errorResponse(Response.Status.INTERNAL_SERVER_ERROR,"driver for "+type+" not defined");
 		}
 
 		//try if type matches url
 		if(!url.startsWith("jdbc:"+type)) {
-			return Response.serverError().entity("database and url do not match properly").build();
+			return ErrorResponse.errorResponse(Response.Status.INTERNAL_SERVER_ERROR,"database and url do not match properly");
 		}
 
 		//try to connect
@@ -95,9 +118,9 @@ public class SystemWebService {
 			conn.close();
 			return Response.ok().build();
 		} catch (ClassNotFoundException e) {
-			return Response.serverError().entity("Can't load driver " + e).build();
+			return ErrorResponse.errorResponse(Response.Status.INTERNAL_SERVER_ERROR,"Can't load driver ",e);
 		} catch (SQLException e) {
-      		return Response.serverError().entity("Database access failed " + e).build();
+      		return ErrorResponse.errorResponse(Response.Status.INTERNAL_SERVER_ERROR,"Database access failed ",e);
     	}
 	}
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/webservices/triplestore/ContextWebService.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/webservices/triplestore/ContextWebService.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/webservices/triplestore/ContextWebService.java
index 7957ade..9e7e413 100644
--- a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/webservices/triplestore/ContextWebService.java
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/webservices/triplestore/ContextWebService.java
@@ -44,7 +44,7 @@ import javax.ws.rs.core.Context;
 import javax.ws.rs.core.Response;
 import javax.ws.rs.core.Response.Status;
 
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.apache.marmotta.commons.http.ContentType;
 import org.apache.marmotta.commons.http.LMFHttpUtils;
 import org.apache.marmotta.platform.core.api.config.ConfigurationService;

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/platform/marmotta-core/src/main/resources/META-INF/NOTICE
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/resources/META-INF/NOTICE b/platform/marmotta-core/src/main/resources/META-INF/NOTICE
index a49305c..8a7975e 100644
--- a/platform/marmotta-core/src/main/resources/META-INF/NOTICE
+++ b/platform/marmotta-core/src/main/resources/META-INF/NOTICE
@@ -6,25 +6,8 @@ The Apache Software Foundation (http://www.apache.org/).
 
 Apache Marmotta, Copyright 2012-2013 The Apache Software Foundation
 
-This product also includes the following third-party components:
+Portions of this software were originally based on the following:
 
-* D3.js, http://d3js.org
-
-  Copyright (c) 2013 Michael Bostock
-
-* Dracula Graph Library, http://www.graphdracula.net
-
-  Copyright (c) 2013 Johann Philipp Strathausen
-
-* strftime, http://hacks.bluesmoon.info/strftime
-
-  Copyright (c) 2008 Philip S Tellis
-
-* jQuery, http://jquery.com
-
-  Copyright (c) 2013 jQuery Foundation
-
-* Sgvizler, http://sgvizler.googlecode.com
-
-  Copyright (c) 2011 Martin G. Skjæveland
+    Copyright 2008-2012 Salzburg Research Forschungsgesellschaft mbH
 
+These have been licensed to the Apache Software Foundation under a software grant.

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/platform/marmotta-core/src/main/resources/config-defaults.properties
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/resources/config-defaults.properties b/platform/marmotta-core/src/main/resources/config-defaults.properties
index 6a5dcc8..16caabb 100644
--- a/platform/marmotta-core/src/main/resources/config-defaults.properties
+++ b/platform/marmotta-core/src/main/resources/config-defaults.properties
@@ -158,6 +158,21 @@ database.password =
 # the database mode (create, update or validate)
 database.mode =
 
+# report slow queries in the log (not thread safe)
+database.debug.slowqueries = false
+
+
+# turn on batch commits for database transactions (EXPERIMENTAL); if supported by the database backend, this can
+# lead to considerable performance improvements
+database.batchcommit = true
+
+# the maximum size of a batch before it is committed to the database; only applicable if batchcommit is enabled
+database.batchsize = 10000
+
+# turn on in-memory sequences (EXPERIMENTAL); if enabled, sequences are pre-loaded once and then updated in memory
+# and only written back if a transaction commits
+database.memsequences = true
+
 # Hibernate-specific configuration for H2
 database.h2.driver = org.h2.Driver
 database.h2.url = jdbc:h2:/tmp/kiwi/db/kiwi;MVCC=true;DB_CLOSE_ON_EXIT=FALSE;DB_CLOSE_DELAY=10

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/platform/marmotta-core/src/main/resources/config-descriptions.properties
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/resources/config-descriptions.properties b/platform/marmotta-core/src/main/resources/config-descriptions.properties
index 913ba5b..f0c80c7 100644
--- a/platform/marmotta-core/src/main/resources/config-descriptions.properties
+++ b/platform/marmotta-core/src/main/resources/config-descriptions.properties
@@ -162,6 +162,20 @@ database.password.type = java.lang.String("password")
 database.mode.description = the database mode (create, update, validate or off)
 database.mode.type = java.lang.Enum("create"|"update"|"validate"|"off")
 
+database.debug.slowqueries.description = enable reporting of slow database queries (produces additional overhead and is not thread safe)
+database.debug.slowqueries.type = java.lang.Boolean
+
+database.batchcommit.description = turn on batch commits for database transactions (EXPERIMENTAL); if supported by the \
+  database backend, this can lead to considerable performance improvements
+database.batchcommit.type = java.lang.Boolean
+
+database.batchsize.description = the maximum size of a batch before it is committed to the database; only applicable if \
+  batchcommit is enabled
+database.batchsize.type = java.lang.Integer(10|0|*)
+
+database.memsequences.description = turn on in-memory sequences (EXPERIMENTAL); if enabled, sequences are pre-loaded \
+  once and then updated in memory and only written back if a transaction commits
+database.memsequences.type = java.lang.Boolean
 
 
 ###############################################################################

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/platform/marmotta-core/src/main/resources/kiwi-module.properties
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/resources/kiwi-module.properties b/platform/marmotta-core/src/main/resources/kiwi-module.properties
index 30703e7..37692bb 100644
--- a/platform/marmotta-core/src/main/resources/kiwi-module.properties
+++ b/platform/marmotta-core/src/main/resources/kiwi-module.properties
@@ -18,6 +18,9 @@
 
 name=Core Services
 
+container=Generic
+container.weight = 10
+
 subtitle = Configure LMF Core
 weight = 10
 
@@ -26,16 +29,35 @@ icon_small = /admin/img/config_small.png
 #do not change!!!
 baseurl=/core
 
-adminpages=/admin/about.html,\
-  /admin/configuration.html,\
-  /admin/tasks.html,\
-  /admin/import.html,\
-  /admin/export.html,\
-  /admin/dataview.html,\
-  /admin/contexts.html,\
-  /admin/prefixes.html,\
-  /admin/system.html,\
-  /admin/database.html,
+adminpage.0.title=About
+adminpage.0.link=/admin/about.html
+
+adminpage.1.title=Configuration
+adminpage.1.link=/admin/configuration.html
+
+adminpage.2.title=Tasks
+adminpage.2.link=/admin/tasks.html
+
+adminpage.3.title=Import
+adminpage.3.link=/admin/import.html
+
+adminpage.4.title=Export
+adminpage.4.link=/admin/export.html
+
+adminpage.5.title=Data Views
+adminpage.5.link=/admin/dataview.html
+
+adminpage.6.title=Context Manager
+adminpage.6.link=/admin/contexts.html
+
+adminpage.7.title=Prefix Manager
+adminpage.7.link=/admin/prefixes.html
+
+adminpage.8.title=System
+adminpage.8.link=/admin/system.html
+
+adminpage.9.title=Database
+adminpage.9.link=/admin/database.html
 
 webservices=org.apache.marmotta.platform.core.webservices.config.ConfigurationWebService,\
   org.apache.marmotta.platform.core.webservices.config.DependenciesWebService,\

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/platform/marmotta-core/src/main/resources/templates/404.ftl
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/resources/templates/404.ftl b/platform/marmotta-core/src/main/resources/templates/404.ftl
index 7303e60..6cc4715 100644
--- a/platform/marmotta-core/src/main/resources/templates/404.ftl
+++ b/platform/marmotta-core/src/main/resources/templates/404.ftl
@@ -25,7 +25,7 @@
   <head>
     <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
     <title>404 Not Found - Marmotta Linked Data Explorer</title>
-    <script src="${SERVER_URL}core/public/js/lib/jquery-1.7.2.js" type="text/javascript" ></script>
+    <script src="${SERVER_URL}webjars/jquery/1.8.2/jquery.min.js" type="text/javascript" ></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" />
     <link href="${SERVER_URL}${DEFAULT_STYLE}404.css" rel="stylesheet" type="text/css" />

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/platform/marmotta-core/src/main/resources/templates/admin.ftl
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/resources/templates/admin.ftl b/platform/marmotta-core/src/main/resources/templates/admin.ftl
index 7d8d7a1..90173ff 100644
--- a/platform/marmotta-core/src/main/resources/templates/admin.ftl
+++ b/platform/marmotta-core/src/main/resources/templates/admin.ftl
@@ -47,7 +47,62 @@
     </#if>
 
     ${HEAD}
+    <style type="text/css">
+        div.menu_heading {
+            color: white;
+            font-weight: bold;
+        }
+        ul.center_submenu {
+            margin:0;
+            padding:0;
+        }
+        ul.center_submenu li {
+            list-style: none;
+            display: list-item;
+            float: left;
+            padding: 5px;
+            margin-right: 4px;
+        }
+        ul.center_submenu li.active {
+            border-top-left-radius: 3px;
+            border-top-right-radius: 3px;
+            background-color: white;
+            border-left: 1px solid #ccc;
+            border-right: 1px solid #ccc;
+            border-top: 1px solid #ccc;
+        }
+        ul.center_submenu a {
+            text-decoration: underline;
+            font-weight: bold;
+            color: #0B61A4;
+        }
 
+        ul.center_submenu li.active a {
+            text-decoration: none;
+        }
+        #content {
+            border-top-left-radius: 0;
+            border-top-right-radius: 3px;
+            border-bottom-right-radius: 3px;
+            border-bottom-left-radius: 3px;
+            border-left: 1px solid #ccc;
+        }
+        #login_logout {
+            float: right;
+            margin-right: 5px;
+            margin-top: -3px;
+            border: 1px solid #aaa;
+            padding: 4px 10px 2px;
+            background-color: white;
+            border-radius: 3px;
+            -webkit-border-radius: 3px;
+            box-shadow: 0px 0px 8px #555;
+        }
+        #login_logout a {
+            color: #0B61A4;
+            font-weight: bold;
+        }
+    </style>
 </head>
 
 <body>
@@ -57,7 +112,6 @@
         <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>
@@ -65,29 +119,49 @@
     <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>
+        <#list MENU["items"] as menu>
+            <li class="menu_item">
+                <div class="menu_heading">${menu.label}</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>
+                    <#list menu["items"] as submenu>
+                        <li
+                            <#if submenu["isActive"]> class="menu_item active" </#if>
+                                >
+                            <#if submenu["items"]?has_content>
+                            <a href="${SERVER_URL}${submenu["items"][0]["path"]?substring(1)}">
+                            <#else>
+                            <a href="${SERVER_URL}doc/rest/index.html">
+                            </#if>
+                            <!-- <i class="${submenu["icon"]}"></i>  <!-- TODO icon -->
+                            <span>${submenu["label"]}</span>
+                        </a>
+                        </li>
+                    </#list>
                 </ul>
             </li>
-            </#list>
+        </#list>
+
         </ul>
     </div>
     <div id="center">
+        <ul class="center_submenu">
+        <#list MENU["items"] as menu>
+            <#if menu["isActive"]>
+                <#list menu["items"] as submenu>
+                    <#if submenu["isActive"]>
+                        <#list submenu["items"] as pages>
+                            <li
+                                <#if pages["isActive"]> class="active" </#if>
+                                    >
+                                <a href="${SERVER_URL}${pages["path"]?substring(1)}">${pages["label"]}</a>
+                            </li>
+                        </#list>
+                    </#if>
+                </#list>
+            </#if>
+        </#list>
+        </ul>
+        <div class="clear"></div>
         <div id="content">
         ${CONTENT}
         </div>

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/platform/marmotta-core/src/main/resources/templates/rdfhtml.ftl
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/resources/templates/rdfhtml.ftl b/platform/marmotta-core/src/main/resources/templates/rdfhtml.ftl
index 1327e5b..45d8e5d 100644
--- a/platform/marmotta-core/src/main/resources/templates/rdfhtml.ftl
+++ b/platform/marmotta-core/src/main/resources/templates/rdfhtml.ftl
@@ -24,10 +24,25 @@
   <title>Resource/s in HTML</title>
   <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
   <meta http-equiv="Default-Style" content="${DEFAULT_STYLE}">
-  <script type="text/javascript" src="${SERVER_URL}core/public/js/lib/jquery-1.7.2.js"></script>
+  <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>
+  <#if resources[0].uri?has_content>
+  <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" /> 
+  <#else>
+  <link rel="alternate" type="application/rdf+xml" href="${SERVER_URL}resource?genid=${resources[0].encoded_genid}&amp;format=application/rdf%2Bxml" /> 
+  <link rel="alternate" type="text/rdf+n3" href="${SERVER_URL}resource?genid=${resources[0].encoded_genid}&amp;format=text/rdf%2Bn3" /> 
+  <link rel="alternate" type="text/turtle" href="${SERVER_URL}resource?genid=${resources[0].encoded_genid}&amp;format=text/turtle" /> 
+  <link rel="alternate" type="application/rdf+json" href="${SERVER_URL}resource?genid=${resources[0].encoded_genid}&amp;format=application/rdf%2Bjson" /> 
+  <link rel="alternate" type="application/ld+json" href="${SERVER_URL}resource?genid=${resources[0].encoded_genid}&amp;format=application/ld%2Bjson" />   
+  </#if>
+  </#if>
+      
   <script>
       $(document).ready(function(){
           $(".submenu li").click(function(event){
@@ -110,7 +125,7 @@
               };
           }
 
-      <#if resources?size = 1>
+      <#if resources?size = 1 && resources[0].uri?has_content>
           var subjLoader = new loader("${resources[0].uri}", "subject", "inspect_subject");
           subjLoader.fetch();
           $("#s0").click(function() {subjLoader.first();});
@@ -175,11 +190,19 @@
         <h1>RDF/HTML</h1>
         <#if resources?size = 1>
         <div id="top_serialisation_links">
+          <#if resources[0].uri?has_content>
             <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>
+          <#else>
+            <a href="${SERVER_URL}resource?genid=${resources[0].encoded_genid}&amp;format=application/rdf%2Bxml">RDF/XML</a>&nbsp;|&nbsp;
+            <a href="${SERVER_URL}resource?genid=${resources[0].encoded_genid}&amp;format=text/rdf%2Bn3">N3</a>&nbsp;|&nbsp;
+            <a href="${SERVER_URL}resource?genid=${resources[0].encoded_genid}&amp;format=text/turtle">Turtle</a>&nbsp;|&nbsp;
+            <a href="${SERVER_URL}resource?genid=${resources[0].encoded_genid}&amp;format=application/rdf%2Bjson">RDF/JSON</a>&nbsp;|&nbsp;
+            <a href="${SERVER_URL}resource?genid=${resources[0].encoded_genid}&amp;format=application/ld%2Bjson">JSON-LD</a>          
+          </#if>
         </div>
         <div class="clean"></div>
         </#if>
@@ -205,12 +228,17 @@
             <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>
+                	<#if resource.uri?has_content>
+                		<a href="${resource.uri}" class="ldcache">${resource.uri}</a>
+                	<#else>
+                		<a href="${SERVER_URL}resource?genid=${resource.encoded_genid}">bnode://${resource.genid}</a>
+                    </#if>                		
+                    <#if timemaplink?? && resource.uri?has_content>
+                        <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">
@@ -221,10 +249,18 @@
                         </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>
+                                    <a href="${triple.predicate.uri}" class="ldcache">${triple.predicate.curie}</a>
+                                </td>
+                                <#if resource.uri?has_content>
                                 <td about="${resource.uri}">
+                                <#else>
+                                <td>
+                                </#if>
                                     <#if triple.object.uri?has_content>
-                                        <a rel="${triple.predicate.curie}" href="${triple.object.uri}" class="${cacheClass(triple.object)}">${triple.object.curie}</a>
+                                    	<a rel="${triple.predicate.curie}" href="${triple.object.uri}" class="${cacheClass(triple.object)}">${triple.object.curie}</a>
+                                    <#elseif triple.object.genid?has_content>	
+                                        <a rel="${triple.predicate.curie}" href="${SERVER_URL}resource?genid=${triple.object.encoded_genid}">${triple.object.genid}</a>
                                     <#else>
                                         <span property="${triple.predicate.curie}" ${rdfaAttributes(triple.object)}>${triple.object.value}</span>
                                     </#if>
@@ -234,7 +270,7 @@
                             </tr>
                         </#list>
                     </table>
-                    <#if resources?size != 1>
+                    <#if resources?size != 1 && resource.uri?has_content>
                     <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>,
@@ -253,7 +289,7 @@
 
             </div>
 
-        <#if resources?size = 1>
+        <#if resources?size = 1 && resources[0].uri?has_content>
             <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">

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/platform/marmotta-core/src/main/resources/web/admin/about.html
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/resources/web/admin/about.html b/platform/marmotta-core/src/main/resources/web/admin/about.html
index 743a39e..706bfda 100644
--- a/platform/marmotta-core/src/main/resources/web/admin/about.html
+++ b/platform/marmotta-core/src/main/resources/web/admin/about.html
@@ -37,7 +37,7 @@
 <p>You can find all installed features on the module list on the right side. To get a quick access to common functionalities, we listed some links:</p>
 <ul>
     <li><a href="import.html">Import your data:</a> RDF and non-RDF formats are supported.</li>
-    <li><a href="../../sparql/admin/snorql/snorql.html">SPARQL your data:</a> full SPARQL 1.1 support including querying and updates.</li>
+    <li><a href="../../sparql/admin/snorql.html">SPARQL your data:</a> full SPARQL 1.1 support including querying and updates.</li>
     <li><a href="configuration.html">Configure your database:</a> Marmotta comes with h2 embedded; configure your own database to handle bigger data.</li>
     <li><a href="dataview.html">Control your data:</a> the dataview gives an overview on the current data in the system. (Attention: there might be problems with the visualisation if big data sets).</li>
     <li><a href="../../user/admin/users.html">Manage your user accounts:</a> the user module allows creating and managing user accounts.</li>
@@ -47,14 +47,14 @@
 <h2>Marmotta Modules</h2>
 <p>Apache Marmotta provides some modules:</p>
 <dl>
-    <dt>Core</dt> <dd>provides the core RDF and Linked Data Platform capabilities.</dd>
-    <dt>SPARQL</dt> <dd>offers query capabilities for the triplestore.</dd>
-    <dt>LDPath Querying</dt> <dd>provides support for LDPath within the platform.</dd>
-    <dt>Linked Data Caching</dt> <dd>provides transparent mechanism to cache Web resources.</dd>
-    <dt>Reasoner</dt> <dd>adds a rule-based reasoner to the triple store.</dd>
-    <dt>Security</dt> <dd>implements security mechanism.</dd>
-    <dt>User</dt> <dd>provides the user management features.</dd>
-    <dt>Versioning</dt> <dd>offers versioning services on top of the triple store.</dd>
+    <dt><a href="../../core/admin/about.html">Core</a></dt> <dd>provides the core RDF and Linked Data Platform capabilities.</dd>
+    <dt><a href="../../sparql/admin/about.html">SPARQL</a></dt> <dd>offers query capabilities for the triplestore.</dd>
+    <dt><a href="../../ldpath/admin/about.html">LDPath Querying</a></dt> <dd>provides support for LDPath within the platform.</dd>
+    <dt><a href="../../cache/admin/about.html">Linked Data Caching</a></dt> <dd>provides transparent mechanism to cache Web resources.</dd>
+    <dt><a href="../../reasoner/admin/about.html">Reasoner</a></dt> <dd>adds a rule-based reasoner to the triple store.</dd>
+    <dt><a href="../../security/admin/about.html">Security</a></dt> <dd>implements security mechanism.</dd>
+    <dt><a href="../../user/me.html">User</a></dt> <dd>provides the user management features.</dd>
+    <dt><a href="../../versioning/admin/about.html">Versioning</a></dt> <dd>offers versioning services on top of the triple store.</dd>
 </dl>
 <!--###END_CONTENT###-->
 </body>

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/platform/marmotta-core/src/main/resources/web/admin/configuration.html
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/resources/web/admin/configuration.html b/platform/marmotta-core/src/main/resources/web/admin/configuration.html
index 928a336..63dc95c 100644
--- a/platform/marmotta-core/src/main/resources/web/admin/configuration.html
+++ b/platform/marmotta-core/src/main/resources/web/admin/configuration.html
@@ -22,7 +22,7 @@
 <!--###BEGIN_HEAD###-->
     <title>Core Module Configuration</title>
     <link type="text/css" rel="stylesheet" href="../public/js/widgets/configurator/style.css">
-    <script type="text/javascript" src="../public/js/lib/jquery-1.7.2.js"></script>
+    <script type="text/javascript" src="../../webjars/jquery/1.8.2/jquery.min.js"></script>
     <script type="text/javascript" src="../public/js/widgets/configurator/configurator.js"></script>
     <script type="text/javascript" src="js/widgets/database.js"></script>
     <script type="text/javascript">

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/platform/marmotta-core/src/main/resources/web/admin/contexts.html
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/resources/web/admin/contexts.html b/platform/marmotta-core/src/main/resources/web/admin/contexts.html
index 8a3a8d7..192309a 100644
--- a/platform/marmotta-core/src/main/resources/web/admin/contexts.html
+++ b/platform/marmotta-core/src/main/resources/web/admin/contexts.html
@@ -59,7 +59,7 @@
 
             function deleteContext(uri, id) {
             	$.ajax({
-            	    url: uri,
+            	    url: "../../context?graph=" + encodeURIComponent(uri),
             	    type: "DELETE",
             	    success: function(result) {
             	    	alert("Context " + uri + " deleted!");

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/platform/marmotta-core/src/main/resources/web/admin/dataview.html
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/resources/web/admin/dataview.html b/platform/marmotta-core/src/main/resources/web/admin/dataview.html
index eec7574..850534f 100644
--- a/platform/marmotta-core/src/main/resources/web/admin/dataview.html
+++ b/platform/marmotta-core/src/main/resources/web/admin/dataview.html
@@ -23,9 +23,9 @@
 <!--###BEGIN_HEAD###-->
     <title>Data Views</title>
     <meta charset="UTF-8"/>
-    <script type="text/javascript" src="../public/js/lib/jquery-1.6.4.js"></script>
+    <script type="text/javascript" src="../../webjars/jquery/1.8.2/jquery.min.js"></script>
     <script type="text/javascript" src="https://www.google.com/jsapi"></script>
-    <script type="text/javascript" src="js/lib/sgvizler.pack.js"></script>
+    <script type="text/javascript" src="../../webjars/sgvizler/0.5.1/sgvizler.js" id="sgvzlr_script" ></script>
     <script type="text/javascript">
 
         var HAS_DATA = true;
@@ -36,7 +36,7 @@
                         'blue','red','orange','green','navy','Crimson','DarkGreen','DarkTurquoise','DodgerBlue','OliveDrab','pink','violet',
                         'GoldenRod','Fuchsia','Darkorange','DarkSlateBlue','GreenYellow','LightSeaGreen','Maroon','MediumVioletRed']
 
-        sgvizler.option.libfolder = "js/lib/";
+        sgvizler.option.libfolder = "../../webjars/sgvizler/0.5.1/lib";
 
         sgvizler.option.stylepath = _SERVER_URL + _CURRENT_STYLE;
 
@@ -237,7 +237,7 @@
                 drawGraphs();
                 drawClasses();
             }
-        });
+    });
 
     </script>
     <style type="text/css">

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/platform/marmotta-core/src/main/resources/web/admin/export.html
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/resources/web/admin/export.html b/platform/marmotta-core/src/main/resources/web/admin/export.html
index cb9f40d..295fa56 100644
--- a/platform/marmotta-core/src/main/resources/web/admin/export.html
+++ b/platform/marmotta-core/src/main/resources/web/admin/export.html
@@ -21,7 +21,7 @@
 <head>
 <!--###BEGIN_HEAD###-->
     <title>Exporter</title>
-    <script type="text/javascript" src="../public/js/lib/jquery-1.7.2.js"></script>
+    <script type="text/javascript" src="../../webjars/jquery/1.8.2/jquery.min.js"></script>
 
     <script type="text/javascript">
         var updateDownloadLink = function() {


[012/100] [abbrv] [partial] Reverting the erroneous merge by Sebastian according to the instructions in INFRA-6876

Posted by wi...@apache.org.
http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldclient/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldclient/pom.xml b/libraries/ldclient/pom.xml
index ad88ca4..084786b 100644
--- a/libraries/ldclient/pom.xml
+++ b/libraries/ldclient/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>
 
@@ -35,6 +35,27 @@
 
     <!-- release management -->
     <build>
+        <pluginManagement>
+            <plugins>
+                <plugin> <!-- generate JRebel Configuration -->
+                    <groupId>org.zeroturnaround</groupId>
+                    <artifactId>jrebel-maven-plugin</artifactId>
+                    <executions>
+                        <execution>
+                            <id>generate-rebel-xml</id>
+                            <phase>process-resources</phase>
+                            <goals>
+                                <goal>generate</goal>
+                            </goals>
+                        </execution>
+                    </executions>
+                    <configuration>
+                        <relativePath>../../../</relativePath>
+                        <rootPath>$${rebel.root}</rootPath>
+                    </configuration>
+                </plugin>
+            </plugins>
+        </pluginManagement>
         <plugins>
             <!-- do not install / deploy reactor -->
             <plugin>

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-api/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-api/pom.xml b/libraries/ldpath/ldpath-api/pom.xml
index 174121e..d97b08f 100644
--- a/libraries/ldpath/ldpath-api/pom.xml
+++ b/libraries/ldpath/ldpath-api/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>
 
@@ -31,6 +31,27 @@
 
 
     <build>
+        <pluginManagement>
+            <plugins>
+                <plugin> <!-- generate JRebel Configuration -->
+                    <groupId>org.zeroturnaround</groupId>
+                    <artifactId>jrebel-maven-plugin</artifactId>
+                    <executions>
+                        <execution>
+                            <id>generate-rebel-xml</id>
+                            <phase>process-resources</phase>
+                            <goals>
+                                <goal>generate</goal>
+                            </goals>
+                        </execution>
+                    </executions>
+                    <configuration>
+                        <relativePath>../../../</relativePath>
+                        <rootPath>$${rebel.root}</rootPath>
+                    </configuration>
+                </plugin>
+            </plugins>
+        </pluginManagement>
         <plugins>
             <plugin>
                 <groupId>org.apache.felix</groupId>

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-api/src/main/java/org/apache/marmotta/ldpath/api/functions/NodeFunction.java
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-api/src/main/java/org/apache/marmotta/ldpath/api/functions/NodeFunction.java b/libraries/ldpath/ldpath-api/src/main/java/org/apache/marmotta/ldpath/api/functions/NodeFunction.java
index 4d26d83..86805f6 100644
--- a/libraries/ldpath/ldpath-api/src/main/java/org/apache/marmotta/ldpath/api/functions/NodeFunction.java
+++ b/libraries/ldpath/ldpath-api/src/main/java/org/apache/marmotta/ldpath/api/functions/NodeFunction.java
@@ -44,7 +44,7 @@ public interface NodeFunction<T,Node> extends LDPathConstruct<Node> {
      * @param args a nested list of KiWiNodes
      * @return
      */
-    public T apply(RDFBackend<Node> backend, Node context, Collection<Node>... args) throws IllegalArgumentException;
+    public T apply(RDFBackend<Node> backend, Node context, @SuppressWarnings("unchecked") Collection<Node>... args) throws IllegalArgumentException;
 
     /**
      * A string describing the signature of this node function, e.g. "fn:content(uris : Nodes) : Nodes". The

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-api/src/main/java/org/apache/marmotta/ldpath/api/tests/NodeTest.java
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-api/src/main/java/org/apache/marmotta/ldpath/api/tests/NodeTest.java b/libraries/ldpath/ldpath-api/src/main/java/org/apache/marmotta/ldpath/api/tests/NodeTest.java
index 17f4da1..78a0414 100644
--- a/libraries/ldpath/ldpath-api/src/main/java/org/apache/marmotta/ldpath/api/tests/NodeTest.java
+++ b/libraries/ldpath/ldpath-api/src/main/java/org/apache/marmotta/ldpath/api/tests/NodeTest.java
@@ -31,6 +31,7 @@ import org.apache.marmotta.ldpath.api.functions.NodeFunction;
 public abstract class NodeTest<Node> implements NodeFunction<Boolean, Node> {
 
     @Override
+    @SafeVarargs
     public final Boolean apply(RDFBackend<Node> backend, Node context, Collection<Node>... args)
             throws IllegalArgumentException {
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-api/src/main/java/org/apache/marmotta/ldpath/api/transformers/NodeTransformer.java
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-api/src/main/java/org/apache/marmotta/ldpath/api/transformers/NodeTransformer.java b/libraries/ldpath/ldpath-api/src/main/java/org/apache/marmotta/ldpath/api/transformers/NodeTransformer.java
index 44b07cc..c467fb1 100644
--- a/libraries/ldpath/ldpath-api/src/main/java/org/apache/marmotta/ldpath/api/transformers/NodeTransformer.java
+++ b/libraries/ldpath/ldpath-api/src/main/java/org/apache/marmotta/ldpath/api/transformers/NodeTransformer.java
@@ -17,10 +17,10 @@
  */
 package org.apache.marmotta.ldpath.api.transformers;
 
-import org.apache.marmotta.ldpath.api.backend.NodeBackend;
-
 import java.util.Map;
 
+import org.apache.marmotta.ldpath.api.backend.RDFBackend;
+
 /**
  * Implementations of this interface allow to transform KiWiNode objects into the type T. This is
  * currently required by the indexer to map KiWiNodes to the Java types corresponding to the
@@ -37,10 +37,12 @@ public interface NodeTransformer<T,Node> {
      * carrying out the transformation.
      *
      *
+     *
+     * @param backend
      * @param node
      * @param configuration the field configuration used when defining the LDPath rule
      * @return
      */
-    public T transform(NodeBackend<Node> backend, Node node, Map<String, String> configuration) throws IllegalArgumentException;
+    public T transform(RDFBackend<Node> backend, Node node, Map<String, String> configuration) throws IllegalArgumentException;
 
 }

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-backend-file/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-backend-file/pom.xml b/libraries/ldpath/ldpath-backend-file/pom.xml
index 0e5cdd7..236ff61 100644
--- a/libraries/ldpath/ldpath-backend-file/pom.xml
+++ b/libraries/ldpath/ldpath-backend-file/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>
 
@@ -29,6 +29,30 @@
     <artifactId>ldpath-backend-file</artifactId>
     <packaging>jar</packaging>
 
+    <build>
+        <pluginManagement>
+            <plugins>
+                <plugin> <!-- generate JRebel Configuration -->
+                    <groupId>org.zeroturnaround</groupId>
+                    <artifactId>jrebel-maven-plugin</artifactId>
+                    <executions>
+                        <execution>
+                            <id>generate-rebel-xml</id>
+                            <phase>process-resources</phase>
+                            <goals>
+                                <goal>generate</goal>
+                            </goals>
+                        </execution>
+                    </executions>
+                    <configuration>
+                        <relativePath>../../../</relativePath>
+                        <rootPath>$${rebel.root}</rootPath>
+                    </configuration>
+                </plugin>
+            </plugins>
+        </pluginManagement>
+    </build>
+
     <dependencies>
 
         <dependency>

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-backend-file/src/test/java/org/apache/marmotta/ldpath/backend/file/ParserTest.java
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-backend-file/src/test/java/org/apache/marmotta/ldpath/backend/file/ParserTest.java b/libraries/ldpath/ldpath-backend-file/src/test/java/org/apache/marmotta/ldpath/backend/file/ParserTest.java
index 4d23c14..11d96f5 100644
--- a/libraries/ldpath/ldpath-backend-file/src/test/java/org/apache/marmotta/ldpath/backend/file/ParserTest.java
+++ b/libraries/ldpath/ldpath-backend-file/src/test/java/org/apache/marmotta/ldpath/backend/file/ParserTest.java
@@ -30,7 +30,8 @@ import org.apache.marmotta.ldpath.model.selectors.TestingSelector;
 import org.apache.marmotta.ldpath.model.selectors.UnionSelector;
 import org.apache.marmotta.ldpath.model.transformers.StringTransformer;
 import org.apache.marmotta.ldpath.parser.ParseException;
-import org.apache.marmotta.ldpath.parser.RdfPathParser;
+import org.apache.marmotta.ldpath.parser.LdPathParser;
+import org.hamcrest.CoreMatchers;
 import org.junit.Assert;
 import org.junit.BeforeClass;
 import org.junit.Test;
@@ -60,7 +61,7 @@ public class ParserTest {
         String path1 = "rdfs:label";
 
         NodeSelector<Value> s1 = parseSelector(path1, null);
-        Assert.assertTrue(s1 instanceof PropertySelector);
+        Assert.assertThat(s1, CoreMatchers.instanceOf(PropertySelector.class));
         Assert.assertEquals("<http://www.w3.org/2000/01/rdf-schema#label>",s1.getPathExpression(backend));
 
 
@@ -70,21 +71,19 @@ public class ParserTest {
         );
         String path2 = "(*[rdf:type is dbp-ont:Person]) | (dct:subject/^dct:subject[rdf:type is dbp-ont:Person]) | (dct:subject/^skos:broader/^dct:subject[rdf:type is dbp-ont:Person])";
         NodeSelector<Value> s2 = parseSelector(path2,namespaces2);
-        Assert.assertTrue(s2 instanceof UnionSelector);
+        Assert.assertThat(s2, CoreMatchers.instanceOf(UnionSelector.class));
 
         String path3 = "*[rdf:type is dbp-ont:Person] | dct:subject/^dct:subject[rdf:type is dbp-ont:Person] | dct:subject/^skos:broader/^dct:subject[rdf:type is dbp-ont:Person]";
         NodeSelector<Value> s3 = parseSelector(path3,namespaces2);
-        Assert.assertTrue(s3 instanceof UnionSelector);
+        Assert.assertThat(s3, CoreMatchers.instanceOf(UnionSelector.class));
         
-        Assert.assertEquals(s2,s3);
-
         String path4 = "(* | dct:subject/^dct:subject | dct:subject/^skos:broader/^dct:subject)[rdf:type is dbp-ont:Person]";
         NodeSelector<Value> s4 = parseSelector(path4,namespaces2);
-        Assert.assertTrue(s4 instanceof TestingSelector);
+        Assert.assertThat(s4, CoreMatchers.instanceOf(TestingSelector.class));
     }
 
     private NodeSelector<Value> parseSelector(String selector, Map<String,String> namespaces) throws ParseException {
-        return new RdfPathParser<Value>(backend,new StringReader(selector)).parseSelector(namespaces);
+        return new LdPathParser<Value>(backend,new StringReader(selector)).parseSelector(namespaces);
     }
 
     @Test
@@ -109,13 +108,13 @@ public class ParserTest {
         Assert.assertNotNull(p3.getFilter());
         Assert.assertEquals(5, p3.getNamespaces().size());
         Assert.assertNotNull(p3.getField("person"));
-        Assert.assertTrue(p3.getField("person").getSelector() instanceof PathSelector);
-        Assert.assertTrue(p3.getField("person").getTransformer() instanceof StringTransformer);
+        Assert.assertThat(p3.getField("person").getSelector() , CoreMatchers.instanceOf(PathSelector.class));
+        Assert.assertThat(p3.getField("person").getTransformer(), CoreMatchers.instanceOf( StringTransformer.class));
 
     }
 
     private Program<Value> parseProgram(String selector) throws ParseException {
-        return new RdfPathParser<Value>(backend,new StringReader(selector)).parseProgram();
+        return new LdPathParser<Value>(backend,new StringReader(selector)).parseProgram();
     }
 
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-backend-jena/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-backend-jena/pom.xml b/libraries/ldpath/ldpath-backend-jena/pom.xml
index d0a3062..6338891 100644
--- a/libraries/ldpath/ldpath-backend-jena/pom.xml
+++ b/libraries/ldpath/ldpath-backend-jena/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>
 
@@ -29,6 +29,30 @@
     <artifactId>ldpath-backend-jena</artifactId>
     <packaging>jar</packaging>
 
+    <build>
+        <pluginManagement>
+            <plugins>
+                <plugin> <!-- generate JRebel Configuration -->
+                    <groupId>org.zeroturnaround</groupId>
+                    <artifactId>jrebel-maven-plugin</artifactId>
+                    <executions>
+                        <execution>
+                            <id>generate-rebel-xml</id>
+                            <phase>process-resources</phase>
+                            <goals>
+                                <goal>generate</goal>
+                            </goals>
+                        </execution>
+                    </executions>
+                    <configuration>
+                        <relativePath>../../../</relativePath>
+                        <rootPath>$${rebel.root}</rootPath>
+                    </configuration>
+                </plugin>
+            </plugins>
+        </pluginManagement>
+    </build>
+
     <dependencies>
 
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-backend-linkeddata/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-backend-linkeddata/pom.xml b/libraries/ldpath/ldpath-backend-linkeddata/pom.xml
index 9c27f08..5be1f7e 100644
--- a/libraries/ldpath/ldpath-backend-linkeddata/pom.xml
+++ b/libraries/ldpath/ldpath-backend-linkeddata/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>
 
@@ -30,6 +30,27 @@
     <packaging>jar</packaging>
 
     <build>
+        <pluginManagement>
+            <plugins>
+                <plugin> <!-- generate JRebel Configuration -->
+                    <groupId>org.zeroturnaround</groupId>
+                    <artifactId>jrebel-maven-plugin</artifactId>
+                    <executions>
+                        <execution>
+                            <id>generate-rebel-xml</id>
+                            <phase>process-resources</phase>
+                            <goals>
+                                <goal>generate</goal>
+                            </goals>
+                        </execution>
+                    </executions>
+                    <configuration>
+                        <relativePath>../../../</relativePath>
+                        <rootPath>$${rebel.root}</rootPath>
+                    </configuration>
+                </plugin>
+            </plugins>
+        </pluginManagement>
         <plugins>
             <plugin>
                 <groupId>org.jasig.maven</groupId>

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-backend-linkeddata/src/main/doc/LICENSE.txt
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-backend-linkeddata/src/main/doc/LICENSE.txt b/libraries/ldpath/ldpath-backend-linkeddata/src/main/doc/LICENSE.txt
index 147194e..6b85159 100644
--- a/libraries/ldpath/ldpath-backend-linkeddata/src/main/doc/LICENSE.txt
+++ b/libraries/ldpath/ldpath-backend-linkeddata/src/main/doc/LICENSE.txt
@@ -702,4 +702,35 @@ For the JSONLD-Java component,
     ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
     THE POSSIBILITY OF SUCH DAMAGE.
 
+For the Marmotta Commons component,
+
+    located at commons/marmotta-commons/src/ext/java
+
+   Javolution - Java(tm) Solution for Real-Time and Embedded Systems
+   Copyright (c) 2012, Javolution (http://javolution.org/)
+   All rights reserved.
+
+   Redistribution and use in source and binary forms, with or without
+   modification, are permitted provided that the following conditions are met:
+
+      1. Redistributions of source code must retain the above copyright
+         notice, this list of conditions and the following disclaimer.
+
+      2. Redistributions in binary form must reproduce the above copyright
+         notice, this list of conditions and the following disclaimer in the
+         documentation and/or other materials provided with the distribution.
+
+   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+   CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+   EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+   PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+   PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+   LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+   NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+   SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-backend-linkeddata/src/main/doc/NOTICE.txt
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-backend-linkeddata/src/main/doc/NOTICE.txt b/libraries/ldpath/ldpath-backend-linkeddata/src/main/doc/NOTICE.txt
index dc6c538..e54d3d5 100644
--- a/libraries/ldpath/ldpath-backend-linkeddata/src/main/doc/NOTICE.txt
+++ b/libraries/ldpath/ldpath-backend-linkeddata/src/main/doc/NOTICE.txt
@@ -1,6 +1,8 @@
-Apache Marmotta LDPath, Copyright 2012-2013 The Apache Software Foundation
+Apache Marmotta LDPath
+Copyright 2012-2013 The Apache Software Foundation
 
-This product includes software developed at The Apache Software Foundation (http://www.apache.org).
+This product includes software developed at 
+The Apache Software Foundation (http://www.apache.org).
 
 Portions of this software were originally based on the following:
 
@@ -8,103 +10,9 @@ Portions of this software were originally based on the following:
 
 These have been licensed to the Apache Software Foundation under a software grant.
 
-* CAL10N, http://cal10n.qos.ch
-
-  Copyright (c) 2009 QOS.ch
-
-* Logback, http://logback.qos.ch
-
-  Copyright (C) 2012 QOS.ch
-
-* Guava, http://guava-libraries.googlecode.com
-
-  Copyright (c) 2013 Google Inc.
-
-* OneJAR, http://one-jar.sourceforge.net
-
-  Copyright (c) 2004-2010 P. Simon Tuffs
-
-* SLF4J, http://www.slf4j.org
-
-  Copyright (c) 2013 QOS.ch
-
-* Jaxen, http://jaxen.codehaus.org
-
-  Copyright (c) 2006 The Werken Company
-
-* JDOM, http://www.jdom.org
-
-  Copyright (c) 2012 Jason Hunter & Brett McLaughlin
-
-* JSoup, http://jsoup.org
-
-  Copyright (c) 2013 Jonathan Hedley
-
-* Jackson, http://jackson.codehaus.org
-
-  Copyright (c) 2010 FasterXML LLC.
-
-* OpenRDF Sesame, http://www.openrdf.org
-
-  Copyright (c) 2013 Aduna
-
-  This software includes code developed by Aduna
-  (http://www.aduna-software.com/).
-
-  This software includes code developed by Ontotext AD
-  (http://www.ontotext.com/).
-
-  This software includes code developed by 3 Round Stones
-  (http://www.3roundstones.com/).
-
-  This software includes code developed by Fluid Operations
-  (http://www.fluidops.com/).
-
-  This software includes code developed by the Information Management Group at
-  Food & Biobased Research, Wageningen University (http://www.fbr.wur.nl/).
-
-  This software includes code developed by Clark & Parsia
-  (http://clarkparsia.com/).
-
-  This software includes code developed by the Institute for Defense Analyses
-  (IDA) (http://www.ida.org/).
-
-  This software includes code developed by Atos (http://www.atos.net/).
-
-  This software includes code developed by Peter Ansell.
-
-  The above parties have licensed their code contributions to Aduna under the
-  terms of a contributor license agreement (CLA).
-
-  This product includes software developed by the JUnit project
-  (http://www.junit.org). License: http://junit.sourceforge.net/cpl-v10.html
-
-  Parts of this product use software developed by JSON.org
-  (http://www.json.org). License: http://www.json.org/license.html
-
-  Parts of this product use software developed by the Mockito project
-  (http://mockito.googlecode.com). License: https://github.com/mockito/mockito/blob/master/LICENSE
-
-* Semargl, http://semarglproject.org
-
-  Copyright (c) 2012 Lev Khomich
-
-  This product uses software developed by The Apache Software Foundation:
-  Clerezza, Jena, IO Commons (http://www.apache.org/).
-
-  This product includes/uses test suite developed by Hewlett-Packard
-  (http://hp.com/). Copyright (c) 2002, Hewlett-Packard Company.
-
-  This product includes/uses test suite developed by W3C Consortium.
-
-  This product includes/uses RDFa test harness developed by RDF Web Applications
-  Working Group (http://www.w3.org/2010/02/rdfa/).
-
-* ROME, http://rometools.jira.com
-
-  Copyright (c) 2004 Sun Microsystems
-
-* JSONLD-Java, http://github.com/tristan/jsonld-java
-
-  Copyright (c) 2012, Deutsches Forschungszentrum für Künstliche Intelligenz GmbH
+This product also includes some third-party source components:
 
+ * The module commons/marmotta-commons contains a modified and reduced version
+   of the Javolution library. Javolution has copyright (c) 2012, Javolution and
+   is licensed under BSD license. The original source code is available from
+   http://javolution.org

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-backend-sesame/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-backend-sesame/pom.xml b/libraries/ldpath/ldpath-backend-sesame/pom.xml
index 910de1b..da8f536 100644
--- a/libraries/ldpath/ldpath-backend-sesame/pom.xml
+++ b/libraries/ldpath/ldpath-backend-sesame/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>
 
@@ -29,8 +29,31 @@
     <artifactId>ldpath-backend-sesame</artifactId>
     <packaging>jar</packaging>
 
-    <dependencies>
+    <build>
+        <pluginManagement>
+            <plugins>
+                <plugin> <!-- generate JRebel Configuration -->
+                    <groupId>org.zeroturnaround</groupId>
+                    <artifactId>jrebel-maven-plugin</artifactId>
+                    <executions>
+                        <execution>
+                            <id>generate-rebel-xml</id>
+                            <phase>process-resources</phase>
+                            <goals>
+                                <goal>generate</goal>
+                            </goals>
+                        </execution>
+                    </executions>
+                    <configuration>
+                        <relativePath>../../../</relativePath>
+                        <rootPath>$${rebel.root}</rootPath>
+                    </configuration>
+                </plugin>
+            </plugins>
+        </pluginManagement>
+    </build>
 
+    <dependencies>
         <dependency>
            <groupId>org.apache.marmotta</groupId>
             <artifactId>ldpath-api</artifactId>
@@ -43,11 +66,6 @@
             <groupId>org.openrdf.sesame</groupId>
             <artifactId>sesame-repository-api</artifactId>
         </dependency>
-
-        <dependency>
-            <groupId>com.google.guava</groupId>
-            <artifactId>guava</artifactId>
-        </dependency>
     </dependencies>
 
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-backend-sesame/src/main/java/org/apache/marmotta/ldpath/backend/sesame/AbstractSesameBackend.java
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-backend-sesame/src/main/java/org/apache/marmotta/ldpath/backend/sesame/AbstractSesameBackend.java b/libraries/ldpath/ldpath-backend-sesame/src/main/java/org/apache/marmotta/ldpath/backend/sesame/AbstractSesameBackend.java
index 93daedf..3e99b72 100644
--- a/libraries/ldpath/ldpath-backend-sesame/src/main/java/org/apache/marmotta/ldpath/backend/sesame/AbstractSesameBackend.java
+++ b/libraries/ldpath/ldpath-backend-sesame/src/main/java/org/apache/marmotta/ldpath/backend/sesame/AbstractSesameBackend.java
@@ -26,11 +26,7 @@ import java.util.concurrent.ThreadPoolExecutor;
 
 
 import org.apache.marmotta.ldpath.api.backend.RDFBackend;
-import org.openrdf.model.Literal;
-import org.openrdf.model.Resource;
-import org.openrdf.model.Statement;
-import org.openrdf.model.Value;
-import org.openrdf.model.ValueFactory;
+import org.openrdf.model.*;
 import org.openrdf.repository.RepositoryConnection;
 import org.openrdf.repository.RepositoryException;
 import org.openrdf.repository.RepositoryResult;
@@ -65,8 +61,10 @@ public abstract class AbstractSesameBackend extends SesameValueBackend implement
 
 	protected Collection<Value> listObjectsInternal(RepositoryConnection connection, Resource subject, org.openrdf.model.URI property)
 			throws RepositoryException {
+        ValueFactory valueFactory = connection.getValueFactory();
+
 		Set<Value> result = new HashSet<Value>();
-		RepositoryResult<Statement> qResult = connection.getStatements(subject, property, null, true);
+		RepositoryResult<Statement> qResult = connection.getStatements(merge(subject, connection.getValueFactory()), merge(property, connection.getValueFactory()), null, true);
 		try {
 			while(qResult.hasNext()) {
 				result.add(qResult.next().getObject());
@@ -80,7 +78,7 @@ public abstract class AbstractSesameBackend extends SesameValueBackend implement
 	protected Collection<Value> listSubjectsInternal(final RepositoryConnection connection, org.openrdf.model.URI property, Value object)
 			throws RepositoryException {
 		Set<Value> result = new HashSet<Value>();
-		RepositoryResult<Statement> qResult = connection.getStatements(null, property, object, true);
+		RepositoryResult<Statement> qResult = connection.getStatements(null, merge(property, connection.getValueFactory()), merge(object, connection.getValueFactory()), true);
 		try {
 			while(qResult.hasNext()) {
 				result.add(qResult.next().getSubject());
@@ -91,6 +89,23 @@ public abstract class AbstractSesameBackend extends SesameValueBackend implement
 		return  result;
 	}
 
+    /**
+     * Merge the value given as argument into the value factory given as argument
+     * @param value
+     * @param vf
+     * @param <T>
+     * @return
+     */
+    protected <T extends Value> T merge(T value, ValueFactory vf) {
+        if(value instanceof org.openrdf.model.URI) {
+            return (T)vf.createURI(value.stringValue());
+        } else if(value instanceof BNode) {
+            return (T)vf.createBNode(((BNode) value).getID());
+        } else {
+            return value;
+        }
+    }
+
 	@Override
 	public abstract Literal createLiteral(String content);
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-backend-sesame/src/main/java/org/apache/marmotta/ldpath/backend/sesame/SesameValueBackend.java
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-backend-sesame/src/main/java/org/apache/marmotta/ldpath/backend/sesame/SesameValueBackend.java b/libraries/ldpath/ldpath-backend-sesame/src/main/java/org/apache/marmotta/ldpath/backend/sesame/SesameValueBackend.java
index 4afda47..b341a27 100644
--- a/libraries/ldpath/ldpath-backend-sesame/src/main/java/org/apache/marmotta/ldpath/backend/sesame/SesameValueBackend.java
+++ b/libraries/ldpath/ldpath-backend-sesame/src/main/java/org/apache/marmotta/ldpath/backend/sesame/SesameValueBackend.java
@@ -1,3 +1,20 @@
+/*
+ * 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.ldpath.backend.sesame;
 
 import java.math.BigDecimal;

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-core/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-core/pom.xml b/libraries/ldpath/ldpath-core/pom.xml
index 00a8dbf..95dd222 100644
--- a/libraries/ldpath/ldpath-core/pom.xml
+++ b/libraries/ldpath/ldpath-core/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>
 
@@ -68,6 +68,10 @@
             <scope>test</scope>
         </dependency>
         <dependency>
+            <groupId>org.hamcrest</groupId>
+            <artifactId>hamcrest-library</artifactId>
+        </dependency>
+        <dependency>
             <groupId>commons-io</groupId>
             <artifactId>commons-io</artifactId>
             <scope>test</scope>
@@ -103,6 +107,27 @@
 
 
     <build>
+        <pluginManagement>
+            <plugins>
+                <plugin> <!-- generate JRebel Configuration -->
+                    <groupId>org.zeroturnaround</groupId>
+                    <artifactId>jrebel-maven-plugin</artifactId>
+                    <executions>
+                        <execution>
+                            <id>generate-rebel-xml</id>
+                            <phase>process-resources</phase>
+                            <goals>
+                                <goal>generate</goal>
+                            </goals>
+                        </execution>
+                    </executions>
+                    <configuration>
+                        <relativePath>../../../</relativePath>
+                        <rootPath>$${rebel.root}</rootPath>
+                     </configuration>
+                </plugin>
+            </plugins>
+        </pluginManagement>
         <plugins>
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/LDPath.java
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/LDPath.java b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/LDPath.java
index bc46c41..29cf999 100644
--- a/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/LDPath.java
+++ b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/LDPath.java
@@ -36,7 +36,7 @@ import org.apache.marmotta.ldpath.model.programs.Program;
 import org.apache.marmotta.ldpath.parser.Configuration;
 import org.apache.marmotta.ldpath.parser.DefaultConfiguration;
 import org.apache.marmotta.ldpath.parser.ParseException;
-import org.apache.marmotta.ldpath.parser.RdfPathParser;
+import org.apache.marmotta.ldpath.parser.LdPathParser;
 
 import com.google.common.collect.ImmutableList;
 import com.google.common.collect.ImmutableMap;
@@ -104,7 +104,7 @@ public class LDPath<Node> {
      * @throws LDPathParseException when the path passed as argument is not valid
      */
     public Collection<Node> pathQuery(Node context, String path, Map<String, String> namespaces) throws LDPathParseException {
-        RdfPathParser<Node> parser = new RdfPathParser<Node>(backend,config,new StringReader(path));
+        LdPathParser<Node> parser = new LdPathParser<Node>(backend,config,new StringReader(path));
         for(SelectorFunction<Node> function : functions) {
             parser.registerFunction(function);
         }
@@ -150,7 +150,7 @@ public class LDPath<Node> {
      * @throws LDPathParseException when the path passed as argument is not valid
      */
     public Collection<Node> pathQuery(Node context, String path, Map<String, String> namespaces, Map<Node,List<Node>> paths) throws LDPathParseException {
-        RdfPathParser<Node> parser = new RdfPathParser<Node>(backend,config,new StringReader(path));
+        LdPathParser<Node> parser = new LdPathParser<Node>(backend,config,new StringReader(path));
         for(SelectorFunction<Node> function : functions) {
             parser.registerFunction(function);
         }
@@ -194,7 +194,7 @@ public class LDPath<Node> {
      * @throws LDPathParseException when the path passed as argument is not valid
      */
     public <T> Collection<T> pathTransform(Node context, String path, Map<String, String> namespaces) throws LDPathParseException {
-        RdfPathParser<Node> parser = new RdfPathParser<Node>(backend,config,new StringReader(path));
+        LdPathParser<Node> parser = new LdPathParser<Node>(backend,config,new StringReader(path));
         for(SelectorFunction<Node> function : functions) {
             parser.registerFunction(function);
         }
@@ -223,7 +223,7 @@ public class LDPath<Node> {
      * @throws LDPathParseException
      */
     public Map<String,Collection<?>> programQuery(Node context, Reader program) throws LDPathParseException {
-        RdfPathParser<Node> parser = new RdfPathParser<Node>(backend,config,program);
+        LdPathParser<Node> parser = new LdPathParser<Node>(backend,config,program);
         for(SelectorFunction<Node> function : functions) {
             parser.registerFunction(function);
         }
@@ -255,7 +255,7 @@ public class LDPath<Node> {
      * @throws LDPathParseException
      */
     public Program<Node> parseProgram(Reader program) throws LDPathParseException {
-        RdfPathParser<Node> parser = new RdfPathParser<Node>(backend,config,program);
+        LdPathParser<Node> parser = new LdPathParser<Node>(backend,config,program);
         for(SelectorFunction<Node> function : functions) {
             parser.registerFunction(function);
         }

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/fields/FieldMapping.java
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/fields/FieldMapping.java b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/fields/FieldMapping.java
index 538be06..ad7984b 100644
--- a/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/fields/FieldMapping.java
+++ b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/fields/FieldMapping.java
@@ -21,6 +21,7 @@ import com.google.common.base.Function;
 import com.google.common.collect.Collections2;
 import com.google.common.collect.ImmutableList;
 
+import java.net.URI;
 import java.util.Collection;
 import java.util.List;
 import java.util.Map;
@@ -38,6 +39,8 @@ import org.apache.marmotta.ldpath.api.transformers.NodeTransformer;
  */
 public class FieldMapping<T,Node> implements LDPathConstruct<Node> {
 
+    private boolean isSimpleName = true;
+    
     /**
      * The name of the field in the search index
      */
@@ -46,7 +49,7 @@ public class FieldMapping<T,Node> implements LDPathConstruct<Node> {
     /**
      * The type of the field in the search index
      */
-    private String fieldType;
+    private URI fieldType;
 
     /**
      * The selector to use for selecting nodes
@@ -63,10 +66,15 @@ public class FieldMapping<T,Node> implements LDPathConstruct<Node> {
      */
     private Map<String, String> fieldConfig;
 
-    public FieldMapping() {
+    private FieldMapping() {
     }
-
-    public FieldMapping(String fieldName, String fieldType, NodeSelector<Node> selector, NodeTransformer<T,Node> transformer, Map<String, String> fieldConfig) {
+    
+    public FieldMapping(URI fieldName, URI fieldType, NodeSelector<Node> selector, NodeTransformer<T,Node> transformer, Map<String, String> fieldConfig) {
+        this(fieldName.toString(), fieldType, selector, transformer, fieldConfig);
+        this.isSimpleName = false;
+    }
+    
+    public FieldMapping(String fieldName, URI fieldType, NodeSelector<Node> selector, NodeTransformer<T,Node> transformer, Map<String, String> fieldConfig) {
     	this();
         this.fieldName = fieldName;
         this.fieldType = fieldType;
@@ -80,7 +88,7 @@ public class FieldMapping<T,Node> implements LDPathConstruct<Node> {
         return fieldName;
     }
 
-    public String getFieldType() {
+    public URI getFieldType() {
         return fieldType;
     }
 
@@ -162,7 +170,10 @@ public class FieldMapping<T,Node> implements LDPathConstruct<Node> {
             }
             fc.append(")");
         }
-        return String.format("%s = %s :: <%s>%s ;", fieldName, selector.getPathExpression(backend), fieldType, fc.toString());
+        if (isSimpleName)
+            return String.format("%s = %s :: <%s>%s ;", fieldName, selector.getPathExpression(backend), fieldType, fc.toString());
+        else
+            return String.format("<%s> = %s :: <%s>%s ;", fieldName, selector.getPathExpression(backend), fieldType, fc.toString());
     }
 
 }

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/functions/ConcatenateFunction.java
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/functions/ConcatenateFunction.java b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/functions/ConcatenateFunction.java
index 81437a6..127c621 100644
--- a/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/functions/ConcatenateFunction.java
+++ b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/functions/ConcatenateFunction.java
@@ -46,7 +46,8 @@ public class ConcatenateFunction<Node> extends SelectorFunction<Node> {
      * @return
      */
     @Override
-    public Collection<Node> apply(RDFBackend<Node> rdfBackend, Node context, Collection<Node>... args) throws IllegalArgumentException {
+    @SafeVarargs
+    public final Collection<Node> apply(RDFBackend<Node> rdfBackend, Node context, Collection<Node>... args) throws IllegalArgumentException {
         Iterator<Node> it = org.apache.marmotta.ldpath.util.Collections.iterator(args);
         StringBuilder result = new StringBuilder();
         while (it.hasNext()) {

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/functions/CountFunction.java
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/functions/CountFunction.java b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/functions/CountFunction.java
index 1f0d130..6e0fc90 100644
--- a/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/functions/CountFunction.java
+++ b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/functions/CountFunction.java
@@ -31,7 +31,8 @@ public class CountFunction<Node> extends SelectorFunction<Node> {
     private final URI dataType = URI.create("http://www.w3.org/2001/XMLSchema#integer");
 
     @Override
-    public Collection<Node> apply(RDFBackend<Node> backend, Node context, Collection<Node>... args) throws IllegalArgumentException {
+    @SafeVarargs
+    public final Collection<Node> apply(RDFBackend<Node> backend, Node context, Collection<Node>... args) throws IllegalArgumentException {
 
         LinkedList<Node> result = new LinkedList<Node>();
         for (Collection<Node> coll : args) {

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/functions/FirstFunction.java
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/functions/FirstFunction.java b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/functions/FirstFunction.java
index 735c13a..44e34c4 100644
--- a/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/functions/FirstFunction.java
+++ b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/functions/FirstFunction.java
@@ -29,7 +29,7 @@ import org.apache.marmotta.ldpath.api.functions.SelectorFunction;
  *
  *
  * @param <Node> the node type used by the backend
- * @author jakob
+ * @author Jakob Frank <ja...@apache.org>
  * 
  */
 public class FirstFunction<Node> extends SelectorFunction<Node> {
@@ -44,7 +44,8 @@ public class FirstFunction<Node> extends SelectorFunction<Node> {
      * @return
      */
     @Override
-    public Collection<Node> apply(RDFBackend<Node> rdfBackend, Node context, Collection<Node>... args) throws IllegalArgumentException {
+    @SafeVarargs
+    public final Collection<Node> apply(RDFBackend<Node> rdfBackend, Node context, Collection<Node>... args) throws IllegalArgumentException {
         for (Collection<Node> arg : args) {
             if (arg.size() > 0) { return arg; }
         }

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/functions/LastFunction.java
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/functions/LastFunction.java b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/functions/LastFunction.java
index ef3cbfe..a0e502e 100644
--- a/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/functions/LastFunction.java
+++ b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/functions/LastFunction.java
@@ -27,7 +27,7 @@ import org.apache.marmotta.ldpath.api.functions.SelectorFunction;
 /**
  * Selects the <code>last</code> node in the argument list.
  * 
- * @author jfrank
+ * @author Jakob Frank <ja...@apache.org>
  * 
  */
 public class LastFunction<Node> extends SelectorFunction<Node> {
@@ -41,7 +41,8 @@ public class LastFunction<Node> extends SelectorFunction<Node> {
      * @return
      */
     @Override
-    public Collection<Node> apply(RDFBackend<Node> rdfBackend, Node context, Collection<Node>... args) throws IllegalArgumentException {
+    @SafeVarargs
+    public final Collection<Node> apply(RDFBackend<Node> rdfBackend, Node context, Collection<Node>... args) throws IllegalArgumentException {
         for (int i = args.length - 1; i >= 0; i--) {
             if (args[i].size() > 0) { return args[i]; }
         }

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/functions/SortFunction.java
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/functions/SortFunction.java b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/functions/SortFunction.java
index 30ec623..786f4ad 100644
--- a/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/functions/SortFunction.java
+++ b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/functions/SortFunction.java
@@ -65,7 +65,8 @@ public class SortFunction<Node> extends SelectorFunction<Node> {
      * @return
      */
     @Override
-    public Collection<Node> apply(final RDFBackend<Node> nodeRDFBackend, Node context, Collection<Node>... args) throws IllegalArgumentException {
+    @SafeVarargs
+    public final Collection<Node> apply(final RDFBackend<Node> nodeRDFBackend, Node context, Collection<Node>... args) throws IllegalArgumentException {
         String order     = "string";
         String direction = "asc";
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/programs/Program.java
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/programs/Program.java b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/programs/Program.java
index b09d9e9..ae4ffcb 100644
--- a/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/programs/Program.java
+++ b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/programs/Program.java
@@ -60,6 +60,11 @@ public class Program<Node> implements LDPathConstruct<Node> {
     private Map<String, String> namespaces;
 
     /**
+     * Restrict evaluation of the program to the graphs/contexts
+     */
+    private Set<Node> graphs;
+
+    /**
      * An (optional) filter to use for checking which resources should be
      * indexed.
      */
@@ -69,7 +74,7 @@ public class Program<Node> implements LDPathConstruct<Node> {
      * An (optional) selector to resolve a document boost factor.
      */
     private FieldMapping<Float,Node> booster;
-    
+
     /**
      * The field mappings contained in this program.
      */
@@ -78,6 +83,7 @@ public class Program<Node> implements LDPathConstruct<Node> {
     public Program() {
         namespaces = new LinkedHashMap<String, String>();
         fields = new LinkedHashSet<FieldMapping<?,Node>>();
+        graphs = new LinkedHashSet<Node>();
     }
 
     public void addNamespace(String prefix, String uri) {
@@ -91,7 +97,7 @@ public class Program<Node> implements LDPathConstruct<Node> {
     public Set<FieldMapping<?,Node>> getFields() {
         return fields;
     }
-    
+
     public FieldMapping<?,Node> getField(String name) {
         for(FieldMapping<?,Node> m : fields) {
             if(name.equals(m.getFieldName())) {
@@ -128,7 +134,21 @@ public class Program<Node> implements LDPathConstruct<Node> {
     public void setNamespaces(Map<String, String> namespaces) {
         this.namespaces = new LinkedHashMap<String, String>(namespaces);
     }
-    
+
+    public Set<Node> getGraphs() {
+        return this.graphs;
+    }
+
+    @SuppressWarnings("unchecked")
+    public Node[] getGraphArr() {
+        return (Node[]) this.graphs.toArray();
+    }
+
+    public void setGraphs(Collection<Node> graphs) {
+        this.graphs.clear();
+        this.graphs.addAll(graphs);
+    }
+
     /**
      * Executes this Program on the parsed {@link RDFBackend backend}. 
      * @param context The context of the execution
@@ -158,22 +178,41 @@ public class Program<Node> implements LDPathConstruct<Node> {
         return result;
     }
 
-    
-    
+
+
     public String getPathExpression(NodeBackend<Node> backend) {
         StringBuilder sb = new StringBuilder();
-        // Filter (?)
+        // Graphs (optional)
+        if (graphs != null && graphs.size() > 0) {
+            sb.append("@graph");
+            boolean first = true;
+            for (Node gaph : graphs) {
+                if (backend.isURI(gaph)) {
+                    if (first) {
+                        sb.append(" <");
+                    } else{
+                        sb.append(", <");
+                    }
+                    sb.append(backend.stringValue(gaph)).append(">");
+
+                    first = false;
+                }
+            }
+            sb.append(" ;\n");
+        }
+
+        // Filter (optional)
         if (filter != null) {
             sb.append(String.format("@filter %s ;%n", filter.getPathExpression(backend)));
         }
 
-        // Booster (?)
+        // Booster (optional)
         if (booster != null) {
             sb.append(String.format("@boost %s ;%n", booster.getSelector().getPathExpression(backend)));
         }
 
         // Field-Definitions
-		for (FieldMapping<?,Node> field : fields) {
+        for (FieldMapping<?,Node> field : fields) {
             sb.append(String.format("  %s%n", field.getPathExpression(backend)));
         }
         String progWithoutNamespace = sb.toString();
@@ -190,7 +229,7 @@ public class Program<Node> implements LDPathConstruct<Node> {
             progWithoutNamespace = progWithoutNamespace.replaceAll("<" + Pattern.quote(ns.getValue()) + "([^>]*)>", Matcher.quoteReplacement(ns.getKey())
                     + ":$1");
         }
-        
+
 
         // Also resolve default namespaces...
         for (Entry<String, String> ns : DEFAULT_NAMESPACES.entrySet()) {
@@ -201,8 +240,8 @@ public class Program<Node> implements LDPathConstruct<Node> {
         }
         final StringBuilder prefixes = new StringBuilder();
         for (Entry<String, String> ns : namespaces.entrySet()) {
-        	prefixes.append(String.format("@prefix %s : <%s> ;%n", ns.getKey(), ns.getValue()));
-		}
+            prefixes.append(String.format("@prefix %s: <%s> ;%n", ns.getKey(), ns.getValue()));
+        }
 
         return prefixes.append(progWithoutNamespace).toString();
     }

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/selectors/GroupedSelector.java
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/selectors/GroupedSelector.java b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/selectors/GroupedSelector.java
new file mode 100644
index 0000000..4ba66d5
--- /dev/null
+++ b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/selectors/GroupedSelector.java
@@ -0,0 +1,101 @@
+/**
+ * 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.ldpath.model.selectors;
+
+
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.marmotta.ldpath.api.backend.NodeBackend;
+import org.apache.marmotta.ldpath.api.backend.RDFBackend;
+import org.apache.marmotta.ldpath.api.selectors.NodeSelector;
+
+/**
+ * A Group is a complex selector in brackets.
+ *
+ * @param <Node> the node type used by the backend
+ * @author Jakob Frank <ja...@apache.org>
+ */
+public class GroupedSelector<Node> implements NodeSelector<Node> {
+
+    private final NodeSelector<Node> content;
+
+    public GroupedSelector(NodeSelector<Node> content) {
+        this.content = content;
+    }
+
+
+    /**
+     * Apply the selector to the context node passed as argument and return the collection
+     * of selected nodes in appropriate order.
+     *
+     * @param context     the node where to start the selection
+     * @param path        the path leading to but not including the context node in the current evaluation of LDPath; may be null,
+     *                    in which case path tracking is disabled
+     * @param resultPaths a map where each of the result nodes maps to a path leading to the result node in the LDPath evaluation;
+     *                    if null, path tracking is disabled and the path argument is ignored
+     * @return the collection of selected nodes
+     */
+    @Override
+    public Collection<Node> select(final RDFBackend<Node> rdfBackend, final Node context, final List<Node> path, final Map<Node, List<Node>> resultPaths) {
+        return content.select(rdfBackend, context, path, resultPaths);
+    }
+
+    /**
+     * Return the name of the NodeSelector for registration in the selector registry
+     *
+     * @param rdfBackend
+     * @return
+     */
+    @Override
+    public String getPathExpression(NodeBackend<Node> rdfBackend) {
+        return String.format("(%s)", content.getPathExpression(rdfBackend));
+    }
+
+    /**
+     * Return a name for this selector to be used as the name for the whole path if not explicitly
+     * specified. In complex selector expressions, this is typically delegated to the first
+     * occurrence of an atomic selector.
+     */
+    @Override
+    public String getName(NodeBackend<Node> nodeRDFBackend) {
+        throw new UnsupportedOperationException("cannot use a group in unnamed field definitions because the name is ambiguous");
+    }
+
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) return true;
+        if (o == null || getClass() != o.getClass()) return false;
+
+        @SuppressWarnings("rawtypes")
+		GroupedSelector that = (GroupedSelector) o;
+
+        if (content!= null ? !content.equals(that.content) : that.content!= null) return false;
+
+        return true;
+    }
+
+    @Override
+    public int hashCode() {
+        int result = 31;
+        result = 31 * result + (content != null ? content.hashCode() : 0);
+        return result;
+    }
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/selectors/IntersectionSelector.java
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/selectors/IntersectionSelector.java b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/selectors/IntersectionSelector.java
index b50a5d6..443b225 100644
--- a/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/selectors/IntersectionSelector.java
+++ b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/selectors/IntersectionSelector.java
@@ -65,7 +65,7 @@ public class IntersectionSelector<Node> implements NodeSelector<Node> {
 
 	@Override
 	public String getPathExpression(NodeBackend<Node> backend) {
-		return String.format("(%s & %s)", left.getPathExpression(backend), right.getPathExpression(backend));
+		return String.format("%s & %s", left.getPathExpression(backend), right.getPathExpression(backend));
 	}
 
     /**

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/selectors/UnionSelector.java
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/selectors/UnionSelector.java b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/selectors/UnionSelector.java
index 963c38a..1964fd3 100644
--- a/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/selectors/UnionSelector.java
+++ b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/selectors/UnionSelector.java
@@ -74,7 +74,7 @@ public class UnionSelector<Node> implements NodeSelector<Node> {
      */
     @Override
     public String getPathExpression(NodeBackend<Node> rdfBackend) {
-        return String.format("(%s | %s)", left.getPathExpression(rdfBackend), right.getPathExpression(rdfBackend));
+        return String.format("%s | %s", left.getPathExpression(rdfBackend), right.getPathExpression(rdfBackend));
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/tests/IsATest.java
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/tests/IsATest.java b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/tests/IsATest.java
new file mode 100644
index 0000000..7f84457
--- /dev/null
+++ b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/tests/IsATest.java
@@ -0,0 +1,57 @@
+/**
+ * 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.ldpath.model.tests;
+
+import org.apache.marmotta.ldpath.api.backend.NodeBackend;
+import org.apache.marmotta.ldpath.model.selectors.PropertySelector;
+
+/**
+ * Shortcut for {@link PathEqualityTest} with the property {@literal http://www.w3.org/1999/02/22-rdf-syntax-ns#type}
+ * @author Jakob Frank <ja...@apache.org>
+ *
+ * @param <Node>
+ */
+public class IsATest<Node> extends PathEqualityTest<Node> {
+
+    public IsATest(Node rdfType, Node node) {
+        super(new PropertySelector<Node>(rdfType), node);
+    }
+    
+    @Override
+    public String getPathExpression(NodeBackend<Node> rdfBackend) {
+        if (rdfBackend.isURI(node)) {
+            return String.format("is-a <%s>", rdfBackend.stringValue(node));
+        } else if (rdfBackend.isLiteral(node)) {
+            return String.format("is-a \"%s\"", rdfBackend.stringValue(node));
+        } else {
+            // TODO Can this happen?
+            return String.format("is-a %s", rdfBackend.stringValue(node));
+        }
+    }
+    
+    @Override
+    public String getSignature() {
+        return "is-a Node :: NodeList -> Boolean";
+    }
+    
+    @Override
+    public String getDescription() {
+        return "tests if a node has a certain type";
+    }
+    
+}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/tests/LiteralTypeTest.java
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/tests/LiteralTypeTest.java b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/tests/LiteralTypeTest.java
index 58bbad0..bbd63d8 100644
--- a/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/tests/LiteralTypeTest.java
+++ b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/tests/LiteralTypeTest.java
@@ -17,6 +17,8 @@
  */
 package org.apache.marmotta.ldpath.model.tests;
 
+import java.net.URI;
+
 import org.apache.marmotta.ldpath.api.backend.NodeBackend;
 import org.apache.marmotta.ldpath.api.backend.RDFBackend;
 import org.apache.marmotta.ldpath.api.tests.NodeTest;
@@ -35,10 +37,14 @@ import org.apache.marmotta.ldpath.api.tests.NodeTest;
  */
 public class LiteralTypeTest<Node> extends NodeTest<Node> {
 
-    private String typeUri;
+    private URI typeUri;
 
     public LiteralTypeTest(String typeUri) {
-        this.typeUri = typeUri;
+        this.typeUri = URI.create(typeUri);
+    }
+    
+    public LiteralTypeTest(URI uri) {
+        this.typeUri = uri;
     }
 
     /**
@@ -55,9 +61,10 @@ public class LiteralTypeTest<Node> extends NodeTest<Node> {
         if(rdfBackend.isLiteral(node)) {
 
             if(typeUri != null) {
-                return typeUri.equals(rdfBackend.getLiteralType(node).toString());
+                return typeUri.equals(rdfBackend.getLiteralType(node));
             } else {
-                return null == rdfBackend.getLiteralType(node).toString();
+                // FIXME: MARMOTTA-39
+                return null == rdfBackend.getLiteralType(node);
             }
         } else {
             return false;
@@ -73,7 +80,7 @@ public class LiteralTypeTest<Node> extends NodeTest<Node> {
      */
     @Override
     public String getPathExpression(NodeBackend<Node> rdfBackend) {
-        return "^^" + typeUri;
+        return String.format("^^<%s>", typeUri);
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/tests/PathEqualityTest.java
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/tests/PathEqualityTest.java b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/tests/PathEqualityTest.java
index 5b6a044..82bb714 100644
--- a/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/tests/PathEqualityTest.java
+++ b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/tests/PathEqualityTest.java
@@ -36,8 +36,8 @@ import org.apache.marmotta.ldpath.api.tests.NodeTest;
  */
 public class PathEqualityTest<Node> extends NodeTest<Node> {
 
-    private NodeSelector<Node> path;
-    private Node node;
+    private final NodeSelector<Node> path;
+    protected final Node node;
 
 
     public PathEqualityTest(NodeSelector<Node> path, Node node) {
@@ -68,6 +68,8 @@ public class PathEqualityTest<Node> extends NodeTest<Node> {
     public String getPathExpression(NodeBackend<Node> rdfBackend) {
         if (rdfBackend.isURI(node)) {
             return String.format("%s is <%s>", path.getPathExpression(rdfBackend), rdfBackend.stringValue(node));
+        } else if (rdfBackend.isLiteral(node)) {
+            return String.format("%s is \"%s\"", path.getPathExpression(rdfBackend), rdfBackend.stringValue(node));
         } else {
             // TODO Can this happen?
             return String.format("%s is %s", path.getPathExpression(rdfBackend), rdfBackend.stringValue(node));

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/tests/functions/BinaryNumericTest.java
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/tests/functions/BinaryNumericTest.java b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/tests/functions/BinaryNumericTest.java
index d59e5d2..a35781c 100644
--- a/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/tests/functions/BinaryNumericTest.java
+++ b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/tests/functions/BinaryNumericTest.java
@@ -20,7 +20,6 @@ package org.apache.marmotta.ldpath.model.tests.functions;
 
 import java.util.Collection;
 
-import org.apache.marmotta.ldpath.api.backend.NodeBackend;
 import org.apache.marmotta.ldpath.api.backend.RDFBackend;
 import org.apache.marmotta.ldpath.api.functions.TestFunction;
 import org.apache.marmotta.ldpath.model.transformers.DoubleTransformer;
@@ -31,6 +30,7 @@ public abstract  class BinaryNumericTest<Node> extends TestFunction<Node> {
     protected final DoubleTransformer<Node> transformer = new DoubleTransformer<Node>();
 
     @Override
+    @SafeVarargs
     public final Boolean apply(RDFBackend<Node> backend, Node context,
             Collection<Node>... args) throws IllegalArgumentException {
 
@@ -49,7 +49,7 @@ public abstract  class BinaryNumericTest<Node> extends TestFunction<Node> {
         return true;
     }
 
-    protected boolean test(NodeBackend<Node> backend, Node leftNode, Node rightNode) {
+    protected boolean test(RDFBackend<Node> backend, Node leftNode, Node rightNode) {
         try {
             return test(transformer.transform(backend, leftNode, null), transformer.transform(backend, rightNode, null));
         } catch (IllegalArgumentException e) {

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/transformers/BigDecimalTransformer.java
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/transformers/BigDecimalTransformer.java b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/transformers/BigDecimalTransformer.java
index d15b185..543ae9b 100644
--- a/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/transformers/BigDecimalTransformer.java
+++ b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/transformers/BigDecimalTransformer.java
@@ -21,7 +21,7 @@ package org.apache.marmotta.ldpath.model.transformers;
 import java.math.BigDecimal;
 import java.util.Map;
 
-import org.apache.marmotta.ldpath.api.backend.NodeBackend;
+import org.apache.marmotta.ldpath.api.backend.RDFBackend;
 import org.apache.marmotta.ldpath.api.transformers.NodeTransformer;
 
 /**
@@ -32,7 +32,7 @@ import org.apache.marmotta.ldpath.api.transformers.NodeTransformer;
 public class BigDecimalTransformer<Node> implements NodeTransformer<BigDecimal,Node> {
 
     @Override
-    public BigDecimal transform(NodeBackend<Node> backend, Node node, Map<String, String> configuration) throws IllegalArgumentException {
+    public BigDecimal transform(RDFBackend<Node> backend, Node node, Map<String, String> configuration) throws IllegalArgumentException {
         if(backend.isLiteral(node)) {
             return backend.decimalValue(node);
         } else {

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/transformers/BigIntegerTransformer.java
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/transformers/BigIntegerTransformer.java b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/transformers/BigIntegerTransformer.java
index 02398a9..f4c95cb 100644
--- a/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/transformers/BigIntegerTransformer.java
+++ b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/transformers/BigIntegerTransformer.java
@@ -20,7 +20,7 @@ package org.apache.marmotta.ldpath.model.transformers;
 import java.math.BigInteger;
 import java.util.Map;
 
-import org.apache.marmotta.ldpath.api.backend.NodeBackend;
+import org.apache.marmotta.ldpath.api.backend.RDFBackend;
 import org.apache.marmotta.ldpath.api.transformers.NodeTransformer;
 
 
@@ -32,7 +32,7 @@ import org.apache.marmotta.ldpath.api.transformers.NodeTransformer;
 public class BigIntegerTransformer<Node> implements NodeTransformer<BigInteger,Node> {
 
     @Override
-    public BigInteger transform(NodeBackend<Node> backend, Node node, Map<String, String> configuration) throws IllegalArgumentException {
+    public BigInteger transform(RDFBackend<Node> backend, Node node, Map<String, String> configuration) throws IllegalArgumentException {
         if(backend.isLiteral(node)) {
             return backend.integerValue(node);
         } else {

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/transformers/BooleanTransformer.java
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/transformers/BooleanTransformer.java b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/transformers/BooleanTransformer.java
index bd57ecd..9ac484a 100644
--- a/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/transformers/BooleanTransformer.java
+++ b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/transformers/BooleanTransformer.java
@@ -17,7 +17,7 @@
  */
 package org.apache.marmotta.ldpath.model.transformers;
 
-import org.apache.marmotta.ldpath.api.backend.NodeBackend;
+import org.apache.marmotta.ldpath.api.backend.RDFBackend;
 import org.apache.marmotta.ldpath.api.transformers.NodeTransformer;
 
 import java.util.Map;
@@ -35,11 +35,13 @@ public class BooleanTransformer<Node> implements NodeTransformer<Boolean,Node> {
      * the respective datatype, throws an IllegalArgumentException that needs to be caught by the class
      * carrying out the transformation.
      *
+     *
+     * @param rdfBackend
      * @param node
      * @return
      */
     @Override
-    public Boolean transform(NodeBackend<Node> rdfBackend, Node node, Map<String, String> configuration) throws IllegalArgumentException {
+    public Boolean transform(RDFBackend<Node> rdfBackend, Node node, Map<String, String> configuration) throws IllegalArgumentException {
         if(rdfBackend.isLiteral(node)) {
             return rdfBackend.booleanValue(node);
         } else {

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/transformers/ByteTransformer.java
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/transformers/ByteTransformer.java b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/transformers/ByteTransformer.java
index 03f001c..6088f39 100644
--- a/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/transformers/ByteTransformer.java
+++ b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/transformers/ByteTransformer.java
@@ -17,7 +17,7 @@
  */
 package org.apache.marmotta.ldpath.model.transformers;
 
-import org.apache.marmotta.ldpath.api.backend.NodeBackend;
+import org.apache.marmotta.ldpath.api.backend.RDFBackend;
 import org.apache.marmotta.ldpath.api.transformers.NodeTransformer;
 
 import java.util.Map;
@@ -25,7 +25,7 @@ import java.util.Map;
 public class ByteTransformer<Node> implements NodeTransformer<Byte,Node> {
 
     @Override
-    public Byte transform(NodeBackend<Node> backend, Node node, Map<String, String> configuration) throws IllegalArgumentException {
+    public Byte transform(RDFBackend<Node> backend, Node node, Map<String, String> configuration) throws IllegalArgumentException {
         if(backend.isLiteral(node)) {
             return backend.decimalValue(node).byteValueExact();
         } else {

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/transformers/DateTimeTransformer.java
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/transformers/DateTimeTransformer.java b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/transformers/DateTimeTransformer.java
index 3e6e173..aec6d53 100644
--- a/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/transformers/DateTimeTransformer.java
+++ b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/transformers/DateTimeTransformer.java
@@ -21,7 +21,7 @@ package org.apache.marmotta.ldpath.model.transformers;
 import java.util.Date;
 import java.util.Map;
 
-import org.apache.marmotta.ldpath.api.backend.NodeBackend;
+import org.apache.marmotta.ldpath.api.backend.RDFBackend;
 import org.apache.marmotta.ldpath.api.transformers.NodeTransformer;
 
 /**
@@ -38,11 +38,13 @@ public class DateTimeTransformer<Node> implements NodeTransformer<Date,Node> {
      * the respective datatype, throws an IllegalArgumentException that needs to be caught by the class
      * carrying out the transformation.
      *
+     *
+     * @param rdfBackend
      * @param node
      * @return
      */
     @Override
-    public Date transform(NodeBackend<Node> rdfBackend, Node node, Map<String, String> configuration) throws IllegalArgumentException {
+    public Date transform(RDFBackend<Node> rdfBackend, Node node, Map<String, String> configuration) throws IllegalArgumentException {
         if(rdfBackend.isLiteral(node)) {
             return rdfBackend.dateTimeValue(node);
         } else {

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/transformers/DateTransformer.java
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/transformers/DateTransformer.java b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/transformers/DateTransformer.java
index c47387a..58937ad 100644
--- a/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/transformers/DateTransformer.java
+++ b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/transformers/DateTransformer.java
@@ -20,7 +20,7 @@ package org.apache.marmotta.ldpath.model.transformers;
 import java.util.Date;
 import java.util.Map;
 
-import org.apache.marmotta.ldpath.api.backend.NodeBackend;
+import org.apache.marmotta.ldpath.api.backend.RDFBackend;
 import org.apache.marmotta.ldpath.api.transformers.NodeTransformer;
 
 /**
@@ -37,11 +37,13 @@ public class DateTransformer<Node> implements NodeTransformer<Date,Node> {
      * the respective datatype, throws an IllegalArgumentException that needs to be caught by the class
      * carrying out the transformation.
      *
+     *
+     * @param rdfBackend
      * @param node
      * @return
      */
     @Override
-    public Date transform(NodeBackend<Node> rdfBackend, Node node, Map<String, String> configuration) throws IllegalArgumentException {
+    public Date transform(RDFBackend<Node> rdfBackend, Node node, Map<String, String> configuration) throws IllegalArgumentException {
         if(rdfBackend.isLiteral(node)) {
             return rdfBackend.dateValue(node);
         } else {

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/transformers/DoubleTransformer.java
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/transformers/DoubleTransformer.java b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/transformers/DoubleTransformer.java
index 83bec9c..d577a2c 100644
--- a/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/transformers/DoubleTransformer.java
+++ b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/transformers/DoubleTransformer.java
@@ -17,7 +17,7 @@
  */
 package org.apache.marmotta.ldpath.model.transformers;
 
-import org.apache.marmotta.ldpath.api.backend.NodeBackend;
+import org.apache.marmotta.ldpath.api.backend.RDFBackend;
 import org.apache.marmotta.ldpath.api.transformers.NodeTransformer;
 
 import java.util.Map;
@@ -34,11 +34,13 @@ public class DoubleTransformer<Node> implements NodeTransformer<Double,Node> {
      * the respective datatype, throws an IllegalArgumentException that needs to be caught by the class
      * carrying out the transformation.
      *
+     *
+     * @param rdfBackend
      * @param node
      * @return
      */
     @Override
-    public Double transform(NodeBackend<Node> rdfBackend, Node node, Map<String, String> configuration) throws IllegalArgumentException {
+    public Double transform(RDFBackend<Node> rdfBackend, Node node, Map<String, String> configuration) throws IllegalArgumentException {
         if(rdfBackend.isLiteral(node)) {
             return rdfBackend.doubleValue(node);
         } else {

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/transformers/DurationTransformer.java
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/transformers/DurationTransformer.java b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/transformers/DurationTransformer.java
index 37d7f54..57a50c6 100644
--- a/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/transformers/DurationTransformer.java
+++ b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/transformers/DurationTransformer.java
@@ -21,7 +21,7 @@ import javax.xml.datatype.DatatypeConfigurationException;
 import javax.xml.datatype.DatatypeFactory;
 import javax.xml.datatype.Duration;
 
-import org.apache.marmotta.ldpath.api.backend.NodeBackend;
+import org.apache.marmotta.ldpath.api.backend.RDFBackend;
 import org.apache.marmotta.ldpath.api.transformers.NodeTransformer;
 
 import java.util.Map;
@@ -58,7 +58,7 @@ public class DurationTransformer<Node> implements NodeTransformer<Duration,Node>
         return xmlDatatypeFactory;
     }
     @Override
-    public Duration transform(NodeBackend<Node> backend, Node node, Map<String, String> configuration) throws IllegalArgumentException {
+    public Duration transform(RDFBackend<Node> backend, Node node, Map<String, String> configuration) throws IllegalArgumentException {
         if(backend.isLiteral(node)) {
             return toDuration(backend.stringValue(node), false);
         } else {

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/transformers/FloatTransformer.java
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/transformers/FloatTransformer.java b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/transformers/FloatTransformer.java
index f019df3..a853963 100644
--- a/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/transformers/FloatTransformer.java
+++ b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/transformers/FloatTransformer.java
@@ -17,7 +17,7 @@
  */
 package org.apache.marmotta.ldpath.model.transformers;
 
-import org.apache.marmotta.ldpath.api.backend.NodeBackend;
+import org.apache.marmotta.ldpath.api.backend.RDFBackend;
 import org.apache.marmotta.ldpath.api.transformers.NodeTransformer;
 
 import java.util.Map;
@@ -36,11 +36,13 @@ public class FloatTransformer<Node> implements NodeTransformer<Float,Node> {
      * the respective datatype, throws an IllegalArgumentException that needs to be caught by the class
      * carrying out the transformation.
      *
+     *
+     * @param rdfBackend
      * @param node
      * @return
      */
     @Override
-    public Float transform(NodeBackend<Node> rdfBackend, Node node, Map<String, String> configuration) throws IllegalArgumentException {
+    public Float transform(RDFBackend<Node> rdfBackend, Node node, Map<String, String> configuration) throws IllegalArgumentException {
         if(rdfBackend.isLiteral(node)) {
             return rdfBackend.floatValue(node);
         } else {

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/transformers/IdentityTransformer.java
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/transformers/IdentityTransformer.java b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/transformers/IdentityTransformer.java
index f0fc6eb..7fc0713 100644
--- a/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/transformers/IdentityTransformer.java
+++ b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/transformers/IdentityTransformer.java
@@ -17,7 +17,7 @@
  */
 package org.apache.marmotta.ldpath.model.transformers;
 
-import org.apache.marmotta.ldpath.api.backend.NodeBackend;
+import org.apache.marmotta.ldpath.api.backend.RDFBackend;
 import org.apache.marmotta.ldpath.api.transformers.NodeTransformer;
 
 import java.util.Map;
@@ -35,11 +35,13 @@ public class IdentityTransformer<Node> implements NodeTransformer<Node,Node> {
      * the respective datatype, throws an IllegalArgumentException that needs to be caught by the class
      * carrying out the transformation.
      *
+     *
+     * @param nodeRDFBackend
      * @param node
      * @return
      */
     @Override
-    public Node transform(NodeBackend<Node> nodeRDFBackend, Node node, Map<String, String> configuration) throws IllegalArgumentException {
+    public Node transform(RDFBackend<Node> nodeRDFBackend, Node node, Map<String, String> configuration) throws IllegalArgumentException {
         return node;
     }
 }

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/transformers/IntTransformer.java
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/transformers/IntTransformer.java b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/transformers/IntTransformer.java
index d0a33c9..8cddda4 100644
--- a/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/transformers/IntTransformer.java
+++ b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/transformers/IntTransformer.java
@@ -17,7 +17,7 @@
  */
 package org.apache.marmotta.ldpath.model.transformers;
 
-import org.apache.marmotta.ldpath.api.backend.NodeBackend;
+import org.apache.marmotta.ldpath.api.backend.RDFBackend;
 import org.apache.marmotta.ldpath.api.transformers.NodeTransformer;
 
 import java.util.Map;
@@ -35,11 +35,13 @@ public class IntTransformer<Node> implements NodeTransformer<Integer,Node> {
      * the respective datatype, throws an IllegalArgumentException that needs to be caught by the class
      * carrying out the transformation.
      *
+     *
+     * @param rdfBackend
      * @param node
      * @return
      */
     @Override
-    public Integer transform(NodeBackend<Node> rdfBackend, Node node, Map<String, String> configuration) throws IllegalArgumentException {
+    public Integer transform(RDFBackend<Node> rdfBackend, Node node, Map<String, String> configuration) throws IllegalArgumentException {
         if(rdfBackend.isLiteral(node)) {
             return rdfBackend.intValue(node);
         } else {

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/transformers/LongTransformer.java
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/transformers/LongTransformer.java b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/transformers/LongTransformer.java
index 4188e02..49754e5 100644
--- a/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/transformers/LongTransformer.java
+++ b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/transformers/LongTransformer.java
@@ -17,7 +17,7 @@
  */
 package org.apache.marmotta.ldpath.model.transformers;
 
-import org.apache.marmotta.ldpath.api.backend.NodeBackend;
+import org.apache.marmotta.ldpath.api.backend.RDFBackend;
 import org.apache.marmotta.ldpath.api.transformers.NodeTransformer;
 
 import java.util.Map;
@@ -34,11 +34,13 @@ public class LongTransformer<Node> implements NodeTransformer<Long,Node> {
      * the respective datatype, throws an IllegalArgumentException that needs to be caught by the class
      * carrying out the transformation.
      *
+     *
+     * @param rdfBackend
      * @param node
      * @return
      */
     @Override
-    public Long transform(NodeBackend<Node> rdfBackend, Node node, Map<String, String> configuration) throws IllegalArgumentException {
+    public Long transform(RDFBackend<Node> rdfBackend, Node node, Map<String, String> configuration) throws IllegalArgumentException {
         if(rdfBackend.isLiteral(node)) {
             return rdfBackend.longValue(node);
         } else {


[088/100] [abbrv] git commit: MARMOTTA-438: removed test suite until the official one is ready to be integrated

Posted by wi...@apache.org.
MARMOTTA-438: removed test suite until the official one is ready to be integrated


Project: http://git-wip-us.apache.org/repos/asf/marmotta/repo
Commit: http://git-wip-us.apache.org/repos/asf/marmotta/commit/b5cfb0a5
Tree: http://git-wip-us.apache.org/repos/asf/marmotta/tree/b5cfb0a5
Diff: http://git-wip-us.apache.org/repos/asf/marmotta/diff/b5cfb0a5

Branch: refs/heads/ldp
Commit: b5cfb0a5d23eea132925ca166b563a8d493ab3f4
Parents: ecebad1
Author: Sergio Fernández <wi...@apache.org>
Authored: Mon May 5 20:42:07 2014 +0200
Committer: Sergio Fernández <wi...@apache.org>
Committed: Mon May 5 20:42:07 2014 +0200

----------------------------------------------------------------------
 .../platform/ldp/testsuite/LdpManifestTest.java |  73 --------
 .../platform/ldp/testsuite/LdpTestCase.java     | 183 -------------------
 .../ldp/testsuite/LdpTestCaseRunner.java        | 111 -----------
 .../platform/ldp/testsuite/LdpTestCases.java    |  71 -------
 .../ldp/testsuite/LdpTestCasesRunner.java       | 128 -------------
 .../ldp/testsuite/LdpTestCasesUtils.java        | 130 -------------
 6 files changed, 696 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/marmotta/blob/b5cfb0a5/platform/marmotta-ldp/src/test/java/org/apache/marmotta/platform/ldp/testsuite/LdpManifestTest.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-ldp/src/test/java/org/apache/marmotta/platform/ldp/testsuite/LdpManifestTest.java b/platform/marmotta-ldp/src/test/java/org/apache/marmotta/platform/ldp/testsuite/LdpManifestTest.java
deleted file mode 100644
index b9102a4..0000000
--- a/platform/marmotta-ldp/src/test/java/org/apache/marmotta/platform/ldp/testsuite/LdpManifestTest.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * 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.platform.ldp.testsuite;
-
-import org.junit.*;
-import org.openrdf.model.Statement;
-import org.openrdf.model.vocabulary.RDF;
-import org.openrdf.repository.Repository;
-import org.openrdf.repository.RepositoryConnection;
-import org.openrdf.repository.RepositoryException;
-import org.openrdf.repository.RepositoryResult;
-import org.openrdf.rio.RDFFormat;
-import org.openrdf.rio.RDFParseException;
-
-import java.io.IOException;
-
-/**
- * LDP Test Cases Manifest test
- *
- * @author Sergio Fernández
- */
-public class LdpManifestTest {
-
-    protected Repository repo;
-
-    @Before
-    public final void before() throws RepositoryException, RDFParseException, IOException {
-        String path = LdpTestCases.ROOT_PATH + LdpTestCases.MANIFEST_CACHE + ".ttl";
-        repo = LdpTestCasesUtils.loadData(path, RDFFormat.TURTLE);
-        Assume.assumeNotNull(repo);
-    }
-
-    @After
-    public final void after() throws RepositoryException {
-        if (repo != null) {
-            repo.shutDown();
-            repo = null;
-        }
-    }
-
-    @Test
-    public void testNotEmpty() throws RepositoryException, RDFParseException, IOException {
-        RepositoryConnection conn = repo.getConnection();
-        try {
-            conn.begin();
-            //ValueFactory vf = conn.getValueFactory();
-            Assert.assertFalse(conn.isEmpty());
-            RepositoryResult<Statement> statements = conn.getStatements(null, RDF.TYPE, conn.getValueFactory().createURI("http://www.w3.org/2006/03/test-description#", "TestCase"), false);
-            Assert.assertTrue(statements.hasNext());
-            statements.close();
-            //TODO: check test cases are actually there
-        } finally {
-            conn.commit();
-            conn.close();
-        }
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/b5cfb0a5/platform/marmotta-ldp/src/test/java/org/apache/marmotta/platform/ldp/testsuite/LdpTestCase.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-ldp/src/test/java/org/apache/marmotta/platform/ldp/testsuite/LdpTestCase.java b/platform/marmotta-ldp/src/test/java/org/apache/marmotta/platform/ldp/testsuite/LdpTestCase.java
deleted file mode 100644
index e293d71..0000000
--- a/platform/marmotta-ldp/src/test/java/org/apache/marmotta/platform/ldp/testsuite/LdpTestCase.java
+++ /dev/null
@@ -1,183 +0,0 @@
-/*
- * 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.platform.ldp.testsuite;
-
-import org.openrdf.model.URI;
-
-import java.util.List;
-
-import static org.junit.Assert.assertEquals;
-
-/**
- * LDP Test Case
- *
- * @author Sergio Fernández
- * @see <a href="http://www.w3.org/TR/ldp-test-cases/#test-case-description">LDP Tests Cases</a>
- */
-public class LdpTestCase /* extends TestCase */ {
-
-    /**
-     * Test Case Uniform Resource Identifier
-     */
-    private URI uri;
-
-    /**
-     * rdfs:label. The human-readable label of the test.
-     */
-    private String label;
-
-    /**
-     * dc:title. The name of the test.
-     */
-    private String title;
-
-    /**
-     * dc:description. The description of the test.
-     */
-    private String description;
-
-    /**
-     * dc:contributor. The person (foaf:Person) contributing the test.
-     */
-    private URI contributor;
-
-    /**
-     * td:reviewStatus. The status of the test; possible status are: td:unreviewed, td:approved or td:rejected.
-     */
-    private URI reviewStatus;
-
-    //td:specificationReference. An excerpt (tn:Excerpt) of the specification that is relevant to the test.
-
-    /**
-     * td:input. An input (tn:TestInput) used in the test.
-     */
-    private URI input;
-
-    /**
-     * td:precondition. A precondition that must be satisfied before running the test.
-     */
-    private URI precondition;
-
-    /**
-     * tn:output. An output (tn:TestOutput) to be produced by the test.
-     */
-    private URI output;
-
-    /**
-     * tn:testProcess. The list of steps (tn:Step) to be performed during the test.
-     */
-    private List<URI> testProcess;
-
-    /**
-     * tn:testAssertion. An assertion (tn:TestAssertion) to be performed over the test output.
-     */
-    private URI testAssertion;
-
-    public LdpTestCase(URI uri) {
-        this.uri = uri;
-    }
-
-    public URI getUri() {
-        return uri;
-    }
-
-    public void setUri(URI uri) {
-        this.uri = uri;
-    }
-
-    public String getLabel() {
-        return label;
-    }
-
-    public void setLabel(String label) {
-        this.label = label;
-    }
-
-    public String getTitle() {
-        return title;
-    }
-
-    public void setTitle(String title) {
-        this.title = title;
-    }
-
-    public String getDescription() {
-        return description;
-    }
-
-    public void setDescription(String description) {
-        this.description = description;
-    }
-
-    public URI getContributor() {
-        return contributor;
-    }
-
-    public void setContributor(URI contributor) {
-        this.contributor = contributor;
-    }
-
-    public URI getReviewStatus() {
-        return reviewStatus;
-    }
-
-    public void setReviewStatus(URI reviewStatus) {
-        this.reviewStatus = reviewStatus;
-    }
-
-    public URI getInput() {
-        return input;
-    }
-
-    public void setInput(URI input) {
-        this.input = input;
-    }
-
-    public URI getPrecondition() {
-        return precondition;
-    }
-
-    public void setPrecondition(URI precondition) {
-        this.precondition = precondition;
-    }
-
-    public URI getOutput() {
-        return output;
-    }
-
-    public void setOutput(URI output) {
-        this.output = output;
-    }
-
-    public List<URI> getTestProcess() {
-        return testProcess;
-    }
-
-    public void setTestProcess(List<URI> testProcess) {
-        this.testProcess = testProcess;
-    }
-
-    public URI getTestAssertion() {
-        return testAssertion;
-    }
-
-    public void setTestAssertion(URI testAssertion) {
-        this.testAssertion = testAssertion;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/b5cfb0a5/platform/marmotta-ldp/src/test/java/org/apache/marmotta/platform/ldp/testsuite/LdpTestCaseRunner.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-ldp/src/test/java/org/apache/marmotta/platform/ldp/testsuite/LdpTestCaseRunner.java b/platform/marmotta-ldp/src/test/java/org/apache/marmotta/platform/ldp/testsuite/LdpTestCaseRunner.java
deleted file mode 100644
index 3c2f36b..0000000
--- a/platform/marmotta-ldp/src/test/java/org/apache/marmotta/platform/ldp/testsuite/LdpTestCaseRunner.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * 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.platform.ldp.testsuite;
-
-import com.jayway.restassured.RestAssured;
-import org.apache.marmotta.platform.core.exception.io.MarmottaImportException;
-import org.apache.marmotta.platform.core.test.base.JettyMarmotta;
-import org.apache.marmotta.platform.ldp.webservices.LdpWebService;
-import org.junit.*;
-import org.junit.rules.TestName;
-import org.junit.runner.Description;
-import org.junit.runner.Runner;
-import org.junit.runner.notification.RunNotifier;
-import org.junit.runners.Suite;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.ws.rs.core.UriBuilder;
-import java.io.IOException;
-import java.net.URISyntaxException;
-
-import static org.junit.Assert.assertNotNull;
-
-/**
- * LDP Test Case JUnit Runner
- *
- * @author Sergio Fernández
- */
-public class LdpTestCaseRunner extends Runner {
-
-    private static Logger log = LoggerFactory.getLogger(LdpTestCaseRunner.class);
-
-    private final LdpTestCase testCase;
-
-    private String baseUrl;
-
-    public LdpTestCaseRunner(LdpTestCase testCase) {
-        this.testCase = testCase;
-    }
-
-    @Override
-    public Description getDescription() {
-        return Description.createSuiteDescription(testCase.getUri().getLocalName());
-    }
-
-    @Override
-    public void run(RunNotifier notifier) {
-        notifier.fireTestRunStarted(getDescription());
-        try {
-            run();
-        } catch (Exception e) {
-            //TODO
-            //notifier.fireTestFailure(e);
-        }
-        notifier.fireTestFinished(getDescription());
-    }
-
-    /**
-     * Actual test case run method, which build the test case execution
-     * on the fly based on
-     */
-    private void run() {
-        Assume.assumeNotNull(baseUrl);
-        assertNotNull(testCase);
-        assertNotNull(testCase.getUri());
-        String context = buildContext(testCase);
-        log.warn("Executing LDP Test Case {} over context {}...", testCase.getUri().getLocalName(), context);
-
-        //basic pre-checking
-        //RestAssured.expect().statusCode(200).get(baseUrl); //TODO: clarify this (root container?)
-        RestAssured.expect().statusCode(404).get(context);
-
-        //load all information of the test cases
-        readTestCase(testCase);
-
-        //actual test case execution
-
-    }
-
-    private void readTestCase(LdpTestCase testCase) {
-        //TODO: read all details
-    }
-
-    private String buildContext(LdpTestCase testCase) {
-        return baseUrl + "/" + testCase.getUri().getLocalName().toLowerCase();
-    }
-
-    public String getBaseUrl() {
-        return baseUrl;
-    }
-
-    public void setBaseUrl(String baseUrl) {
-        this.baseUrl = baseUrl;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/b5cfb0a5/platform/marmotta-ldp/src/test/java/org/apache/marmotta/platform/ldp/testsuite/LdpTestCases.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-ldp/src/test/java/org/apache/marmotta/platform/ldp/testsuite/LdpTestCases.java b/platform/marmotta-ldp/src/test/java/org/apache/marmotta/platform/ldp/testsuite/LdpTestCases.java
deleted file mode 100644
index ace1b23..0000000
--- a/platform/marmotta-ldp/src/test/java/org/apache/marmotta/platform/ldp/testsuite/LdpTestCases.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * 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.platform.ldp.testsuite;
-
-import com.jayway.restassured.RestAssured;
-import org.apache.marmotta.platform.core.test.base.JettyMarmotta;
-import org.apache.marmotta.platform.ldp.webservices.LdpWebService;
-import org.junit.ClassRule;
-import org.junit.rules.ExternalResource;
-import org.junit.runner.RunWith;
-
-import javax.ws.rs.core.UriBuilder;
-
-/**
- * LDP Test Cases
- *
- * @author Sergio Fernández
- *
- * @see <a href="https://dvcs.w3.org/hg/ldpwg/raw-file/default/Test%20Cases/LDP%20Test%20Cases.html">LDP Test Cases</a>
- */
-@RunWith(LdpTestCasesRunner.class)
-public class LdpTestCases {
-
-    public final static String ROOT_PATH = "/testsuite/";
-
-    public final static String BASE = "http://www.w3.org/TR/ldp-test-cases/";
-
-    public final static String MANIFEST_CACHE = "LDP-Test-Cases-WD-live";
-
-    @ClassRule
-    public static ExternalResource marmotta = new MarmottaResource();
-
-    public static class MarmottaResource extends ExternalResource {
-
-        JettyMarmotta marmotta;
-
-        String baseUrl;
-
-        @Override
-        protected void before() throws Throwable {
-            marmotta = new JettyMarmotta("/marmotta", LdpWebService.class);
-            RestAssured.baseURI = "http://localhost";
-            RestAssured.port = marmotta.getPort();
-            RestAssured.basePath = marmotta.getContext();
-            baseUrl = UriBuilder.fromUri("http://localhost").port(marmotta.getPort()).path(marmotta.getContext()).build().toString();
-        }
-
-        @Override
-        protected void after() {
-            //marmotta.shutdown();
-            marmotta = null;
-        }
-
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/b5cfb0a5/platform/marmotta-ldp/src/test/java/org/apache/marmotta/platform/ldp/testsuite/LdpTestCasesRunner.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-ldp/src/test/java/org/apache/marmotta/platform/ldp/testsuite/LdpTestCasesRunner.java b/platform/marmotta-ldp/src/test/java/org/apache/marmotta/platform/ldp/testsuite/LdpTestCasesRunner.java
deleted file mode 100644
index 4cb18a7..0000000
--- a/platform/marmotta-ldp/src/test/java/org/apache/marmotta/platform/ldp/testsuite/LdpTestCasesRunner.java
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
- * 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.platform.ldp.testsuite;
-
-import org.apache.commons.lang3.StringUtils;
-import org.apache.marmotta.platform.ldp.webservices.LdpWebService;
-import org.junit.rules.TestRule;
-import org.junit.runner.Runner;
-import org.junit.runner.notification.RunNotifier;
-import org.junit.runners.Suite;
-import org.junit.runners.model.FrameworkField;
-import org.openrdf.model.URI;
-import org.openrdf.query.*;
-import org.openrdf.repository.Repository;
-import org.openrdf.repository.RepositoryConnection;
-import org.openrdf.repository.RepositoryException;
-import org.openrdf.rio.RDFFormat;
-import org.openrdf.rio.RDFParseException;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.IOException;
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Field;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-/**
- * LDP Test Cases JUnit Runner
- *
- * @author Sergio Fernández
- */
-public class LdpTestCasesRunner extends Suite {
-
-    private static Logger log = LoggerFactory.getLogger(LdpTestCasesRunner.class);
-
-    private LdpTestCases.MarmottaResource marmotta;
-
-    private Repository repo;
-
-    private List<Runner> runners;
-
-    public LdpTestCasesRunner(Class<?> klass) throws Throwable {
-        super(klass, Collections.EMPTY_LIST);
-
-        //load test cases manifest
-        repo = loadManifest();
-
-        //get children runners for each test cases from manifest
-        RepositoryConnection conn = repo.getConnection();
-        try {
-            conn.begin();
-            runners = buildTestCasesFromManifest(conn);
-            log.info("Initialized LDP test suite with {} test cases", runners.size());
-            conn.commit();
-        } finally {
-            conn.close();
-        }
-
-        //get embedded marmotta from rules
-        //TODO: it should be an easier way to do it...
-        for (TestRule rule : this.classRules()) {
-            if (LdpTestCases.MarmottaResource.class.equals(rule.getClass())) {
-                marmotta = (LdpTestCases.MarmottaResource)rule;
-                break;
-            }
-        }
-    }
-
-    @Override
-    protected List<Runner> getChildren() {
-        return Collections.unmodifiableList(runners);
-    }
-
-    @Override
-    protected void runChild(Runner runner, RunNotifier notifier) {
-        if (runner instanceof LdpTestCaseRunner) {
-            ((LdpTestCaseRunner)runner).setBaseUrl(marmotta.baseUrl + LdpWebService.PATH);
-        }
-        super.runChild(runner, notifier);
-    }
-
-    private Repository loadManifest() throws RepositoryException, RDFParseException, IOException {
-        String path = LdpTestCases.ROOT_PATH + LdpTestCases.MANIFEST_CACHE + ".ttl";
-        return LdpTestCasesUtils.loadData(path, RDFFormat.TURTLE);
-    }
-
-    private static List<Runner> buildTestCasesFromManifest(RepositoryConnection conn) throws Throwable {
-        List<Runner> runners = new ArrayList<>();
-        try {
-            String testCasesQuery = LdpTestCasesUtils.getNormativeNamespacesSparql()+ "\n"
-                    + "SELECT ?tc WHERE { ?tc a td:TestCase }";
-            TupleQuery tupleQuery = conn.prepareTupleQuery(QueryLanguage.SPARQL, testCasesQuery);
-            TupleQueryResult results = tupleQuery.evaluate();
-            try {
-                while (results.hasNext()) {
-                    BindingSet bindings = results.next();
-                    LdpTestCase testCase = new LdpTestCase((URI)bindings.getValue("tc"));
-                    runners.add(new LdpTestCaseRunner(testCase));
-                }
-            } finally {
-                results.close();
-            }
-        } catch (RepositoryException e) {
-            log.error("Error loading test cases: {}", e.getMessage(), e);
-        } catch (QueryEvaluationException | MalformedQueryException e) {
-            log.error("Error performing test cases' query: {}", e.getMessage(), e);
-        }
-        return runners;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/b5cfb0a5/platform/marmotta-ldp/src/test/java/org/apache/marmotta/platform/ldp/testsuite/LdpTestCasesUtils.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-ldp/src/test/java/org/apache/marmotta/platform/ldp/testsuite/LdpTestCasesUtils.java b/platform/marmotta-ldp/src/test/java/org/apache/marmotta/platform/ldp/testsuite/LdpTestCasesUtils.java
deleted file mode 100644
index 9270da7..0000000
--- a/platform/marmotta-ldp/src/test/java/org/apache/marmotta/platform/ldp/testsuite/LdpTestCasesUtils.java
+++ /dev/null
@@ -1,130 +0,0 @@
-/*
- * 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.platform.ldp.testsuite;
-
-import org.openrdf.repository.Repository;
-import org.openrdf.repository.RepositoryConnection;
-import org.openrdf.repository.RepositoryException;
-import org.openrdf.repository.sail.SailRepository;
-import org.openrdf.rio.RDFFormat;
-import org.openrdf.rio.RDFParseException;
-import org.openrdf.sail.memory.MemoryStore;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Properties;
-
-/**
- * Utils functions for the test cases
- *
- * @author Sergio Fernández
- */
-public class LdpTestCasesUtils {
-
-    /**
-     * Load test cases' data
-     *
-     * @param path path to the manifest file
-     * @param format serialization format used in the manifest file
-     * @return In-Memory repository with the data
-     * @throws org.openrdf.rio.RDFParseException
-     * @throws org.openrdf.repository.RepositoryException
-     * @throws java.io.IOException
-     */
-    public static Repository loadData(String path, RDFFormat format) throws RDFParseException, RepositoryException, IOException {
-        Repository repo = new SailRepository(new MemoryStore());
-        repo.initialize();
-        RepositoryConnection conn = repo.getConnection();
-        try {
-            conn.begin();
-            conn.clear();
-            InputStream is = LdpTestCasesUtils.class.getResourceAsStream(path);
-            if (is == null) {
-                throw new IOException("Manifest file not found at: " + path);
-            } else {
-                try {
-                    conn.add(is, LdpTestCases.BASE, RDFFormat.TURTLE);
-                } finally {
-                    is.close();
-                }
-            }
-            addNormativeNamespaces(conn);
-            conn.commit();
-        } finally {
-            conn.close();
-        }
-        return repo;
-    }
-
-    /**
-     * Get normative namespaces
-     *
-     * @throws IOException
-     * @throws RepositoryException
-     *
-     * @see <a href="https://dvcs.w3.org/hg/ldpwg/raw-file/default/Test%20Cases/LDP%20Test%20Cases.html#h3_namespaces-used">Sec. 4.1 Namespaces used</a>
-     */
-    public static Map<String,String> getNormativeNamespaces() throws IOException {
-        String path = LdpTestCases.ROOT_PATH + "namespaces.properties";
-        Map<String,String> prefixes = new HashMap<>();
-        Properties properties = new Properties();
-        properties.load(LdpTestCasesUtils.class.getResourceAsStream(path));
-        for(String key : properties.stringPropertyNames()) {
-            String value = properties.getProperty(key);
-            prefixes.put(key, value);
-        }
-        return Collections.unmodifiableMap(prefixes);
-    }
-
-    /**
-     * Get normative namespaces with SPARQL syntax
-     *
-     * @throws IOException
-     */
-    public static String getNormativeNamespacesSparql() throws IOException {
-        StringBuffer sb = new StringBuffer();
-        Map<String, String> normativeNamespaces = getNormativeNamespaces();
-        for (Map.Entry<String, String> entry : normativeNamespaces.entrySet()) {
-            //PREFIX dc: <http://purl.org/dc/terms/>
-            sb.append("PREFIX ");
-            sb.append(entry.getKey());
-            sb.append(": <");
-            sb.append(entry.getValue());
-            sb.append("> \n");
-        }
-        return sb.toString();
-    }
-
-    /**
-     * Add normative namespaces
-     *
-     * @param conn target connection
-     * @throws IOException
-     * @throws RepositoryException
-     */
-    public static void addNormativeNamespaces(RepositoryConnection conn) throws IOException, RepositoryException {
-        Map<String, String> normativeNamespaces = getNormativeNamespaces();
-        for (Map.Entry<String, String> entry : normativeNamespaces.entrySet()) {
-            conn.setNamespace(entry.getValue(), entry.getKey());
-        }
-    }
-
-}


[038/100] [abbrv] [partial] Reverting the erroneous merge by Sebastian according to the instructions in INFRA-6876

Posted by wi...@apache.org.
http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0012-in.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0012-in.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0012-in.jsonld
deleted file mode 100644
index d06cec5..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0012-in.jsonld
+++ /dev/null
@@ -1,20 +0,0 @@
-{
-  "@id": [
-    {
-      "@id": "http://example.org/med-1",
-      "@type": "http://smartplatforms.org/terms#Medication",
-      "http://smartplatforms.org/terms#hasFulfillment": {
-        "@id": "http://example.org/fill-1"
-      },
-      "http://smartplatforms.org/terms#label": "Lisinopril"
-    },
-    {
-      "@id": "http://example.org/fill-1",
-      "@type": "http://smartplatforms.org/terms#Fulfillment",
-      "http://smartplatforms.org/terms#hasMedication": {
-        "@id": "http://example.org/med-1"
-      },
-      "http://smartplatforms.org/terms#label": "30 pills on 2/2/2011"
-    }
-  ]
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0012-out.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0012-out.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0012-out.jsonld
deleted file mode 100644
index 920dfca..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0012-out.jsonld
+++ /dev/null
@@ -1,24 +0,0 @@
-[
-  {
-    "@context": {
-      "sp": "http://smartplatforms.org/terms#"
-    },
-    "@id": "http://example.org/med-1",
-    "@type": "sp:Medication",
-    "sp:hasFulfillment": {
-      "@id": "http://example.org/fill-1"
-    },
-    "sp:label": "Lisinopril"
-  },
-  {
-    "@context": {
-      "sp": "http://smartplatforms.org/terms#"
-    },
-    "@id": "http://example.org/fill-1",
-    "@type": "sp:Fulfillment",
-    "sp:hasMedication": {
-      "@id": "http://example.org/med-1"
-    },
-    "sp:label": "30 pills on 2/2/2011"
-  }
-]
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0013-frame.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0013-frame.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0013-frame.jsonld
deleted file mode 100644
index 0637a08..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0013-frame.jsonld
+++ /dev/null
@@ -1 +0,0 @@
-[]
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0013-in.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0013-in.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0013-in.jsonld
deleted file mode 100644
index e95cc1b..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0013-in.jsonld
+++ /dev/null
@@ -1,18 +0,0 @@
-{
-  "@id": [
-    {
-      "@id": "looker",
-      "canSee": [
-        {
-          "@id": "forgotten"
-        },
-        {
-          "@id": "spotted"
-        }
-      ]
-    },
-    {
-      "@id": "spotted"
-    }
-  ]
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0013-out.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0013-out.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0013-out.jsonld
deleted file mode 100644
index c58f9cb..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0013-out.jsonld
+++ /dev/null
@@ -1,19 +0,0 @@
-[
-  {
-    "@id": "forgotten"
-  },
-  {
-    "@id": "looker",
-    "canSee": [
-      {
-        "@id": "forgotten"
-      },
-      {
-        "@id": "spotted"
-      }
-    ]
-  },
-  {
-    "@id": "spotted"
-  }
-]
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0014-frame.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0014-frame.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0014-frame.jsonld
deleted file mode 100644
index a8b5073..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0014-frame.jsonld
+++ /dev/null
@@ -1,7 +0,0 @@
-[
-  {
-    "@type": [
-      "Node"
-    ]
-  }
-]
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0014-in.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0014-in.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0014-in.jsonld
deleted file mode 100644
index 86fb3bc..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0014-in.jsonld
+++ /dev/null
@@ -1,11 +0,0 @@
-{
-  "@id": "a",
-  "@type": "Node",
-  "sees": {
-    "@id": "b",
-    "@type": "Node",
-    "sees": {
-      "remember_me": "This value should not disappear."
-    }
-  }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0014-out.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0014-out.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0014-out.jsonld
deleted file mode 100644
index ed0b011..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0014-out.jsonld
+++ /dev/null
@@ -1,17 +0,0 @@
-[
-  {
-    "@id": "a",
-    "@type": "Node",
-    "sees": {
-      "@id": "b"
-    }
-  },
-  {
-    "@id": "b",
-    "@type": "Node",
-    "sees": {
-      "@id": "_:c14n0",
-      "remember_me": "This value should not disappear."
-    }
-  }
-]
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0015-frame.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0015-frame.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0015-frame.jsonld
deleted file mode 100644
index bfe8672..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0015-frame.jsonld
+++ /dev/null
@@ -1,227 +0,0 @@
-[
-  {
-    "@context": {
-      "api": "http://smartplatforms.org/terms/api#",
-      "dcterms": "http://purl.org/dc/terms/",
-      "foaf": "http://xmlns.com/foaf/0.1/",
-      "owl": "http://www.w3.org/2002/07/owl#",
-      "rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
-      "rdfs": "http://www.w3.org/2000/01/rdf-schema#",
-      "sp": "http://smartplatforms.org/terms#",
-      "sp:abnormalInterpretation": {
-        "@type": "@id"
-      },
-      "sp:address": {
-        "@type": "@id"
-      },
-      "sp:alertLevel": {
-        "@type": "@id"
-      },
-      "sp:allergicReaction": {
-        "@type": "@id"
-      },
-      "sp:allergyExclusionName": {
-        "@type": "@id"
-      },
-      "sp:belongsTo": {
-        "@type": "@id"
-      },
-      "sp:bloodPressure": {
-        "@type": "@id"
-      },
-      "sp:bodyMassIndex": {
-        "@type": "@id"
-      },
-      "sp:bodyPosition": {
-        "@type": "@id"
-      },
-      "sp:bodySite": {
-        "@type": "@id"
-      },
-      "sp:category": {
-        "@type": "@id"
-      },
-      "sp:code": {
-        "@type": "@id"
-      },
-      "sp:created": {
-        "@type": "@id"
-      },
-      "sp:denominator": {
-        "@type": "@id"
-      },
-      "sp:diastolic": {
-        "@type": "@id"
-      },
-      "sp:drugAllergen": {
-        "@type": "@id"
-      },
-      "sp:drugClass": {
-        "@type": "@id"
-      },
-      "sp:drugClassAllergen": {
-        "@type": "@id"
-      },
-      "sp:drugName": {
-        "@type": "@id"
-      },
-      "sp:encounter": {
-        "@type": "@id"
-      },
-      "sp:encounterType": {
-        "@type": "@id"
-      },
-      "sp:facility": {
-        "@type": "@id"
-      },
-      "sp:foodAllergen": {
-        "@type": "@id"
-      },
-      "sp:frequency": {
-        "@type": "@id"
-      },
-      "sp:fulfillment": {
-        "@type": "@id"
-      },
-      "sp:hasStatement": {
-        "@type": "@id"
-      },
-      "sp:heartRate": {
-        "@type": "@id"
-      },
-      "sp:height": {
-        "@type": "@id"
-      },
-      "sp:labName": {
-        "@type": "@id"
-      },
-      "sp:labResult": {
-        "@type": "@id"
-      },
-      "sp:labSpecimenCollected": {
-        "@type": "@id"
-      },
-      "sp:labStatus": {
-        "@type": "@id"
-      },
-      "sp:maximum": {
-        "@type": "@id"
-      },
-      "sp:medicalRecordNumber": {
-        "@type": "@id"
-      },
-      "sp:medication": {
-        "@type": "@id"
-      },
-      "sp:method": {
-        "@type": "@id"
-      },
-      "sp:minimum": {
-        "@type": "@id"
-      },
-      "sp:narrativeResult": {
-        "@type": "@id"
-      },
-      "sp:nominalResult": {
-        "@type": "@id"
-      },
-      "sp:nonCriticalRange": {
-        "@type": "@id"
-      },
-      "sp:normalRange": {
-        "@type": "@id"
-      },
-      "sp:numerator": {
-        "@type": "@id"
-      },
-      "sp:ordinalResult": {
-        "@type": "@id"
-      },
-      "sp:organization": {
-        "@type": "@id"
-      },
-      "sp:oxygenSaturation": {
-        "@type": "@id"
-      },
-      "sp:participant": {
-        "@type": "@id"
-      },
-      "sp:person": {
-        "@type": "@id"
-      },
-      "sp:pharmacy": {
-        "@type": "@id"
-      },
-      "sp:problemName": {
-        "@type": "@id"
-      },
-      "sp:provenance": {
-        "@type": "@id"
-      },
-      "sp:provider": {
-        "@type": "@id"
-      },
-      "sp:quantitativeResult": {
-        "@type": "@id"
-      },
-      "sp:quantity": {
-        "@type": "@id"
-      },
-      "sp:quantityDispensed": {
-        "@type": "@id"
-      },
-      "sp:respiratoryRate": {
-        "@type": "@id"
-      },
-      "sp:severity": {
-        "@type": "@id"
-      },
-      "sp:specimenCollected": {
-        "@type": "@id"
-      },
-      "sp:systolic": {
-        "@type": "@id"
-      },
-      "sp:temperature": {
-        "@type": "@id"
-      },
-      "sp:translationFidelity": {
-        "@type": "@id"
-      },
-      "sp:valueAndUnit": {
-        "@type": "@id"
-      },
-      "sp:vitalName": {
-        "@type": "@id"
-      },
-      "sp:weight": {
-        "@type": "@id"
-      },
-      "spcode": "http://smartplatforms.org/terms/codes/",
-      "vcard": "http://www.w3.org/2006/vcard/ns#",
-      "vcard:adr": {
-        "@type": "@id"
-      },
-      "vcard:n": {
-        "@type": "@id"
-      },
-      "vcard:tel": {
-        "@type": "@id"
-      }
-    },
-    "@type": [
-      "http://smartplatforms.org/terms#Statement",
-      "http://smartplatforms.org/terms#Fulfillment",
-      "http://smartplatforms.org/terms#Alert",
-      "http://smartplatforms.org/terms#AllergyExclusion",
-      "http://smartplatforms.org/terms#Demographics",
-      "http://smartplatforms.org/terms#Problem",
-      "http://smartplatforms.org/terms#Medication",
-      "http://smartplatforms.org/terms#VitalSigns",
-      "http://smartplatforms.org/terms#MedicalRecord",
-      "http://smartplatforms.org/terms#LabResult",
-      "http://smartplatforms.org/terms#Allergy",
-      "http://smartplatforms.org/terms#Encounter"
-    ]
-  }
-]
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0015-in.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0015-in.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0015-in.jsonld
deleted file mode 100644
index fce8c8c..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0015-in.jsonld
+++ /dev/null
@@ -1,70 +0,0 @@
-[
-  {
-    "@id": "http://localhost:7000/records/999888",
-    "@type": "http://smartplatforms.org/terms#MedicalRecord"
-  },
-  {
-    "@id": "http://localhost:7000/records/999888",
-    "http://smartplatforms.org/terms#hasStatement": {
-      "@id": "http://localhost:7000/records/999888/vital_signs/c9ddca3e-3df8-4f13-9a16-eecd80aa8ff6"
-    }
-  },
-  {
-    "@id": "_:uDkkVEva509",
-    "@type": "http://smartplatforms.org/terms#VitalSign"
-  },
-  {
-    "@id": "_:uDkkVEva509",
-    "http://smartplatforms.org/terms#vitalName": {
-      "@id": "_:uDkkVEva510"
-    }
-  },
-  {
-    "@id": "_:uDkkVEva509",
-    "http://smartplatforms.org/terms#value": "111.226458141"
-  },
-  {
-    "@id": "_:uDkkVEva509",
-    "http://smartplatforms.org/terms#unit": "mm[Hg]"
-  },
-  {
-    "@id": "_:uDkkVEva508",
-    "@type": "http://smartplatforms.org/terms#BloodPressure"
-  },
-  {
-    "@id": "_:uDkkVEva508",
-    "http://smartplatforms.org/terms#systolic": {
-      "@id": "_:uDkkVEva509"
-    }
-  },
-  {
-    "@id": "http://localhost:7000/records/999888/vital_signs/c9ddca3e-3df8-4f13-9a16-eecd80aa8ff6",
-    "http://smartplatforms.org/terms#bloodPressure": {
-      "@id": "_:uDkkVEva508"
-    }
-  },
-  {
-    "@id": "http://localhost:7000/records/999888/vital_signs/c9ddca3e-3df8-4f13-9a16-eecd80aa8ff6",
-    "@type": "http://smartplatforms.org/terms#VitalSigns"
-  },
-  {
-    "@id": "http://localhost:7000/records/999888/vital_signs/c9ddca3e-3df8-4f13-9a16-eecd80aa8ff6",
-    "http://smartplatforms.org/terms#belongsTo": {
-      "@id": "http://localhost:7000/records/999888"
-    }
-  },
-  {
-    "@id": "_:uDkkVEva510",
-    "http://purl.org/dc/terms/title": "Systolic blood pressure"
-  },
-  {
-    "@id": "_:uDkkVEva510",
-    "@type": "http://smartplatforms.org/terms#CodedValue"
-  },
-  {
-    "@id": "_:uDkkVEva510",
-    "http://smartplatforms.org/terms#code": {
-      "@id": "http://loinc.org/codes/8480-6"
-    }
-  }
-]
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0015-out.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0015-out.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0015-out.jsonld
deleted file mode 100644
index 8c433b3..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0015-out.jsonld
+++ /dev/null
@@ -1,44 +0,0 @@
-[
-  {
-    "@context": {
-      "sp": "http://smartplatforms.org/terms#",
-      "sp:hasStatement": {
-        "@type": "@id"
-      }
-    },
-    "@id": "http://localhost:7000/records/999888",
-    "@type": "sp:MedicalRecord",
-    "sp:hasStatement": "http://localhost:7000/records/999888/vital_signs/c9ddca3e-3df8-4f13-9a16-eecd80aa8ff6"
-  },
-  {
-    "@context": {
-      "dcterms": "http://purl.org/dc/terms/",
-      "sp": "http://smartplatforms.org/terms#",
-      "sp:belongsTo": {
-        "@type": "@id"
-      },
-      "sp:code": {
-        "@type": "@id"
-      }
-    },
-    "@id": "http://localhost:7000/records/999888/vital_signs/c9ddca3e-3df8-4f13-9a16-eecd80aa8ff6",
-    "@type": "sp:VitalSigns",
-    "sp:belongsTo": "http://localhost:7000/records/999888",
-    "sp:bloodPressure": {
-      "@id": "_:c14n0",
-      "@type": "sp:BloodPressure",
-      "sp:systolic": {
-        "@id": "_:c14n2",
-        "@type": "sp:VitalSign",
-        "sp:unit": "mm[Hg]",
-        "sp:value": "111.226458141",
-        "sp:vitalName": {
-          "@id": "_:c14n1",
-          "@type": "sp:CodedValue",
-          "dcterms:title": "Systolic blood pressure",
-          "sp:code": "http://loinc.org/codes/8480-6"
-        }
-      }
-    }
-  }
-]
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-manifest.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-manifest.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-manifest.jsonld
deleted file mode 100644
index f3567d1..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-manifest.jsonld
+++ /dev/null
@@ -1,98 +0,0 @@
-{
-   "@context": "http://json-ld.org/test-suite/context.jsonld",
-   "@id": "",
-   "@type": "jld:Manifest",
-   "rdfs:comment": "JSON-LD to Framing tests use object compare",
-   "name": "frame",
-   "sequence": [{
-      "@type": ["test:TestCase", "jld:FrameTest"],
-      "name": "simple",
-      "input": "frame-0001-in.jsonld",
-      "frame": "frame-0001-frame.jsonld",
-      "expect": "frame-0001-out.jsonld"
-   }, {
-      "@type": ["test:TestCase", "jld:FrameTest"],
-      "name": "reframe w/extra CURIE value",
-      "input": "frame-0002-in.jsonld",
-      "frame": "frame-0002-frame.jsonld",
-      "expect": "frame-0002-out.jsonld"
-   }, {
-      "@type": ["test:TestCase", "jld:FrameTest"],
-      "name": "reframe (null)",
-      "input": "frame-0003-in.jsonld",
-      "frame": "frame-0003-frame.jsonld",
-      "expect": "frame-0003-out.jsonld"
-   }, {
-      "@type": ["test:TestCase", "jld:FrameTest"],
-      "name": "reframe (type)",
-      "input": "frame-0004-in.jsonld",
-      "frame": "frame-0004-frame.jsonld",
-      "expect": "frame-0004-out.jsonld"
-   }, {
-      "@type": ["test:TestCase", "jld:FrameTest"],
-      "name": "reframe (explicit)",
-      "input": "frame-0005-in.jsonld",
-      "frame": "frame-0005-frame.jsonld",
-      "expect": "frame-0005-out.jsonld"
-   }, {
-      "@type": ["test:TestCase", "jld:FrameTest"],
-      "name": "reframe (non-explicit)",
-      "input": "frame-0006-in.jsonld",
-      "frame": "frame-0006-frame.jsonld",
-      "expect": "frame-0006-out.jsonld"
-   }, {
-      "@type": ["test:TestCase", "jld:FrameTest"],
-      "name": "input has multiple types",
-      "input": "frame-0007-in.jsonld",
-      "frame": "frame-0007-frame.jsonld",
-      "expect": "frame-0007-out.jsonld"
-   }, {
-      "@type": ["test:TestCase", "jld:FrameTest"],
-      "name": "array framing cases",
-      "input": "frame-0008-in.jsonld",
-      "frame": "frame-0008-frame.jsonld",
-      "expect": "frame-0008-out.jsonld"
-   }, {
-      "@type": ["test:TestCase", "jld:FrameTest"],
-      "name": "default value",
-      "input": "frame-0009-in.jsonld",
-      "frame": "frame-0009-frame.jsonld",
-      "expect": "frame-0009-out.jsonld"
-   }, {
-      "@type": ["test:TestCase", "jld:FrameTest"],
-      "name": "property CURIE conflict",
-      "input": "frame-0010-in.jsonld",
-      "frame": "frame-0010-frame.jsonld",
-      "expect": "frame-0010-out.jsonld"
-   }, {  
-      "@type": ["test:TestCase", "jld:FrameTest"],
-      "name": "@embed",
-      "input": "frame-0011-in.jsonld",
-      "frame": "frame-0011-frame.jsonld",
-      "expect": "frame-0011-out.jsonld"
-   }, {
-      "@type": ["test:TestCase", "jld:FrameTest"],
-      "name": "Array frame",
-      "input": "frame-0012-in.jsonld",
-      "frame": "frame-0012-frame.jsonld",
-      "expect": "frame-0012-out.jsonld"
-   }, {
-      "@type": ["test:TestCase", "jld:FrameTest"],
-      "name": "Replace existing embed",
-      "input": "frame-0013-in.jsonld",
-      "frame": "frame-0013-frame.jsonld",
-      "expect": "frame-0013-out.jsonld"
-   }, {
-      "@type": ["test:TestCase", "jld:FrameTest"],
-      "name": "Replace existing embed on 2nd pass",
-      "input": "frame-0014-in.jsonld",
-      "frame": "frame-0014-frame.jsonld",
-      "expect": "frame-0014-out.jsonld"
-   }, {
-      "@type": ["test:TestCase", "jld:FrameTest"],
-      "name": "Replace deeply-nested embed",
-      "input": "frame-0015-in.jsonld",
-      "frame": "frame-0015-frame.jsonld",
-      "expect": "frame-0015-out.jsonld"
-   }]
-}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0001-in.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0001-in.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0001-in.jsonld
deleted file mode 100644
index 39c6605..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0001-in.jsonld
+++ /dev/null
@@ -1,3 +0,0 @@
-{
-  "@id": "http://example.org/test#example"
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0001-out.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0001-out.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0001-out.jsonld
deleted file mode 100644
index aa595db..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0001-out.jsonld
+++ /dev/null
@@ -1 +0,0 @@
-[{"@id":"http://example.org/test#example"}]
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0002-in.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0002-in.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0002-in.jsonld
deleted file mode 100644
index bdcb83c..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0002-in.jsonld
+++ /dev/null
@@ -1,14 +0,0 @@
-{
-  "@context": {
-    "ex": "http://example.org/vocab#"
-  },
-  "@id": "http://example.org/test#example1",
-  "ex:p": [
-    {
-      "@id": "http://example.org/test#example2"
-    },
-    {
-      "@id": "http://example.org/test#example2"
-    }
-  ]
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0002-out.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0002-out.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0002-out.jsonld
deleted file mode 100644
index 90ab0e4..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0002-out.jsonld
+++ /dev/null
@@ -1 +0,0 @@
-[{"@id":"http://example.org/test#example1","http://example.org/vocab#p":{"@id":"http://example.org/test#example2"}},{"@id":"http://example.org/test#example2"}]
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0003-in.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0003-in.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0003-in.jsonld
deleted file mode 100644
index efdc7a8..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0003-in.jsonld
+++ /dev/null
@@ -1,6 +0,0 @@
-{
-  "@context": {
-    "ex": "http://example.org/vocab#"
-  },
-  "@type": "ex:Foo"
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0003-out.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0003-out.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0003-out.jsonld
deleted file mode 100644
index 1d7f491..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0003-out.jsonld
+++ /dev/null
@@ -1 +0,0 @@
-[{"@id":"_:c14n0","@type":"http://example.org/vocab#Foo"}]
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0004-in.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0004-in.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0004-in.jsonld
deleted file mode 100644
index b6d71c5..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0004-in.jsonld
+++ /dev/null
@@ -1,9 +0,0 @@
-{
-  "@context": {
-    "ex": "http://example.org/vocab#"
-  },
-  "@type": "ex:Foo",
-  "ex:embed": {
-    "@id": "http://example.org/test#example"
-  }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0004-out.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0004-out.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0004-out.jsonld
deleted file mode 100644
index 1296996..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0004-out.jsonld
+++ /dev/null
@@ -1 +0,0 @@
-[{"@id":"_:c14n0","@type":"http://example.org/vocab#Foo","http://example.org/vocab#embed":{"@id":"http://example.org/test#example"}},{"@id":"http://example.org/test#example"}]
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0005-in.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0005-in.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0005-in.jsonld
deleted file mode 100644
index 28264b9..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0005-in.jsonld
+++ /dev/null
@@ -1,10 +0,0 @@
-{
-  "@context": {
-    "ex": "http://example.org/vocab#"
-  },
-  "@id": "http://example.org/test#example",
-  "@type": "ex:Foo",
-  "ex:embed": {
-    "@type": "ex:Bar"
-  }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0005-out.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0005-out.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0005-out.jsonld
deleted file mode 100644
index 308a71d..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0005-out.jsonld
+++ /dev/null
@@ -1 +0,0 @@
-[{"@id":"_:c14n0","@type":"http://example.org/vocab#Bar"},{"@id":"http://example.org/test#example","@type":"http://example.org/vocab#Foo","http://example.org/vocab#embed":{"@id":"_:c14n0"}}]
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0006-in.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0006-in.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0006-in.jsonld
deleted file mode 100644
index 122aa0b..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0006-in.jsonld
+++ /dev/null
@@ -1,10 +0,0 @@
-{
-  "@context": {
-    "ex": "http://example.org/vocab#"
-  },
-  "@id": "http://example.org/test#example",
-  "@type": [
-    "ex:Foo",
-    "ex:Bar"
-  ]
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0006-out.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0006-out.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0006-out.jsonld
deleted file mode 100644
index e909479..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0006-out.jsonld
+++ /dev/null
@@ -1 +0,0 @@
-[{"@id":"http://example.org/test#example","@type":["http://example.org/vocab#Foo","http://example.org/vocab#Bar"]}]
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0007-in.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0007-in.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0007-in.jsonld
deleted file mode 100644
index 13fe150..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0007-in.jsonld
+++ /dev/null
@@ -1,12 +0,0 @@
-{
-  "@context": {
-    "ex": "http://example.org/vocab#",
-    "ex:foo": {
-      "@type": "@id"
-    },
-    "xsd": "http://www.w3.org/2001/XMLSchema#"
-  },
-  "@id": "http://example.org/test#example",
-  "@type": "ex:Foo",
-  "ex:foo": "ex:Bar"
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0007-out.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0007-out.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0007-out.jsonld
deleted file mode 100644
index d3a24f7..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0007-out.jsonld
+++ /dev/null
@@ -1 +0,0 @@
-[{"@id":"http://example.org/test#example","@type":"http://example.org/vocab#Foo","http://example.org/vocab#foo":{"@id":"http://example.org/vocab#Bar"}},{"@id":"http://example.org/vocab#Bar"}]
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0008-in.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0008-in.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0008-in.jsonld
deleted file mode 100644
index 311c34d..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0008-in.jsonld
+++ /dev/null
@@ -1,20 +0,0 @@
-{
-  "@context": {
-    "dc": "http://purl.org/dc/elements/1.1/",
-    "ex": "http://example.org/vocab#",
-    "ex:contains": {
-      "@type": "@id"
-    }
-  },
-  "@id": "http://example.org/test#library",
-  "ex:contains": {
-    "@id": "http://example.org/test#book",
-    "dc:contributor": "Writer",
-    "dc:title": "My Book",
-    "ex:contains": {
-      "@id": "http://example.org/test#chapter",
-      "dc:description": "Fun",
-      "dc:title": "Chapter One"
-    }
-  }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0008-out.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0008-out.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0008-out.jsonld
deleted file mode 100644
index fd9b5d9..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0008-out.jsonld
+++ /dev/null
@@ -1 +0,0 @@
-[{"@id":"http://example.org/test#book","http://example.org/vocab#contains":{"@id":"http://example.org/test#chapter"},"http://purl.org/dc/elements/1.1/contributor":"Writer","http://purl.org/dc/elements/1.1/title":"My Book"},{"@id":"http://example.org/test#chapter","http://purl.org/dc/elements/1.1/description":"Fun","http://purl.org/dc/elements/1.1/title":"Chapter One"},{"@id":"http://example.org/test#library","http://example.org/vocab#contains":{"@id":"http://example.org/test#book"}}]
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0009-in.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0009-in.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0009-in.jsonld
deleted file mode 100644
index ac24485..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0009-in.jsonld
+++ /dev/null
@@ -1,39 +0,0 @@
-{
-  "@context": {
-    "dc": "http://purl.org/dc/elements/1.1/",
-    "ex": "http://example.org/vocab#",
-    "ex:authored": {
-      "@type": "@id"
-    },
-    "ex:contains": {
-      "@type": "@id"
-    },
-    "foaf": "http://xmlns.com/foaf/0.1/",
-    "xsd": "http://www.w3.org/2001/XMLSchema#"
-  },
-  "@id": [
-    {
-      "@id": "http://example.org/test#chapter",
-      "dc:description": "Fun",
-      "dc:title": "Chapter One"
-    },
-    {
-      "@id": "http://example.org/test#jane",
-      "ex:authored": "http://example.org/test#chapter",
-      "foaf:name": "Jane"
-    },
-    {
-      "@id": "http://example.org/test#john",
-      "foaf:name": "John"
-    },
-    {
-      "@id": "http://example.org/test#library",
-      "ex:contains": {
-        "@id": "http://example.org/test#book",
-        "dc:contributor": "Writer",
-        "dc:title": "My Book",
-        "ex:contains": "http://example.org/test#chapter"
-      }
-    }
-  ]
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0009-out.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0009-out.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0009-out.jsonld
deleted file mode 100644
index 5af067a..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0009-out.jsonld
+++ /dev/null
@@ -1 +0,0 @@
-[{"@id":"http://example.org/test#book","http://example.org/vocab#contains":{"@id":"http://example.org/test#chapter"},"http://purl.org/dc/elements/1.1/contributor":"Writer","http://purl.org/dc/elements/1.1/title":"My Book"},{"@id":"http://example.org/test#chapter","http://purl.org/dc/elements/1.1/description":"Fun","http://purl.org/dc/elements/1.1/title":"Chapter One"},{"@id":"http://example.org/test#jane","http://example.org/vocab#authored":{"@id":"http://example.org/test#chapter"},"http://xmlns.com/foaf/0.1/name":"Jane"},{"@id":"http://example.org/test#john","http://xmlns.com/foaf/0.1/name":"John"},{"@id":"http://example.org/test#library","http://example.org/vocab#contains":{"@id":"http://example.org/test#book"}}]
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0010-in.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0010-in.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0010-in.jsonld
deleted file mode 100644
index c71bc96..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0010-in.jsonld
+++ /dev/null
@@ -1,11 +0,0 @@
-{
-  "@context": {
-    "ex": "http://example.org/vocab#",
-    "ex:validFrom": {
-      "@type": "xsd:dateTime"
-    },
-    "xsd": "http://www.w3.org/2001/XMLSchema#"
-  },
-  "@id": "http://example.org/test#example",
-  "ex:validFrom": "2011-01-25T00:00:00+0000"
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0010-out.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0010-out.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0010-out.jsonld
deleted file mode 100644
index 62a7e90..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0010-out.jsonld
+++ /dev/null
@@ -1 +0,0 @@
-[{"@id":"http://example.org/test#example","http://example.org/vocab#validFrom":{"@value":"2011-01-25T00:00:00+0000","@type":"http://www.w3.org/2001/XMLSchema#dateTime"}}]
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0011-in.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0011-in.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0011-in.jsonld
deleted file mode 100644
index 4beabc9..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0011-in.jsonld
+++ /dev/null
@@ -1,11 +0,0 @@
-{
-  "@context": {
-    "ex": "http://example.org/vocab#",
-    "ex:validFrom": {
-      "@type": "xsd:dateTime"
-    },
-    "xsd": "http://www.w3.org/2001/XMLSchema#"
-  },
-  "@id": "http://example.org/test#example",
-  "ex:validFrom": "2011-01-25T00:00:00Z"
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0011-out.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0011-out.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0011-out.jsonld
deleted file mode 100644
index cfa685c..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0011-out.jsonld
+++ /dev/null
@@ -1 +0,0 @@
-[{"@id":"http://example.org/test#example","http://example.org/vocab#validFrom":{"@value":"2011-01-25T00:00:00Z","@type":"http://www.w3.org/2001/XMLSchema#dateTime"}}]
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0012-in.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0012-in.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0012-in.jsonld
deleted file mode 100644
index 3c04439..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0012-in.jsonld
+++ /dev/null
@@ -1,14 +0,0 @@
-{
-  "@context": {
-    "ex": "http://example.org/vocab#",
-    "ex:date": {
-      "@type": "xsd:dateTime"
-    },
-    "xsd": "http://www.w3.org/2001/XMLSchema#"
-  },
-  "@id": "http://example.org/test#example",
-  "ex:date": [
-    "2011-01-25T00:00:00Z",
-    "2011-01-25T00:00:00Z"
-  ]
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0012-out.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0012-out.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0012-out.jsonld
deleted file mode 100644
index a447093..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0012-out.jsonld
+++ /dev/null
@@ -1 +0,0 @@
-[{"@id":"http://example.org/test#example","http://example.org/vocab#date":{"@value":"2011-01-25T00:00:00Z","@type":"http://www.w3.org/2001/XMLSchema#dateTime"}}]

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0013-in.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0013-in.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0013-in.jsonld
deleted file mode 100644
index b49fac4..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0013-in.jsonld
+++ /dev/null
@@ -1,18 +0,0 @@
-{
-  "@context": {
-    "ex": "http://example.org/vocab#",
-    "ex:date": {
-      "@type": "xsd:dateTime"
-    },
-    "ex:parent": {
-      "@type": "@id"
-    },
-    "xsd": "http://www.w3.org/2001/XMLSchema#"
-  },
-  "@id": "http://example.org/test#example1",
-  "ex:date": "2011-01-25T00:00:00Z",
-  "ex:embed": {
-    "@id": "http://example.org/test#example2",
-    "ex:parent": "http://example.org/test#example1"
-  }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0013-out.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0013-out.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0013-out.jsonld
deleted file mode 100644
index 42a9ed6..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0013-out.jsonld
+++ /dev/null
@@ -1 +0,0 @@
-[{"@id":"http://example.org/test#example1","http://example.org/vocab#date":{"@value":"2011-01-25T00:00:00Z","@type":"http://www.w3.org/2001/XMLSchema#dateTime"},"http://example.org/vocab#embed":{"@id":"http://example.org/test#example2"}},{"@id":"http://example.org/test#example2","http://example.org/vocab#parent":{"@id":"http://example.org/test#example1"}}]
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0014-in.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0014-in.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0014-in.jsonld
deleted file mode 100644
index 2998d9c..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0014-in.jsonld
+++ /dev/null
@@ -1,16 +0,0 @@
-{
-  "@context": {
-    "d": "http://purl.org/dc/elements/1.1/",
-    "e": "http://example.org/vocab#",
-    "e:double-zero": {
-      "@type": "xsd:double"
-    },
-    "f": "http://xmlns.com/foaf/0.1/",
-    "xsd": "http://www.w3.org/2001/XMLSchema#"
-  },
-  "@id": "http://example.org/test",
-  "e:bool": true,
-  "e:double": 1.23,
-  "e:double-zero": 0,
-  "e:int": 123
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0014-out.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0014-out.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0014-out.jsonld
deleted file mode 100644
index fc3bd59..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0014-out.jsonld
+++ /dev/null
@@ -1 +0,0 @@
-[{"@id":"http://example.org/test","http://example.org/vocab#bool":{"@value":"true","@type":"http://www.w3.org/2001/XMLSchema#boolean"},"http://example.org/vocab#double":{"@value":"1.230000e+00","@type":"http://www.w3.org/2001/XMLSchema#double"},"http://example.org/vocab#double-zero":{"@value":"0.000000e+00","@type":"http://www.w3.org/2001/XMLSchema#double"},"http://example.org/vocab#int":{"@value":"123","@type":"http://www.w3.org/2001/XMLSchema#integer"}}]
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0015-in.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0015-in.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0015-in.jsonld
deleted file mode 100644
index 90bceb0..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0015-in.jsonld
+++ /dev/null
@@ -1,13 +0,0 @@
-{
-  "@context": {
-    "e": "http://example.org/vocab#"
-  },
-  "@id": [
-    {
-      "@id": "e:A"
-    },
-    {
-      "@id": "e:B"
-    }
-  ]
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0015-out.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0015-out.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0015-out.jsonld
deleted file mode 100644
index 9c936c6..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0015-out.jsonld
+++ /dev/null
@@ -1 +0,0 @@
-[{"@id":"http://example.org/vocab#A"},{"@id":"http://example.org/vocab#B"}]
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0016-in.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0016-in.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0016-in.jsonld
deleted file mode 100644
index 752edf5..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0016-in.jsonld
+++ /dev/null
@@ -1,18 +0,0 @@
-{
-  "@context": {
-    "e": "http://example.org/vocab#",
-    "e:B": {
-      "@type": "@id"
-    },
-    "xsd": "http://www.w3.org/2001/XMLSchema#"
-  },
-  "@id": "http://example.org/test",
-  "e:A": {
-    "@id": "_:b1"
-  },
-  "e:B": "_:b1",
-  "e:embed": {
-    "@id": "_:b1",
-    "name": "foo"
-  }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0016-out.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0016-out.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0016-out.jsonld
deleted file mode 100644
index a89213d..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0016-out.jsonld
+++ /dev/null
@@ -1 +0,0 @@
-[{"@id":"_:c14n0","name":"foo"},{"@id":"http://example.org/test","http://example.org/vocab#A":{"@id":"_:c14n0"},"http://example.org/vocab#B":{"@id":"_:c14n0"},"http://example.org/vocab#embed":{"@id":"_:c14n0"}}]
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0017-in.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0017-in.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0017-in.jsonld
deleted file mode 100644
index 17fcbc6..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0017-in.jsonld
+++ /dev/null
@@ -1,20 +0,0 @@
-[
-  {
-    "@context": {
-      "e": "http://example.org/vocab#",
-      "e:B": {
-        "@type": "@id"
-      },
-      "xsd": "http://www.w3.org/2001/XMLSchema#"
-    },
-    "@id": "http://example.org/test",
-    "e:A": {
-      "@id": "_:b1"
-    },
-    "e:B": "_:b1"
-  },
-  {
-    "@id": "_:b1",
-    "name": "foo"
-  }
-]
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0017-out.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0017-out.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0017-out.jsonld
deleted file mode 100644
index e309339..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0017-out.jsonld
+++ /dev/null
@@ -1 +0,0 @@
-[{"@id":"_:c14n0","name":"foo"},{"@id":"http://example.org/test","http://example.org/vocab#A":{"@id":"_:c14n0"},"http://example.org/vocab#B":{"@id":"_:c14n0"}}]
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0018-in.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0018-in.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0018-in.jsonld
deleted file mode 100644
index e233f90..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0018-in.jsonld
+++ /dev/null
@@ -1,11 +0,0 @@
-{
-  "@context": {
-    "e": "http://example.org/vocab#",
-    "e:self": {
-      "@type": "@id"
-    },
-    "xsd": "http://www.w3.org/2001/XMLSchema#"
-  },
-  "@id": "_:b0",
-  "e:self": "_:b0"
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0018-out.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0018-out.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0018-out.jsonld
deleted file mode 100644
index f48c254..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0018-out.jsonld
+++ /dev/null
@@ -1 +0,0 @@
-[{"@id":"_:c14n0","http://example.org/vocab#self":{"@id":"_:c14n0"}}]
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0019-in.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0019-in.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0019-in.jsonld
deleted file mode 100644
index 186c46d..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0019-in.jsonld
+++ /dev/null
@@ -1,19 +0,0 @@
-{
-  "@context": {
-    "e": "http://example.org/vocab#",
-    "e:self": {
-      "@type": "@id"
-    },
-    "xsd": "http://www.w3.org/2001/XMLSchema#"
-  },
-  "@id": [
-    {
-      "@id": "_:b0",
-      "e:self": "_:b0"
-    },
-    {
-      "@id": "_:b1",
-      "e:self": "_:b1"
-    }
-  ]
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0019-out.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0019-out.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0019-out.jsonld
deleted file mode 100644
index 6c4ffb7..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0019-out.jsonld
+++ /dev/null
@@ -1 +0,0 @@
-[{"@id":"_:c14n0","http://example.org/vocab#self":{"@id":"_:c14n0"}},{"@id":"_:c14n1","http://example.org/vocab#self":{"@id":"_:c14n1"}}]
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0020-in.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0020-in.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0020-in.jsonld
deleted file mode 100644
index 23cc465..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0020-in.jsonld
+++ /dev/null
@@ -1,33 +0,0 @@
-{
-  "@context": {
-    "e": "http://example.org/vocab#",
-    "e:A": {
-      "@type": "@id"
-    },
-    "e:B": {
-      "@type": "@id"
-    },
-    "e:next": {
-      "@type": "@id"
-    },
-    "xsd": "http://www.w3.org/2001/XMLSchema#"
-  },
-  "@id": [
-    {
-      "@id": "e:test",
-      "e:A": "_:b1",
-      "e:B": "_:b2"
-    },
-    {
-      "@id": "_:b1",
-      "e:next": "_:b3"
-    },
-    {
-      "@id": "_:b2",
-      "e:next": "_:b3"
-    },
-    {
-      "@id": "_:b3"
-    }
-  ]
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0020-out.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0020-out.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0020-out.jsonld
deleted file mode 100644
index 1c9432d..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0020-out.jsonld
+++ /dev/null
@@ -1 +0,0 @@
-[{"@id":"_:c14n0"},{"@id":"_:c14n1","http://example.org/vocab#next":{"@id":"_:c14n0"}},{"@id":"_:c14n2","http://example.org/vocab#next":{"@id":"_:c14n0"}},{"@id":"http://example.org/vocab#test","http://example.org/vocab#A":{"@id":"_:c14n1"},"http://example.org/vocab#B":{"@id":"_:c14n2"}}]
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0021-in.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0021-in.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0021-in.jsonld
deleted file mode 100644
index 59142a0..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0021-in.jsonld
+++ /dev/null
@@ -1,19 +0,0 @@
-{
-  "@context": {
-    "e": "http://example.org/vocab#",
-    "e:next": {
-      "@type": "@id"
-    },
-    "xsd": "http://www.w3.org/2001/XMLSchema#"
-  },
-  "@id": [
-    {
-      "@id": "_:b1",
-      "e:next": "_:b2"
-    },
-    {
-      "@id": "_:b2",
-      "e:next": "_:b1"
-    }
-  ]
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0021-out.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0021-out.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0021-out.jsonld
deleted file mode 100644
index 34b36ab..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0021-out.jsonld
+++ /dev/null
@@ -1 +0,0 @@
-[{"@id":"_:c14n0","http://example.org/vocab#next":{"@id":"_:c14n1"}},{"@id":"_:c14n1","http://example.org/vocab#next":{"@id":"_:c14n0"}}]
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0022-in.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0022-in.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0022-in.jsonld
deleted file mode 100644
index 5809e45..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0022-in.jsonld
+++ /dev/null
@@ -1,24 +0,0 @@
-{
-  "@context": {
-    "e": "http://example.org/vocab#",
-    "e:next": {
-      "@type": "@id"
-    },
-    "e:prev": {
-      "@type": "@id"
-    },
-    "xsd": "http://www.w3.org/2001/XMLSchema#"
-  },
-  "@id": [
-    {
-      "@id": "_:b1",
-      "e:next": "_:b2",
-      "e:prev": "_:b2"
-    },
-    {
-      "@id": "_:b2",
-      "e:next": "_:b1",
-      "e:prev": "_:b1"
-    }
-  ]
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0022-out.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0022-out.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0022-out.jsonld
deleted file mode 100644
index 62e0cd2..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0022-out.jsonld
+++ /dev/null
@@ -1 +0,0 @@
-[{"@id":"_:c14n0","http://example.org/vocab#next":{"@id":"_:c14n1"},"http://example.org/vocab#prev":{"@id":"_:c14n1"}},{"@id":"_:c14n1","http://example.org/vocab#next":{"@id":"_:c14n0"},"http://example.org/vocab#prev":{"@id":"_:c14n0"}}]
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0023-in.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0023-in.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0023-in.jsonld
deleted file mode 100644
index 4a8091f..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0023-in.jsonld
+++ /dev/null
@@ -1,23 +0,0 @@
-{
-  "@context": {
-    "e": "http://example.org/vocab#",
-    "e:next": {
-      "@type": "@id"
-    },
-    "xsd": "http://www.w3.org/2001/XMLSchema#"
-  },
-  "@id": [
-    {
-      "@id": "_:b1",
-      "e:next": "_:b2"
-    },
-    {
-      "@id": "_:b2",
-      "e:next": "_:b3"
-    },
-    {
-      "@id": "_:b3",
-      "e:next": "_:b1"
-    }
-  ]
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0023-out.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0023-out.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0023-out.jsonld
deleted file mode 100644
index e7a87e2..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0023-out.jsonld
+++ /dev/null
@@ -1 +0,0 @@
-[{"@id":"_:c14n0","http://example.org/vocab#next":{"@id":"_:c14n1"}},{"@id":"_:c14n1","http://example.org/vocab#next":{"@id":"_:c14n2"}},{"@id":"_:c14n2","http://example.org/vocab#next":{"@id":"_:c14n0"}}]
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0024-in.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0024-in.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0024-in.jsonld
deleted file mode 100644
index 34e76a2..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0024-in.jsonld
+++ /dev/null
@@ -1,29 +0,0 @@
-{
-  "@context": {
-    "e": "http://example.org/vocab#",
-    "e:next": {
-      "@type": "@id"
-    },
-    "e:prev": {
-      "@type": "@id"
-    },
-    "xsd": "http://www.w3.org/2001/XMLSchema#"
-  },
-  "@id": [
-    {
-      "@id": "_:b1",
-      "e:next": "_:b2",
-      "e:prev": "_:b3"
-    },
-    {
-      "@id": "_:b2",
-      "e:next": "_:b3",
-      "e:prev": "_:b1"
-    },
-    {
-      "@id": "_:b3",
-      "e:next": "_:b1",
-      "e:prev": "_:b2"
-    }
-  ]
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0024-out.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0024-out.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0024-out.jsonld
deleted file mode 100644
index dbb2900..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0024-out.jsonld
+++ /dev/null
@@ -1 +0,0 @@
-[{"@id":"_:c14n0","http://example.org/vocab#next":{"@id":"_:c14n1"},"http://example.org/vocab#prev":{"@id":"_:c14n2"}},{"@id":"_:c14n1","http://example.org/vocab#next":{"@id":"_:c14n2"},"http://example.org/vocab#prev":{"@id":"_:c14n0"}},{"@id":"_:c14n2","http://example.org/vocab#next":{"@id":"_:c14n0"},"http://example.org/vocab#prev":{"@id":"_:c14n1"}}]
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0025-in.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0025-in.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0025-in.jsonld
deleted file mode 100644
index f425006..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0025-in.jsonld
+++ /dev/null
@@ -1,29 +0,0 @@
-{
-  "@context": {
-    "e": "http://example.org/vocab#",
-    "e:next": {
-      "@type": "@id"
-    },
-    "e:prev": {
-      "@type": "@id"
-    },
-    "xsd": "http://www.w3.org/2001/XMLSchema#"
-  },
-  "@id": [
-    {
-      "@id": "_:b1",
-      "e:next": "_:b2",
-      "e:prev": "_:b3"
-    },
-    {
-      "@id": "_:b3",
-      "e:next": "_:b1",
-      "e:prev": "_:b2"
-    },
-    {
-      "@id": "_:b2",
-      "e:next": "_:b3",
-      "e:prev": "_:b1"
-    }
-  ]
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0025-out.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0025-out.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0025-out.jsonld
deleted file mode 100644
index dbb2900..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0025-out.jsonld
+++ /dev/null
@@ -1 +0,0 @@
-[{"@id":"_:c14n0","http://example.org/vocab#next":{"@id":"_:c14n1"},"http://example.org/vocab#prev":{"@id":"_:c14n2"}},{"@id":"_:c14n1","http://example.org/vocab#next":{"@id":"_:c14n2"},"http://example.org/vocab#prev":{"@id":"_:c14n0"}},{"@id":"_:c14n2","http://example.org/vocab#next":{"@id":"_:c14n0"},"http://example.org/vocab#prev":{"@id":"_:c14n1"}}]
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0026-in.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0026-in.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0026-in.jsonld
deleted file mode 100644
index ea9a2bd..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0026-in.jsonld
+++ /dev/null
@@ -1,29 +0,0 @@
-{
-  "@context": {
-    "e": "http://example.org/vocab#",
-    "e:next": {
-      "@type": "@id"
-    },
-    "e:prev": {
-      "@type": "@id"
-    },
-    "xsd": "http://www.w3.org/2001/XMLSchema#"
-  },
-  "@id": [
-    {
-      "@id": "_:b2",
-      "e:next": "_:b3",
-      "e:prev": "_:b1"
-    },
-    {
-      "@id": "_:b1",
-      "e:next": "_:b2",
-      "e:prev": "_:b3"
-    },
-    {
-      "@id": "_:b3",
-      "e:next": "_:b1",
-      "e:prev": "_:b2"
-    }
-  ]
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0026-out.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0026-out.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0026-out.jsonld
deleted file mode 100644
index dbb2900..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0026-out.jsonld
+++ /dev/null
@@ -1 +0,0 @@
-[{"@id":"_:c14n0","http://example.org/vocab#next":{"@id":"_:c14n1"},"http://example.org/vocab#prev":{"@id":"_:c14n2"}},{"@id":"_:c14n1","http://example.org/vocab#next":{"@id":"_:c14n2"},"http://example.org/vocab#prev":{"@id":"_:c14n0"}},{"@id":"_:c14n2","http://example.org/vocab#next":{"@id":"_:c14n0"},"http://example.org/vocab#prev":{"@id":"_:c14n1"}}]
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0027-in.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0027-in.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0027-in.jsonld
deleted file mode 100644
index 4fcac78..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0027-in.jsonld
+++ /dev/null
@@ -1,29 +0,0 @@
-{
-  "@context": {
-    "e": "http://example.org/vocab#",
-    "e:next": {
-      "@type": "@id"
-    },
-    "e:prev": {
-      "@type": "@id"
-    },
-    "xsd": "http://www.w3.org/2001/XMLSchema#"
-  },
-  "@id": [
-    {
-      "@id": "_:b2",
-      "e:next": "_:b3",
-      "e:prev": "_:b1"
-    },
-    {
-      "@id": "_:b3",
-      "e:next": "_:b1",
-      "e:prev": "_:b2"
-    },
-    {
-      "@id": "_:b1",
-      "e:next": "_:b2",
-      "e:prev": "_:b3"
-    }
-  ]
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0027-out.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0027-out.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0027-out.jsonld
deleted file mode 100644
index dbb2900..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0027-out.jsonld
+++ /dev/null
@@ -1 +0,0 @@
-[{"@id":"_:c14n0","http://example.org/vocab#next":{"@id":"_:c14n1"},"http://example.org/vocab#prev":{"@id":"_:c14n2"}},{"@id":"_:c14n1","http://example.org/vocab#next":{"@id":"_:c14n2"},"http://example.org/vocab#prev":{"@id":"_:c14n0"}},{"@id":"_:c14n2","http://example.org/vocab#next":{"@id":"_:c14n0"},"http://example.org/vocab#prev":{"@id":"_:c14n1"}}]
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0028-in.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0028-in.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0028-in.jsonld
deleted file mode 100644
index fb981bf..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0028-in.jsonld
+++ /dev/null
@@ -1,29 +0,0 @@
-{
-  "@context": {
-    "e": "http://example.org/vocab#",
-    "e:next": {
-      "@type": "@id"
-    },
-    "e:prev": {
-      "@type": "@id"
-    },
-    "xsd": "http://www.w3.org/2001/XMLSchema#"
-  },
-  "@id": [
-    {
-      "@id": "_:b3",
-      "e:next": "_:b1",
-      "e:prev": "_:b2"
-    },
-    {
-      "@id": "_:b2",
-      "e:next": "_:b3",
-      "e:prev": "_:b1"
-    },
-    {
-      "@id": "_:b1",
-      "e:next": "_:b2",
-      "e:prev": "_:b3"
-    }
-  ]
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0028-out.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0028-out.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0028-out.jsonld
deleted file mode 100644
index dbb2900..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0028-out.jsonld
+++ /dev/null
@@ -1 +0,0 @@
-[{"@id":"_:c14n0","http://example.org/vocab#next":{"@id":"_:c14n1"},"http://example.org/vocab#prev":{"@id":"_:c14n2"}},{"@id":"_:c14n1","http://example.org/vocab#next":{"@id":"_:c14n2"},"http://example.org/vocab#prev":{"@id":"_:c14n0"}},{"@id":"_:c14n2","http://example.org/vocab#next":{"@id":"_:c14n0"},"http://example.org/vocab#prev":{"@id":"_:c14n1"}}]
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0029-in.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0029-in.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0029-in.jsonld
deleted file mode 100644
index 7788b3e..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0029-in.jsonld
+++ /dev/null
@@ -1,29 +0,0 @@
-{
-  "@context": {
-    "e": "http://example.org/vocab#",
-    "e:next": {
-      "@type": "@id"
-    },
-    "e:prev": {
-      "@type": "@id"
-    },
-    "xsd": "http://www.w3.org/2001/XMLSchema#"
-  },
-  "@id": [
-    {
-      "@id": "_:b3",
-      "e:next": "_:b1",
-      "e:prev": "_:b2"
-    },
-    {
-      "@id": "_:b1",
-      "e:next": "_:b2",
-      "e:prev": "_:b3"
-    },
-    {
-      "@id": "_:b2",
-      "e:next": "_:b3",
-      "e:prev": "_:b1"
-    }
-  ]
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0029-out.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0029-out.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0029-out.jsonld
deleted file mode 100644
index dbb2900..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0029-out.jsonld
+++ /dev/null
@@ -1 +0,0 @@
-[{"@id":"_:c14n0","http://example.org/vocab#next":{"@id":"_:c14n1"},"http://example.org/vocab#prev":{"@id":"_:c14n2"}},{"@id":"_:c14n1","http://example.org/vocab#next":{"@id":"_:c14n2"},"http://example.org/vocab#prev":{"@id":"_:c14n0"}},{"@id":"_:c14n2","http://example.org/vocab#next":{"@id":"_:c14n0"},"http://example.org/vocab#prev":{"@id":"_:c14n1"}}]
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0030-in.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0030-in.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0030-in.jsonld
deleted file mode 100644
index 0ae2e0f..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0030-in.jsonld
+++ /dev/null
@@ -1,38 +0,0 @@
-{
-  "@context": {
-    "e": "http://example.org/vocab#",
-    "e:A": {
-      "@type": "@id"
-    },
-    "e:B": {
-      "@type": "@id"
-    },
-    "e:C": {
-      "@type": "@id"
-    },
-    "e:next": {
-      "@type": "@id"
-    },
-    "xsd": "http://www.w3.org/2001/XMLSchema#"
-  },
-  "@id": [
-    {
-      "@id": "e:test",
-      "e:A": "_:b1",
-      "e:B": "_:b2",
-      "e:C": "_:b3"
-    },
-    {
-      "@id": "_:b1",
-      "e:next": "_:b2"
-    },
-    {
-      "@id": "_:b2",
-      "e:next": "_:b3"
-    },
-    {
-      "@id": "_:b3",
-      "e:next": "_:b1"
-    }
-  ]
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0030-out.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0030-out.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0030-out.jsonld
deleted file mode 100644
index 38e1aca..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0030-out.jsonld
+++ /dev/null
@@ -1 +0,0 @@
-[{"@id":"_:c14n0","http://example.org/vocab#next":{"@id":"_:c14n1"}},{"@id":"_:c14n1","http://example.org/vocab#next":{"@id":"_:c14n2"}},{"@id":"_:c14n2","http://example.org/vocab#next":{"@id":"_:c14n0"}},{"@id":"http://example.org/vocab#test","http://example.org/vocab#A":{"@id":"_:c14n0"},"http://example.org/vocab#B":{"@id":"_:c14n1"},"http://example.org/vocab#C":{"@id":"_:c14n2"}}]
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0031-in.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0031-in.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0031-in.jsonld
deleted file mode 100644
index 5a05ec9..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0031-in.jsonld
+++ /dev/null
@@ -1,7 +0,0 @@
-{
-  "@context": {
-    "ex": "http://example.org/vocab#"
-  },
-  "@id": "_:a",
-  "@type": "ex:Foo"
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0031-out.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0031-out.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0031-out.jsonld
deleted file mode 100644
index 1d7f491..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0031-out.jsonld
+++ /dev/null
@@ -1 +0,0 @@
-[{"@id":"_:c14n0","@type":"http://example.org/vocab#Foo"}]
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0032-in.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0032-in.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0032-in.jsonld
deleted file mode 100644
index 2359444..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0032-in.jsonld
+++ /dev/null
@@ -1,7 +0,0 @@
-{
-  "@context": {
-    "ex": "http://example.org/vocab#"
-  },
-  "@id": "_:b",
-  "@type": "ex:Foo"
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0032-out.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0032-out.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0032-out.jsonld
deleted file mode 100644
index 1d7f491..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/normalize-0032-out.jsonld
+++ /dev/null
@@ -1 +0,0 @@
-[{"@id":"_:c14n0","@type":"http://example.org/vocab#Foo"}]
\ No newline at end of file


[040/100] [abbrv] [partial] Reverting the erroneous merge by Sebastian according to the instructions in INFRA-6876

Posted by wi...@apache.org.
http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/ext/java/de/dfki/km/json/jsonld/JSONLDUtils.java
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/ext/java/de/dfki/km/json/jsonld/JSONLDUtils.java b/commons/sesame-tools-rio-jsonld/src/ext/java/de/dfki/km/json/jsonld/JSONLDUtils.java
deleted file mode 100644
index 8e67644..0000000
--- a/commons/sesame-tools-rio-jsonld/src/ext/java/de/dfki/km/json/jsonld/JSONLDUtils.java
+++ /dev/null
@@ -1,855 +0,0 @@
-package de.dfki.km.json.jsonld;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-public class JSONLDUtils {
-
-    public static class NameGenerator {
-        private String prefix;
-        private int count;
-
-        public NameGenerator(String prefix) {
-            this.prefix = prefix;
-            this.count = -1;
-        }
-
-        public String next() {
-            count += 1;
-            return current();
-        }
-
-        public String current() {
-            return "_:" + prefix + count;
-        }
-
-        public boolean inNamespace(String iri) {
-            return iri.startsWith("_:" + prefix);
-        }
-    }
-
-    public static Map<String, String> getKeywords(Object ctx) {
-        Map<String, String> rval = new HashMap<String, String>();
-        rval.put("@id", "@id");
-        rval.put("@language", "@language");
-        rval.put("@value", "@value");
-        rval.put("@type", "@type");
-
-        if (ctx != null && ctx instanceof Map) {
-            Map<String, String> keywords = new HashMap<String, String>();
-            for (String key : ((Map<String, Object>) ctx).keySet()) {
-                Object value = ((Map<String, String>) ctx).get(key);
-                if (value instanceof String && rval.containsKey(value)) {
-                    keywords.put((String) value, key);
-                }
-            }
-
-            rval.putAll(keywords);
-        }
-        return rval;
-    }
-
-    public static String getTermIri(Object ctx, String term) {
-        String rval = null;
-
-        if (((Map<String, Object>) ctx).containsKey(term)) {
-            Object t = ((Map<String, Object>) ctx).get(term);
-            if (t instanceof String) {
-                rval = (String) t;
-            } else if (t instanceof Map && ((Map<String, Object>) t).containsKey("@id")) {
-                rval = (String) ((Map<String, Object>) t).get("@id");
-            }
-        }
-
-        return rval;
-    }
-
-    public static Map<String, Object> mergeContexts(Object ctxOne, Object ctxTwo) {
-
-        Map<String, Object> ctx1;
-        Map<String, Object> ctx2;
-
-        if (ctxOne instanceof List) {
-            ctx1 = mergeContexts(new HashMap<String, Object>(), ctxOne);
-        } else {
-            ctx1 = (Map<String, Object>) ctxOne;
-        }
-
-        Map<String, Object> merged = (Map<String, Object>) clone(ctx1);
-
-        if (ctxTwo instanceof List) {
-            for (Object i : (List<Object>) ctxTwo) {
-                merged = mergeContexts(merged, i);
-            }
-        } else {
-            ctx2 = (Map<String, Object>) ctxTwo;
-
-            for (String key : ctx2.keySet()) {
-                if (!key.startsWith("@")) {
-                    for (String mkey : merged.keySet()) {
-                        if (merged.get(mkey).equals(ctx2.get(key))) {
-                            // FIXME: update related @coerce rules
-                            merged.remove(mkey);
-                            break;
-                        }
-                    }
-                }
-            }
-
-            // merge contexts
-            for (String key : ctx2.keySet()) {
-                merged.put(key, ctx2.get(key));
-            }
-        }
-        return merged;
-    }
-
-    @Deprecated
-    // TODO: it may make sense to keep this function, as usedCtx can be null
-    public static String compactIRI(Map<String, Object> ctx, String iri) {
-        return compactIRI(ctx, iri, null);
-    }
-
-    public static String compactIRI(Map<String, Object> ctx, String iri, Map<String, Object> usedCtx) {
-        String rval = null;
-
-        for (String key : ctx.keySet()) {
-            if (!key.startsWith("@")) {
-                if (iri.equals(getTermIri(ctx, key))) {
-                    // compact to a term
-                    rval = key;
-                    if (usedCtx != null) {
-                        usedCtx.put(key, clone(ctx.get(key)));
-                    }
-                    break;
-                }
-            }
-        }
-
-        // term not found, if term is keyword, use alias
-        if (rval == null) {
-            Map<String, String> keywords = getKeywords(ctx);
-            if (keywords.containsKey(iri)) {
-                rval = keywords.get(iri);
-                if (!rval.equals(iri) && usedCtx != null) {
-                    usedCtx.put(rval, iri);
-                }
-            }
-        }
-
-        if (rval == null) {
-            // rval still not found, check the context for a CURIE prefix
-            for (String key : ctx.keySet()) {
-                if (!key.startsWith("@")) {
-                    String ctxIRI = getTermIri(ctx, key);
-
-                    if (ctxIRI != null) {
-                        if (iri.startsWith(ctxIRI) && iri.length() > ctxIRI.length()) {
-                            rval = key + ":" + iri.substring(ctxIRI.length());
-                            if (usedCtx != null) {
-                                usedCtx.put(key, clone(ctx.get(key)));
-                            }
-                            break;
-                        }
-                    }
-                }
-            }
-        }
-
-        if (rval == null) {
-            // could not compact IRI
-            rval = iri;
-        }
-
-        return rval;
-    }
-
-    @Deprecated
-    // TODO: dep'd for backwards compatibility, but perhaps it's a valid
-    // function as usedCtx can be null
-    public static String getCoercionType(Map<String, Object> ctx, String property) {
-        return getCoercionType(ctx, property, new HashMap<String, Object>());
-    }
-
-    public static String getCoercionType(Map<String, Object> ctx, String property, Map<String, Object> usedCtx) {
-        String rval = null;
-
-        // get expanded property
-        String p = expandTerm(ctx, property, null);
-
-        // built-in type coercion JSON-LD-isms
-        if ("@id".equals(p) || "@type".equals(p)) {
-            rval = "@id";
-        } else {
-            p = compactIRI(ctx, p, null);// , null);
-
-            if (ctx.containsKey(p) && ctx.get(p) instanceof Map && ((Map<String, String>) ctx.get(p)).containsKey("@type")) {
-                String type = ((Map<String, String>) ctx.get(p)).get("@type");
-                rval = expandTerm(ctx, type, usedCtx);
-                if (usedCtx != null) {
-                    usedCtx.put(p, clone(ctx.get(p)));
-                }
-            }
-
-        }
-
-        return rval;
-    }
-
-    @Deprecated
-    // TODO: remove depreciated
-    public static String expandTerm(Map<String, Object> ctx, String term) {
-        return expandTerm(ctx, term, null);
-    }
-
-    public static String expandTerm(Map<String, Object> ctx, String term, Map<String, Object> usedCtx) {
-        Map<String, String> keywords = getKeywords(ctx);
-        String rval = term;
-
-        // 1. If the property has a colon, it has a prefix or an absolute IRI:
-        int idx = term.indexOf(":");
-        if (idx != -1) {
-            String prefix = term.substring(0, idx);
-
-            // 1.1 See if the prefix is in the context:
-            if (ctx.containsKey(prefix)) {
-                String iri = getTermIri(ctx, prefix);
-                rval = iri + term.substring(idx + 1);
-                if (usedCtx != null) {
-                    usedCtx.put(prefix, clone(ctx.get(prefix)));
-                }
-            }
-        } else if (ctx.containsKey(term)) {
-            // 2. If the property is in the context, then it's a term.
-            rval = getTermIri(ctx, term); // TODO: assuming string
-            if (usedCtx != null) {
-                usedCtx.put(term, clone(ctx.get(term)));
-            }
-        } else {
-            // 3. The property is a keyword.
-            for (String k : keywords.keySet()) {
-                String v = keywords.get(k);
-                if (v.equals(term)) {
-                    rval = k;
-                    break;
-                }
-            }
-
-        }
-
-        if (!term.equals(rval)) {
-        	//recurse
-        	return expandTerm(ctx, rval, usedCtx);
-        } else {
-        	return rval;
-        }
-    }
-
-    public static boolean isReference(Object value) {
-        return (value != null && value instanceof Map && ((Map<String, Object>) value).containsKey("@id") && ((Map<String, Object>) value).size() == 1);
-    }
-
-    public static boolean isSubject(Object value) {
-        boolean rval = false;
-        if (value != null && value instanceof Map && !((Map<String, Object>) value).containsKey("@value")) {
-            rval = ((Map<String, Object>) value).size() > 1 || !((Map<String, Object>) value).containsKey("@id");
-        }
-        return rval;
-    }
-
-    public static boolean isBlankNode(Object v) {
-        return isSubject(v) && (!((Map<String, Object>) v).containsKey("@id") || isNamedBlankNode(v));
-    }
-
-    public static boolean isNamedBlankNode(Object v) {
-        return v instanceof Map && ((Map<String, Object>) v).containsKey("@id") && isBlankNodeIri(((Map<String, Object>) v).get("@id"));
-    }
-
-    public static boolean isBlankNodeIri(Object input) {
-        return input instanceof String && ((String) input).startsWith("_:");
-    }
-
-    public static Object clone(Object value) {// throws
-                                              // CloneNotSupportedException {
-        Object rval = null;
-        if (value instanceof Cloneable) {
-            try {
-                rval = value.getClass().getMethod("clone").invoke(value);
-            } catch (Exception e) {
-                rval = e;
-            }
-        }
-        if (rval == null || rval instanceof Exception) {
-            // the object wasn't cloneable, or an error occured
-            if (value instanceof String || value instanceof Number || value instanceof Boolean) {
-                // strings numbers and booleans are immutable
-                rval = value;
-            } else {
-                // TODO: making this throw runtime exception so it doesn't have
-                // to be caught
-                // because simply it should never fail in the case of JSON-LD
-                // and means that
-                // the input JSON-LD is invalid
-                throw new RuntimeException(new CloneNotSupportedException((rval instanceof Exception ? ((Exception) rval).getMessage() : "")));
-            }
-        }
-        return rval;
-    }
-
-    public static int compare(Object v1, Object v2) {
-        int rval = 0;
-        
-        // TODO: not sure if we should allow this, but as long as the tests pass it "should" be ok.
-        if (v1 == null && v2 == null) {
-        	return 0;
-        }
-
-        if (v1 instanceof List && v2 instanceof List) {
-            if (((List) v1).size() != ((List) v2).size()) {
-                rval = 1;
-            } else {
-                // TODO: should the order of things in the list matter?
-                for (int i = 0; i < ((List<Object>) v1).size() && rval == 0; i++) {
-                    rval = compare(((List<Object>) v1).get(i), ((List<Object>) v2).get(i));
-                }
-            }
-        } else if (v1 instanceof Number && v2 instanceof Number) {
-            // TODO: this is VERY sketchy
-            double n1 = ((Number) v1).doubleValue();
-            double n2 = ((Number) v2).doubleValue();
-
-            rval = (n1 < n2 ? -1 : (n1 > n2 ? 1 : 0));
-        } else if (v1 instanceof String && v2 instanceof String) {
-            rval = ((String) v1).compareTo((String) v2);
-            if (rval > 1)
-                rval = 1;
-            else if (rval < -1)
-                rval = -1;
-        } else if (v1 instanceof Map && v2 instanceof Map) {
-            throw new RuntimeException("I don't know how I should handle this case yet!");
-            /*
-             * TODO: not sure what to do here exactly...
-             * 
-             * python can compare objects using the < and > operators. js pretends it can (i.e. it doesn't throw an error) but always returns false. thus the js
-             * code and the py code are inconsistant.
-             * 
-             * // TODO: this assumes the order of keys doesn't matter if (((Map) v1).size() != ((Map) v2).size() ) { rval = 1; } else { if (((Map) v1).size() !=
-             * ((Map) v2).size()) { rval = 1; } else { for (Object k1: ((Map) v1).keySet()) { rval = ((Map) v2).containsKey(k1) ? compare(((Map) v1).get(k1),
-             * ((Map) v2).get(k1)) : 1; if (rval != 0) { break; } } } } } else if (v1 instanceof Boolean && v2 instanceof Boolean) { //rval = (v1 == v2 ? 0 :
-             * 1);
-             */
-        } else {
-            // TODO: this is probably something I don't want to allow either
-            throw new RuntimeException("compare unspecified for these objects");
-            // rval = (v1.equals(v2) ? 0 : 1);
-        }
-        return rval;
-    }
-
-    public static int compareBlankNodeObjects(Map<String, Object> a, Map<String, Object> b) {
-        int rval = 0;
-
-        // the keys tend to come up unsorted, so try the following lines if this
-        // causes trouble
-        // List<String> akeys = new ArrayList<String>();
-        // akeys.addAll(a.keySet());
-        // Collections.sort(akeys);
-
-        for (String p : a.keySet()) {
-
-            if (!p.equals("@id")) { // TODO: this should ignore "ignoreKeyword" keywords as well
-                int lenA = (a.get(p) instanceof List ? ((List<Object>) a.get(p)).size() : 1);
-                int lenB = (b.get(p) instanceof List ? ((List<Object>) b.get(p)).size() : 1);
-                rval = compare(lenA, lenB);
-
-                if (rval == 0) {
-                    List<Object> objsA;
-                    List<Object> objsB;
-
-                    if (a.get(p) instanceof List) {
-                        objsA = (List<Object>) clone((List<Object>) a.get(p));
-                        objsB = (List<Object>) clone((List<Object>) b.get(p));
-                    } else {
-                        objsA = new ArrayList<Object>();
-                        objsA.add(a.get(p));
-                        objsB = new ArrayList<Object>();
-                        objsB.add(b.get(p));
-                    }
-
-                    for (int i = 0; i < objsA.size(); i++) {
-                        Object e = objsA.get(i);
-                        if (isNamedBlankNode(e)) {
-                            objsA.remove(i);
-                            --i;
-                        }
-                    }
-                    for (int i = 0; i < objsB.size(); i++) {
-                        Object e = objsB.get(i);
-                        if (isNamedBlankNode(e)) {
-                            objsB.remove(i);
-                            --i;
-                        }
-                    }
-
-                    rval = compare(objsA.size(), objsB.size());
-
-                    if (rval == 0) {
-                        Collections.sort(objsA, new Comparator<Object>() {
-                            public int compare(Object o1, Object o2) {
-                                return compareObjects(o1, o2);
-                            }
-                        });
-                        Collections.sort(objsB, new Comparator<Object>() {
-                            public int compare(Object o1, Object o2) {
-                                return compareObjects(o1, o2);
-                            }
-                        });
-                        for (int i = 0; i < objsA.size() && rval == 0; ++i) {
-                            rval = compareObjects(objsA.get(i), objsB.get(i));
-                            if (rval != 0) {
-                                break;
-                            }
-                        }
-                    }
-                }
-                if (rval != 0) {
-                    break;
-                }
-            }
-        }
-
-        return rval;
-    }
-
-    public static int compareObjects(Object o1, Object o2) {
-        int rval = 0;
-        if (o1 instanceof String) {
-            if (o2 instanceof String) {
-                rval = compare(o1, o2);
-            } else {
-                rval = -1;
-            }
-        } else if (o2 instanceof String) {
-            rval = 1;
-        } else if (o1 instanceof Map) {
-            rval = compareObjectKeys(o1, o2, "@value");
-            if (rval == 0) {
-                if (((Map) o1).containsKey("@value")) {
-                    rval = compareObjectKeys(o1, o2, "@type");
-                    if (rval == 0) {
-                        rval = compareObjectKeys(o1, o2, "@language");
-                    }
-                } else {
-                    rval = compare(((Map<String, Object>) o1).get("@id"), ((Map<String, Object>) o2).get("@id"));
-                }
-            }
-
-        }
-        return rval;
-    }
-
-    private static int compareObjectKeys(Object o1, Object o2, String key) {
-        int rval = 0;
-        if (((Map<String, Object>) o1).containsKey(key)) {
-            if (((Map<String, Object>) o2).containsKey(key)) {
-                rval = compare(((Map<String, Object>) o1).get(key), ((Map<String, Object>) o2).get(key));
-            } else {
-                rval = -1;
-            }
-        } else if (((Map<String, Object>) o2).containsKey(key)) {
-            rval = 1;
-        }
-        return rval;
-    }
-
-    public static void rotate(List<Object> a) {
-        if (a.size() > 0) {
-            Object tmp = a.remove(0);
-            a.add(tmp);
-        }
-    }
-
-    public static int compareSerializations(String s1, String s2) {
-        int rval = 0;
-        if (s1.length() == s2.length()) {
-            rval = compare(s1, s2);
-        } else if (s1.length() > s2.length()) {
-            rval = compare(s1.substring(0, s2.length()), s2);
-        } else {
-            rval = compare(s1, s2.substring(0, s1.length()));
-        }
-
-        return rval;
-    }
-
-    public static String serializeProperties(Map<String, Object> b) {
-        String rval = "";
-
-        Boolean first = true;
-        for (String p : b.keySet()) {
-            if (!"@id".equals(p)) {
-                if (first) {
-                    first = false;
-                } else {
-                    rval += "|";
-                }
-
-                rval += "<" + p + ">";
-
-                List<Object> objs = null;
-                if (b.get(p) instanceof List) {
-                    objs = (List<Object>) b.get(p);
-                } else {
-                    objs = new ArrayList<Object>();
-                    objs.add(b.get(p));
-                }
-
-                for (Object o : objs) {
-                    if (o instanceof Map) {
-                        if (((Map) o).containsKey("@id")) { // iri
-                            if (isBlankNodeIri(((Map<String, Object>) o).get("@id"))) {
-                                rval += "_:";
-                            } else {
-                                rval += "<" + ((Map<String, Object>) o).get("@id") + ">";
-                            }
-                        } else { // literal
-                            rval += "\"" + ((Map<String, Object>) o).get("@value") + "\"";
-                            if (((Map<String, Object>) o).containsKey("@type")) {
-                                rval += "^^<" + ((Map<String, Object>) o).get("@type") + ">";
-                            } else if (((Map<String, Object>) o).containsKey("@language")) {
-                                rval += "@" + ((Map<String, Object>) o).get("@language");
-                            }
-                        }
-                    } else {
-                        rval += "\"" + o + "\"";
-                    }
-                }
-            }
-        }
-
-        return rval;
-    }
-
-    public static void setProperty(Map<String, Object> s, String p, Object o) {
-        if (s.containsKey(p)) {
-            if (s.get(p) instanceof List) {
-                ((List<Object>) s.get(p)).add(o);
-            } else {
-                List<Object> tmp = new ArrayList<Object>();
-                tmp.add(s.get(p));
-                tmp.add(o);
-                s.put(p, tmp);
-            }
-        } else {
-            s.put(p, o);
-        }
-    }
-
-    /**
-     * Recursively frames the given input according to the given frame.
-     * 
-     * @param subjects
-     *            a map of subjects in the graph.
-     * @param input
-     *            the input to frame.
-     * @param frame
-     *            the frame to use.
-     * @param embeds
-     *            a map of previously embedded subjects, used to prevent cycles.
-     * @param autoembed
-     *            true if auto-embed is on, false if not.
-     * @param parent
-     *            the parent object (for subframing).
-     * @param parentKey
-     *            the parent key (for subframing).
-     * @param options
-     *            the framing options.
-     * @return the framed input.
-     */
-    public static Object frame(Map subjects, List input, Object frame, HashMap embeds, boolean autoembed, Object parent, String parentKey, Map options) {
-        Object rval = null;
-
-        int limit = -1;
-        List frames = null;
-
-        if (frame instanceof List) {
-            rval = new ArrayList();
-            frames = (List) frame;
-            if (frames.isEmpty()) {
-                frames.add(new HashMap());
-            }
-        } else {
-            frames = new ArrayList();
-            frames.add(frame);
-            limit = 1;
-        }
-
-        boolean omitOn = false;
-        if (options != null) {
-            if (options.containsKey("defaults")) {
-                Map defopts = (Map) options.get("defaults");
-                if (defopts.containsKey("omitDefaultOn")) {
-                    omitOn = (Boolean) defopts.get("omitDefaultOn");
-                }
-            }
-        }
-
-        List<List> values = new ArrayList<List>();
-        for (Object f : frames) {
-            if (!(f instanceof List || f instanceof Map)) {
-                throw new RuntimeException("Invalid JSON - LD frame. Frame type is not a map or array.");
-            }
-            List vali = new ArrayList();
-            for (Object n : input) {
-                if (n instanceof Map && ((Map) n).containsKey("@id") && subjects.containsKey(((Map) n).get("@id"))) {
-                    n = subjects.get(((Map) n).get("@id"));
-                }
-
-                if (JSONLDUtils.isType(n, (Map) f) || JSONLDUtils.isDuckType(n, (Map) f)) {
-                    vali.add(n);
-                    limit -= 1;
-                    if (limit == 0) {
-                        break;
-                    }
-                }
-            }
-            values.add(vali);
-            if (limit == 0) {
-                break;
-            }
-        }
-
-        for (int i = 0; i < frames.size(); i++) {
-            Object f = frames.get(i);
-            List v = values.get(i);
-
-            for (Object value : v) {
-                if (JSONLDUtils.isSubject(value)) {
-                    value = subframe(subjects, (Map) value, (Map) f, embeds, autoembed, parent, parentKey, options);
-                }
-
-                if (rval == null) {
-                    rval = value;
-                } else {
-                    if (!((JSONLDUtils.isReference(value) && embeds.containsKey(((Map) value).get("@id"))) && parent == null)) {
-                        ((List) rval).add(value);
-                    }
-                }
-            }
-        }
-
-        return rval;
-    }
-
-    /**
-     * Subframes a value.
-     * 
-     * @param subjects
-     *            a map of subjects in the graph.
-     * @param value
-     *            the value to subframe.
-     * @param frame
-     *            the frame to use.
-     * @param embeds
-     *            a map of previously embedded subjects, used to prevent cycles.
-     * @param autoembed
-     *            true if auto-embed is on, false if not.
-     * @param parent
-     *            the parent object.
-     * @param parentKey
-     *            the parent key.
-     * @param options
-     *            the framing options.
-     * @return the framed input.
-     */
-    private static Object subframe(Map subjects, Map value, Map frame, HashMap embeds, boolean autoembed, Object parent, String parentKey, Map options) {
-        String iri = (String) value.get("@id");
-        Map embed = (Map) embeds.get(iri);
-
-        boolean embedOn = (((frame.containsKey("@embed") && (Boolean) frame.get("@embed")) || (!frame.containsKey("@embed") && (Boolean) ((Map) options
-                .get("defaults")).get("embedOn"))) && (embed == null || ((Boolean) embed.get("autoembed") && !autoembed)));
-
-        if (!embedOn) {
-            Map tmp = new HashMap();
-            tmp.put("@id", value.get("@id"));
-            return tmp;
-        } else {
-            if (embed == null) {
-                embed = new HashMap();
-                embeds.put(iri, embed);
-            } else if (embed.get("parent") != null) {
-                Object objs = ((Map) embed.get("parent")).get(embed.get("key"));
-                if (objs instanceof List) {
-                    for (int i = 0; i < ((List) objs).size(); i++) {
-                        Object oi = ((List) objs).get(i);
-                        if (oi instanceof Map && ((Map) oi).containsKey("@id") && ((Map) oi).get("@id").equals(iri)) {
-                            Map tmp = new HashMap();
-                            tmp.put("@id", value.get("id"));
-                            ((List) objs).set(i, tmp);
-                            break;
-                        }
-                    }
-                } else {
-                    Map tmp = new HashMap();
-                    tmp.put("@id", value.get("@id"));
-                    ((Map) embed.get("parent")).put(embed.get("key"), tmp);
-                }
-
-                removeDependentEmbeds(iri, embeds);
-            }
-
-            embed.put("autoembed", autoembed);
-            embed.put("parent", parent);
-            embed.put("key", parentKey);
-
-            boolean explicitOn = (frame.containsKey("@explicit") ? (Boolean) frame.get("@explicit") : (Boolean) ((Map) options.get("defaults"))
-                    .get("explicitOn"));
-
-            if (explicitOn) {
-                for (String key : new HashSet<String>((Set<String>) value.keySet())) {
-                    if (!"@id".equals(key) && !frame.containsKey(key)) {
-                        value.remove(key);
-                    }
-                }
-            }
-
-            for (String key : (Set<String>) value.keySet()) {
-                Object v = value.get(key);
-                if (!key.startsWith("@")) {
-                    Object f = frame.get(key);
-                    boolean _autoembed = (f == null);
-                    if (_autoembed) {
-                        f = value.get(key) instanceof List ? new ArrayList() : new HashMap();
-                    }
-                    List input = null;
-                    if (value.get(key) instanceof List) {
-                        input = (List) value.get(key);
-                    } else {
-                        List tmp = new ArrayList();
-                        tmp.add(value.get(key));
-                        input = tmp;
-                    }
-                    for (int n = 0; n < input.size(); n++) {
-                        Object in = input.get(n);
-                        if (in instanceof Map && ((Map) in).containsKey("@id") && subjects.containsKey(((Map) in).get("@id"))) {
-                            input.set(n, subjects.get(((Map) in).get("@id")));
-                        }
-                    }
-                    value.put(key, frame(subjects, input, f, embeds, _autoembed, value, key, options));
-                }
-            }
-
-            for (String key : (Set<String>) frame.keySet()) {
-                Object f = frame.get(key);
-                if (!key.startsWith("@") && (!value.containsKey(key) || value.get(key) == null)) {
-                    if (f instanceof List) {
-                        value.put(key, new ArrayList());
-                    } else {
-                        // TODO: jsonld.js and pyld.js have a block here that will never be reached
-                        // because they can only run if the previous if was true
-
-                        boolean omitOn = ((Map) f).containsKey("@omitDefault") ? (Boolean) ((Map) f).get("@omitDefault") : (Boolean) ((Map) options
-                                .get("defaults")).get("omitDefaultOn");
-
-                        if (!omitOn) {
-                            if (((Map) f).containsKey("@default")) {
-                                value.put(key, ((Map) f).get("@default"));
-                            } else {
-                                value.put(key, null);
-                            }
-                        }
-                    }
-                }
-            }
-        }
-        return value;
-    }
-
-    private static void removeDependentEmbeds(String iri, Map embeds) {
-        Set<String> iris = new HashSet(embeds.keySet());
-        for (String i : iris) {
-            if (embeds.containsKey(i) && ((Map) embeds.get(i)).get("parent") != null && iri.equals(((Map) ((Map) embeds.get(i)).get("parent")).get("@id"))) {
-                embeds.remove(i);
-                removeDependentEmbeds(i, embeds);
-            }
-        }
-    }
-
-    /**
-     * Returns True if the given src matches the given frame via duck-typing.
-     * 
-     * @param src
-     *            the input.
-     * @param frame
-     *            the frame to check against.
-     * @return True if the src matches the frame.
-     */
-    private static boolean isDuckType(Object src, Map frame) {
-        String rType = "@type";
-        if (!frame.containsKey(rType)) {
-            Set<String> props1 = frame.keySet();
-            Set<String> props = new HashSet<String>();
-            for (String p : props1) {
-                if (!p.startsWith("@")) {
-                    props.add(p);
-                }
-            }
-            if (props.isEmpty()) {
-                return true;
-            }
-            if (src instanceof Map && ((Map) src).containsKey("@id")) {
-                for (String i : props) {
-                    if (!((Map) src).containsKey(i)) {
-                        return false;
-                    }
-                }
-                return true;
-            }
-        }
-        return false;
-    }
-
-    /**
-     * Returns True if the given source is a subject and has one of the given types in the given frame.
-     * 
-     * @param src
-     *            the input.
-     * @param frame
-     *            the frame with types to look for.
-     * @return True if the src has one of the given types.
-     */
-    private static boolean isType(Object src, Map frame) {
-        String rType = "@type";
-        if (frame.containsKey(rType) && src instanceof Map && ((Map) src).containsKey(rType)) {
-            List tmp = null;
-            if (((Map) src).get(rType) instanceof List) {
-                tmp = (List) ((Map) src).get(rType);
-            } else {
-                tmp = new ArrayList();
-                tmp.add(((Map) src).get(rType));
-            }
-            List types = null;
-            if (frame.get(rType) instanceof List) {
-                types = (List) frame.get(rType);
-            } else {
-                types = new ArrayList();
-                types.add(frame.get(rType));
-            }
-
-            for (Object typ : types) {
-                for (Object i : tmp) {
-                    if (i.equals(typ)) {
-                        return true;
-                    }
-                }
-            }
-        }
-        return false;
-    }
-}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/ext/java/de/dfki/km/json/jsonld/impl/SesameJSONLDSerializer.java
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/ext/java/de/dfki/km/json/jsonld/impl/SesameJSONLDSerializer.java b/commons/sesame-tools-rio-jsonld/src/ext/java/de/dfki/km/json/jsonld/impl/SesameJSONLDSerializer.java
deleted file mode 100644
index 7301de8..0000000
--- a/commons/sesame-tools-rio-jsonld/src/ext/java/de/dfki/km/json/jsonld/impl/SesameJSONLDSerializer.java
+++ /dev/null
@@ -1,49 +0,0 @@
-package de.dfki.km.json.jsonld.impl;
-
-import java.util.Iterator;
-
-import org.openrdf.model.Graph;
-import org.openrdf.model.Literal;
-import org.openrdf.model.Resource;
-import org.openrdf.model.Statement;
-import org.openrdf.model.URI;
-import org.openrdf.model.Value;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class SesameJSONLDSerializer extends de.dfki.km.json.jsonld.JSONLDSerializer {
-    private static final Logger LOG = LoggerFactory.getLogger(SesameJSONLDSerializer.class);
-
-    public void importGraph(Graph model, Resource... contexts) {
-        Iterator<Statement> statements = model.match(null, null, null, contexts);
-        while (statements.hasNext()) {
-            handleStatement(statements.next());
-        }
-    }
-
-    public void handleStatement(Statement nextStatement) {
-        Resource subject = nextStatement.getSubject();
-        URI predicate = nextStatement.getPredicate();
-        Value object = nextStatement.getObject();
-
-        if (object instanceof Literal) {
-            Literal literal = (Literal) object;
-            String value = literal.getLabel();
-            URI datatypeURI = literal.getDatatype();
-            String language = literal.getLanguage();
-            
-            String datatype;
-            
-            if (datatypeURI == null) {
-                datatype = null;
-            } else {
-                datatype = datatypeURI.stringValue();
-            }
-            
-            triple(subject.stringValue(), predicate.stringValue(), value, datatype, language);
-        } else {
-            triple(subject.stringValue(), predicate.stringValue(), object.stringValue());
-        }
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/ext/java/de/dfki/km/json/jsonld/impl/SesameTripleCallback.java
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/ext/java/de/dfki/km/json/jsonld/impl/SesameTripleCallback.java b/commons/sesame-tools-rio-jsonld/src/ext/java/de/dfki/km/json/jsonld/impl/SesameTripleCallback.java
deleted file mode 100644
index 4d1a3c7..0000000
--- a/commons/sesame-tools-rio-jsonld/src/ext/java/de/dfki/km/json/jsonld/impl/SesameTripleCallback.java
+++ /dev/null
@@ -1,83 +0,0 @@
-package de.dfki.km.json.jsonld.impl;
-
-import org.openrdf.model.Graph;
-import org.openrdf.model.Statement;
-import org.openrdf.model.URI;
-import org.openrdf.model.Value;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.GraphImpl;
-
-import de.dfki.km.json.jsonld.JSONLDTripleCallback;
-
-public class SesameTripleCallback implements JSONLDTripleCallback {
-
-    private ValueFactory vf;
-
-    private Graph storageGraph;
-
-    public SesameTripleCallback() {
-        this(new GraphImpl());
-    }
-
-    public SesameTripleCallback(Graph nextGraph) {
-        setStorageGraph(nextGraph);
-    }
-
-    @Override
-    public void triple(String s, String p, String o) {
-        if (s == null || p == null || o == null) {
-            // TODO: i don't know what to do here!!!!
-            return;
-        }
-
-        // This method is always called with three URIs as subject predicate and
-        // object
-        Statement result = vf.createStatement(vf.createURI(s), vf.createURI(p), vf.createURI(o));
-        storageGraph.add(result);
-    }
-
-    @Override
-    public void triple(String s, String p, String value, String datatype, String language) {
-
-        if (s == null || p == null || value == null) {
-            // TODO: i don't know what to do here!!!!
-            return;
-        }
-
-        URI subject = vf.createURI(s);
-
-        URI predicate = vf.createURI(p);
-
-        Value object;
-        if (language != null) {
-            object = vf.createLiteral(value, language);
-        } else if (datatype != null) {
-            object = vf.createLiteral(value, vf.createURI(datatype));
-        } else {
-            object = vf.createLiteral(value);
-        }
-
-        Statement result = vf.createStatement(subject, predicate, object);
-        storageGraph.add(result);
-    }
-
-    /**
-     * @return the storageGraph
-     */
-    public Graph getStorageGraph() {
-        return storageGraph;
-    }
-
-    /**
-     * @param storageGraph
-     *            the storageGraph to set
-     */
-    public void setStorageGraph(Graph storageGraph) {
-        this.storageGraph = storageGraph;
-
-        if (storageGraph != null) {
-            vf = storageGraph.getValueFactory();
-        }
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/main/java/org/apache/marmotta/commons/sesame/rio/jsonld/JsonLdParser.java
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/main/java/org/apache/marmotta/commons/sesame/rio/jsonld/JsonLdParser.java b/commons/sesame-tools-rio-jsonld/src/main/java/org/apache/marmotta/commons/sesame/rio/jsonld/JsonLdParser.java
deleted file mode 100644
index bf47ea3..0000000
--- a/commons/sesame-tools-rio-jsonld/src/main/java/org/apache/marmotta/commons/sesame/rio/jsonld/JsonLdParser.java
+++ /dev/null
@@ -1,202 +0,0 @@
-/**
- * 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.commons.sesame.rio.jsonld;
-
-import com.google.common.base.Preconditions;
-import de.dfki.km.json.jsonld.JSONLDProcessor;
-import de.dfki.km.json.jsonld.JSONLDTripleCallback;
-import org.codehaus.jackson.map.ObjectMapper;
-import org.codehaus.jackson.type.TypeReference;
-import org.openrdf.OpenRDFException;
-import org.openrdf.model.URI;
-import org.openrdf.model.Value;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.rio.RDFFormat;
-import org.openrdf.rio.RDFHandlerException;
-import org.openrdf.rio.RDFParseException;
-import org.openrdf.rio.helpers.RDFParserBase;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.Reader;
-import java.util.Map;
-
-/**
- * Add file description here!
- * <p/>
- * Author: Sebastian Schaffert
- */
-public class JsonLdParser extends RDFParserBase implements JSONLDTripleCallback {
-
-    private static Logger log = LoggerFactory.getLogger(JsonLdParser.class);
-
-    JSONLDProcessor processor;
-
-    /**
-     * Creates a new RDFParserBase that will use a {@link org.openrdf.model.impl.ValueFactoryImpl} to
-     * create RDF model objects.
-     */
-    public JsonLdParser() {
-        processor =  new JSONLDProcessor();
-    }
-
-    /**
-     * Creates a new RDFParserBase that will use the supplied ValueFactory to
-     * create RDF model objects.
-     *
-     * @param valueFactory A ValueFactory.
-     */
-    public JsonLdParser(ValueFactory valueFactory) {
-        super(valueFactory);
-        processor = new JSONLDProcessor();
-    }
-
-    /**
-     * Gets the RDF format that this parser can parse.
-     */
-    @Override
-    public RDFFormat getRDFFormat() {
-        return RDFFormat.JSONLD;
-    }
-
-    /**
-     * Parses the data from the supplied InputStream, using the supplied baseURI
-     * to resolve any relative URI references.
-     *
-     * @param in      The InputStream from which to read the data.
-     * @param baseURI The URI associated with the data in the InputStream.
-     * @throws java.io.IOException If an I/O error occurred while data was read from the InputStream.
-     * @throws org.openrdf.rio.RDFParseException
-     *                             If the parser has found an unrecoverable parse error.
-     * @throws org.openrdf.rio.RDFHandlerException
-     *                             If the configured statement handler has encountered an
-     *                             unrecoverable error.
-     */
-    @Override
-    public void parse(InputStream in, String baseURI) throws IOException, RDFParseException, RDFHandlerException {
-        if(baseURI != null)
-            setBaseURI(baseURI);
-
-        ObjectMapper mapper = new ObjectMapper();
-        Map<String,Object> object = mapper.readValue(in,new TypeReference<Map<String,Object>>() {});
-
-        try {
-            processor.triples(object,this);
-        } catch(IllegalArgumentException ex) {
-            if(ex.getCause() instanceof RDFParseException)
-                throw (RDFParseException)ex.getCause();
-            else {
-                throw new IllegalArgumentException(ex);
-            }
-        }
-    }
-
-    /**
-     * Parses the data from the supplied Reader, using the supplied baseURI to
-     * resolve any relative URI references.
-     *
-     * @param reader  The Reader from which to read the data.
-     * @param baseURI The URI associated with the data in the InputStream.
-     * @throws java.io.IOException If an I/O error occurred while data was read from the InputStream.
-     * @throws org.openrdf.rio.RDFParseException
-     *                             If the parser has found an unrecoverable parse error.
-     * @throws org.openrdf.rio.RDFHandlerException
-     *                             If the configured statement handler has encountered an
-     *                             unrecoverable error.
-     */
-    @Override
-    public void parse(Reader reader, String baseURI) throws IOException, RDFParseException, RDFHandlerException {
-        if(baseURI != null)
-            setBaseURI(baseURI);
-
-        ObjectMapper mapper = new ObjectMapper();
-        Map<String,Object> object = mapper.readValue(reader,new TypeReference<Map<String,Object>>() {});
-
-        try {
-            processor.triples(object,this);
-        } catch(IllegalArgumentException ex) {
-            if(ex.getCause() instanceof RDFParseException)
-                throw (RDFParseException)ex.getCause();
-            else {
-                throw new IllegalArgumentException(ex);
-            }
-        }
-    }
-
-
-    /**
-     * Construct a triple with three URIs.
-     *
-     * @param s The Subject URI
-     * @param p The Predicate URI
-     * @param o The Object URI
-     * @return The generated triple, or null to force triple generation to stop
-     */
-    @Override
-    public void triple(String s, String p, String o) {
-        // This method is always called with three URIs as subject predicate and
-        // object
-        try {
-            rdfHandler.handleStatement(createStatement(resolveURI(s), resolveURI(p), resolveURI(o)));
-        } catch (OpenRDFException e) {
-            log.error("RDF Parse Error while creating statement",e);
-            throw new IllegalArgumentException("RDF Parse Error while creating statement",e);
-        }
-    }
-
-    /**
-     * Constructs a triple with a Literal object, which may or may not contain a
-     * language and/or a datatype.
-     *
-     * @param s        The Subject URI
-     * @param p        The Predicate URI
-     * @param value    The literal value
-     * @param datatype The literal datatype
-     * @param language The literal language (NOTE: may be null if not specified!)
-     * @return The generated triple, or null to force triple generation to stop
-     */
-    @Override
-    public void triple(String s, String p, String value, String datatype, String language) {
-        Preconditions.checkNotNull(s);
-        Preconditions.checkNotNull(p);
-        Preconditions.checkNotNull(value);
-
-        try {
-            URI subject = createURI(s);
-
-            URI predicate = createURI(p);
-
-            Value object;
-            if (language != null) {
-                object = createLiteral(value, language, null);
-            } else if (datatype != null) {
-                object = createLiteral(value, null, createURI(datatype));
-            } else {
-                object = createLiteral(value, null, null);
-            }
-
-            rdfHandler.handleStatement(createStatement(subject, predicate, object));
-
-        } catch (OpenRDFException e) {
-            log.error("RDF Parse Error while creating statement",e);
-            throw new IllegalArgumentException("RDF Parse Error while creating statement",e);
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/main/java/org/apache/marmotta/commons/sesame/rio/jsonld/JsonLdParserFactory.java
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/main/java/org/apache/marmotta/commons/sesame/rio/jsonld/JsonLdParserFactory.java b/commons/sesame-tools-rio-jsonld/src/main/java/org/apache/marmotta/commons/sesame/rio/jsonld/JsonLdParserFactory.java
deleted file mode 100644
index 30f453f..0000000
--- a/commons/sesame-tools-rio-jsonld/src/main/java/org/apache/marmotta/commons/sesame/rio/jsonld/JsonLdParserFactory.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/**
- * 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.commons.sesame.rio.jsonld;
-
-import org.openrdf.rio.RDFFormat;
-import org.openrdf.rio.RDFParser;
-import org.openrdf.rio.RDFParserFactory;
-
-/**
- * Add file description here!
- * <p/>
- * Author: Sebastian Schaffert
- */
-public class JsonLdParserFactory implements RDFParserFactory {
-
-    /**
-     * Returns the RDF format for this factory.
-     */
-    @Override
-    public RDFFormat getRDFFormat() {
-        return RDFFormat.JSONLD;
-    }
-
-    /**
-     * Returns a RDFParser instance.
-     */
-    @Override
-    public RDFParser getParser() {
-        return new JsonLdParser();
-    }
-}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/main/java/org/apache/marmotta/commons/sesame/rio/jsonld/JsonLdWriter.java
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/main/java/org/apache/marmotta/commons/sesame/rio/jsonld/JsonLdWriter.java b/commons/sesame-tools-rio-jsonld/src/main/java/org/apache/marmotta/commons/sesame/rio/jsonld/JsonLdWriter.java
deleted file mode 100644
index c788c85..0000000
--- a/commons/sesame-tools-rio-jsonld/src/main/java/org/apache/marmotta/commons/sesame/rio/jsonld/JsonLdWriter.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/**
- * 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.commons.sesame.rio.jsonld;
-
-import de.dfki.km.json.jsonld.impl.SesameJSONLDSerializer;
-import org.openrdf.model.Statement;
-import org.openrdf.rio.RDFFormat;
-import org.openrdf.rio.RDFHandlerException;
-import org.openrdf.rio.RDFWriter;
-
-import java.io.OutputStream;
-import java.io.OutputStreamWriter;
-import java.io.PrintWriter;
-import java.io.Writer;
-
-/**
- * Add file description here!
- * <p/>
- * User: sschaffe
- */
-public class JsonLdWriter implements RDFWriter {
-
-
-    private PrintWriter writer;
-
-    SesameJSONLDSerializer serializer;
-
-    public JsonLdWriter(OutputStream out) {
-        writer = new PrintWriter(new OutputStreamWriter(out));
-        serializer = new SesameJSONLDSerializer();
-    }
-
-
-    public JsonLdWriter(Writer writer) {
-        this.writer = new PrintWriter(writer);
-        serializer = new SesameJSONLDSerializer();
-    }
-
-
-    /**
-     * Gets the RDF format that this RDFWriter uses.
-     */
-    @Override
-    public RDFFormat getRDFFormat() {
-        return RDFFormat.JSONLD;
-    }
-
-    /**
-     * Signals the start of the RDF data. This method is called before any data
-     * is reported.
-     *
-     * @throws org.openrdf.rio.RDFHandlerException
-     *          If the RDF handler has encountered an unrecoverable error.
-     */
-    @Override
-    public void startRDF() throws RDFHandlerException {
-    }
-
-    /**
-     * Signals the end of the RDF data. This method is called when all data has
-     * been reported.
-     *
-     * @throws org.openrdf.rio.RDFHandlerException
-     *          If the RDF handler has encountered an unrecoverable error.
-     */
-    @Override
-    public void endRDF() throws RDFHandlerException {
-        writer.print(serializer.asString());
-        writer.flush();
-    }
-
-    /**
-     * Handles a namespace declaration/definition. A namespace declaration
-     * associates a (short) prefix string with the namespace's URI. The prefix
-     * for default namespaces, which do not have an associated prefix, are
-     * represented as empty strings.
-     *
-     * @param prefix The prefix for the namespace, or an empty string in case of a
-     *               default namespace.
-     * @param uri    The URI that the prefix maps to.
-     * @throws org.openrdf.rio.RDFHandlerException
-     *          If the RDF handler has encountered an unrecoverable error.
-     */
-    @Override
-    public void handleNamespace(String prefix, String uri) throws RDFHandlerException {
-        serializer.setPrefix(uri,prefix);
-    }
-
-    /**
-     * Handles a statement.
-     *
-     * @param st The statement.
-     * @throws org.openrdf.rio.RDFHandlerException
-     *          If the RDF handler has encountered an unrecoverable error.
-     */
-    @Override
-    public void handleStatement(Statement st) throws RDFHandlerException {
-        serializer.handleStatement(st);
-    }
-
-    /**
-     * Handles a comment.
-     *
-     * @param comment The comment.
-     * @throws org.openrdf.rio.RDFHandlerException
-     *          If the RDF handler has encountered an unrecoverable error.
-     */
-    @Override
-    public void handleComment(String comment) throws RDFHandlerException {
-    }
-}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/main/java/org/apache/marmotta/commons/sesame/rio/jsonld/JsonLdWriterFactory.java
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/main/java/org/apache/marmotta/commons/sesame/rio/jsonld/JsonLdWriterFactory.java b/commons/sesame-tools-rio-jsonld/src/main/java/org/apache/marmotta/commons/sesame/rio/jsonld/JsonLdWriterFactory.java
deleted file mode 100644
index 959b2e3..0000000
--- a/commons/sesame-tools-rio-jsonld/src/main/java/org/apache/marmotta/commons/sesame/rio/jsonld/JsonLdWriterFactory.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/**
- * 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.commons.sesame.rio.jsonld;
-
-import org.openrdf.rio.RDFFormat;
-import org.openrdf.rio.RDFWriter;
-import org.openrdf.rio.RDFWriterFactory;
-
-import java.io.OutputStream;
-import java.io.Writer;
-
-/**
- * Add file description here!
- * <p/>
- * Author: Sebastian Schaffert
- */
-public class JsonLdWriterFactory implements RDFWriterFactory {
-
-    /**
-     * Returns the RDF format for this factory.
-     */
-    @Override
-    public RDFFormat getRDFFormat() {
-        return RDFFormat.JSONLD;
-    }
-
-    /**
-     * Returns an RDFWriter instance that will write to the supplied output
-     * stream.
-     *
-     * @param out The OutputStream to write the RDF to.
-     */
-    @Override
-    public RDFWriter getWriter(OutputStream out) {
-        return new JsonLdWriter(out);
-    }
-
-    /**
-     * Returns an RDFWriter instance that will write to the supplied writer.
-     *
-     * @param writer The Writer to write the RDF to.
-     */
-    @Override
-    public RDFWriter getWriter(Writer writer) {
-        return new JsonLdWriter(writer);
-    }
-}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/main/resources/META-INF/LICENSE
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/main/resources/META-INF/LICENSE b/commons/sesame-tools-rio-jsonld/src/main/resources/META-INF/LICENSE
deleted file mode 100644
index e21dc40..0000000
--- a/commons/sesame-tools-rio-jsonld/src/main/resources/META-INF/LICENSE
+++ /dev/null
@@ -1,205 +0,0 @@
-                                 Apache License
-                           Version 2.0, January 2004
-                        http://www.apache.org/licenses/
-
-   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-   1. Definitions.
-
-      "License" shall mean the terms and conditions for use, reproduction,
-      and distribution as defined by Sections 1 through 9 of this document.
-
-      "Licensor" shall mean the copyright owner or entity authorized by
-      the copyright owner that is granting the License.
-
-      "Legal Entity" shall mean the union of the acting entity and all
-      other entities that control, are controlled by, or are under common
-      control with that entity. For the purposes of this definition,
-      "control" means (i) the power, direct or indirect, to cause the
-      direction or management of such entity, whether by contract or
-      otherwise, or (ii) ownership of fifty percent (50%) or more of the
-      outstanding shares, or (iii) beneficial ownership of such entity.
-
-      "You" (or "Your") shall mean an individual or Legal Entity
-      exercising permissions granted by this License.
-
-      "Source" form shall mean the preferred form for making modifications,
-      including but not limited to software source code, documentation
-      source, and configuration files.
-
-      "Object" form shall mean any form resulting from mechanical
-      transformation or translation of a Source form, including but
-      not limited to compiled object code, generated documentation,
-      and conversions to other media types.
-
-      "Work" shall mean the work of authorship, whether in Source or
-      Object form, made available under the License, as indicated by a
-      copyright notice that is included in or attached to the work
-      (an example is provided in the Appendix below).
-
-      "Derivative Works" shall mean any work, whether in Source or Object
-      form, that is based on (or derived from) the Work and for which the
-      editorial revisions, annotations, elaborations, or other modifications
-      represent, as a whole, an original work of authorship. For the purposes
-      of this License, Derivative Works shall not include works that remain
-      separable from, or merely link (or bind by name) to the interfaces of,
-      the Work and Derivative Works thereof.
-
-      "Contribution" shall mean any work of authorship, including
-      the original version of the Work and any modifications or additions
-      to that Work or Derivative Works thereof, that is intentionally
-      submitted to Licensor for inclusion in the Work by the copyright owner
-      or by an individual or Legal Entity authorized to submit on behalf of
-      the copyright owner. For the purposes of this definition, "submitted"
-      means any form of electronic, verbal, or written communication sent
-      to the Licensor or its representatives, including but not limited to
-      communication on electronic mailing lists, source code control systems,
-      and issue tracking systems that are managed by, or on behalf of, the
-      Licensor for the purpose of discussing and improving the Work, but
-      excluding communication that is conspicuously marked or otherwise
-      designated in writing by the copyright owner as "Not a Contribution."
-
-      "Contributor" shall mean Licensor and any individual or Legal Entity
-      on behalf of whom a Contribution has been received by Licensor and
-      subsequently incorporated within the Work.
-
-   2. Grant of Copyright License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      copyright license to reproduce, prepare Derivative Works of,
-      publicly display, publicly perform, sublicense, and distribute the
-      Work and such Derivative Works in Source or Object form.
-
-   3. Grant of Patent License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      (except as stated in this section) patent license to make, have made,
-      use, offer to sell, sell, import, and otherwise transfer the Work,
-      where such license applies only to those patent claims licensable
-      by such Contributor that are necessarily infringed by their
-      Contribution(s) alone or by combination of their Contribution(s)
-      with the Work to which such Contribution(s) was submitted. If You
-      institute patent litigation against any entity (including a
-      cross-claim or counterclaim in a lawsuit) alleging that the Work
-      or a Contribution incorporated within the Work constitutes direct
-      or contributory patent infringement, then any patent licenses
-      granted to You under this License for that Work shall terminate
-      as of the date such litigation is filed.
-
-   4. Redistribution. You may reproduce and distribute copies of the
-      Work or Derivative Works thereof in any medium, with or without
-      modifications, and in Source or Object form, provided that You
-      meet the following conditions:
-
-      (a) You must give any other recipients of the Work or
-          Derivative Works a copy of this License; and
-
-      (b) You must cause any modified files to carry prominent notices
-          stating that You changed the files; and
-
-      (c) You must retain, in the Source form of any Derivative Works
-          that You distribute, all copyright, patent, trademark, and
-          attribution notices from the Source form of the Work,
-          excluding those notices that do not pertain to any part of
-          the Derivative Works; and
-
-      (d) If the Work includes a "NOTICE" text file as part of its
-          distribution, then any Derivative Works that You distribute must
-          include a readable copy of the attribution notices contained
-          within such NOTICE file, excluding those notices that do not
-          pertain to any part of the Derivative Works, in at least one
-          of the following places: within a NOTICE text file distributed
-          as part of the Derivative Works; within the Source form or
-          documentation, if provided along with the Derivative Works; or,
-          within a display generated by the Derivative Works, if and
-          wherever such third-party notices normally appear. The contents
-          of the NOTICE file are for informational purposes only and
-          do not modify the License. You may add Your own attribution
-          notices within Derivative Works that You distribute, alongside
-          or as an addendum to the NOTICE text from the Work, provided
-          that such additional attribution notices cannot be construed
-          as modifying the License.
-
-      You may add Your own copyright statement to Your modifications and
-      may provide additional or different license terms and conditions
-      for use, reproduction, or distribution of Your modifications, or
-      for any such Derivative Works as a whole, provided Your use,
-      reproduction, and distribution of the Work otherwise complies with
-      the conditions stated in this License.
-
-   5. Submission of Contributions. Unless You explicitly state otherwise,
-      any Contribution intentionally submitted for inclusion in the Work
-      by You to the Licensor shall be under the terms and conditions of
-      this License, without any additional terms or conditions.
-      Notwithstanding the above, nothing herein shall supersede or modify
-      the terms of any separate license agreement you may have executed
-      with Licensor regarding such Contributions.
-
-   6. Trademarks. This License does not grant permission to use the trade
-      names, trademarks, service marks, or product names of the Licensor,
-      except as required for reasonable and customary use in describing the
-      origin of the Work and reproducing the content of the NOTICE file.
-
-   7. Disclaimer of Warranty. Unless required by applicable law or
-      agreed to in writing, Licensor provides the Work (and each
-      Contributor provides its Contributions) on an "AS IS" BASIS,
-      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-      implied, including, without limitation, any warranties or conditions
-      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
-      PARTICULAR PURPOSE. You are solely responsible for determining the
-      appropriateness of using or redistributing the Work and assume any
-      risks associated with Your exercise of permissions under this License.
-
-   8. Limitation of Liability. In no event and under no legal theory,
-      whether in tort (including negligence), contract, or otherwise,
-      unless required by applicable law (such as deliberate and grossly
-      negligent acts) or agreed to in writing, shall any Contributor be
-      liable to You for damages, including any direct, indirect, special,
-      incidental, or consequential damages of any character arising as a
-      result of this License or out of the use or inability to use the
-      Work (including but not limited to damages for loss of goodwill,
-      work stoppage, computer failure or malfunction, or any and all
-      other commercial damages or losses), even if such Contributor
-      has been advised of the possibility of such damages.
-
-   9. Accepting Warranty or Additional Liability. While redistributing
-      the Work or Derivative Works thereof, You may choose to offer,
-      and charge a fee for, acceptance of support, warranty, indemnity,
-      or other liability obligations and/or rights consistent with this
-      License. However, in accepting such obligations, You may act only
-      on Your own behalf and on Your sole responsibility, not on behalf
-      of any other Contributor, and only if You agree to indemnify,
-      defend, and hold each Contributor harmless for any liability
-      incurred by, or claims asserted against, such Contributor by reason
-      of your accepting any such warranty or additional liability.
-
-   END OF TERMS AND CONDITIONS
-
-   APPENDIX: How to apply the Apache License to your work.
-
-      To apply the Apache License to your work, attach the following
-      boilerplate notice, with the fields enclosed by brackets "[]"
-      replaced with your own identifying information. (Don't include
-      the brackets!)  The text should be enclosed in the appropriate
-      comment syntax for the file format. We also recommend that a
-      file or class name and description of purpose be included on the
-      same "printed page" as the copyright notice for easier
-      identification within third-party archives.
-
-   Copyright [yyyy] [name of copyright owner]
-
-   Licensed 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.
-
-
-This library bundles the JSON-LD java library, which is available under a
-"New BSD" license.  For details, see https://github.com/tristan/jsonld-java.

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/main/resources/META-INF/NOTICE
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/main/resources/META-INF/NOTICE b/commons/sesame-tools-rio-jsonld/src/main/resources/META-INF/NOTICE
deleted file mode 100644
index f566193..0000000
--- a/commons/sesame-tools-rio-jsonld/src/main/resources/META-INF/NOTICE
+++ /dev/null
@@ -1,9 +0,0 @@
-Apache Marmotta JSON-LD
-Copyright [2012-2013] The Apache Software Foundation
-
-This product includes software developed at
-The Apache Software Foundation (http://www.apache.org/).
-
-Additionally, it includes the following 3rd party modules:
-
-  jsonld-java licensed under the New BSD License

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/main/resources/META-INF/services/org.openrdf.rio.RDFParserFactory
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/main/resources/META-INF/services/org.openrdf.rio.RDFParserFactory b/commons/sesame-tools-rio-jsonld/src/main/resources/META-INF/services/org.openrdf.rio.RDFParserFactory
deleted file mode 100644
index 7864661..0000000
--- a/commons/sesame-tools-rio-jsonld/src/main/resources/META-INF/services/org.openrdf.rio.RDFParserFactory
+++ /dev/null
@@ -1 +0,0 @@
-org.apache.marmotta.commons.sesame.rio.jsonld.JsonLdParserFactory
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/main/resources/META-INF/services/org.openrdf.rio.RDFWriterFactory
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/main/resources/META-INF/services/org.openrdf.rio.RDFWriterFactory b/commons/sesame-tools-rio-jsonld/src/main/resources/META-INF/services/org.openrdf.rio.RDFWriterFactory
deleted file mode 100644
index 72b825d..0000000
--- a/commons/sesame-tools-rio-jsonld/src/main/resources/META-INF/services/org.openrdf.rio.RDFWriterFactory
+++ /dev/null
@@ -1 +0,0 @@
-org.apache.marmotta.commons.sesame.rio.jsonld.JsonLdWriterFactory
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/java/org/apache/marmotta/commons/sesame/rio/jsonld/TestJSONLdParser.java
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/java/org/apache/marmotta/commons/sesame/rio/jsonld/TestJSONLdParser.java b/commons/sesame-tools-rio-jsonld/src/test/java/org/apache/marmotta/commons/sesame/rio/jsonld/TestJSONLdParser.java
deleted file mode 100644
index 01c46b3..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/java/org/apache/marmotta/commons/sesame/rio/jsonld/TestJSONLdParser.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/**
- * 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.commons.sesame.rio.jsonld;
-/*
- * Copyright (c) 2013 The Apache Software Foundation
- *
- *  Licensed 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.
- */
-
-import org.apache.commons.io.IOUtils;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.junit.runners.Parameterized;
-import org.openrdf.query.BooleanQuery;
-import org.openrdf.query.QueryLanguage;
-import org.openrdf.repository.Repository;
-import org.openrdf.repository.RepositoryConnection;
-import org.openrdf.repository.sail.SailRepository;
-import org.openrdf.rio.RDFFormat;
-import org.openrdf.sail.memory.MemoryStore;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-
-import static java.util.Arrays.asList;
-import static org.hamcrest.CoreMatchers.everyItem;
-import static org.hamcrest.CoreMatchers.notNullValue;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-import static org.junit.Assume.assumeThat;
-
-/**
- * Add file description here!
- * <p/>
- * Author: Sebastian Schaffert
- */
-@RunWith(Parameterized.class)
-public class TestJSONLdParser {
-
-    private static Logger log = LoggerFactory.getLogger(TestJSONLdParser.class);
-
-    private String fileName;
-
-    public TestJSONLdParser(String fileName) {
-        this.fileName = fileName;
-    }
-
-    // return the list of rdf-NNNN.jsonld files
-    @Parameterized.Parameters(name = "{0}")
-    public static Collection<Object[]> data() {
-        int[] skip = new int[] {1,2,8,9,10,11,12,14,15,16,17,18,21,22,25};
-        ArrayList<Object[]> list = new ArrayList<Object[]>();
-        for(int i=1; i<=26; i++) {
-            if(Arrays.binarySearch(skip,i) == -1) {
-                list.add(new Object[] {"rdf-"+String.format("%04d",i)});
-            }
-        }
-        return list;
-    }
-
-
-    @Test
-    public void runTest() throws Exception {
-        log.info("running test {} ...", fileName);
-
-        InputStream jsonLD = this.getClass().getResourceAsStream(fileName+".jsonld");
-        InputStream sparql = this.getClass().getResourceAsStream(fileName+".sparql");
-        assumeThat("Could not load testfiles", asList(jsonLD, sparql), everyItem(notNullValue(InputStream.class)));
-
-        Repository repository = new SailRepository(new MemoryStore());
-        repository.initialize();
-
-        RepositoryConnection connection = repository.getConnection();
-        try {
-            connection.add(jsonLD,"http://localhost/jsonld/", RDFFormat.JSONLD);
-            connection.commit();
-        } catch(Exception ex) {
-            fail("parsing "+fileName+" failed!");
-        }
-        assertTrue(connection.size() > 0);
-
-        int count = connection.getStatements(null, null, null, false).asList().size();
-        assertTrue(count > 0);
-
-        BooleanQuery sparqlQuery = (BooleanQuery)connection.prepareQuery(QueryLanguage.SPARQL, IOUtils.toString(sparql));
-        assertTrue("SPARQL query evaluation for "+fileName+" failed",sparqlQuery.evaluate());
-
-        connection.close();
-        repository.shutDown();
-    }
-}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/logback.xml
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/logback.xml b/commons/sesame-tools-rio-jsonld/src/test/resources/logback.xml
deleted file mode 100644
index 1bfecff..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/logback.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-<!--
-  ~ 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.
-  -->
-
-<configuration>
-    <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
-        <encoder>
-            <pattern>%d{HH:mm:ss.SSS} %highlight(%level) %cyan(%logger{15}) - %m%n</pattern>
-        </encoder>
-    </appender>
-    <root level="${root-level:-INFO}">
-        <appender-ref ref="CONSOLE"/>
-    </root>
-</configuration>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0001-context.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0001-context.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0001-context.jsonld
deleted file mode 100644
index 8eddd02..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0001-context.jsonld
+++ /dev/null
@@ -1,13 +0,0 @@
-{
-  "@context": {
-    "dc": "http://purl.org/dc/elements/1.1/",
-    "ex": "http://example.org/vocab#",
-    "ex:authored": {
-      "@type": "@id"
-    },
-    "ex:contains": {
-      "@type": "@id"
-    },
-    "foaf": "http://xmlns.com/foaf/0.1/"
-  }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0001-in.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0001-in.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0001-in.jsonld
deleted file mode 100644
index bb26e1a..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0001-in.jsonld
+++ /dev/null
@@ -1,27 +0,0 @@
-{
-  "@id": [
-    {
-      "@id": "http://example.org/test#chapter",
-      "http://purl.org/dc/elements/1.1/description": "Fun",
-      "http://purl.org/dc/elements/1.1/title": "Chapter One"
-    },
-    {
-      "@id": "http://example.org/test#jane",
-      "http://example.org/vocab#authored": "http://example.org/test#chapter",
-      "http://xmlns.com/foaf/0.1/name": "Jane"
-    },
-    {
-      "@id": "http://example.org/test#john",
-      "http://xmlns.com/foaf/0.1/name": "John"
-    },
-    {
-      "@id": "http://example.org/test#library",
-      "http://example.org/vocab#contains": {
-        "@id": "http://example.org/test#book",
-        "http://example.org/vocab#contains": "http://example.org/test#chapter",
-        "http://purl.org/dc/elements/1.1/contributor": "Writer",
-        "http://purl.org/dc/elements/1.1/title": "My Book"
-      }
-    }
-  ]
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0001-out.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0001-out.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0001-out.jsonld
deleted file mode 100644
index 678a298..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0001-out.jsonld
+++ /dev/null
@@ -1,38 +0,0 @@
-{
-  "@context": {
-    "dc": "http://purl.org/dc/elements/1.1/",
-    "ex": "http://example.org/vocab#",
-    "ex:authored": {
-      "@type": "@id"
-    },
-    "ex:contains": {
-      "@type": "@id"
-    },
-    "foaf": "http://xmlns.com/foaf/0.1/"
-  },
-  "@id": [
-    {
-      "@id": "http://example.org/test#chapter",
-      "dc:description": "Fun",
-      "dc:title": "Chapter One"
-    },
-    {
-      "@id": "http://example.org/test#jane",
-      "ex:authored": "http://example.org/test#chapter",
-      "foaf:name": "Jane"
-    },
-    {
-      "@id": "http://example.org/test#john",
-      "foaf:name": "John"
-    },
-    {
-      "@id": "http://example.org/test#library",
-      "ex:contains": {
-        "@id": "http://example.org/test#book",
-        "dc:contributor": "Writer",
-        "dc:title": "My Book",
-        "ex:contains": "http://example.org/test#chapter"
-      }
-    }
-  ]
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0002-context.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0002-context.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0002-context.jsonld
deleted file mode 100644
index 4ad288e..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0002-context.jsonld
+++ /dev/null
@@ -1,6 +0,0 @@
-{
-  "@context": {
-    "dc": "http://purl.org/dc/terms/",
-    "ex": "http://example.org/test#"
-  }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0002-in.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0002-in.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0002-in.jsonld
deleted file mode 100644
index 580e172..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0002-in.jsonld
+++ /dev/null
@@ -1,4 +0,0 @@
-{
-  "@id": "http://example.org/test#thing",
-  "http://purl.org/dc/terms/title": "Title"
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0002-out.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0002-out.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0002-out.jsonld
deleted file mode 100644
index 79117e9..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0002-out.jsonld
+++ /dev/null
@@ -1,8 +0,0 @@
-{
-  "@context": {
-    "dc": "http://purl.org/dc/terms/",
-    "ex": "http://example.org/test#"
-  },
-  "@id": "ex:thing",
-  "dc:title": "Title"
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0003-context.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0003-context.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0003-context.jsonld
deleted file mode 100644
index 58040b8..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0003-context.jsonld
+++ /dev/null
@@ -1,9 +0,0 @@
-{
-  "@context": {
-      "dc": "http://purl.org/dc/elements/1.1/",
-      "ex": "http://example.org/vocab#",
-      "ex:contains": {
-        "@type": "@id"
-      }
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0003-in.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0003-in.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0003-in.jsonld
deleted file mode 100644
index 9b70fba..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0003-in.jsonld
+++ /dev/null
@@ -1,7 +0,0 @@
-{
-  "@id": "http://example.org/test#book",
-  "http://example.org/vocab#contains": {
-    "@id": "http://example.org/test#chapter"
-  },
-  "http://purl.org/dc/elements/1.1/title": "Title"
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0003-out.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0003-out.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0003-out.jsonld
deleted file mode 100644
index d0c0e7e..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0003-out.jsonld
+++ /dev/null
@@ -1,12 +0,0 @@
-{
-  "@context": {
-    "dc": "http://purl.org/dc/elements/1.1/",
-    "ex": "http://example.org/vocab#",
-    "ex:contains": {
-      "@type": "@id"
-    }
-  },
-  "@id": "http://example.org/test#book",
-  "dc:title": "Title",
-  "ex:contains": "http://example.org/test#chapter"
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0004-context.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0004-context.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0004-context.jsonld
deleted file mode 100644
index 81b7978..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0004-context.jsonld
+++ /dev/null
@@ -1,9 +0,0 @@
-{
-  "@context": {
-    "ex": "http://example.org/test#",
-    "ex:int": {
-      "@type": "xsd:integer"
-    },
-    "xsd": "http://www.w3.org/2001/XMLSchema#"
-  }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0004-in.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0004-in.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0004-in.jsonld
deleted file mode 100644
index 6c3f88a..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0004-in.jsonld
+++ /dev/null
@@ -1,7 +0,0 @@
-{
-  "@id": "http://example.org/test",
-  "http://example.org/test#int": {
-    "@value": "123",
-    "@type": "http://www.w3.org/2001/XMLSchema#integer"
-  }
-}
\ No newline at end of file


[036/100] [abbrv] [partial] Reverting the erroneous merge by Sebastian according to the instructions in INFRA-6876

Posted by wi...@apache.org.
http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0018.sparql
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0018.sparql b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0018.sparql
deleted file mode 100644
index 316d105..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0018.sparql
+++ /dev/null
@@ -1,5 +0,0 @@
-PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
-
-ASK WHERE {
-  <http://json-ld.org/test-suite/tests/rdf-0018.jsonld#frag> a rdfs:Resource
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0019.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0019.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0019.jsonld
deleted file mode 100644
index 0e0e3e3..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0019.jsonld
+++ /dev/null
@@ -1,8 +0,0 @@
-{
-  "@context": {
-    "foaf": "http://xmlns.com/foaf/0.1/",
-    "knows": {"@id": "http://xmlns.com/foaf/0.1/knows", "@type": "@id"}
-  },
-  "@id":    "http://greggkellogg.net/foaf#me",
-  "knows":  "http://manu.sporny.org/#me"
-}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0019.sparql
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0019.sparql b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0019.sparql
deleted file mode 100644
index 4943c00..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0019.sparql
+++ /dev/null
@@ -1,5 +0,0 @@
-PREFIX foaf: <http://xmlns.com/foaf/0.1/>
-
-ASK WHERE {
-  <http://greggkellogg.net/foaf#me> foaf:knows <http://manu.sporny.org/#me> .
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0020.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0020.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0020.jsonld
deleted file mode 100644
index 804b2fc..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0020.jsonld
+++ /dev/null
@@ -1,8 +0,0 @@
-{
-  "@context": {
-    "xsd": "http://www.w3.org/2001/XMLSchema#",
-    "created": {"@id": "http://purl.org/dc/terms/created", "@type": "xsd:date"}
-  },
-  "@id":  "http://greggkellogg.net/foaf#me",
-  "created":  "1957-02-27"
-}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0020.sparql
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0020.sparql b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0020.sparql
deleted file mode 100644
index 0fc1f0f..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0020.sparql
+++ /dev/null
@@ -1,6 +0,0 @@
-PREFIX dcterms: <http://purl.org/dc/terms/>
-PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
-
-ASK WHERE {
-  <http://greggkellogg.net/foaf#me> dcterms:created "1957-02-27"^^xsd:date
-}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0021.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0021.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0021.jsonld
deleted file mode 100644
index fdf8e8d..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0021.jsonld
+++ /dev/null
@@ -1,4 +0,0 @@
-{
-  "@context": { "measure": "http://example/measure#"},
-  "measure:cups": 5.3
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0021.sparql
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0021.sparql b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0021.sparql
deleted file mode 100644
index 25d6a15..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0021.sparql
+++ /dev/null
@@ -1,5 +0,0 @@
-PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
-
-ASK WHERE {
-  _:a <http://example/measure#cups> "5.3"^^xsd:double
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0022.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0022.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0022.jsonld
deleted file mode 100644
index 061de81..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0022.jsonld
+++ /dev/null
@@ -1,4 +0,0 @@
-{
-  "@context": { "measure": "http://example/measure#"},
-  "measure:cups": 5.3e0
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0022.sparql
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0022.sparql b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0022.sparql
deleted file mode 100644
index 25d6a15..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0022.sparql
+++ /dev/null
@@ -1,5 +0,0 @@
-PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
-
-ASK WHERE {
-  _:a <http://example/measure#cups> "5.3"^^xsd:double
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0023.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0023.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0023.jsonld
deleted file mode 100644
index be26079..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0023.jsonld
+++ /dev/null
@@ -1,4 +0,0 @@
-{
-  "@context": { "chem": "http://example/chem#"},
-  "chem:protons": 12
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0023.sparql
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0023.sparql b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0023.sparql
deleted file mode 100644
index de5e17b..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0023.sparql
+++ /dev/null
@@ -1,5 +0,0 @@
-PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
-
-ASK WHERE {
-  _:a <http://example/chem#protons> "12"^^xsd:integer
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0024.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0024.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0024.jsonld
deleted file mode 100644
index 777318a..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0024.jsonld
+++ /dev/null
@@ -1,4 +0,0 @@
-{
-  "@context": { "sensor": "http://example/sensor#"},
-  "sensor:active": true
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0024.sparql
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0024.sparql b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0024.sparql
deleted file mode 100644
index 6f5547a..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0024.sparql
+++ /dev/null
@@ -1,5 +0,0 @@
-PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
-
-ASK WHERE {
-  _:a <http://example/sensor#active> "true"^^xsd:boolean
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0025.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0025.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0025.jsonld
deleted file mode 100644
index 55f40e3..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0025.jsonld
+++ /dev/null
@@ -1,7 +0,0 @@
-{
-  "@context": {
-    "knows": {"@id": "http://xmlns.com/foaf/0.1/knows", "@list": true}
-  },
-  "@id": "http://greggkellogg.net/foaf#me",
-  "knows": ["Manu Sporny"]
-}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0025.sparql
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0025.sparql b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0025.sparql
deleted file mode 100644
index 92cde3e..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0025.sparql
+++ /dev/null
@@ -1,5 +0,0 @@
-PREFIX foaf: <http://xmlns.com/foaf/0.1/>
-
-ASK WHERE {
-  <http://greggkellogg.net/foaf#me> foaf:knows ("Manu Sporny") .
-}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0026.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0026.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0026.jsonld
deleted file mode 100644
index bb3ba6a..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0026.jsonld
+++ /dev/null
@@ -1,4 +0,0 @@
-{
-  "@context": {"rdfs": "http://www.w3.org/2000/01/rdf-schema#"},
-  "@type": ["rdfs:Resource", "rdfs:Class"]
-}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0026.sparql
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0026.sparql b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0026.sparql
deleted file mode 100644
index e175ca3..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-0026.sparql
+++ /dev/null
@@ -1,5 +0,0 @@
-PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
-
-ASK WHERE {
-  [a rdfs:Resource, rdfs:Class]
-}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-manifest.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-manifest.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-manifest.jsonld
deleted file mode 100644
index 00e0cb0..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/rdf-manifest.jsonld
+++ /dev/null
@@ -1,166 +0,0 @@
-{
-  "@context": "http://json-ld.org/test-suite/context.jsonld",
-  "@id": "",
-  "@type": "jld:Manifest",
-  "rdfs:comment": "JSON-LD to RDF tests use SPARQL queries to determine results",
-  "name": "rdf",
-  "sequence": [
-    {
-      "@type": ["test:TestCase", "jld:RDFTest"],
-      "input": "rdf-0001.jsonld",
-      "name": "Plain literal with URIs",
-      "purpose": "Tests generation of a triple using full URIs and a plain literal.",
-      "sparql": "rdf-0001.sparql"
-    }, {
-      "@type": ["test:TestCase", "jld:RDFTest"],
-      "input": "rdf-0002.jsonld",
-      "name": "Plain literal with CURIE from default context",
-      "purpose": "Tests generation of a triple using a CURIE defined in the default context.",
-      "sparql": "rdf-0002.sparql"
-    }, {
-      "@type": ["test:TestCase", "jld:RDFTest"],
-      "input": "rdf-0003.jsonld",
-      "name": "Default subject is BNode",
-      "purpose": "Tests that a BNode is created if no explicit subject is set.",
-      "sparql": "rdf-0003.sparql"
-    }, {
-      "@type": ["test:TestCase", "jld:RDFTest"],
-      "input": "rdf-0004.jsonld",
-      "name": "Literal with language tag",
-      "purpose": "Tests that a plain literal is created with a language tag.",
-      "sparql": "rdf-0004.sparql"
-    }, {
-      "@type": ["test:TestCase", "jld:RDFTest"],
-      "input": "rdf-0005.jsonld",
-      "name": "Extended character set literal",
-      "purpose": "Tests that a literal may be created using extended characters.",
-      "sparql": "rdf-0005.sparql"
-    }, {
-      "@type": ["test:TestCase", "jld:RDFTest"],
-      "input": "rdf-0006.jsonld",
-      "name": "Typed literal",
-      "purpose": "Tests creation of a literal with a datatype.",
-      "sparql": "rdf-0006.sparql"
-    }, {
-      "@type": ["test:TestCase", "jld:RDFTest"],
-      "input": "rdf-0007.jsonld",
-      "name": "Tests 'a' generates rdf:type and object is implicit IRI",
-      "purpose": "Verify that 'a' is an alias for rdf:type, and the object is created as an IRI.",
-      "sparql": "rdf-0007.sparql"
-    }, {
-      "@type": ["test:TestCase", "jld:RDFTest"],
-      "input": "rdf-0008.jsonld",
-      "name": "Test prefix defined in @context",
-      "purpose": "Generate an IRI using a prefix defined within an @context.",
-      "sparql": "rdf-0008.sparql"
-    }, {
-      "@type": ["test:TestCase", "jld:RDFTest"],
-      "input": "rdf-0009.jsonld",
-      "name": "Test using default prefix",
-      "purpose": "The empty string may be used to define the default prefix.",
-      "sparql": "rdf-0009.sparql"
-    }, {
-      "@type": ["test:TestCase", "jld:RDFTest"],
-      "input": "rdf-0010.jsonld",
-      "name": "Test object processing defines object",
-      "purpose": "A property referencing an associative array gets object from subject of array.",
-      "sparql": "rdf-0010.sparql"
-    }, {
-      "@type": ["test:TestCase", "jld:RDFTest"],
-      "input": "rdf-0011.jsonld",
-      "name": "Test object processing defines object with implicit BNode",
-      "purpose": "If no @ is specified, a BNode is created, and will be used as the object of an enclosing property.",
-      "sparql": "rdf-0011.sparql"
-    }, {
-      "@type": ["test:TestCase", "jld:RDFTest"],
-      "input": "rdf-0012.jsonld",
-      "name": "Multiple Objects for a Single Property",
-      "purpose": "Tests that Multiple Objects are for a Single Property using array syntax.",
-      "sparql": "rdf-0012.sparql"
-    }, {
-      "@type": ["test:TestCase", "jld:RDFTest"],
-      "input": "rdf-0013.jsonld",
-      "name": "Creation of an empty list",
-      "purpose": "Tests that [[]] generates an empty list.",
-      "sparql": "rdf-0013.sparql"
-    }, {
-      "@type": ["test:TestCase", "jld:RDFTest"],
-      "input": "rdf-0014.jsonld",
-      "name": "Creation of a list with single element",
-      "purpose": "Tests that [[a]] generates list.",
-      "sparql": "rdf-0014.sparql"
-    }, {
-      "@type": ["test:TestCase", "jld:RDFTest"],
-      "input": "rdf-0015.jsonld",
-      "name": "Creation of a list with multiple elements",
-      "purpose": "Tests that list with multiple elements.",
-      "sparql": "rdf-0015.sparql"
-    }, {
-      "@type": ["test:TestCase", "jld:RDFTest"],
-      "input": "rdf-0016.jsonld",
-      "name": "Empty IRI expands to resource location",
-      "purpose": "Expanding an empty IRI uses the test file location.",
-      "sparql": "rdf-0016.sparql"
-    }, {
-      "@type": ["test:TestCase", "jld:RDFTest"],
-      "input": "rdf-0017.jsonld",
-      "name": "Relative IRI expands relative resource location",
-      "purpose": "Expanding a relative IRI uses the test file location.",
-      "sparql": "rdf-0017.sparql"
-    }, {
-      "@type": ["test:TestCase", "jld:RDFTest"],
-      "input": "rdf-0018.jsonld",
-      "name": "Frag ID expands relative resource location",
-      "purpose": "Expanding a fragment uses the test file location.",
-      "sparql": "rdf-0018.sparql"
-    }, {
-      "@type": ["test:TestCase", "jld:RDFTest"],
-      "input": "rdf-0019.jsonld",
-      "name": "Test type coercion to anyURI",
-      "purpose": "Tests coercion of object to anyURI when specified.",
-      "sparql": "rdf-0019.sparql"
-    }, {
-      "@type": ["test:TestCase", "jld:RDFTest"],
-      "input": "rdf-0020.jsonld",
-      "name": "Test type coercion to typed literal",
-      "purpose": "Tests coercion of object to a typed literal when specified.",
-      "sparql": "rdf-0020.sparql"
-    }, {
-      "@type": ["test:TestCase", "jld:RDFTest"],
-      "input": "rdf-0021.jsonld",
-      "name": "Test coercion of decimal value to double",
-      "purpose": "Tests that a decimal value generates a xsd:double typed literal.",
-      "sparql": "rdf-0021.sparql"
-    }, {
-      "@type": ["test:TestCase", "jld:RDFTest"],
-      "input": "rdf-0022.jsonld",
-      "name": "Test coercion of double value",
-      "purpose": "Tests that a decimal value generates a xsd:double typed literal;.",
-      "sparql": "rdf-0022.sparql"
-    }, {
-      "@type": ["test:TestCase", "jld:RDFTest"],
-      "input": "rdf-0023.jsonld",
-      "name": "Test coercion of integer value",
-      "purpose": "Tests that a decimal value generates a xsd:integer typed literal.",
-      "sparql": "rdf-0023.sparql"
-    }, {
-      "@type": ["test:TestCase", "jld:RDFTest"],
-      "input": "rdf-0024.jsonld",
-      "name": "Test coercion of boolean value",
-      "purpose": "Tests that a decimal value generates a xsd:boolean typed literal.",
-      "sparql": "rdf-0024.sparql"
-    }, {
-      "@type": ["test:TestCase", "jld:RDFTest"],
-      "input": "rdf-0025.jsonld",
-      "name": "Test list coercion with single element",
-      "purpose": "Tests that an array with a single element on a property with @list coercion creates an RDF Collection.",
-      "sparql": "rdf-0025.sparql"
-    }, {
-      "@type": ["test:TestCase", "jld:RDFTest"],
-      "input": "rdf-0026.jsonld",
-      "name": "Test creation of multiple types",
-      "purpose": "Tests that @type with an array of types creates multiple types.",
-      "sparql": "rdf-0026.sparql"
-    }
-  ]
-}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/simplify-0001-in.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/simplify-0001-in.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/simplify-0001-in.jsonld
deleted file mode 100644
index a99e5e4..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/simplify-0001-in.jsonld
+++ /dev/null
@@ -1,44 +0,0 @@
-{
-   "rdfs:label" : "string1024",
-   "@context" : {
-      "void" : "http://rdfs.org/ns/void#",
-      "dtype" : "http://www.linkedmodel.org/schema/dtype#",
-      "ontology" : "http://omv.ontoware.org/2005/05/ontology#",
-      "dimension" : "http://qudt.org/schema/dimension#",
-      "owl1" : "http://www.w3.org/2002/07/owl#",
-      "creativecommons1" : "http://creativecommons.org/ns#",
-      "qudt-quantity" : "http://qudt.org/vocab/quantity#",
-      "voag1" : "http://voag.linkedmodel.org/schema/voag#",
-      "qudt" : "http://qudt.org/schema/qudt#",
-      "xsd1" : "http://www.w3.org/2001/XMLSchema#",
-      "vaem1" : "http://www.linkedmodel.org/schema/vaem#",
-      "unit1" : "http://qudt.org/vocab/unit#",
-      "skos" : "http://www.w3.org/2004/02/skos/core#",
-      "qudt-dimension1" : "http://qudt.org/vocab/dimension#",
-      "rdfs" : "http://www.w3.org/2000/01/rdf-schema#",
-      "rdf" : "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
-      "dc1" : "http://purl.org/dc/elements/1.1/",
-      "quantity1" : "http://qudt.org/schema/quantity#"
-   },
-   "owl1:equivalentClass" : {
-      "owl1:onDatatype" : {
-         "@id" : "xsd1:string"
-      },
-      "owl1:withRestrictions" : {
-         "@list" : [
-            {
-               "xsd1:maxLength" : {
-                  "@value" : "1024",
-                  "@type" : "xsd1:nonNegativeInteger"
-               }
-            }
-         ]
-      },
-      "@type" : "rdfs:Datatype"
-   },
-   "@id" : "http://qudt.org/schema/qudt#string1024",
-   "rdfs:subClassOf" : {
-      "@id" : "xsd1:string"
-   },
-   "@type" : "rdfs:Datatype"
-}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/simplify-0001-out.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/simplify-0001-out.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/simplify-0001-out.jsonld
deleted file mode 100644
index 8cb158b..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/simplify-0001-out.jsonld
+++ /dev/null
@@ -1,37 +0,0 @@
-{
-    "@context" : {
-        "qudt" : "http://qudt.org/schema/qudt#",
-        "onDatatype" : {
-            "@id" : "http://www.w3.org/2002/07/owl#onDatatype",
-            "@type" : "@id"
-        },
-        "xsd1" : "http://www.w3.org/2001/XMLSchema#",
-        "rdfs" : "http://www.w3.org/2000/01/rdf-schema#",
-        "maxLength" : "http://www.w3.org/2001/XMLSchema#maxLength",
-        "equivalentClass" : "http://www.w3.org/2002/07/owl#equivalentClass",
-        "withRestrictions" : "http://www.w3.org/2002/07/owl#withRestrictions",
-        "label" : "http://www.w3.org/2000/01/rdf-schema#label",
-        "subClassOf" : {
-            "@id" : "http://www.w3.org/2000/01/rdf-schema#subClassOf",
-            "@type" : "@id"
-        }
-    },
-    "equivalentClass" : {
-        "onDatatype" : "xsd1:string",
-        "withRestrictions" : {
-            "@list" : [
-                {
-                    "maxLength" : {
-                        "@value" : "1024",
-                        "@type" : "http://www.w3.org/2001/XMLSchema#nonNegativeInteger"
-                    }
-                }
-            ]
-        },
-        "@type" : "rdfs:Datatype"
-    },
-    "@id" : "qudt:string1024",
-    "label" : "string1024",
-    "@type" : "rdfs:Datatype",
-    "subClassOf" : "xsd1:string"
-}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/simplify-manifest.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/simplify-manifest.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/simplify-manifest.jsonld
deleted file mode 100644
index 4f7d4a7..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/simplify-manifest.jsonld
+++ /dev/null
@@ -1,13 +0,0 @@
-{
-   "@context": "http://json-ld.org/test-suite/context.jsonld",
-   "@id": "",
-   "@type": "jld:Manifest",
-   "rdfs:comment": "JSON-LD to Simplify tests use object compare",
-   "name": "simplify",
-   "sequence": [{
-      "@type": ["test:TestCase", "jld:SimplifyTest"],
-      "name": "nested objects of the same type",
-      "input": "simplify-0001-in.jsonld",
-      "expect": "simplify-0001-out.jsonld"
-   }]
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-rdfjson/pom.xml
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-rdfjson/pom.xml b/commons/sesame-tools-rio-rdfjson/pom.xml
deleted file mode 100644
index da00181..0000000
--- a/commons/sesame-tools-rio-rdfjson/pom.xml
+++ /dev/null
@@ -1,113 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-   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.
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-    <modelVersion>4.0.0</modelVersion>
-
-    <parent>
-        <groupId>org.apache.marmotta</groupId>
-        <artifactId>marmotta-parent</artifactId>
-        <version>3.1.0-incubating-SNAPSHOT</version>
-        <relativePath>../../parent</relativePath>
-    </parent>
-
-    <name>Sesame I/O: RDF/JSON</name>
-    <artifactId>sesame-tools-rio-rdfjson</artifactId>
-    <packaging>jar</packaging>
-
-    <dependencies>
-        <dependency>
-            <groupId>org.apache.marmotta</groupId>
-            <artifactId>sesame-tools-rio-api</artifactId>
-        </dependency>
-
-        <dependency>
-            <groupId>org.slf4j</groupId>
-            <artifactId>slf4j-api</artifactId>
-        </dependency>
-
-        <dependency>
-            <groupId>org.codehaus.jackson</groupId>
-            <artifactId>jackson-core-asl</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.codehaus.jackson</groupId>
-            <artifactId>jackson-mapper-asl</artifactId>
-        </dependency>
-
-        <dependency>
-            <groupId>org.openrdf.sesame</groupId>
-            <artifactId>sesame-model</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.openrdf.sesame</groupId>
-            <artifactId>sesame-rio-api</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.openrdf.sesame</groupId>
-            <artifactId>sesame-rio-rdfxml</artifactId>
-        </dependency>
-
-        <dependency>
-            <groupId>org.openrdf.sesame</groupId>
-            <artifactId>sesame-query</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.openrdf.sesame</groupId>
-            <artifactId>sesame-queryparser-api</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.openrdf.sesame</groupId>
-            <artifactId>sesame-queryparser-sparql</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.openrdf.sesame</groupId>
-            <artifactId>sesame-queryalgebra-model</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.openrdf.sesame</groupId>
-            <artifactId>sesame-queryalgebra-evaluation</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.openrdf.sesame</groupId>
-            <artifactId>sesame-sail-memory</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.openrdf.sesame</groupId>
-            <artifactId>sesame-repository-sail</artifactId>
-            <scope>test</scope>
-        </dependency>
-        
-        <dependency>
-            <groupId>junit</groupId>
-            <artifactId>junit</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>ch.qos.logback</groupId>
-            <artifactId>logback-classic</artifactId>
-            <scope>test</scope>
-        </dependency>
-    </dependencies>
-
-</project>

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-rdfjson/src/main/java/org/apache/marmotta/commons/sesame/rio/rdfjson/RDFJsonParser.java
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-rdfjson/src/main/java/org/apache/marmotta/commons/sesame/rio/rdfjson/RDFJsonParser.java b/commons/sesame-tools-rio-rdfjson/src/main/java/org/apache/marmotta/commons/sesame/rio/rdfjson/RDFJsonParser.java
deleted file mode 100644
index f21dcae..0000000
--- a/commons/sesame-tools-rio-rdfjson/src/main/java/org/apache/marmotta/commons/sesame/rio/rdfjson/RDFJsonParser.java
+++ /dev/null
@@ -1,160 +0,0 @@
-/**
- * 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.commons.sesame.rio.rdfjson;
-
-import org.codehaus.jackson.map.ObjectMapper;
-import org.codehaus.jackson.type.TypeReference;
-import org.openrdf.model.Resource;
-import org.openrdf.model.Value;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.BNodeImpl;
-import org.openrdf.model.impl.URIImpl;
-import org.openrdf.rio.RDFFormat;
-import org.openrdf.rio.RDFHandlerException;
-import org.openrdf.rio.RDFParseException;
-import org.openrdf.rio.helpers.RDFParserBase;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.Reader;
-import java.util.Map;
-import java.util.Set;
-
-/**
- * Add file description here!
- * <p/>
- * User: sschaffe
- */
-public class RDFJsonParser extends RDFParserBase {
-
-
-    private static final String HTTP = "http://";
-    private static final String VALUE = "value";
-    private static final String TYPE = "type";
-    private static final String BNODE = "bnode";
-    private static final String URI = "uri";
-    private static final String LANG = "lang";
-    private static final String DATATYPE = "datatype";
-
-    /**
-     * Creates a new RDFParserBase that will use a {@link org.openrdf.model.impl.ValueFactoryImpl} to
-     * create RDF model objects.
-     */
-    public RDFJsonParser() {
-        super();
-    }
-
-    /**
-     * Creates a new TurtleParser that will use the supplied ValueFactory to
-     * create RDF model objects.
-     *
-     * @param valueFactory A ValueFactory.
-     */
-    public RDFJsonParser(ValueFactory valueFactory) {
-        super(valueFactory);
-    }
-
-    /**
-     * Gets the RDF format that this parser can parse.
-     */
-    @Override
-    public RDFFormat getRDFFormat() {
-        return RDFFormat.RDFJSON;
-    }
-
-    /**
-     * Parses the data from the supplied InputStream, using the supplied baseURI
-     * to resolve any relative URI references.
-     *
-     * @param in      The InputStream from which to read the data.
-     * @param baseURI The URI associated with the data in the InputStream.
-     * @throws java.io.IOException If an I/O error occurred while data was read from the InputStream.
-     * @throws org.openrdf.rio.RDFParseException
-     *                             If the parser has found an unrecoverable parse error.
-     * @throws org.openrdf.rio.RDFHandlerException
-     *                             If the configured statement handler has encountered an
-     *                             unrecoverable error.
-     */
-    @Override
-    public void parse(InputStream in, String baseURI) throws IOException, RDFParseException, RDFHandlerException {
-        ObjectMapper mapper = new ObjectMapper();
-        Map<String,Map<String,Set<Map<String,String>>>> subjects = mapper.readValue(in, new TypeReference<Map<String,Map<String,Set<Map<String,String>>>>>(){});
-        addToRepository(subjects);
-    }
-
-    /**
-     * Parses the data from the supplied Reader, using the supplied baseURI to
-     * resolve any relative URI references.
-     *
-     * @param reader  The Reader from which to read the data.
-     * @param baseURI The URI associated with the data in the InputStream.
-     * @throws java.io.IOException If an I/O error occurred while data was read from the InputStream.
-     * @throws org.openrdf.rio.RDFParseException
-     *                             If the parser has found an unrecoverable parse error.
-     * @throws org.openrdf.rio.RDFHandlerException
-     *                             If the configured statement handler has encountered an
-     *                             unrecoverable error.
-     */
-    @Override
-    public void parse(Reader reader, String baseURI) throws IOException, RDFParseException, RDFHandlerException {
-        ObjectMapper mapper = new ObjectMapper();
-        Map<String,Map<String,Set<Map<String,String>>>> subjects = mapper.readValue(reader, new TypeReference<Map<String,Map<String,Set<Map<String,String>>>>>(){});
-        addToRepository(subjects);
-    }
-
-
-
-    private void addToRepository(Map<String,Map<String,Set<Map<String,String>>>> subjects) throws RDFParseException, RDFHandlerException {
-        for(String subjectKey : subjects.keySet() ) {
-            //create subject Resource
-            Resource subject;
-            if(subjectKey.startsWith(HTTP)) {
-                subject = new URIImpl(subjectKey);
-            } else {
-                subject = new BNodeImpl(subjectKey);
-            }
-
-            for(Map.Entry<String, Set<Map<String, String>>> entry : subjects.get(subjectKey).entrySet()) {
-                //create property URI
-                URIImpl property = new URIImpl(entry.getKey());
-
-                for(Map<String,String> o : entry.getValue()) {
-                    //create object resources
-                    Value object;
-
-                    if( o.get(TYPE).equals(URI) ) {
-                        object = createURI(o.get(VALUE));
-                    } else if( o.get(TYPE).equals(BNODE) ) {
-                        object = createBNode(o.get(VALUE));
-                    } else {
-                        if( o.get(LANG) != null ) {
-                            object = createLiteral(o.get(VALUE),o.get(LANG),null);
-                        } else if( o.get(DATATYPE) != null) {
-                            object = createLiteral(o.get(VALUE),null,new URIImpl(o.get(DATATYPE)));
-                        } else {
-                            object = createLiteral(o.get(VALUE),null,null);
-                        }
-                    }
-                    //add triple
-                    rdfHandler.handleStatement(createStatement(subject, property, object));
-                }
-            }
-        }
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-rdfjson/src/main/java/org/apache/marmotta/commons/sesame/rio/rdfjson/RDFJsonParserFactory.java
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-rdfjson/src/main/java/org/apache/marmotta/commons/sesame/rio/rdfjson/RDFJsonParserFactory.java b/commons/sesame-tools-rio-rdfjson/src/main/java/org/apache/marmotta/commons/sesame/rio/rdfjson/RDFJsonParserFactory.java
deleted file mode 100644
index b61200b..0000000
--- a/commons/sesame-tools-rio-rdfjson/src/main/java/org/apache/marmotta/commons/sesame/rio/rdfjson/RDFJsonParserFactory.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/**
- * 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.commons.sesame.rio.rdfjson;
-
-import org.openrdf.rio.RDFFormat;
-import org.openrdf.rio.RDFParser;
-import org.openrdf.rio.RDFParserFactory;
-
-/**
- * Add file description here!
- * <p/>
- * Author: Sebastian Schaffert
- */
-public class RDFJsonParserFactory implements RDFParserFactory {
-
-    /**
-     * Returns the RDF format for this factory.
-     */
-    @Override
-    public RDFFormat getRDFFormat() {
-        return RDFFormat.RDFJSON;
-    }
-
-    /**
-     * Returns a RDFParser instance.
-     */
-    @Override
-    public RDFParser getParser() {
-        return new RDFJsonParser();
-    }
-}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-rdfjson/src/main/java/org/apache/marmotta/commons/sesame/rio/rdfjson/RDFJsonWriter.java
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-rdfjson/src/main/java/org/apache/marmotta/commons/sesame/rio/rdfjson/RDFJsonWriter.java b/commons/sesame-tools-rio-rdfjson/src/main/java/org/apache/marmotta/commons/sesame/rio/rdfjson/RDFJsonWriter.java
deleted file mode 100644
index 0395f21..0000000
--- a/commons/sesame-tools-rio-rdfjson/src/main/java/org/apache/marmotta/commons/sesame/rio/rdfjson/RDFJsonWriter.java
+++ /dev/null
@@ -1,193 +0,0 @@
-/**
- * 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.commons.sesame.rio.rdfjson;
-
-import org.codehaus.jackson.map.ObjectMapper;
-import org.openrdf.model.BNode;
-import org.openrdf.model.Literal;
-import org.openrdf.model.Statement;
-import org.openrdf.model.URI;
-import org.openrdf.model.Value;
-import org.openrdf.rio.RDFFormat;
-import org.openrdf.rio.RDFHandlerException;
-import org.openrdf.rio.RDFWriter;
-
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.OutputStreamWriter;
-import java.io.Writer;
-import java.util.HashMap;
-import java.util.HashSet;
-
-/**
- * Add file description here!
- * <p/>
- * User: sschaffe
- */
-public class RDFJsonWriter implements RDFWriter {
-
-    private static final String VALUE = "value";
-    private static final String TYPE = "type";
-    private static final String BNODE = "bnode";
-    private static final String URI = "uri";
-    private static final String LITERAL = "literal";
-    private static final String LANG = "lang";
-    private static final String DATATYPE = "datatype";
-
-
-    private Writer writer;
-
-    private HashMap<String,HashMap<String,HashSet<HashMap<String,String>>>> subjects;
-
-
-    public RDFJsonWriter(OutputStream out) {
-        writer = new OutputStreamWriter(out);
-    }
-
-
-    public RDFJsonWriter(Writer writer) {
-        this.writer = writer;
-    }
-
-    /**
-     * Gets the RDF format that this RDFWriter uses.
-     */
-    @Override
-    public RDFFormat getRDFFormat() {
-        return RDFFormat.RDFJSON;
-    }
-
-    /**
-     * Signals the start of the RDF data. This method is called before any data
-     * is reported.
-     *
-     * @throws org.openrdf.rio.RDFHandlerException
-     *          If the RDF handler has encountered an unrecoverable error.
-     */
-    @Override
-    public void startRDF() throws RDFHandlerException {
-        subjects = new HashMap<String,HashMap<String,HashSet<HashMap<String,String>>>>();
-    }
-
-    /**
-     * Signals the end of the RDF data. This method is called when all data has
-     * been reported.
-     *
-     * @throws org.openrdf.rio.RDFHandlerException
-     *          If the RDF handler has encountered an unrecoverable error.
-     */
-    @Override
-    public void endRDF() throws RDFHandlerException {
-        ObjectMapper mapper = new ObjectMapper();
-        try {
-            mapper.writeValue(writer,subjects);
-        } catch (IOException e) {
-            throw new RDFHandlerException("error while serializing JSON objects",e);
-        }
-    }
-
-    /**
-     * Handles a namespace declaration/definition. A namespace declaration
-     * associates a (short) prefix string with the namespace's URI. The prefix
-     * for default namespaces, which do not have an associated prefix, are
-     * represented as empty strings.
-     *
-     * @param prefix The prefix for the namespace, or an empty string in case of a
-     *               default namespace.
-     * @param uri    The URI that the prefix maps to.
-     * @throws org.openrdf.rio.RDFHandlerException
-     *          If the RDF handler has encountered an unrecoverable error.
-     */
-    @Override
-    public void handleNamespace(String prefix, String uri) throws RDFHandlerException {
-    }
-
-    /**
-     * Handles a statement.
-     *
-     * @param st The statement.
-     * @throws org.openrdf.rio.RDFHandlerException
-     *          If the RDF handler has encountered an unrecoverable error.
-     */
-    @Override
-    public void handleStatement(Statement st) throws RDFHandlerException {
-            // get subject key
-            String subjectKey;
-            if( st.getSubject() instanceof URI) {
-                subjectKey = ((URI)st.getSubject()).stringValue();
-            } else {
-                subjectKey = ((BNode)st.getSubject()).getID();
-            }
-
-            //add or get predicate map
-            HashMap<String,HashSet<HashMap<String,String>>> predicates;
-            if( subjects.containsKey(subjectKey)) {
-                predicates = subjects.get(subjectKey);
-            } else {
-                predicates = new HashMap<String,HashSet<HashMap<String,String>>>();
-                subjects.put(subjectKey,predicates);
-            }
-
-            //get predicate key
-            String predicateKey = st.getPredicate().stringValue();
-
-            //add or get object set
-            HashSet<HashMap<String,String>> objects;
-            if( predicates.containsKey(predicateKey) ) {
-                objects = predicates.get(predicateKey);
-            } else {
-                 objects = new HashSet<HashMap<String,String>>();
-                predicates.put(predicateKey,objects);
-            }
-
-            //add objects
-            HashMap<String,String> object = new HashMap<String,String>();
-            Value objectNode = st.getObject();
-            if( objectNode instanceof Literal) {
-                object.put(TYPE,LITERAL);
-                object.put(VALUE,((Literal)objectNode).stringValue());
-                if(((Literal) objectNode).getLanguage() != null )
-                    object.put(LANG,((Literal) objectNode).getLanguage());
-                if(((Literal) objectNode).getDatatype() != null)
-                    object.put(DATATYPE,((Literal) objectNode).getDatatype().stringValue());
-            } else {
-                if( objectNode instanceof URI ) {
-                    object.put(TYPE,URI);
-                    object.put(VALUE,((URI)objectNode).stringValue());
-                } else {
-                    object.put(TYPE,BNODE);
-                    object.put(VALUE,((BNode)objectNode).getID());
-                }
-            }
-            objects.add(object);
-    }
-
-    /**
-     * Handles a comment.
-     *
-     * @param comment The comment.
-     * @throws org.openrdf.rio.RDFHandlerException
-     *          If the RDF handler has encountered an unrecoverable error.
-     */
-    @Override
-    public void handleComment(String comment) throws RDFHandlerException {
-    }
-
-
-
-}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-rdfjson/src/main/java/org/apache/marmotta/commons/sesame/rio/rdfjson/RDFJsonWriterFactory.java
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-rdfjson/src/main/java/org/apache/marmotta/commons/sesame/rio/rdfjson/RDFJsonWriterFactory.java b/commons/sesame-tools-rio-rdfjson/src/main/java/org/apache/marmotta/commons/sesame/rio/rdfjson/RDFJsonWriterFactory.java
deleted file mode 100644
index 22dd3b2..0000000
--- a/commons/sesame-tools-rio-rdfjson/src/main/java/org/apache/marmotta/commons/sesame/rio/rdfjson/RDFJsonWriterFactory.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/**
- * 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.commons.sesame.rio.rdfjson;
-
-import org.openrdf.rio.RDFFormat;
-import org.openrdf.rio.RDFWriter;
-import org.openrdf.rio.RDFWriterFactory;
-
-import java.io.OutputStream;
-import java.io.Writer;
-
-/**
- * Add file description here!
- * <p/>
- * Author: Sebastian Schaffert
- */
-public class RDFJsonWriterFactory implements RDFWriterFactory {
-
-    /**
-     * Returns the RDF format for this factory.
-     */
-    @Override
-    public RDFFormat getRDFFormat() {
-        return RDFFormat.RDFJSON;
-    }
-
-    /**
-     * Returns an RDFWriter instance that will write to the supplied output
-     * stream.
-     *
-     * @param out The OutputStream to write the RDF to.
-     */
-    @Override
-    public RDFWriter getWriter(OutputStream out) {
-        return new RDFJsonWriter(out);
-    }
-
-    /**
-     * Returns an RDFWriter instance that will write to the supplied writer.
-     *
-     * @param writer The Writer to write the RDF to.
-     */
-    @Override
-    public RDFWriter getWriter(Writer writer) {
-        return new RDFJsonWriter(writer);
-    }
-}

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-rdfjson/src/main/resources/META-INF/services/org.openrdf.rio.RDFParserFactory
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-rdfjson/src/main/resources/META-INF/services/org.openrdf.rio.RDFParserFactory b/commons/sesame-tools-rio-rdfjson/src/main/resources/META-INF/services/org.openrdf.rio.RDFParserFactory
deleted file mode 100644
index 0cf0d1a..0000000
--- a/commons/sesame-tools-rio-rdfjson/src/main/resources/META-INF/services/org.openrdf.rio.RDFParserFactory
+++ /dev/null
@@ -1 +0,0 @@
-org.apache.marmotta.commons.sesame.rio.rdfjson.RDFJsonParserFactory
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-rdfjson/src/main/resources/META-INF/services/org.openrdf.rio.RDFWriterFactory
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-rdfjson/src/main/resources/META-INF/services/org.openrdf.rio.RDFWriterFactory b/commons/sesame-tools-rio-rdfjson/src/main/resources/META-INF/services/org.openrdf.rio.RDFWriterFactory
deleted file mode 100644
index b224d1c..0000000
--- a/commons/sesame-tools-rio-rdfjson/src/main/resources/META-INF/services/org.openrdf.rio.RDFWriterFactory
+++ /dev/null
@@ -1 +0,0 @@
-org.apache.marmotta.commons.sesame.rio.rdfjson.RDFJsonWriterFactory
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-rdfjson/src/test/java/org/apache/marmotta/commons/sesame/rio/rdfjson/TestRDFJsonParser.java
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-rdfjson/src/test/java/org/apache/marmotta/commons/sesame/rio/rdfjson/TestRDFJsonParser.java b/commons/sesame-tools-rio-rdfjson/src/test/java/org/apache/marmotta/commons/sesame/rio/rdfjson/TestRDFJsonParser.java
deleted file mode 100644
index f6ac7d5..0000000
--- a/commons/sesame-tools-rio-rdfjson/src/test/java/org/apache/marmotta/commons/sesame/rio/rdfjson/TestRDFJsonParser.java
+++ /dev/null
@@ -1,135 +0,0 @@
-/**
- * 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.commons.sesame.rio.rdfjson;
-/*
- * Copyright (c) 2013 The Apache Software Foundation
- *
- *  Licensed 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.
- */
-
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.junit.runners.Parameterized;
-import org.openrdf.model.BNode;
-import org.openrdf.model.Resource;
-import org.openrdf.model.Statement;
-import org.openrdf.model.URI;
-import org.openrdf.model.Value;
-import org.openrdf.repository.Repository;
-import org.openrdf.repository.RepositoryConnection;
-import org.openrdf.repository.sail.SailRepository;
-import org.openrdf.rio.RDFFormat;
-import org.openrdf.sail.memory.MemoryStore;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.Collection;
-
-import static java.util.Arrays.asList;
-import static org.hamcrest.CoreMatchers.everyItem;
-import static org.hamcrest.CoreMatchers.notNullValue;
-import static org.junit.Assert.*;
-import static org.junit.Assume.assumeThat;
-
-/**
- * Add file description here!
- * <p/>
- * Author: Sebastian Schaffert
- */
-@RunWith(Parameterized.class)
-public class TestRDFJsonParser {
-
-    private static Logger log = LoggerFactory.getLogger(TestRDFJsonParser.class);
-
-    private String fileName;
-
-    public TestRDFJsonParser(String fileName) {
-        this.fileName = fileName;
-    }
-
-    // return the list of rdf-NNNN.jsonld files
-    @Parameterized.Parameters(name = "{0}")
-    public static Collection<Object[]> data() {
-        ArrayList<Object[]> list = new ArrayList<Object[]>();
-        for(int i=1; i<=1; i++) {
-            list.add(new Object[] {"test-"+String.format("%03d",i)});
-        }
-        return list;
-    }
-
-    @Test
-    public void runTest() throws Exception {
-        log.info("running test {} ...", fileName);
-
-        InputStream rdfJSON = this.getClass().getResourceAsStream(fileName+".json");
-        InputStream rdfXML = this.getClass().getResourceAsStream(fileName+".rdf");
-        assumeThat("Could not load testfiles", asList(rdfJSON, rdfXML), everyItem(notNullValue(InputStream.class)));
-
-        Repository repositoryJSON = new SailRepository(new MemoryStore());
-        repositoryJSON.initialize();
-
-        RepositoryConnection connectionJSON = repositoryJSON.getConnection();
-        try {
-            connectionJSON.add(rdfJSON, "http://localhost/rdfjson/", RDFFormat.RDFJSON);
-            connectionJSON.commit();
-        } catch(Exception ex) {
-            fail("parsing "+fileName+" failed!");
-        }
-        assertTrue(connectionJSON.size() > 0);
-
-
-        Repository repositoryRDF = new SailRepository(new MemoryStore());
-        repositoryRDF.initialize();
-
-        RepositoryConnection connectionRDF = repositoryRDF.getConnection();
-        connectionRDF.add(rdfXML, "http://localhost/rdfjson/", RDFFormat.RDFXML);
-        connectionRDF.commit();
-
-        assertEquals(connectionJSON.size(), connectionRDF.size());
-
-        // check each triple in the RDF/XML whether it exists in the RDF/JSON
-        for(Statement statement : connectionRDF.getStatements(null,null,null,false).asList()) {
-            Resource subject = statement.getSubject() instanceof URI ? statement.getSubject() : null;
-            URI predicate = statement.getPredicate();
-            Value object = statement.getObject() instanceof BNode ? null : statement.getObject();
-            assertTrue("statement "+statement+" not contained in result",connectionJSON.hasStatement(subject,predicate,object,false));
-        }
-
-        connectionJSON.close();
-        connectionRDF.close();
-
-        repositoryJSON.shutDown();
-        repositoryRDF.shutDown();
-
-    }
-
-
-
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-rdfjson/src/test/resources/logback.xml
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-rdfjson/src/test/resources/logback.xml b/commons/sesame-tools-rio-rdfjson/src/test/resources/logback.xml
deleted file mode 100644
index 1bfecff..0000000
--- a/commons/sesame-tools-rio-rdfjson/src/test/resources/logback.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-<!--
-  ~ 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.
-  -->
-
-<configuration>
-    <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
-        <encoder>
-            <pattern>%d{HH:mm:ss.SSS} %highlight(%level) %cyan(%logger{15}) - %m%n</pattern>
-        </encoder>
-    </appender>
-    <root level="${root-level:-INFO}">
-        <appender-ref ref="CONSOLE"/>
-    </root>
-</configuration>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-rdfjson/src/test/resources/org/apache/marmotta/commons/sesame/rio/rdfjson/test-001.json
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-rdfjson/src/test/resources/org/apache/marmotta/commons/sesame/rio/rdfjson/test-001.json b/commons/sesame-tools-rio-rdfjson/src/test/resources/org/apache/marmotta/commons/sesame/rio/rdfjson/test-001.json
deleted file mode 100644
index 02e2ee4..0000000
--- a/commons/sesame-tools-rio-rdfjson/src/test/resources/org/apache/marmotta/commons/sesame/rio/rdfjson/test-001.json
+++ /dev/null
@@ -1,21 +0,0 @@
-{
-    "http://example.org/about" : {
-        "http://purl.org/dc/elements/1.1/creator" : [ { "value" : "Anna Wilder", "type" : "literal" } ],
-        "http://purl.org/dc/elements/1.1/title"   : [ { "value" : "Anna's Homepage", "type" : "literal", "lang" : "en" } ] ,
-        "http://xmlns.com/foaf/0.1/maker"         : [ { "value" : "_:person", "type" : "bnode" } ]
-    } ,
-
-    "_:person" : {
-        "http://xmlns.com/foaf/0.1/homepage"      : [ { "value" : "http://example.org/about", "type" : "uri" } ] ,
-        "http://xmlns.com/foaf/0.1/made"          : [ { "value" : "http://example.org/about", "type" : "uri" } ] ,
-        "http://xmlns.com/foaf/0.1/name"          : [ { "value" : "Anna Wilder", "type" : "literal" } ] ,
-        "http://xmlns.com/foaf/0.1/firstName"     : [ { "value" : "Anna", "type" : "literal" } ] ,
-        "http://xmlns.com/foaf/0.1/surname"       : [ { "value" : "Wilder", "type" : "literal" } ] ,
-        "http://xmlns.com/foaf/0.1/depiction"     : [ { "value" : "http://example.org/pic.jpg", "type" : "uri" } ] ,
-        "http://xmlns.com/foaf/0.1/nick"          : [
-            { "type" : "literal", "value" : "wildling"} ,
-            { "type" : "literal", "value" : "wilda" }
-        ] ,
-        "http://xmlns.com/foaf/0.1/mbox_sha1sum"  : [ {  "value" : "69e31bbcf58d432950127593e292a55975bc66fd", "type" : "literal" } ]
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-rdfjson/src/test/resources/org/apache/marmotta/commons/sesame/rio/rdfjson/test-001.rdf
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-rdfjson/src/test/resources/org/apache/marmotta/commons/sesame/rio/rdfjson/test-001.rdf b/commons/sesame-tools-rio-rdfjson/src/test/resources/org/apache/marmotta/commons/sesame/rio/rdfjson/test-001.rdf
deleted file mode 100644
index 4befdab..0000000
--- a/commons/sesame-tools-rio-rdfjson/src/test/resources/org/apache/marmotta/commons/sesame/rio/rdfjson/test-001.rdf
+++ /dev/null
@@ -1,37 +0,0 @@
-<!--
-  ~ 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.
-  -->
-
-<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-         xmlns:foaf="http://xmlns.com/foaf/0.1/"
-         xmlns:dc="http://purl.org/dc/elements/1.1/">
-    <rdf:Description rdf:about="http://example.org/about">
-        <dc:creator>Anna Wilder</dc:creator>
-        <dc:title xml:lang="en">Anna's Homepage</dc:title>
-        <foaf:maker rdf:nodeID="person" />
-    </rdf:Description>
-    <rdf:Description rdf:nodeID="person">
-        <foaf:homepage rdf:resource="http://example.org/about" />
-        <foaf:made rdf:resource="http://example.org/about" />
-        <foaf:name>Anna Wilder</foaf:name>
-        <foaf:firstName>Anna</foaf:firstName>
-        <foaf:surname>Wilder</foaf:surname>
-        <foaf:depiction rdf:resource="http://example.org/pic.jpg" />
-        <foaf:nick>wildling</foaf:nick>
-        <foaf:nick>wilda</foaf:nick>
-        <foaf:mbox_sha1sum>69e31bbcf58d432950127593e292a55975bc66fd</foaf:mbox_sha1sum>
-    </rdf:Description>
-</rdf:RDF>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-rss/pom.xml
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-rss/pom.xml b/commons/sesame-tools-rio-rss/pom.xml
index 5dd8f40..0f4a8d8 100644
--- a/commons/sesame-tools-rio-rss/pom.xml
+++ b/commons/sesame-tools-rio-rss/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/marmotta/blob/582abb5b/commons/sesame-tools-rio-rss/src/main/resources/META-INF/NOTICE
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-rss/src/main/resources/META-INF/NOTICE b/commons/sesame-tools-rio-rss/src/main/resources/META-INF/NOTICE
index e3cb85c..9893868 100644
--- a/commons/sesame-tools-rio-rss/src/main/resources/META-INF/NOTICE
+++ b/commons/sesame-tools-rio-rss/src/main/resources/META-INF/NOTICE
@@ -1,9 +1,11 @@
 Apache Marmotta RSS
-Copyright [2012-2013] The Apache Software Foundation
+Copyright 2012-2013 The Apache Software Foundation
 
 This product includes software developed at
 The Apache Software Foundation (http://www.apache.org/).
 
-Additionally, it includes the following 3rd party modules:
+Portions of this software were originally based on the following:
 
-  rometools licensed under the Apache License 2.0
+    Copyright 2008-2012 Salzburg Research Forschungsgesellschaft mbH
+
+These have been licensed to the Apache Software Foundation under a software grant.

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/commons/sesame-tools-rio-vcard/pom.xml
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-vcard/pom.xml b/commons/sesame-tools-rio-vcard/pom.xml
index 6d88340..25de2c0 100644
--- a/commons/sesame-tools-rio-vcard/pom.xml
+++ b/commons/sesame-tools-rio-vcard/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/marmotta/blob/582abb5b/extras/pom.xml
----------------------------------------------------------------------
diff --git a/extras/pom.xml b/extras/pom.xml
index 4d9cf28..0be1aef 100644
--- a/extras/pom.xml
+++ b/extras/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>
 
@@ -47,7 +47,20 @@
                     <skip>true</skip>
                 </configuration>
             </plugin>
+            <plugin>
+                <!-- this is a reactor, no checking -->
+                <groupId>org.apache.rat</groupId>
+                <artifactId>apache-rat-plugin</artifactId>
+                <configuration>
+                    <excludes>
+                        <exclude>**</exclude>
+                    </excludes>
+                </configuration>
+            </plugin>
         </plugins>
     </build>
 
+    <modules>
+        <module>webjars</module>
+    </modules>
 </project>

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/extras/webjars/codemirror/pom.xml
----------------------------------------------------------------------
diff --git a/extras/webjars/codemirror/pom.xml b/extras/webjars/codemirror/pom.xml
new file mode 100644
index 0000000..1605757
--- /dev/null
+++ b/extras/webjars/codemirror/pom.xml
@@ -0,0 +1,97 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ 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.
+  -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>org.apache.marmotta</groupId>
+        <artifactId>marmotta-parent</artifactId>
+        <version>3.1.0-incubating</version>
+        <relativePath>../../../parent/</relativePath>
+    </parent>
+
+    <properties>
+        <webjar.version>3.16</webjar.version>
+        <webjar.path>${project.build.outputDirectory}/META-INF/resources/webjars/${project.artifactId}/${webjar.version}</webjar.path>
+    </properties>
+
+    <groupId>org.apache.marmotta.webjars</groupId>
+    <artifactId>codemirror</artifactId>
+    <packaging>jar</packaging>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.sonatype.plugins</groupId>
+                <artifactId>yuicompressor-maven-plugin</artifactId>
+                <version>1.0.0</version>
+                <executions>
+                    <execution>
+                        <id>assemble-javascript</id>
+                        <goals>
+                            <goal>aggregate</goal>
+                        </goals>
+                        <configuration>
+                            <sourceDirectory>${project.basedir}/src/main/resources</sourceDirectory>
+                            <output>${webjar.path}/codemirror.js</output>
+                            <includes>
+                                <include>codemirror.js</include>
+                                <include>matchbrackets.js</include>
+                                <include>sparql.js</include>
+                                <include>ldpath.js</include>
+                            </includes>
+                        </configuration>
+                    </execution>
+                    <execution>
+                        <id>assemble-css</id>
+                        <goals>
+                            <goal>aggregate-css</goal>
+                        </goals>
+                        <configuration>
+                            <sourceDirectory>${project.basedir}/src/main/resources</sourceDirectory>
+                            <output>${webjar.path}/codemirror.css</output>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <!-- these are "extras", so they come from 3rd parties, no RAT check! -->
+                <groupId>org.apache.rat</groupId>
+                <artifactId>apache-rat-plugin</artifactId>
+                <configuration>
+                    <excludes>
+                        <exclude>src/**</exclude>
+                    </excludes>
+                </configuration>
+            </plugin>
+        </plugins>
+        <resources>
+            <resource>
+                <directory>src/main/resources</directory>
+                <excludes>
+                    <exclude>**/*.js</exclude>
+                    <exclude>**/*.css</exclude>
+                </excludes>
+                <filtering>false</filtering>
+                <targetPath>${webjar.path}</targetPath>
+            </resource>
+        </resources>
+    </build>
+
+</project>

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/extras/webjars/codemirror/src/main/resources/codemirror.css
----------------------------------------------------------------------
diff --git a/extras/webjars/codemirror/src/main/resources/codemirror.css b/extras/webjars/codemirror/src/main/resources/codemirror.css
new file mode 100644
index 0000000..c95db64
--- /dev/null
+++ b/extras/webjars/codemirror/src/main/resources/codemirror.css
@@ -0,0 +1,259 @@
+/* BASICS */
+
+.CodeMirror {
+  /* Set height, width, borders, and global font properties here */
+  font-family: monospace;
+  height: 300px;
+}
+.CodeMirror-scroll {
+  /* Set scrolling behaviour here */
+  overflow: auto;
+}
+
+/* PADDING */
+
+.CodeMirror-lines {
+  padding: 4px 0; /* Vertical padding around content */
+}
+.CodeMirror pre {
+  padding: 0 4px; /* Horizontal padding of content */
+}
+
+.CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {
+  background-color: white; /* The little square between H and V scrollbars */
+}
+
+/* GUTTER */
+
+.CodeMirror-gutters {
+  border-right: 1px solid #ddd;
+  background-color: #f7f7f7;
+  white-space: nowrap;
+}
+.CodeMirror-linenumbers {}
+.CodeMirror-linenumber {
+  padding: 0 3px 0 5px;
+  min-width: 20px;
+  text-align: right;
+  color: #999;
+}
+
+/* CURSOR */
+
+.CodeMirror div.CodeMirror-cursor {
+  border-left: 1px solid black;
+  z-index: 3;
+}
+/* Shown when moving in bi-directional text */
+.CodeMirror div.CodeMirror-secondarycursor {
+  border-left: 1px solid silver;
+}
+.CodeMirror.cm-keymap-fat-cursor div.CodeMirror-cursor {
+  width: auto;
+  border: 0;
+  background: #7e7;
+  z-index: 1;
+}
+/* Can style cursor different in overwrite (non-insert) mode */
+.CodeMirror div.CodeMirror-cursor.CodeMirror-overwrite {}
+
+.cm-tab { display: inline-block; }
+
+/* DEFAULT THEME */
+
+.cm-s-default .cm-keyword {color: #708;}
+.cm-s-default .cm-atom {color: #219;}
+.cm-s-default .cm-number {color: #164;}
+.cm-s-default .cm-def {color: #00f;}
+.cm-s-default .cm-variable {color: black;}
+.cm-s-default .cm-variable-2 {color: #05a;}
+.cm-s-default .cm-variable-3 {color: #085;}
+.cm-s-default .cm-property {color: black;}
+.cm-s-default .cm-operator {color: black;}
+.cm-s-default .cm-comment {color: #a50;}
+.cm-s-default .cm-string {color: #a11;}
+.cm-s-default .cm-string-2 {color: #f50;}
+.cm-s-default .cm-meta {color: #555;}
+.cm-s-default .cm-error {color: #f00;}
+.cm-s-default .cm-qualifier {color: #555;}
+.cm-s-default .cm-builtin {color: #30a;}
+.cm-s-default .cm-bracket {color: #997;}
+.cm-s-default .cm-tag {color: #170;}
+.cm-s-default .cm-attribute {color: #00c;}
+.cm-s-default .cm-header {color: blue;}
+.cm-s-default .cm-quote {color: #090;}
+.cm-s-default .cm-hr {color: #999;}
+.cm-s-default .cm-link {color: #00c;}
+
+.cm-negative {color: #d44;}
+.cm-positive {color: #292;}
+.cm-header, .cm-strong {font-weight: bold;}
+.cm-em {font-style: italic;}
+.cm-link {text-decoration: underline;}
+
+.cm-invalidchar {color: #f00;}
+
+div.CodeMirror span.CodeMirror-matchingbracket {color: #0f0;}
+div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
+.CodeMirror-activeline-background {background: #e8f2ff;}
+
+/* STOP */
+
+/* The rest of this file contains styles related to the mechanics of
+   the editor. You probably shouldn't touch them. */
+
+.CodeMirror {
+  line-height: 1;
+  position: relative;
+  overflow: hidden;
+  background: white;
+  color: black;
+}
+
+.CodeMirror-scroll {
+  /* 30px is the magic margin used to hide the element's real scrollbars */
+  /* See overflow: hidden in .CodeMirror */
+  margin-bottom: -30px; margin-right: -30px;
+  padding-bottom: 30px; padding-right: 30px;
+  height: 100%;
+  outline: none; /* Prevent dragging from highlighting the element */
+  position: relative;
+}
+.CodeMirror-sizer {
+  position: relative;
+}
+
+/* The fake, visible scrollbars. Used to force redraw during scrolling
+   before actuall scrolling happens, thus preventing shaking and
+   flickering artifacts. */
+.CodeMirror-vscrollbar, .CodeMirror-hscrollbar, .CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {
+  position: absolute;
+  z-index: 6;
+  display: none;
+}
+.CodeMirror-vscrollbar {
+  right: 0; top: 0;
+  overflow-x: hidden;
+  overflow-y: scroll;
+}
+.CodeMirror-hscrollbar {
+  bottom: 0; left: 0;
+  overflow-y: hidden;
+  overflow-x: scroll;
+}
+.CodeMirror-scrollbar-filler {
+  right: 0; bottom: 0;
+}
+.CodeMirror-gutter-filler {
+  left: 0; bottom: 0;
+}
+
+.CodeMirror-gutters {
+  position: absolute; left: 0; top: 0;
+  padding-bottom: 30px;
+  z-index: 3;
+}
+.CodeMirror-gutter {
+  white-space: normal;
+  height: 100%;
+  padding-bottom: 30px;
+  margin-bottom: -32px;
+  display: inline-block;
+  /* Hack to make IE7 behave */
+  *zoom:1;
+  *display:inline;
+}
+.CodeMirror-gutter-elt {
+  position: absolute;
+  cursor: default;
+  z-index: 4;
+}
+
+.CodeMirror-lines {
+  cursor: text;
+}
+.CodeMirror pre {
+  /* Reset some styles that the rest of the page might have set */
+  -moz-border-radius: 0; -webkit-border-radius: 0; border-radius: 0;
+  border-width: 0;
+  background: transparent;
+  font-family: inherit;
+  font-size: inherit;
+  margin: 0;
+  white-space: pre;
+  word-wrap: normal;
+  line-height: inherit;
+  color: inherit;
+  z-index: 2;
+  position: relative;
+  overflow: visible;
+}
+.CodeMirror-wrap pre {
+  word-wrap: break-word;
+  white-space: pre-wrap;
+  word-break: normal;
+}
+.CodeMirror-code pre {
+  border-right: 30px solid transparent;
+  width: -webkit-fit-content;
+  width: -moz-fit-content;
+  width: fit-content;
+}
+.CodeMirror-wrap .CodeMirror-code pre {
+  border-right: none;
+  width: auto;
+}
+.CodeMirror-linebackground {
+  position: absolute;
+  left: 0; right: 0; top: 0; bottom: 0;
+  z-index: 0;
+}
+
+.CodeMirror-linewidget {
+  position: relative;
+  z-index: 2;
+  overflow: auto;
+}
+
+.CodeMirror-widget {
+}
+
+.CodeMirror-wrap .CodeMirror-scroll {
+  overflow-x: hidden;
+}
+
+.CodeMirror-measure {
+  position: absolute;
+  width: 100%; height: 0px;
+  overflow: hidden;
+  visibility: hidden;
+}
+.CodeMirror-measure pre { position: static; }
+
+.CodeMirror div.CodeMirror-cursor {
+  position: absolute;
+  visibility: hidden;
+  border-right: none;
+  width: 0;
+}
+.CodeMirror-focused div.CodeMirror-cursor {
+  visibility: visible;
+}
+
+.CodeMirror-selected { background: #d9d9d9; }
+.CodeMirror-focused .CodeMirror-selected { background: #d7d4f0; }
+
+.cm-searching {
+  background: #ffa;
+  background: rgba(255, 255, 0, .4);
+}
+
+/* IE7 hack to prevent it from returning funny offsetTops on the spans */
+.CodeMirror span { *vertical-align: text-bottom; }
+
+@media print {
+  /* Hide the cursor when printing */
+  .CodeMirror div.CodeMirror-cursor {
+    visibility: hidden;
+  }
+}


[087/100] [abbrv] git commit: MARMOTTA-438: removed test cases retrieval

Posted by wi...@apache.org.
MARMOTTA-438: removed test cases retrieval


Project: http://git-wip-us.apache.org/repos/asf/marmotta/repo
Commit: http://git-wip-us.apache.org/repos/asf/marmotta/commit/ecebad15
Tree: http://git-wip-us.apache.org/repos/asf/marmotta/tree/ecebad15
Diff: http://git-wip-us.apache.org/repos/asf/marmotta/diff/ecebad15

Branch: refs/heads/ldp
Commit: ecebad15349eb8f917fa2dca340b4e29c04358df
Parents: b00e935
Author: Sergio Fernández <wi...@apache.org>
Authored: Mon May 5 20:39:09 2014 +0200
Committer: Sergio Fernández <wi...@apache.org>
Committed: Mon May 5 20:39:09 2014 +0200

----------------------------------------------------------------------
 platform/marmotta-ldp/pom.xml | 19 -------------------
 1 file changed, 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/marmotta/blob/ecebad15/platform/marmotta-ldp/pom.xml
----------------------------------------------------------------------
diff --git a/platform/marmotta-ldp/pom.xml b/platform/marmotta-ldp/pom.xml
index f0e7dd5..fcc3879 100644
--- a/platform/marmotta-ldp/pom.xml
+++ b/platform/marmotta-ldp/pom.xml
@@ -66,25 +66,6 @@
 
         <plugins>
             <plugin>
-                <groupId>com.googlecode.maven-download-plugin</groupId>
-                <artifactId>maven-download-plugin</artifactId>
-                <executions>
-                    <execution>
-                        <id>download-ldp-test-cases</id>
-                        <phase>process-test-resources</phase>
-                        <goals>
-                            <goal>wget</goal>
-                        </goals>
-                        <configuration>
-                            <url>http://www.w3.org/2012/pyRdfa/extract?uri=https%3A%2F%2Fdvcs.w3.org%2Fhg%2Fldpwg%2Fraw-file%2Fdefault%2FTest%2520Cases%2FLDP%2520Test%2520Cases.html&amp;format=turtle&amp;rdfagraph=output&amp;vocab_expansion=false&amp;rdfa_lite=false&amp;embedded_rdf=true&amp;space_preserve=true&amp;vocab_cache=true&amp;vocab_cache_report=false&amp;vocab_cache_refresh=false</url>
-                            <unpack>false</unpack>
-                            <outputDirectory>${project.build.testOutputDirectory}/testsuite/</outputDirectory>
-                            <outputFileName>LDP-Test-Cases-WD-live.ttl</outputFileName>
-                        </configuration>
-                    </execution>
-                </executions>
-            </plugin>
-            <plugin>
                 <groupId>org.apache.marmotta</groupId>
                 <artifactId>buildinfo-maven-plugin</artifactId>
                 <configuration>