You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stanbol.apache.org by ci...@apache.org on 2011/03/30 15:44:01 UTC

svn commit: r1086954 [15/16] - in /incubator/stanbol/trunk/kres/ontologymanager/store: ./ api/ api/src/ api/src/main/ api/src/main/java/ api/src/main/java/org/ api/src/main/java/org/apache/ api/src/main/java/org/apache/stanbol/ api/src/main/java/org/ap...

Added: incubator/stanbol/trunk/kres/ontologymanager/store/rest/src/main/resources/META-INF/static/scripts/requestResponse.js
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/kres/ontologymanager/store/rest/src/main/resources/META-INF/static/scripts/requestResponse.js?rev=1086954&view=auto
==============================================================================
--- incubator/stanbol/trunk/kres/ontologymanager/store/rest/src/main/resources/META-INF/static/scripts/requestResponse.js (added)
+++ incubator/stanbol/trunk/kres/ontologymanager/store/rest/src/main/resources/META-INF/static/scripts/requestResponse.js Wed Mar 30 13:43:53 2011
@@ -0,0 +1,62 @@
+//Create the PSTORE object if one does not exist. 
+if (!this.PSTORE) {
+	this.PSTORE = {};
+}
+
+//Create the HTTPHelper
+if (!this.PSTORE.HTTPHelper) {
+	this.PSTORE.HTTPHelper = {};
+}
+
+(function () {
+	var httphelper = this.PSTORE.HTTPHelper;
+	
+	httphelper.send = function(method, uri, normalize, override, name, value){
+		var request  = null;
+		if (window.XMLHttpRequest) {
+			request = new XMLHttpRequest();
+		} else if (window.ActiveXObject) {
+			request = new ActiveXObject("Msxml2.XMLHTTP");
+		}
+		if(normalize){
+			uri = httphelper.normalize(uri);
+		}
+		request.open(method, uri, false);
+		if(override){
+			request.setRequestHeader('X-HTTP-Method-Override', 'DELETE');	
+		}
+		if(method === 'POST' || override){
+			var data = name + '=' + value;
+			request.setRequestHeader("Content-Type",
+			"application/x-www-form-urlencoded");
+			request.send(data);
+		}else{
+			request.send();
+		}
+		location.reload('false');
+	};
+	
+	httphelper.normalize = function(uri){
+		var n = uri.lastIndexOf("#");
+		uri =  uri.substring(0,n) + "/" + uri.substring(n+1, uri.length);
+		return uri;
+	};
+	
+}());
+
+
+function getResponse(method, uri, acceptHeader) {
+	if (typeof acceptHeader == "undefined") {
+		acceptHeader = "application/xml";
+	}
+	var request = new XMLHttpRequest();
+	request.open(method, uri, false);
+	request.setRequestHeader("Accept", acceptHeader);
+	request.send();
+	var headers = request.getAllResponseHeaders();
+
+	return ("HTTP/1.1 " + request.status + " " + request.statusText + "\n"
+			+ headers + "\n\n" + request.responseText.replace(/</gi, "&lt;")
+			.replace(/>/gi, "&gt;"));
+
+}

Propchange: incubator/stanbol/trunk/kres/ontologymanager/store/rest/src/main/resources/META-INF/static/scripts/requestResponse.js
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/stanbol/trunk/kres/ontologymanager/store/rest/src/main/resources/META-INF/static/style/persistencestore.css
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/kres/ontologymanager/store/rest/src/main/resources/META-INF/static/style/persistencestore.css?rev=1086954&view=auto
==============================================================================
--- incubator/stanbol/trunk/kres/ontologymanager/store/rest/src/main/resources/META-INF/static/style/persistencestore.css (added)
+++ incubator/stanbol/trunk/kres/ontologymanager/store/rest/src/main/resources/META-INF/static/style/persistencestore.css Wed Mar 30 13:43:53 2011
@@ -0,0 +1,391 @@
+body {
+  font: normal 13px/20px Arial,Helvetica,sans-serif;
+  padding: 0;
+  margin: 0;
+  background-color: #eff9f0;
+}
+
+img {
+  border: none;
+}
+
+a:link, a:visited, a:hover {
+  color: #c43187;
+}
+
+a: active {
+  color: black;  
+}
+
+a:focus {
+  outline: none;
+}
+
+dt, dd {
+  margin-top: 1em;
+}
+
+pre, textarea {
+  border: 1px solid #f8dcbb;
+  padding: 1em;
+  background-color: #f8f8f8;
+  font-size: 90%;  
+  overflow: auto;
+}
+
+textarea {
+  width: 100%;
+}
+
+pre {
+  white-space: pre-wrap;       /* css-3 */
+  white-space: -moz-pre-wrap;  /* Mozilla, since 1999 */
+  white-space: -pre-wrap;      /* Opera 4-6 */
+  white-space: -o-pre-wrap;    /* Opera 7 */
+  word-wrap: break-word;       /* Internet Explorer 5.5+ */  
+}
+
+form  {
+  margin-bottom: 2em;
+}
+
+.home {
+  position: absolute;
+}
+
+.header {
+  padding: 0.5em 1em;
+  background: #4c4c4c url("../../../../static/images/header_bg.png") repeat-x top left;  
+  border-bottom: 1px solid black;
+}
+
+.header h1 {
+  float: left;
+}
+
+.header .mainNavigationMenu {
+  margin: 23px 1em 0;
+  text-align: right;
+}
+
+.header .mainNavigationMenu ul {
+  display: inline;
+}
+
+.header .mainNavigationMenu li {
+  display: inline;
+  margin-left: 0.5em;
+  border: 1px solid transparent;
+  padding: 0.3em 0.5em 0.5em 0.5em;
+  border-radius: 8px;
+}
+
+.header .mainNavigationMenu li.selected {
+  border: 1px solid #222;
+  background-color: #333;
+}
+
+.header .mainNavigationMenu a {
+  font-weight: bold;
+  color: #EFF9F0;
+}
+
+
+.restapitabs {
+  text-align: right;
+}
+
+.restapitabs ul {
+  display: inline;
+}
+
+.restapitabs li {
+  display: inline;
+  margin-left: 0.5em;
+  border: 1px solid #transparent;
+  padding: 0.5em 0.5em 0.5em 0.5em;
+  border-radius: 8px;
+}
+
+.restapitabs a {
+  text-decoration: none;
+}
+
+.restapitabs li.selected {
+  font-weight: bold;
+}
+
+h1 {
+  color: #e9e9e9;
+  font-size: 18px;
+  font-weight: normal;
+  margin: 22px 0 3px;
+  padding: 0 0 0 160px;
+  text-shadow: 0 1px 0 #000;
+}
+
+h2 {
+  padding: 0;
+  margin: 1em 0;
+  font-size: 16px;
+}
+
+h3 {
+  padding: 0;
+  margin: 1em 0;
+  font-size: 14px;
+  font-weight:bold;
+}
+
+.content {
+  background-color: #fff;
+  border-color: #d1dfce;
+  border-style: solid;
+  border-width: 0 1px 2px;
+  margin: 0 auto 5em;
+  padding: 0.5em 2em 1em;
+  width: 75%;
+}
+
+.content img.preview {
+  border: 1px solid gray;  
+  max-width: 800px;  
+}
+
+.content fieldset {
+  border-color: #d1dfce;
+  border-style: solid;
+  border-width: 1px;
+}
+
+.footer {
+  background-color: #494949;
+  border-top: 2px solid #373737;
+  color: #d9d9d9;
+  font-size: 85%;
+  padding: 1em 1em 2em;
+  text-shadow: 0 1px 0 #111111;
+}
+
+.footer .column {
+  float: left;
+  width: 48%;
+  padding: 0.5em;
+}
+
+.column a img {
+  border: 1px solid #373737;
+}
+
+.footer img.swcube {
+  padding: 6px;
+  background-color: white;  
+}
+
+.right {
+  text-align: right;
+} 
+
+table {
+  text-align: left;
+  width: 100%;
+}
+
+.content h2 {
+  float: left;  
+}
+
+.content input.url {
+  width: 600px;
+}
+
+.content .contentItemPreview pre {
+  max-height: 200px;  
+}
+
+.content table {
+  font-size: 95%; 
+}
+
+
+.ontology { 
+  border: 1px solid #eee;
+  border-spacing : 1px;
+  border-radius: 6px;
+  -moz-border-radius: 6px;
+  padding-bottom:3px;
+  padding-top:3px;
+  padding-left:3px;
+  padding-right:3px;
+  
+} 
+
+.ontologyHeader{
+  display: inline;
+  background: url("../../static/images/foldable_unfolded.png") ;
+  background-repeat: no-repeat;
+  background-position : right;
+  text-indent: 5%;
+  border: 0;
+  width: 10%;
+  height: 16px;
+  float: right;
+  cursor: hand;
+}
+
+.collapsed .ontologyHeader{
+  background: url("../../static/images/foldable_folded.png") ;
+  background-repeat: no-repeat;
+  background-position : right;
+}
+
+
+.imgOnt{
+  display: inline;
+  background: url(../../static/images/rdf_flyer_16.png) ;
+  background-repeat: no-repeat;
+  padding-left: 20px;
+}
+.imgOntClass{
+  display: inline;
+  background: url(../../static/images/ont_class_16.png) ;
+  background-repeat: no-repeat;
+  padding-left: 20px;
+}
+
+.imgOntDataProp{
+  display: inline;
+  background: url(../../static/images/ont_data_prop.png) ;
+  background-repeat: no-repeat;
+  padding-left: 20px;
+}
+
+.imgOntObjectProp{
+  display: inline;
+  background: url(../../static/images/ont_obj_prop.png) ;
+  background-repeat: no-repeat;
+  padding-left: 20px;
+}
+
+.imgOntInd{
+  display: inline;
+  background: url(../../static/images/ont_ind.png) ;
+  background-repeat: no-repeat;
+  padding-left: 20px;
+}
+
+.ontology .collapsed .ontologyCollapsable{
+  display: none
+}
+
+.rightFloat{
+	float: right;
+	align: right;
+}
+
+.ontology .ontologySubmitHeader{
+  background: url(../../static/images/add_icon_16.png) , url("../../static/images/foldable_unfolded.png") ;
+  background-repeat: no-repeat;
+  background-position : 1%, right;
+  text-indent: 4%;
+  margin-top: 1px;
+  margin-bottom: 1px;
+}
+
+.ontology .collapsed .ontologySubmitHeader{
+  background: url(../../static/images/add_icon_16.png) , url("../../static/images/foldable_folded.png") ;
+  background-repeat: no-repeat;
+  background-position : 1%, right;
+  text-indent: 4%;
+}
+
+.delete{
+   background: url(../../static/images/delete_icon_16.png) no-repeat center;
+   border: 0;
+   width: 36px;
+   height: 16px;
+   padding-left: 20px;
+   cursor: hand;
+}
+
+.addHeader{
+	background: url(../../static/images/add_icon_16.png);
+	background-repeat: no-repeat;
+	background-position : 1%;
+	text-indent: 4%;
+}
+
+.invisible{
+	display:none;
+}
+
+.horizontal{
+	horizontal-align:left;
+}
+
+.inline{
+  display: inline;
+}
+
+.margined{
+	margin: 10px 0px 10px 0px;	
+}
+
+.show{
+  padding: 4px 6px 5px;
+  position: absolute;
+  left: 50%;
+}
+
+.previousButton{
+  border: 1px solid #c3c3c3;
+  background-color: #fafafa;
+  padding: 4px 6px 5px;
+  align:left;
+}
+.nextButton{
+  border: 1px solid #c3c3c3;
+  background-color: #fafafa;
+  padding: 4px 6px 5px;
+  float: right;
+  align: right;
+}
+
+.props th {  
+  color: #000;
+  font-size: 105%;
+  font-weight: normal;
+  padding: 6px 10px;
+  border-bottom: 1px solid #d1dfce;
+  background-color:#f8f8f8;
+}
+
+.formParams th{
+  color: #000;
+  font-size: 105%;
+  font-weight: normal;
+  padding: 6px 10px;
+  border-bottom: 1px solid #d1dfce;
+  background-color:#f8f8f8;
+}
+
+.props td {
+  padding: 4px 10px 5px;
+  border-bottom: 1px solid #ffe8f9;
+}
+
+.formParams td {
+  padding: 4px 10px 5px;
+  border-bottom: 1px solid #ffe8f9;
+}
+
+.bordered {
+	padding-bottom: 4px;
+	padding-right: 4px;
+	border: 1px solid #d1dfce;
+}
+
+li {
+	padding-bottom: 2px;
+	padding-top: 2px;
+}
\ No newline at end of file

Propchange: incubator/stanbol/trunk/kres/ontologymanager/store/rest/src/main/resources/META-INF/static/style/persistencestore.css
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/stanbol/trunk/kres/ontologymanager/store/rest/src/main/resources/META-INF/templates/imports/classConstraint.ftl
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/kres/ontologymanager/store/rest/src/main/resources/META-INF/templates/imports/classConstraint.ftl?rev=1086954&view=auto
==============================================================================
--- incubator/stanbol/trunk/kres/ontologymanager/store/rest/src/main/resources/META-INF/templates/imports/classConstraint.ftl (added)
+++ incubator/stanbol/trunk/kres/ontologymanager/store/rest/src/main/resources/META-INF/templates/imports/classConstraint.ftl Wed Mar 30 13:43:53 2011
@@ -0,0 +1,74 @@
+<#macro processConstraint original constraint>
+	<#assign seqs = constraint.classConstraintOrClassMetaInformationOrPropertyMetaInformation/>  
+	<#assign type = constraint.type/>
+	  <fieldset>
+	  	<legend>${type?replace("_", " ")?capitalize}</legend>	
+	  <ul>
+    
+	<#if type == "COMPLEMENT_OF" || type =="ENUMERATION_OF" || type =="INTERSECTION_OF"|| type =="UNION_OF">
+	 <!-- ClassMetaInf or IndividualMetaInf or ClassConstraint or Literal -->
+	  <!--<li><b>Type:&nbsp;&nbsp;</b> ${constraint.type}</li>-->
+	 <#list seqs as seq>
+		 	<#if seq.class.simpleName == "ClassMetaInformation">
+		 		<li><b>Class: </b> <a href='${seq.href}'>${seq.URI}</a></li>	
+		 	<#elseif seq.class.simpleName == "ClassConstraint">
+		 		<li><b>Range: </b> <@processConstraint original=constraint constraint=seq/></li>
+		 	<#elseif seq.class.simpleName == "IndividualMetaInformation">
+		 		<li><b>Individual: </b> <a href='${seq.href}'>${seq.URI}</a></li>
+		 		
+	 		<#elseif seq.class.simpleName == "String">
+	 			<li><b>Resource: </b> ${seq}</li>
+		 	<#else>
+		 	</#if>
+		 </#list>
+	<#elseif type=="ALL_VALUES_FROM" || type=="SOME_VALUES_FROM" || type=="HAS_VALUE">
+	<!--[0] Property:(Clickable : PropertyMetaInf | Unclickable : ResourceMetaInf) -->
+	<!-- [>0] ((ClassMetaInformation | Class Constraint) | DataRange : (IndividualMetaInformation | Literal) )-->
+	 <!--<li><b>Type:&nbsp;&nbsp;</b> ${constraint.type}</li>-->
+		 <#if seqs?first.class.simpleName == "ResourceMetaInformationType" >
+	 	 		<li><b>On:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>${seqs?first.URI}</li>		
+	 	<#else>
+	 		<li><b>On:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b><a href='${seqs?first.href}'>${seqs?first.URI}</a></li>
+	 	</#if>
+	 	<#if (seqs?size >1)>
+	 	<#if seqs[1].class.simpleName == "IndividualMetaInformation" || seqs[1].class.simpleName	== "String">
+ 	 		<li class="bordered">Data Range
+	 			<ul>
+	 	 </#if>
+	 	 </#if>
+		 <#list seqs as seq>
+		 	<#if seq_index != 0>
+			 	<#if seq.class.simpleName == "ClassMetaInformation">
+			 		<li><b>On Class: </b> <a href='${seq.href}'>${seq.URI}</a></li>	
+			 	<#elseif seq.class.simpleName == "ClassConstraint">
+			 		<li><b>On Class: </b> <@processConstraint original=constraint constraint=seq/></li>
+			 	<#elseif seq.class.simpleName == "IndividualMetaInformation">
+			 		<li><b>Value: </b> <a href='${seq.href}'>${seq.URI}</a></li>
+			 	<#elseif seq.class.simpleName == "String">
+			 		<li><b>Value: </b> ${seq}</li>
+			 	<#else>
+			 	</#if>
+			 </#if>
+		 </#list>
+		 <#if (seqs?size >1)>
+			 <#if seqs[1].class.simpleName == "IndividualMetaInformation" || seqs[1].class.simpleName	== "String">
+		 			</ul>
+		 	 </#if>
+		 </#if>
+	<#elseif type=="CARDINALITY" || type="MAX_CARDINALITY" || type=="MIN_CARDINALITY">
+	<!--[0] Property:(Clickable : PropertyMetaInf | Unclickable : ResourceMetaInf) -->
+	<!--[1] Cardinality : literal-->
+	 <!--<li><b>Type:&nbsp;&nbsp;</b> ${constraint.type}</li>-->
+	 	<#if seqs?first.class.simpleName == "ResourceMetaInformationType" >
+	 		<li><b>On:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>${seqs?first.URI}</li>		
+	 	<#else>
+	 		<li><b>On:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b><a href='${seqs?first.href}'>${seqs?first.URI}</a></li>
+	 	</#if>
+	 <li><b>Value:&nbsp;</b>${seqs[1]}</li>
+	
+	<#else>
+	</#if>
+  </ul>
+  </fieldset>
+  <#assign constraint = original>
+</#macro>
\ No newline at end of file

Propchange: incubator/stanbol/trunk/kres/ontologymanager/store/rest/src/main/resources/META-INF/templates/imports/classConstraint.ftl
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/stanbol/trunk/kres/ontologymanager/store/rest/src/main/resources/META-INF/templates/imports/common.ftl
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/kres/ontologymanager/store/rest/src/main/resources/META-INF/templates/imports/common.ftl?rev=1086954&view=auto
==============================================================================
--- incubator/stanbol/trunk/kres/ontologymanager/store/rest/src/main/resources/META-INF/templates/imports/common.ftl (added)
+++ incubator/stanbol/trunk/kres/ontologymanager/store/rest/src/main/resources/META-INF/templates/imports/common.ftl Wed Mar 30 13:43:53 2011
@@ -0,0 +1,78 @@
+<#macro page title hasrestapi>
+<html>
+  <head>
+	<script type="text/javascript">
+		document.write("<base href=\"");
+		var whref =window.location.href; 
+		var base =  whref.substring(0, whref.indexOf("ontologies"));
+		document.write(base);
+		document.write("\"/>");
+	</script>
+    <title>FISE - ${title?html}</title>
+    
+    <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
+
+    <link rel="stylesheet" href="static/style/persistencestore.css" /> 
+    <link rel="stylesheet" href="static/scripts/prettify/prettify.css" />
+    <link rel="icon" type="image/png" href="static/images/favicon.png" />
+
+    <script type="text/javascript" src="static/scripts/prettify/prettify.js"></script>
+    <script type="text/javascript" src="static/scripts/jquery-1.4.2.js"></script>
+    <script type="text/javascript" src="static/scripts/jit.js"></script>
+    <script type="text/javascript" src="static/scripts/paging.js"></script>
+    <script type="text/javascript" src="static/scripts/requestResponse.js"></script>
+	
+  </head>
+  <body>
+    <div class="home"><a href="/ontologies"><img src="static/images/fise_logo_cropped.png" alt="FISE Home" /></a></div>
+    <div class="header">
+      <h1>The RESTful Persistence Store</h1>
+		<div class="mainNavigationMenu">
+			<ul>
+				<li><a href="ontologies">/ontologies</a></li>
+				<#if it?exists && it.metadata?exists && it.metadata.ontologyMetaInformation?exists>
+	           		<li ><a href="${it.metadata.ontologyMetaInformation.href}">ontology</a></li>
+      			</#if>
+	      	</ul>
+	     </div>
+      <div style="clear: both"></div>
+    </div>
+
+    <div class="content">
+      <h2>${title?html}</h2>
+   <#if hasrestapi>
+	  <div class="restapitabs">
+	  <ul>
+	    <li id="tab-webview" class="selected"><a href="javascript:">Web View</a></li>
+	    <li id="tab-restapi" ><a href="javascript:">REST API</a></li>
+	  <ul>
+	  </div>
+<script>
+$(".restapitabs a").click(function () {
+  $(this).parents("ul").find("li").removeClass("selected");
+  $(this).parents("li").addClass("selected");
+  $(".panel").hide();
+  var panelId = $(this).parents("li")[0].id.split("-")[1];
+  $("#" + panelId).fadeIn();
+});    
+</script>
+	  </#if>
+      <div style="clear: both"></div>
+      <#nested>
+    </div>
+	<div class="footer">
+	<div class="column">
+	  <a href="http://www.w3.org/standards/semanticweb/"><img class="swcube"
+	    src="static/images/sw-cube.png"/></a>
+      <a href="http://www.iks-project.eu"><img
+        height="60px" alt="IKS Project" src="static/images/iks_project_logo.jpg" /></a>
+    </div>
+    <div class="column right">
+      <em>The research leading to these results has received funding from the European Community's
+          Seventh Framework Programme (FP7/2007-2013) under grant agreement n° 231527</em>
+	</div>
+	<div style="clear: both"></div>
+	</div>
+  </body>
+</html>
+</#macro>

Propchange: incubator/stanbol/trunk/kres/ontologymanager/store/rest/src/main/resources/META-INF/templates/imports/common.ftl
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/stanbol/trunk/kres/ontologymanager/store/rest/src/main/resources/META-INF/templates/imports/prevNextButtons.ftl
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/kres/ontologymanager/store/rest/src/main/resources/META-INF/templates/imports/prevNextButtons.ftl?rev=1086954&view=auto
==============================================================================
--- incubator/stanbol/trunk/kres/ontologymanager/store/rest/src/main/resources/META-INF/templates/imports/prevNextButtons.ftl (added)
+++ incubator/stanbol/trunk/kres/ontologymanager/store/rest/src/main/resources/META-INF/templates/imports/prevNextButtons.ftl Wed Mar 30 13:43:53 2011
@@ -0,0 +1,23 @@
+<#macro prevNextButtons className>
+		<div class = "margined">
+			<a class="${className} previousButton" href="javascript:;" onClick="javascript: PAGING.gotoPrevious('${className}')">&lt;&lt; Previous</a>
+				<div class="show inline ${className} sizeCombobox">
+					<p class = "inline">Show</p> 
+					<form class=" inline" id="${className}sizeCombobox"> 
+				                    <select name="pagesizes" size="1" 
+				   onChange="javascript:  var select = document.getElementById('${className}sizeCombobox').elements['pagesizes']; var value = select.options[select.selectedIndex].value;  PAGING.pageSize['${className}'] = parseInt(value); PAGING.adjustVisibility(
+				   '${className}')  "> 
+				                    <option selected  value="5">5</option> 
+				                    <option value="10">10</option> 
+				                    <option value="15">15</option>
+				                    <option value="20">20</option>
+				                    <option value="30">30</option>
+				                    <option value="40">40</option>
+				                    <option value="50">50</option> 
+				                    </select>
+			    </div> 
+			 </form>
+			<a class="${className} nextButton" href="javascript:;" onClick="javascript: PAGING.gotoNext('${className}')">Next &gt;&gt;</a>
+			</br>
+		</div>
+</#macro>
\ No newline at end of file

Propchange: incubator/stanbol/trunk/kres/ontologymanager/store/rest/src/main/resources/META-INF/templates/imports/prevNextButtons.ftl
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/stanbol/trunk/kres/ontologymanager/store/rest/src/main/resources/META-INF/templates/imports/propertySerializer.ftl
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/kres/ontologymanager/store/rest/src/main/resources/META-INF/templates/imports/propertySerializer.ftl?rev=1086954&view=auto
==============================================================================
--- incubator/stanbol/trunk/kres/ontologymanager/store/rest/src/main/resources/META-INF/templates/imports/propertySerializer.ftl (added)
+++ incubator/stanbol/trunk/kres/ontologymanager/store/rest/src/main/resources/META-INF/templates/imports/propertySerializer.ftl Wed Mar 30 13:43:53 2011
@@ -0,0 +1,30 @@
+<#macro property it>
+    var property = this.PSTORE.propUtil.property;
+	property.domainURIs = new Array();
+	
+	<#list it.domain.classMetaInformationOrBuiltInResource as resource>
+		<#if resource?is_hash>
+			property.domainURIs.push("${resource.URI}");
+		<#else>
+			property.domainURIs.push("${resource}");
+		</#if>
+	</#list>
+	property.rangeURIs = new Array();
+	<#list it.range.classMetaInformationOrBuiltInResource as resource>
+		<#if resource?is_hash>
+			property.rangeURIs.push("${resource.URI}");
+		<#else>
+			property.rangeURIs.push("${resource}");
+		</#if>
+	</#list>
+	property.isFunctional = ${it.isIsFunctional()?string};
+	
+	<!-- Object Property Attributes -->
+	<#if it.class.simpleName== 'ObjectPropertyContext'>
+		property.isTransitive = ${it.isIsTransitive()?string};
+		property.isSymmetric = ${it.isIsSymmetric()?string};
+		property.isInverseFunctional = ${it.isIsInverseFunctional()?string};
+	</#if>
+	<!--Deep copy using jQuery-->
+  	jQuery.extend(true, this.PSTORE.propUtil.originalProperty, property);
+</#macro>
\ No newline at end of file

Propchange: incubator/stanbol/trunk/kres/ontologymanager/store/rest/src/main/resources/META-INF/templates/imports/propertySerializer.ftl
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/stanbol/trunk/kres/ontologymanager/store/rest/src/main/resources/META-INF/templates/org/apache/stanbol/ontologymanager/store/rest/resources/ontologies.ftl
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/kres/ontologymanager/store/rest/src/main/resources/META-INF/templates/org/apache/stanbol/ontologymanager/store/rest/resources/ontologies.ftl?rev=1086954&view=auto
==============================================================================
--- incubator/stanbol/trunk/kres/ontologymanager/store/rest/src/main/resources/META-INF/templates/org/apache/stanbol/ontologymanager/store/rest/resources/ontologies.ftl (added)
+++ incubator/stanbol/trunk/kres/ontologymanager/store/rest/src/main/resources/META-INF/templates/org/apache/stanbol/ontologymanager/store/rest/resources/ontologies.ftl Wed Mar 30 13:43:53 2011
@@ -0,0 +1,136 @@
+<#import "/imports/common.ftl" as common>
+<#import "/imports/prevNextButtons.ftl" as buttons>
+<@common.page title="Persistence Store" hasrestapi=true >
+<div class="panel" id="webview">
+<button class="rightFloat" onClick="javascript: clearStore()">Clear Persistence Store</button>
+<br/>
+<br/>
+<div class="ontology">
+	<div class="collapsed">
+		<h4 class="ontologySubmitHeader">Submit a new Ontology</h4>
+		<form class="ontologyCollapsable" method="POST" accept-charset="utf-8" enctype="application/x-www-form-urlencoded">
+		  <fieldset>
+			  <legend>Submit raw text in RDF/XML format</legend>
+			  <p>Ontology URI: <textarea rows="1" name="ontologyURI"></textarea></p>
+			  <p>Ontology Content:<textarea rows="15" name="ontologyContent"></textarea></p>
+			  <p><input type="submit" value="Submit Ontology"></p>
+		  </fieldset>
+		</form>
+	</div>
+</div>
+
+<#if it.ontologies?size == 0>
+	<p><em>There is no ontologies installed, a DBPedia ontology can be submitted by activating eu.iksproject.fise.stores.persistencestore.dbPedia.DBPediaClient component in Configuration tab of Apache Felix Web Console.</em></p>
+<#else>
+	<fieldset>
+		<legend><b>Installed Ontologies</b></legend>
+    <#list it.ontologies as ontology>
+		<div class="ontology ontologyList ${ontology_index}"> 
+			<div class="collapsed">
+				<a class="imgOnt" href="${ontology.href}">${ontology.URI}</a>
+				<button class="delete" title="Delete ${ontology.URI}" onClick="javascript: deleteOnt('${ontology.href}')"></button>
+				<button class="ontologyHeader"></button>
+				<ul class= "ontologyCollapsable">
+					<li><b>Description:</b> ${ontology.description}</li>
+					<li><b>URI:</b> ${ontology.URI}</li>
+				</ul>
+			</div>
+		</div>	
+    </#list>
+    	<@buttons.prevNextButtons className="ontologyList"/>
+    </fieldset>
+</#if>
+	<script>
+	PAGING.adjustVisibility("ontologyList");
+	
+	function clearStore()
+	{
+		xmlhttp=new XMLHttpRequest();
+		xmlhttp.open('DELETE',"ontologies",false);
+		xmlhttp.send();
+		location.reload('true');
+	}
+	
+	function deleteOnt(uri)
+	{
+		xmlhttp=new XMLHttpRequest();
+		xmlhttp.open('DELETE',uri,false);
+		xmlhttp.send();
+		location.reload('true');
+	}
+	
+	$(".ontology .ontologySubmitHeader").click(function () {
+	  $(this).parents("div").toggleClass("collapsed");
+	});
+	
+	$(".ontology .ontologyHeader").click(function () {
+	  $(this).parent().toggleClass("collapsed");
+	}); 
+</script>
+</div>
+<div class="panel" id="restapi" style="display: none;">
+<h3>Getting ontologies from the persistence store</h3>
+	<p>A list of previously registered ontologies can be obtained by following command:<p>
+<pre>
+curl -i -X GET -H "Accept:application/xml" http://localhost:8080/persistencestore/ontologies
+</pre>
+<p>Response:</p>
+<pre>
+HTTP/1.1 200 OK
+Content-Type: application/xml
+Transfer-Encoding: chunked
+Server: Jetty(6.1.x)
+
+&lt;?xml version="1.0" encoding="UTF-8" standalone="yes"?&gt;
+&lt;ns1:AdministeredOntologies xmlns:ns1="model.rest.persistence.iks.srdc.com.tr" xmlns:ns2="http://www.w3.org/1999/xlink"&gt;
+    &lt;ns1:OntologyMetaInformation ns2:href="ontologies/http://www.co-ode.org/ontologies/pizza/pizza.owl"&gt;
+        &lt;ns1:URI&gt;http://www.co-ode.org/ontologies/pizza/pizza.owl&lt;/ns1:URI&gt;
+        &lt;ns1:Description&gt;&lt;/ns1:Description&gt;
+    &lt;/ns1:OntologyMetaInformation&gt;
+    &lt;ns1:OntologyMetaInformation ns2:href="ontologies/http://oiled.man.example.net/facts"&gt;
+        &lt;ns1:URI&gt;http://oiled.man.example.net/facts&lt;/ns1:URI&gt;
+        &lt;ns1:Description&gt;&lt;/ns1:Description&gt;
+    &lt;/ns1:OntologyMetaInformation&gt;
+&lt;/ns1:AdministeredOntologies&gt;
+
+</pre>
+
+<p><b>OntologyMetaInformation</b> element contains URI, and description of an ontology and provides a relative link to that ontology resource.</p>	
+<p>This link can be resolved into an absolute URI using http://localhost:8080/persistencestore/ as base URI.</p>  	 	
+<h3>Submitting new ontologies to the persistence store</h3>
+<p>New ontologies can be submitted with following command</p>
+<pre>
+curl -i -X POST -H "Accept:application/xml" --data-urlencode ontologyURI=http://iks-project.eu/sample --data-urlencode ontologyContent@sampleOntology.owl http://localhost:8080/persistencestore/ontologies
+</pre>
+<p>Response :</p>
+<pre>
+HTTP/1.1 200 OK
+Content-Type: application/xml
+Transfer-Encoding: chunked
+Server: Jetty(6.1.x)
+
+&lt;?xml version="1.0" encoding="UTF-8" standalone="yes"?&gt;
+&lt;ns1:OntologyMetaInformation xmlns:ns1="model.rest.persistence.iks.srdc.com.tr" xmlns:ns2="http://www.w3.org/1999/xlink" ns2:href="ontologies/http://iks-project.eu/sample"&gt;
+    &lt;ns1:URI&gt;http://iks-project.eu/sample&lt;/ns1:URI&gt;
+    &lt;ns1:Description&gt;&lt;/ns1:Description&gt;
+&lt;/ns1:OntologyMetaInformation&gt;
+</pre>
+<p>Following URIs can be used to observe classes, datatype properties, object properties and individuals respectively.</p>
+<ul>
+	<li>http://localhost:8080/persistencestore/ontologies/http://iks-project.eu/sample/classes</li>
+	<li>http://localhost:8080/persistencestore/ontologies/http://iks-project.eu/sample/datatypeProperties</li>
+	<li>http://localhost:8080/persistencestore/ontologies/http://iks-project.eu/sample/objectProperties</li>
+	<li>http://localhost:8080/persistencestore/ontologies/http://iks-project.eu/sample/individuals</li>
+</ul>
+<h3>Clearing the persistence store</h3>
+<p>Persistence Store can be cleared using following command</p>
+<pre>
+curl -i -X DELETE http://localhost:8080/persistencestore/ontologies
+</pre>
+<p>Response :</p>
+<pre>
+HTTP/1.1 204 No Content
+Server: Jetty(6.1.x)
+</pre>
+</div>
+</...@common.page>

Propchange: incubator/stanbol/trunk/kres/ontologymanager/store/rest/src/main/resources/META-INF/templates/org/apache/stanbol/ontologymanager/store/rest/resources/ontologies.ftl
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/stanbol/trunk/kres/ontologymanager/store/rest/src/main/resources/META-INF/templates/org/apache/stanbol/ontologymanager/store/rest/resources/ontologyClasses.ftl
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/kres/ontologymanager/store/rest/src/main/resources/META-INF/templates/org/apache/stanbol/ontologymanager/store/rest/resources/ontologyClasses.ftl?rev=1086954&view=auto
==============================================================================
--- incubator/stanbol/trunk/kres/ontologymanager/store/rest/src/main/resources/META-INF/templates/org/apache/stanbol/ontologymanager/store/rest/resources/ontologyClasses.ftl (added)
+++ incubator/stanbol/trunk/kres/ontologymanager/store/rest/src/main/resources/META-INF/templates/org/apache/stanbol/ontologymanager/store/rest/resources/ontologyClasses.ftl Wed Mar 30 13:43:53 2011
@@ -0,0 +1,99 @@
+<#import "/imports/common.ftl" as common>
+<#import "/imports/prevNextButtons.ftl" as buttons>
+<@common.page title="Classes Of ${it.metadata.ontologyMetaInformation.URI}" hasrestapi=true>
+<div class="panel" id="webview">
+		<h4 class="addHeader">Create a new Class</h4>
+		<form method="POST" accept="text/html" accept-charset="utf-8" enctype="application/x-www-form-urlencoded">
+		  <fieldset>
+			  <legend>Enter Class URI to be created</legend>
+			  <p>Class URI: <textarea rows="1" name="classURI"></textarea></p>
+			  <p><input type="submit" value="Create Class"></p>
+		  </fieldset>
+		</form>
+	<#if it.metadata.classMetaInformation?size == 0>
+	<p><em>Currently there are no classes in this ontology.</em></p>
+		
+	<#else>
+	<fieldset>
+		<legend><b>Classes</b></legend>
+		<#list it.metadata.classMetaInformation?sort_by("URI") as classInf>
+			<div class="ontology ontologyClassesList ${classInf_index}"> 
+			<div class="collapsed">
+					<a class="imgOntClass" href="${classInf.href}">${classInf.URI}</a>
+					<button class="delete" title="Delete ${classInf.URI}" onClick="javascript: deleteClass('${classInf.href}')"></button>
+					<div class="ontologyHeader"></div>
+				<ul class= "ontologyCollapsable">
+					<li><b>Description:</b> ${classInf.description}</li>
+					<li><b>Namespace:</b> ${classInf.namespace}</li>
+					<li><b>Local Name:</b> ${classInf.localName}</li>
+				</ul>
+			</div>	
+		</div>
+		</#list>
+		<@buttons.prevNextButtons className="ontologyClassesList"/>
+	</fieldset>
+	</#if>
+<script>
+	PAGING.adjustVisibility("ontologyClassesList");
+
+	function deleteClass(uri)
+	{
+		xmlhttp=new XMLHttpRequest();
+		xmlhttp.open('DELETE',uri,false);
+		xmlhttp.send();
+		location.reload('true');
+	}
+
+	$(".ontology .ontologyHeader").click(function () {
+	  $(this).parent().toggleClass("collapsed");
+	}); 
+</script>
+</div>
+
+<div class="panel" id="restapi" style="display: none;">
+<h3>Getting Classes of ontology</h3>
+<pre>
+curl -i -X GET -H "Accept:application/xml" http://localhost:8080/persistencestore/${it.metadata.ontologyMetaInformation.href}/classes
+</pre>
+<p>Response :</p>
+<pre>
+HTTP/1.1 200 OK
+Content-Type: application/xml
+Transfer-Encoding: chunked
+Server: Jetty(6.1.x)
+
+&lt;?xml version="1.0" encoding="UTF-8" standalone="yes"?&gt;
+&lt;ns1:ClassesForOntology xmlns:ns1="model.rest.persistence.iks.srdc.com.tr" xmlns:ns2="http://www.w3.org/1999/xlink"&gt;
+    &lt;ns1:OntologyMetaInformation ns2:href="ontologies/http://dbpedia.org/ontology/"&gt;
+        &lt;ns1:URI&gt;http://dbpedia.org/ontology/&lt;/ns1:URI&gt;
+        &lt;ns1:Description&gt;&lt;/ns1:Description&gt;
+    &lt;/ns1:OntologyMetaInformation&gt;
+    &lt;ns1:ClassMetaInformation ns2:href="ontologies/http://dbpedia.org/ontology//classes/http://dbpedia.org/ontology/PopulatedPlace"&gt;
+        &lt;ns1:URI&gt;http://dbpedia.org/ontology/PopulatedPlace&lt;/ns1:URI&gt;
+        &lt;ns1:Description&gt;&lt;/ns1:Description&gt;
+        &lt;ns1:Namespace&gt;http://dbpedia.org/ontology/&lt;/ns1:Namespace&gt;
+        &lt;ns1:LocalName&gt;PopulatedPlace&lt;/ns1:LocalName&gt;
+    &lt;/ns1:ClassMetaInformation&gt;
+&lt;/ns1:ClassesForOntology&gt;
+</pre>
+<h3>Creating a new Class</h3>
+<pre>
+curl -i -X POST -H "Accept:application/xml" --data-urlencode classURI=http://iks-project.eu/klazzes#SampleClass http://localhost:8080/persistencestore/${it.metadata.ontologyMetaInformation.href}/classes
+</pre>
+<p>Response</p>
+<pre>
+HTTP/1.1 200 OK
+Content-Type: application/xml
+Transfer-Encoding: chunked
+Server: Jetty(6.1.x)
+
+&lt;?xml version="1.0" encoding="UTF-8" standalone="yes"?&gt;
+&lt;ns1:ClassMetaInformation xmlns:ns1="model.rest.persistence.iks.srdc.com.tr" xmlns:ns2="http://www.w3.org/1999/xlink" ns2:href="ontologies/http://dbpedia.org/ontology//classes/http://iks-project.eu/klazzes/SampleClass"&gt;
+    &lt;ns1:URI&gt;http://iks-project.eu/klazzes#SampleClass&lt;/ns1:URI&gt;
+    &lt;ns1:Description&gt;&lt;/ns1:Description&gt;
+    &lt;ns1:Namespace&gt;http://iks-project.eu/klazess#&lt;/ns1:Namespace&gt;
+    &lt;ns1:LocalName&gt;SampleClass&lt;/ns1:LocalName&gt;
+&lt;/ns1:ClassMetaInformation&gt;
+</pre>
+</div>
+</...@common.page>
\ No newline at end of file

Propchange: incubator/stanbol/trunk/kres/ontologymanager/store/rest/src/main/resources/META-INF/templates/org/apache/stanbol/ontologymanager/store/rest/resources/ontologyClasses.ftl
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/stanbol/trunk/kres/ontologymanager/store/rest/src/main/resources/META-INF/templates/org/apache/stanbol/ontologymanager/store/rest/resources/ontologyDatatypeProperties.ftl
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/kres/ontologymanager/store/rest/src/main/resources/META-INF/templates/org/apache/stanbol/ontologymanager/store/rest/resources/ontologyDatatypeProperties.ftl?rev=1086954&view=auto
==============================================================================
--- incubator/stanbol/trunk/kres/ontologymanager/store/rest/src/main/resources/META-INF/templates/org/apache/stanbol/ontologymanager/store/rest/resources/ontologyDatatypeProperties.ftl (added)
+++ incubator/stanbol/trunk/kres/ontologymanager/store/rest/src/main/resources/META-INF/templates/org/apache/stanbol/ontologymanager/store/rest/resources/ontologyDatatypeProperties.ftl Wed Mar 30 13:43:53 2011
@@ -0,0 +1,102 @@
+<#import "/imports/common.ftl" as common>
+<#import "/imports/prevNextButtons.ftl" as buttons>
+<@common.page title="Datatype Properties Of ${it.metadata.ontologyMetaInformation.URI}" hasrestapi=true>
+<div class="panel" id="webview">
+		<h4 class="addHeader">Create a new Datatype Property</h4>
+		<form method="POST" accept-charset="utf-8" accept="text/html" enctype="application/x-www-form-urlencoded">
+		  <fieldset>
+			  <legend>Enter Datatype Property URI to be created</legend>
+			  <p>Datatype Property URI: <textarea rows="1" name="datatypePropertyURI"></textarea></p>
+			  <p><input type="submit" value="Create Datatype Property"></p>
+		  </fieldset>
+		</form>
+	<#if it.metadata.propertyMetaInformation?size == 0>
+	<br>
+	<p><em>Currently there is no classes in this ontology.</em></p>
+		
+	<#else>
+	<fieldset>
+		<legend><b>Datatype Properties</b></legend>
+		<#list it.metadata.propertyMetaInformation?sort_by("URI") as prop>
+			<div class="ontology ontDPropList ${prop_index}"> 
+			<div class="collapsed">
+					<a class="imgOntDataProp" href="${prop.href}">${prop.URI}</a>
+					<button class="delete" title="Delete ${prop.URI}" onClick="javascript: deleteClass('${prop.href}')"></button>
+					<div class="ontologyHeader"></div>
+				<ul class= "ontologyCollapsable">
+					<li><b>Description:</b> ${prop.description}</li>
+					<li><b>Namespace:</b> ${prop.namespace}</li>
+					<li><b>Local Name:</b> ${prop.localName}</li>
+				</ul>
+			</div>	
+		</div>
+		</#list>
+			<@buttons.prevNextButtons className="ontDPropList"/>
+	</fieldset>
+	</#if>
+<script>
+	PAGING.adjustVisibility("ontDPropList");
+
+	function deleteClass(uri)
+	{
+		xmlhttp=new XMLHttpRequest();
+		xmlhttp.open('DELETE',uri,false);
+		xmlhttp.send();
+		location.reload('true');
+	}
+
+	$(".ontology .ontologyHeader").click(function () {
+	  $(this).parent().toggleClass("collapsed");
+	}); 
+</script>
+</div>
+
+<div class="panel" id="restapi" style="display: none;">
+<h3>Getting datatype properties of ontology</h3>
+<pre>
+curl -i -X GET -H "Accept:application/xml" http://localhost:8080/persistencestore/${it.metadata.ontologyMetaInformation.href}/datatypeProperties
+</pre>
+<p>Response :</p>
+
+<pre>
+HTTP/1.1 200 OK
+Content-Type: application/xml
+Transfer-Encoding: chunked
+Server: Jetty(6.1.x)
+
+&lt;?xml version="1.0" encoding="UTF-8" standalone="yes"?&gt;
+&lt;ns1:DatatypePropertiesForOntology xmlns:ns1="model.rest.persistence.iks.srdc.com.tr" xmlns:ns2="http://www.w3.org/1999/xlink"&gt;
+    &lt;ns1:OntologyMetaInformation ns2:href="ontologies/http://dbpedia.org/ontology/"&gt;
+        &lt;ns1:URI&gt;http://dbpedia.org/ontology/&lt;/ns1:URI&gt;
+        &lt;ns1:Description&gt;&lt;/ns1:Description&gt;
+    &lt;/ns1:OntologyMetaInformation&gt;
+    &lt;ns1:PropertyMetaInformation ns2:href="ontologies/http://dbpedia.org/ontology//datatypeProperties/http://dbpedia.org/ontology/academyaward"&gt;
+        &lt;ns1:URI&gt;http://dbpedia.org/ontology/academyaward&lt;/ns1:URI&gt;
+        &lt;ns1:Description&gt;&lt;/ns1:Description&gt;
+        &lt;ns1:Namespace&gt;http://dbpedia.org/ontology/&lt;/ns1:Namespace&gt;
+        &lt;ns1:LocalName&gt;academyaward&lt;/ns1:LocalName&gt;
+    &lt;/ns1:PropertyMetaInformation&gt;
+&lt;/ns1:DatatypePropertiesForOntology&gt;
+</pre>
+<h3>Creating a new datatypeProperty</h3>
+<pre>
+curl -i -X POST -H "Accept:application/xml" --data-urlencode datatypePropertyURI=http://iks-project.eu/datatypeProps#SampleDatatypeProperty http://localhost:8080/persistencestore/${it.metadata.ontologyMetaInformation.href}/datatypeProperties
+</pre>
+<p>Response</p>
+<pre>
+HTTP/1.1 200 OK
+Content-Type: application/xml
+Transfer-Encoding: chunked
+Server: Jetty(6.1.x)
+
+&lt;?xml version="1.0" encoding="UTF-8" standalone="yes"?&gt;
+&lt;ns1:PropertyMetaInformation xmlns:ns1="model.rest.persistence.iks.srdc.com.tr" xmlns:ns2="http://www.w3.org/1999/xlink" ns2:href="ontologies/http://dbpedia.org/ontology//datatypeP
+roperties/http://iks-project.eu/datatypeProps/SampleDatatypeProperty"&gt;
+    &lt;ns1:URI&gt;http://iks-project.eu/datatypeProps#SampleDatatypeProperty&lt;/ns1:URI&gt;
+    &lt;ns1:Description&gt;&lt;/ns1:Description&gt;
+    &lt;ns1:Namespace&gt;http://iks-project.eu/datatypeProps#&lt;/ns1:Namespace&gt;
+    &lt;ns1:LocalName&gt;SampleDatatypeProperty&lt;/ns1:LocalName&gt;
+&lt;/ns1:PropertyMetaInformation&gt;
+</pre>
+</div>
+</...@common.page>
\ No newline at end of file

Propchange: incubator/stanbol/trunk/kres/ontologymanager/store/rest/src/main/resources/META-INF/templates/org/apache/stanbol/ontologymanager/store/rest/resources/ontologyDatatypeProperties.ftl
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/stanbol/trunk/kres/ontologymanager/store/rest/src/main/resources/META-INF/templates/org/apache/stanbol/ontologymanager/store/rest/resources/ontologyIndividuals.ftl
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/kres/ontologymanager/store/rest/src/main/resources/META-INF/templates/org/apache/stanbol/ontologymanager/store/rest/resources/ontologyIndividuals.ftl?rev=1086954&view=auto
==============================================================================
--- incubator/stanbol/trunk/kres/ontologymanager/store/rest/src/main/resources/META-INF/templates/org/apache/stanbol/ontologymanager/store/rest/resources/ontologyIndividuals.ftl (added)
+++ incubator/stanbol/trunk/kres/ontologymanager/store/rest/src/main/resources/META-INF/templates/org/apache/stanbol/ontologymanager/store/rest/resources/ontologyIndividuals.ftl Wed Mar 30 13:43:53 2011
@@ -0,0 +1,99 @@
+<#import "/imports/common.ftl" as common>
+<#import "/imports/prevNextButtons.ftl" as buttons>
+<@common.page title="Datatype Properties Of ${it.metadata.ontologyMetaInformation.URI}" hasrestapi=true>
+<div class="panel" id="webview">
+		<h4 class="addHeader">Create a new Individual</h4>
+		<form method="POST" accept-charset="utf-8" accept="text/html" enctype="application/x-www-form-urlencoded">
+		  <fieldset>
+			  <legend>Enter Individual URI to be created</legend>
+			  <p>Individual URI: <textarea rows="1" name="individualURI"></textarea></p>
+			  <p>Class URI: <textarea rows="1" name="classURI"></textarea></p>
+			  <p><input type="submit" value="Create Individual"></p>
+		  </fieldset>
+		</form>
+	<#if it.metadata.individualMetaInformation?size == 0>
+		<p><em>Currently there is no individuals in this ontology.</em></p>
+	<#else>
+	<fieldset>
+		<legend><b>Individuals</b></legend>
+		<#list it.metadata.individualMetaInformation?sort_by("URI") as ind>
+			<div class="ontology ontIndList ${ind_index}"> 
+			<div class="collapsed">
+					<a class="imgOntInd" href="${ind.href}">${ind.URI}</a>
+					<button class="delete" title="Delete ${ind.URI}" onClick="javascript: deleteClass('${ind.href}')"></button>
+					<div class ="ontologyHeader"></div>
+				<ul class= "ontologyCollapsable">
+					<li><b>Description:</b> ${ind.description}</li>
+					<li><b>Namespace:</b> ${ind.namespace}</li>
+					<li><b>Local Name:</b> ${ind.localName}</li>
+				</ul>
+			</div>	
+		</div>
+		</#list>
+			<@buttons.prevNextButtons className="ontIndList"/>
+	</fieldset>
+	</#if>
+<script>
+	PAGING.adjustVisibility("ontIndList");
+	
+	function deleteClass(uri)
+	{
+		xmlhttp=new XMLHttpRequest();
+		xmlhttp.open('DELETE',uri,false);
+		xmlhttp.send();
+		location.reload('true');
+	}
+
+	$(".ontology .ontologyHeader").click(function () {
+	  $(this).parent().toggleClass("collapsed");
+	}); 
+</script>
+</div>
+<div class="panel" id="restapi" style="display: none;">
+<h3>Getting individuals of ontology</h3>
+<pre>
+curl -i -X GET -H "Accept:application/xml" http://localhost:8080/persistencestore/${it.metadata.ontologyMetaInformation.href}/individuals
+</pre>
+<p>Response :</p>
+<pre>
+HTTP/1.1 200 OK
+Content-Type: application/xml
+Transfer-Encoding: chunked
+Server: Jetty(6.1.x)
+
+&lt;?xml version="1.0" encoding="UTF-8" standalone="yes"?&gt;
+&lt;ns1:IndividualsForOntology xmlns:ns1="model.rest.persistence.iks.srdc.com.tr" xmlns:ns2="http://www.w3.org/1999/xlink"&gt;
+    &lt;ns1:OntologyMetaInformation ns2:href="ontologies/http://dbpedia.org/ontology/"&gt;
+        &lt;ns1:URI&gt;http://dbpedia.org/ontology/&lt;/ns1:URI&gt;
+        &lt;ns1:Description&gt;&lt;/ns1:Description&gt;
+    &lt;/ns1:OntologyMetaInformation&gt;
+    &lt;ns1:IndividualMetaInformation ns2:href="ontologies/http://dbpedia.org/ontology//individuals/http://iks-project.eu/individuals/SampleIndividual"&gt;
+        &lt;ns1:URI&gt;http://iks-project.eu/inds#SampleIndividual&lt;/ns1:URI&gt;
+        &lt;ns1:Description&gt;&lt;/ns1:Description&gt;
+        &lt;ns1:Namespace&gt;http://iks-project.eu/inds#&lt;/ns1:Namespace&gt;
+        &lt;ns1:LocalName&gt;SampleIndividual&lt;/ns1:LocalName&gt;
+    &lt;/ns1:IndividualMetaInformation&gt;
+&lt;/ns1:IndividualsForOntology&gt;
+
+</pre>
+<h3>Creating a new individual</h3>
+<pre>
+curl -i -X POST -H "Accept:application/xml" --data-urlencode individualURI=http://iks-project.eu/inds#SampleIndividual --data-urlencode classURI=http://dbpedia.org/ontology/Actor http://localhost:8080/persistencestore/${it.metadata.ontologyMetaInformation.href}/individuals
+</pre>
+<p>Response</p>
+<pre>
+HTTP/1.1 200 OK
+Content-Type: application/xml
+Transfer-Encoding: chunked
+Server: Jetty(6.1.x)
+
+&lt;?xml version="1.0" encoding="UTF-8" standalone="yes"?&gt;
+&lt;ns1:IndividualMetaInformation xmlns:ns1="model.rest.persistence.iks.srdc.com.tr" xmlns:ns2="http://www.w3.org/1999/xlink" ns2:href="ontologies/http://dbpedia.org/ontology//individuals/http://iks-project.eu/inds/SampleIndividual"&gt;
+    &lt;ns1:URI&gt;http://iks-project.eu/individuals#SampleIndividual&lt;/ns1:URI&gt;
+    &lt;ns1:Description&gt;&lt;/ns1:Description&gt;
+    &lt;ns1:Namespace&gt;http://iks-project.eu/individuals#&lt;/ns1:Namespace&gt;
+    &lt;ns1:LocalName&gt;SampleIndividual&lt;/ns1:LocalName&gt;
+&lt;/ns1:IndividualMetaInformation&gt;
+</pre>
+</div>
+</...@common.page>
\ No newline at end of file

Propchange: incubator/stanbol/trunk/kres/ontologymanager/store/rest/src/main/resources/META-INF/templates/org/apache/stanbol/ontologymanager/store/rest/resources/ontologyIndividuals.ftl
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/stanbol/trunk/kres/ontologymanager/store/rest/src/main/resources/META-INF/templates/org/apache/stanbol/ontologymanager/store/rest/resources/ontologyObjectProperties.ftl
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/kres/ontologymanager/store/rest/src/main/resources/META-INF/templates/org/apache/stanbol/ontologymanager/store/rest/resources/ontologyObjectProperties.ftl?rev=1086954&view=auto
==============================================================================
--- incubator/stanbol/trunk/kres/ontologymanager/store/rest/src/main/resources/META-INF/templates/org/apache/stanbol/ontologymanager/store/rest/resources/ontologyObjectProperties.ftl (added)
+++ incubator/stanbol/trunk/kres/ontologymanager/store/rest/src/main/resources/META-INF/templates/org/apache/stanbol/ontologymanager/store/rest/resources/ontologyObjectProperties.ftl Wed Mar 30 13:43:53 2011
@@ -0,0 +1,101 @@
+<#import "/imports/common.ftl" as common>
+<#import "/imports/prevNextButtons.ftl" as buttons>
+<@common.page title="Object Properties Of ${it.metadata.ontologyMetaInformation.URI}" hasrestapi=true>
+<div class="panel" id="webview">
+		<h4 class="addHeader">Create a new Object Property</h4>
+		<form method="POST" accept-charset="utf-8" accept="text/html" enctype="application/x-www-form-urlencoded">
+		  <fieldset>
+			  <legend>Enter Object Property URI to be created</legend>
+			  <p>Object Property URI: <textarea rows="1" name="objectPropertyURI"></textarea></p>
+			  <p><input type="submit" value="Create Object Property"></p>
+		  </fieldset>
+		</form>
+	<#if it.metadata.propertyMetaInformation?size == 0>
+	<p><em>Currently there is no classes in this ontology.</em></p>
+		
+	<#else>
+	<fieldset>
+		<legend><b>Object Properties</b></legend>
+		<#list it.metadata.propertyMetaInformation?sort_by("URI") as prop>
+			<div class="ontology ontOPropList ${prop_index}"> 
+			<div class="collapsed">
+					<a class="imgOntObjectProp" href="${prop.href}">${prop.URI}</a>
+					<button class="delete" title="Delete ${prop.URI}" onClick="javascript: deleteClass('${prop.href}')"></button>
+					<div class="ontologyHeader"></div>
+				<ul class= "ontologyCollapsable">
+					<li><b>Description:</b> ${prop.description}</li>
+					<li><b>Namespace:</b> ${prop.namespace}</li>
+					<li><b>Local Name:</b> ${prop.localName}</li>
+				</ul>
+			</div>	
+		</div>
+		</#list>
+			<@buttons.prevNextButtons className="ontOPropList"/>
+	</fieldset>
+	</#if>
+<script>
+	PAGING.adjustVisibility("ontOPropList");
+
+	function deleteClass(uri)
+	{
+		xmlhttp=new XMLHttpRequest();
+		xmlhttp.open('DELETE',uri,false);
+		xmlhttp.send();
+		location.reload('true');
+	}
+
+	$(".ontology .ontologyHeader").click(function () {
+	  $(this).parent().toggleClass("collapsed");
+	}); 
+</script>
+</div>
+<div class="panel" id="restapi" style="display: none;">
+<h3>Getting object properties of ontology</h3>
+<pre>
+curl -i -X GET -H "Accept:application/xml" http://localhost:8080/persistencestore/${it.metadata.ontologyMetaInformation.href}/objectProperties
+</pre>
+<p>Response :</p>
+
+<pre>
+HTTP/1.1 200 OK
+Content-Type: application/xml
+Transfer-Encoding: chunked
+Server: Jetty(6.1.x)
+
+&lt;?xml version="1.0" encoding="UTF-8" standalone="yes"?&gt;
+&lt;ns1:ObjectPropertiesForOntology xmlns:ns1="model.rest.persistence.iks.srdc.com.tr" xmlns:ns2="http://www.w3.org/1999/xlink"&gt;
+    &lt;ns1:OntologyMetaInformation ns2:href="ontologies/http://dbpedia.org/ontology/"&gt;
+        &lt;ns1:URI&gt;http://dbpedia.org/ontology/&lt;/ns1:URI&gt;
+        &lt;ns1:Description&gt;&lt;/ns1:Description&gt;
+    &lt;/ns1:OntologyMetaInformation&gt;
+    &lt;ns1:PropertyMetaInformation ns2:href="ontologies/http://dbpedia.org/ontology//objectProperties/http://dbpedia.org/ontology/actingheadteacher"&gt;
+        &lt;ns1:URI&gt;http://dbpedia.org/ontology/actingheadteacher&lt;/ns1:URI&gt;
+        &lt;ns1:Description&gt;&lt;/ns1:Description&gt;
+        &lt;ns1:Namespace&gt;http://dbpedia.org/ontology/&lt;/ns1:Namespace&gt;
+        &lt;ns1:LocalName&gt;actingheadteacher&lt;/ns1:LocalName&gt;
+    &lt;/ns1:PropertyMetaInformation&gt;
+&lt;/ns1:ObjectPropertiesForOntology&gt;
+</pre>
+<h3>Creating a new object property</h3>
+<pre>
+curl -i -X POST -H "Accept:application/xml" --data-urlencode objectPropertyURI=http://iks-project.eu/objectProps#SampleObjectProperty http://localhost:8080/persistencestore/${it.metadata.ontologyMetaInformation.href}/objectProperties
+</pre>
+<p>Response</p>
+<pre>
+HTTP/1.1 200 OK
+Content-Type: application/xml
+Transfer-Encoding: chunked
+Server: Jetty(6.1.x)
+
+&lt;?xml version="1.0" encoding="UTF-8" standalone="yes"?&gt;
+&lt;ns1:PropertyMetaInformation xmlns:ns1="model.rest.persistence.iks.srdc.com.tr" xmlns:ns2="http://www.w3.org/1999/xlink" ns2:href="ontologies/http://dbpedia.org/ontology//objectPro
+perties/http://iks-project.eu/objectProps/SampleObjectProperty"&gt;
+    &lt;ns1:URI&gt;http://iks-project.eu/objectProps#SampleObjectProperty&lt;/ns1:URI&gt;
+    &lt;ns1:Description&gt;&lt;/ns1:Description&gt;
+    &lt;ns1:Namespace&gt;http://iks-project.eu/objectProps#&lt;/ns1:Namespace&gt;
+    &lt;ns1:LocalName&gt;SampleObjectProperty&lt;/ns1:LocalName&gt;
+&lt;/ns1:PropertyMetaInformation&gt;
+
+</pre>
+</div>
+</...@common.page>
\ No newline at end of file

Propchange: incubator/stanbol/trunk/kres/ontologymanager/store/rest/src/main/resources/META-INF/templates/org/apache/stanbol/ontologymanager/store/rest/resources/ontologyObjectProperties.ftl
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/stanbol/trunk/kres/ontologymanager/store/rest/src/main/resources/META-INF/templates/org/apache/stanbol/ontologymanager/store/rest/resources/particularClass.ftl
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/kres/ontologymanager/store/rest/src/main/resources/META-INF/templates/org/apache/stanbol/ontologymanager/store/rest/resources/particularClass.ftl?rev=1086954&view=auto
==============================================================================
--- incubator/stanbol/trunk/kres/ontologymanager/store/rest/src/main/resources/META-INF/templates/org/apache/stanbol/ontologymanager/store/rest/resources/particularClass.ftl (added)
+++ incubator/stanbol/trunk/kres/ontologymanager/store/rest/src/main/resources/META-INF/templates/org/apache/stanbol/ontologymanager/store/rest/resources/particularClass.ftl Wed Mar 30 13:43:53 2011
@@ -0,0 +1,318 @@
+<#import "/imports/common.ftl" as common>
+<#import "/imports/prevNextButtons.ftl" as buttons>
+<#import "/imports/classConstraint.ftl" as constraint>
+<@common.page title="Class Context of ${it.metadata.classMetaInformation.URI}" hasrestapi=true>
+<div class="panel" id="webview">
+
+	<!-- Equivalent Classes -->
+	<fieldset>
+			<legend><b>Equivalent Classes</b></legend>
+			<div class="ontology">
+				<div class="collapsed">
+					<fieldset>
+					    <h4 class="ontologySubmitHeader">Add Equivalent Class</h4>
+					  	<div class="ontologyCollapsable">
+						  <p>Domain URI: <textarea class="equivalentClassInput"rows="1" name="classURI"></textarea></p>
+						  <p><button  name="Add Domain" onClick="javascript: PSTORE.HTTPHelper.send('POST', '${it.metadata.classMetaInformation.href}/equivalentClasses', false, false, 'equivalentClassURIs',$('.equivalentClassInput')[0].value )">Add Equivalent Class</button></p>
+						 </div>
+					  </fieldset>
+				</div>
+			</div>
+	<#if it.metadata.equivalentClasses.classMetaInformation?size !=0>
+			<#list it.metadata.equivalentClasses.classMetaInformation?sort_by("URI") as eqCls>
+				<div class="ontology equClasses ${eqCls_index}"> 
+				<div class="collapsed">
+					<a class="imgOntClass" href="${eqCls.href}">${eqCls.URI}</a>
+					<button class="delete" title="Delete ${eqCls.URI}" onClick="javascript: PSTORE.HTTPHelper.send('DELETE', '${it.metadata.classMetaInformation.href}/equivalentClasses/${eqCls.URI}', true, false, null, null)"></button>
+				</div>
+			</div>
+			</#list>
+				<@buttons.prevNextButtons className="equClasses"/>
+	</#if>
+	</fieldset>	
+	
+		<!-- Super Classes -->
+		<fieldset>
+			<legend><b>Super Classes</b></legend>
+			<div class="ontology">
+				<div class="collapsed">
+					<fieldset>
+					    <h4 class="ontologySubmitHeader">Add Super Class</h4>
+					  	<div class="ontologyCollapsable">
+						  <p>Domain URI: <textarea class="superClassInput"rows="1" name="classURI"></textarea></p>
+						  <p><button  name="Add Super Class" onClick="javascript: PSTORE.HTTPHelper.send('POST', '${it.metadata.classMetaInformation.href}/superClasses', false, false, 'superClassURIs',$('.superClassInput')[0].value )">Add Super Class</button></p>
+						 </div>
+					  </fieldset>
+				</div>
+			</div>
+	<#if it.metadata.superclasses.classMetaInformation?size !=0>
+			<#list it.metadata.superclasses.classMetaInformation?sort_by("URI") as supCls>
+				<div class="ontology supClasses ${supCls_index}"> 
+				<div class="collapsed">
+					<a class="imgOntClass" href="${supCls.href}">${supCls.URI}</a>
+					<button class="delete" title="Delete ${supCls.URI}" onClick="javascript: PSTORE.HTTPHelper.send('DELETE', '${it.metadata.classMetaInformation.href}/superClasses/${supCls.URI}', true, false, null, null)"></button>
+				</div>
+			</div>
+			</#list>
+				<@buttons.prevNextButtons className="supClasses"/>
+		
+	</#if>
+	</fieldset>
+		<!-- Disjoint Classes -->
+		<fieldset>
+			<legend><b>Disjoint Classes</b></legend>
+			<div class="ontology">
+				<div class="collapsed">
+					<fieldset>
+					    <h4 class="ontologySubmitHeader">Add Disjoint Class</h4>
+					  	<div class="ontologyCollapsable">
+						  <p>Domain URI: <textarea class="disjointClassInput"rows="1" name="classURI"></textarea></p>
+						  <p><button  name="Add Disjoint Class" onClick="javascript: PSTORE.HTTPHelper.send('POST', '${it.metadata.classMetaInformation.href}/disjointClasses', false, false, 'disjointClassURIs',$('.disjointClassInput')[0].value )">Add Disjoint Class</button></p>
+						 </div>
+					  </fieldset>
+				</div>
+			</div>
+	<#if it.metadata.disjointClasses.classMetaInformation?size !=0>
+		
+			<#list it.metadata.disjointClasses.classMetaInformation?sort_by("URI") as disjCls>
+				<div class="ontology disClasses ${disjCls_index}"> 
+				<div class="collapsed">
+					<a class="imgOntClass" href="${disjCls.href}">${disjCls.URI}</a>
+					<button class="delete" title="Delete ${disjCls.URI}" onClick="javascript: PSTORE.HTTPHelper.send('DELETE', '${it.metadata.classMetaInformation.href}/disjointClasses/${disjCls.URI}', true, false, null, null)"></button>
+				</div>
+			</div>
+			</#list>
+				<@buttons.prevNextButtons className="disClasses"/>
+	</#if>
+	</fieldset>
+	
+	
+		<!-- Class Constraints -->
+	<#if it.metadata.classConstraint?size != 0>
+		<fieldset>
+			<legend><b>Class Constraints</b></legend>
+			<#list it.metadata.classConstraint?sort_by("type") as clsCons>
+				<p class="clasCons ${clsCons_index}">
+					<@constraint.processConstraint original=clsCons constraint=clsCons/>
+				</p>
+			</#list>
+		</fieldset>
+	</#if>
+</div>
+<div class="panel" id="restapi" style="display: none;">
+<h3>Getting class context of a  class</h3>
+<pre>
+curl -i -X GET -H "Accept:application/xml" http://localhost:8080/persistencestore/${it.metadata.classMetaInformation.href}
+</pre>
+<p>Response :</p>
+<pre>
+HTTP/1.1 200 OK
+Content-Type: application/xml
+Transfer-Encoding: chunked
+Server: Jetty(6.1.x)
+
+&lt;?xml version="1.0" encoding="UTF-8" standalone="yes"?&gt;
+&lt;ns1:ClassContext xmlns:ns1="model.rest.persistence.iks.srdc.com.tr" xmlns:ns2="http://www.w3.org/1999/xlink"&gt;
+    &lt;ns1:ClassMetaInformation ns2:href="ontologies/http://dbpedia.org/ontology//classes/http://dbpedia.org/ontology/AdultActor"&gt;
+        &lt;ns1:URI&gt;http://dbpedia.org/ontology/AdultActor&lt;/ns1:URI&gt;
+        &lt;ns1:Description&gt;&lt;/ns1:Description&gt;
+        &lt;ns1:Namespace&gt;http://dbpedia.org/ontology/&lt;/ns1:Namespace&gt;
+        &lt;ns1:LocalName&gt;AdultActor&lt;/ns1:LocalName&gt;
+    &lt;/ns1:ClassMetaInformation&gt;
+    &lt;ns1:EquivalentClasses/&gt;
+    &lt;ns1:Superclasses&gt;
+        &lt;ns1:ClassMetaInformation ns2:href="ontologies/http://dbpedia.org/ontology//classes/http://dbpedia.org/ontology/Actor"&gt;
+            &lt;ns1:URI&gt;http://dbpedia.org/ontology/Actor&lt;/ns1:URI&gt;
+            &lt;ns1:Description&gt;&lt;/ns1:Description&gt;
+            &lt;ns1:Namespace&gt;http://dbpedia.org/ontology/&lt;/ns1:Namespace&gt;
+            &lt;ns1:LocalName&gt;Actor&lt;/ns1:LocalName&gt;
+        &lt;/ns1:ClassMetaInformation&gt;
+    &lt;/ns1:Superclasses&gt;
+    &lt;ns1:DisjointClasses/&gt;
+&lt;/ns1:ClassContext&gt;
+</pre>
+
+<p><b>Class</b> Context contains following information:
+	<ul>
+		<li><b>Equivalent Classes</b> as a list of ClassMetaInformation</li>
+		<li><b>Super Classes</b> as a list of ClassMetaInformation</li>
+		<li><b>Disjoint Classes</b> as a list of ClassMetaInformation</li>
+		<li><b>Class Constraint</b> list containing
+			<ul>
+				<li>owl:allValuesFrom</li>
+				<li>owl:someValuesFrom</li>
+				<li>owl:hasValue</li>
+				<li>owl:maxCardinality</li>
+				<li>owl:minCardinality</li>
+				<li>owl:cardinality</li>
+				<li>owl:intersectionOf</li>
+				<li>owl:unionOf</li>
+			</ul>
+			constrains defined on this class
+		</li>
+		Here is an example class constraint that defines a class which has either a student or a happy friend : 
+<pre>
+&lt;ns1:ClassConstraint ns1:type="union_of">
+    &lt;ns1:ClassConstraint ns1:type="some_values_from"&gt;
+        &lt;ns1:PropertyMetaInformation ns2:href="ontologies/http://oiled.man.example.net/facts/objectProperties/http://oiled.man.example.net/facts/hasFriend"&gt;
+            &lt;ns1:URI&gt;http://oiled.man.example.net/facts#hasFriend&lt;/ns1:URI&gt;
+            &lt;ns1:Description&gt;&lt;/ns1:Description&gt;
+            &lt;ns1:Namespace&gt;http://oiled.man.example.net/facts#&lt;/ns1:Namespace&gt;
+            &lt;ns1:LocalName&gt;hasFriend&lt;/ns1:LocalName&gt;
+        &lt;/ns1:PropertyMetaInformation&gt;
+        &lt;ns1:ClassMetaInformation ns2:href="ontologies/http://oiled.man.example.net/facts/classes/http://oiled.man.example.net/facts/Happy"&gt;
+            &lt;ns1:URI&gt;http://oiled.man.example.net/facts#Happy&lt;/ns1:URI&gt;
+            &lt;ns1:Description&gt;&lt;/ns1:Description&gt;
+            &lt;ns1:Namespace&gt;http://oiled.man.example.net/facts#&lt;/ns1:Namespace&gt;
+            &lt;ns1:LocalName&gt;Happy&lt;/ns1:LocalName&gt;
+        &lt;/ns1:ClassMetaInformation&gt;
+    &lt;/ns1:ClassConstraint&gt;
+    &lt;ns1:ClassConstraint ns1:type="some_values_from"&gt;
+        &lt;ns1:PropertyMetaInformation ns2:href="ontologies/http://oiled.man.example.net/facts/objectProperties/http://oiled.man.example.net/facts/hasFriend"&gt;
+            &lt;ns1:URI&gt;http://oiled.man.example.net/facts#hasFriend&lt;/ns1:URI&gt;
+            &lt;ns1:Description&gt;&lt;/ns1:Description&gt;
+            &lt;ns1:Namespace&gt;http://oiled.man.example.net/facts#&lt;/ns1:Namespace&gt;
+            &lt;ns1:LocalName&gt;hasFriend&lt;/ns1:LocalName&gt;
+        &lt;/ns1:PropertyMetaInformation&gt;
+        &lt;ns1:ClassMetaInformation ns2:href="ontologies/http://oiled.man.example.net/facts/classes/http://oiled.man.example.net/facts/Student"&gt;
+            &lt;ns1:URI&gt;http://oiled.man.example.net/facts#Student&lt;/ns1:URI&gt;
+            &lt;ns1:Description&gt;&lt;/ns1:Description&gt;
+            &lt;ns1:Namespace&gt;http://oiled.man.example.net/facts#&lt;/ns1:Namespace&gt;
+            &lt;ns1:LocalName&gt;Student&lt;/ns1:LocalName&gt;
+        &lt;/ns1:ClassMetaInformation&gt;
+    &lt;/ns1:ClassConstraint&gt;
+&lt;/ns1:ClassConstraint&gt;
+		
+</pre>
+	</ul>
+</p>
+
+<h3>Updating class context of a class</h3>
+<fieldset>
+	<legend><b>SubPath: /superClasses  Method: POST </b></legend>
+	<table class="formParams">
+		<head>
+			<th width="20%">POST Parameter</th>
+			<th width="10%">Type</th>
+			<th width="70%">Explanation</th>
+		</head>
+		<body>
+			<tr>
+				<td>superClassURIs</td>
+				<td>List&lt;String&gt;</td>
+				<td>A list of existing class URIs which will be added as a super class to this class</td>
+			</tr>
+		</body>
+	</table>
+</fieldset>
+<fieldset>
+	<legend><b>SubPath:  /superClasses/{classURI} Method : DELETE</b></legend> 
+	<p>Delete class indicated by classURI at path parameter from the super class list of this class</p>
+</fieldset>
+
+<fieldset>
+	<legend><b>SubPath: /equivalentClasses  Method: POST </b></legend>
+	<table class="formParams">
+		<head>
+			<th width="20%">POST Parameter</th>
+			<th width="10%">Type</th>
+			<th width="70%">Explanation</th>
+		</head>
+		<body>
+			<tr>
+				<td>equivalentClassURIs</td>
+				<td>List&lt;String&gt;</td>
+				<td>A list of existing class URIs which will be added as an equivalent class to this class</td>
+			</tr>
+		</body>
+	</table>
+</fieldset>
+<fieldset>
+	<legend><b>SubPath: /equivalentClasses/{classURI} Method : DELETE</b></legend> 
+	<p>Delete class indicated by classURI at path parameter from the equivalent class list of this class</p>
+</fieldset>
+<fieldset>
+	<legend><b>SubPath: /disjointClasses  Method: POST </b></legend>
+	<table class="formParams">
+		<head>
+			<th width="20%">POST Parameter</th>
+			<th width="10%">Type</th>
+			<th width="70%">Explanation</th>
+		</head>
+		<body>
+			<tr>
+				<td>disjointClassURIs</td>
+				<td>List&lt;String&gt;</td>
+				<td>A list of existing class URIs which will be added as a disjoint class to this class</td>
+			</tr>
+		</body>
+	</table>
+</fieldset>
+<fieldset>
+	<legend><b>SubPath: /disjointClasses/{classURI} Method : DELETE</b></legend> 
+	<p>Delete class indicated by classURI at path parameter from the super disjoint class  list of this class</p>
+</fieldset>
+
+<fieldset>
+	<legend><b>SubPath: /unionClasses  Method: POST </b></legend>
+	<table class="formParams">
+		<head>
+			<th width="20%">POST Parameter</th>
+			<th width="10%">Type</th>
+			<th width="70%">Explanation</th>
+		</head>
+		<body>
+			<tr>
+				<td>unionClassURIs</td>
+				<td>List&lt;String&gt;</td>
+				<td>A list of existing class URIs which will be added as a union class to this class and this class is converted to union class of this list</td>
+			</tr>
+		</body>
+	</table>
+</fieldset>
+<fieldset>
+	<legend><b>SubPath: /unionClasses/{classURI} Method : DELETE</b></legend> 
+	<p>Delete class indicated by classURI at path parameter from the union class list of this class</p>
+</fieldset>
+</div>
+<script>
+	PAGING.adjustVisibility("equClasses");
+	PAGING.adjustVisibility("supClasses");
+	PAGING.adjustVisibility("disClasses");
+	PAGING.adjustVisibility("clasCons");
+	
+	$(".ontology .ontologyHeader").click(function () {
+	  $(this).parents("div").toggleClass("collapsed");
+	}); 
+	
+	$(".ontology .ontologySubmitHeader").click(function () {
+	  $(this).parents("div").toggleClass("collapsed");
+	}); 
+
+	$(".updateRadio").change(
+		function(){
+			$(".superClass").addClass("invisible");
+			$(".equivalentClass").addClass("invisible");
+			$(".disjointClass").addClass("invisible");
+			$(".unionOf").addClass("invisible");
+			$(".superClass").children("p").children("textarea")[0].value="";
+			$(".equivalentClass").children("p").children("textarea")[0].value="";
+			$(".disjointClass").children("p").children("textarea")[0].value="";
+			$(".unionOf").children("p").children("textarea")[0].value="";
+			var rb = $("input:checked")[0];
+			if(rb != null){ 
+				var checked = $("input:checked")[0].value;
+				if(checked == "SP"){
+					$(".superClass").removeClass("invisible");
+				}else if(checked == "EQ"){
+					$(".equivalentClass").removeClass("invisible");
+				}else if(checked == "DS"){
+					$(".disjointClass").removeClass("invisible");
+				}else if(checked == "UN"){
+					$(".unionOf").removeClass("invisible");
+				}
+			}
+		}
+	)
+</script>
+</...@common.page>
\ No newline at end of file

Propchange: incubator/stanbol/trunk/kres/ontologymanager/store/rest/src/main/resources/META-INF/templates/org/apache/stanbol/ontologymanager/store/rest/resources/particularClass.ftl
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/stanbol/trunk/kres/ontologymanager/store/rest/src/main/resources/META-INF/templates/org/apache/stanbol/ontologymanager/store/rest/resources/particularDatatypeProperty.ftl
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/kres/ontologymanager/store/rest/src/main/resources/META-INF/templates/org/apache/stanbol/ontologymanager/store/rest/resources/particularDatatypeProperty.ftl?rev=1086954&view=auto
==============================================================================
--- incubator/stanbol/trunk/kres/ontologymanager/store/rest/src/main/resources/META-INF/templates/org/apache/stanbol/ontologymanager/store/rest/resources/particularDatatypeProperty.ftl (added)
+++ incubator/stanbol/trunk/kres/ontologymanager/store/rest/src/main/resources/META-INF/templates/org/apache/stanbol/ontologymanager/store/rest/resources/particularDatatypeProperty.ftl Wed Mar 30 13:43:53 2011
@@ -0,0 +1,288 @@
+<#import "/imports/common.ftl" as common>
+<#import "/imports/prevNextButtons.ftl" as buttons>
+<#import "/imports/propertySerializer.ftl" as propSerializer>
+<@common.page title="Datatype Property Context of ${it.metadata.propertyMetaInformation.URI}" hasrestapi=true>
+<div class="panel" id="webview">
+	<!--FIXME Currently superProperties of this property are not changed using html interface-->
+	<script type="text/javascript" src="static/scripts/propertyUpdater.js"></script>
+<!-- Property Features-->
+	<fieldset>
+		<legend><b>Property Feature</b></legend>
+			<input class="horizontal" name="propFeatFunc"   type="checkbox" <#if it.metadata.isIsFunctional()>checked</#if>>Functional<br>
+			<input type="button" value="Save Changes" onClick="javascript: PSTORE.propUtil.post('${it.metadata.propertyMetaInformation.href}')">
+	</fieldset>
+<!--Domains -->
+	<fieldset>
+		<legend><b>Datatype Property Domains</b></legend>
+		<div class="ontology">
+			<div class="collapsed">
+				<fieldset>
+				    <h4 class="ontologySubmitHeader">Add Domain</h4>
+				  	<div class="ontologyCollapsable">
+					  <p>Domain URI: <textarea class="domainInput"rows="1" name="classURI"></textarea></p>
+					  <p><button  name="Add Domain" onClick="javascript: PSTORE.HTTPHelper.send('POST', '${it.metadata.propertyMetaInformation.href}/domains', false, false, 'domainURIs',$('.domainInput')[0].value )">Add Domain</button></p>
+					 </div>
+				  </fieldset>
+			</div>
+		</div>
+		<#if it.metadata.domain.classMetaInformationOrBuiltInResource?size == 0>
+			<em>There is no ranges declared for this Datatype property.</em>
+			
+		<#else>
+			<#list it.metadata.domain.classMetaInformationOrBuiltInResource as domain>
+				<#if domain?keys?seq_contains("href")>
+					<div class="ontology domainList ${domain_index}"> 
+						<div class="collapsed">
+							<a class= "imgOntClass" href="${domain.href}">${domain.URI}</a>
+							<button class="delete" title="Delete ${domain.URI}" onClick="javascript: PSTORE.HTTPHelper.send('DELETE', '${it.metadata.propertyMetaInformation.href}/domains/${domain.URI}', true, false, null, null)"></button>	
+							<ul class= "ontologyCollapsable">
+								<li><b>Description:</b> ${domain.description}</li>
+								<li><b>URI:</b> ${domain.URI}</li>
+							</ul>
+						</div>
+					</div>
+				<#else>
+					<div class="ontology ontologyHeader domainList ${domain_index}">
+						<b>URI:</b> ${domain.URI}<button class="delete" title="Delete ${domain.URI}" onClick="javascript: PSTORE.HTTPHelper.send('DELETE', '${it.metadata.propertyMetaInformation.href}/domains/${domain.URI}', true, false, null, null)"></button>
+					<div>
+				</#if>
+			</#list>
+				<@buttons.prevNextButtons className="domainList"/>
+			
+		</#if>
+	</fieldset>
+<!--Ranges -->
+	<fieldset>
+		<legend><b>Datatype Property Ranges</b></legend>
+		<div class="ontology">
+			<div class="collapsed">
+				<fieldset>
+				    <h4 class="ontologySubmitHeader">Add Range</h4>
+				  	<div class="ontologyCollapsable">
+					  <p>Range URI: <textarea class="rangeInput"rows="1" name="classURI"></textarea></p>
+					  <p><button  name="Add Range" onClick="javascript: PSTORE.HTTPHelper.send('POST', '${it.metadata.propertyMetaInformation.href}/ranges', false, false, 'rangeURIs',$('.rangeInput')[0].value )">Add Range</button></p>
+					 </div>
+				  </fieldset>
+			</div>
+		</div>
+		<#if it.metadata.range.classMetaInformationOrBuiltInResource?size == 0>
+			<em>There is no ranges declared for this Datatype property.</em>
+			
+		<#else>
+			<#list it.metadata.range.classMetaInformationOrBuiltInResource as range>
+				<#if range?keys?seq_contains("href")>
+					<div class="ontology rangeList ${range_index}"> 
+						<div class="collapsed">
+							<p class ="ontologyHeader">
+							<a class ="imgOntClass" href="${range.href}">${range.URI}</a>
+								<button class="delete" title="Delete ${range.URI}" onClick="javascript: PSTORE.HTTPHelper.send('DELETE', '${it.metadata.propertyMetaInformation.href}/ranges/${range.URI}', true, false, null, null)"></button>
+							</p>
+						</div>
+					</div>
+				<#else>
+					<div class="ontology rangeList ${range_index}">
+						<b>URI:</b> ${range.URI}&nbsp;&nbsp;<button class="delete" title="Delete ${range.URI}" onClick="javascript: PSTORE.HTTPHelper.send('DELETE', '${it.metadata.propertyMetaInformation.href}/ranges/${range.URI}', true, false, null, null)"></button>
+					</div>
+				</#if>
+			</#list>
+				<@buttons.prevNextButtons className="rangeList"/>
+			</fieldset>
+		</#if>
+	
+	
+<!-- Equivalent Properties -->
+	<#if it.metadata.equivalentProperties.propertyMetaInformation?size !=0>
+		<fieldset>
+			<legend><b>Equivalent Properties</b></legend>
+			<#list it.metadata.equivalentProperties.propertyMetaInformation?sort_by("URI") as prop>
+				<div class="ontology equProps ${prop_index}"> 
+				<div class="collapsed">
+					<a  class="imgOntDataProp" href="${prop.href}">${prop.URI}</a>		
+				</div>
+			</div>
+			</#list>
+				<@buttons.prevNextButtons className="equProps"/>
+		</fieldset>
+	</#if>
+	
+<!-- Super Properties -->
+	<#if it.metadata.superProperties.propertyMetaInformation?size !=0>
+		<fieldset>
+			<legend><b>Super Properties</b></legend>
+			<#list it.metadata.superProperties.propertyMetaInformation?sort_by("URI") as prop>
+				<div class="ontology superProps ${prop_index}"> 
+				<div class="collapsed">
+					<a class="imgOntDataProp" href="${prop.href}">${prop.URI}</a>	
+				</div>
+			</div>
+			</#list>
+				<@buttons.prevNextButtons className="superProps"/>
+		</fieldset>
+	</#if>
+	<br>
+</div>
+
+<div class="panel" id="restapi" style="display: none;">
+<h3>Getting datatype property context of a  class</h3>
+<pre>
+curl -i -X GET -H "Accept:application/xml" http://localhost:8080/persistencestore/${it.metadata.propertyMetaInformation.href}
+</pre>
+<p>Response :</p>
+<pre>
+HTTP/1.1 200 OK
+Content-Type: application/xml
+Transfer-Encoding: chunked
+Server: Jetty(6.1.x)
+
+&lt;?xml version="1.0" encoding="UTF-8" standalone="yes"?&gt;
+&lt;ns1:DatatypePropertyContext xmlns:ns1="model.rest.persistence.iks.srdc.com.tr" xmlns:ns2="http://www.w3.org/1999/xlink" ns1:isFunctional="true"&gt;
+    &lt;ns1:PropertyMetaInformation ns2:href="ontologies/http://dbpedia.org/ontology//datatypeProperties/http://dbpedia.org/ontology/added"&gt;
+        &lt;ns1:URI&gt;http://dbpedia.org/ontology/added&lt;/ns1:URI&gt;
+        &lt;ns1:Description&gt;&lt;/ns1:Description&gt;
+        &lt;ns1:Namespace&gt;http://dbpedia.org/ontology/&lt;/ns1:Namespace&gt;
+        &lt;ns1:LocalName&gt;added&lt;/ns1:LocalName&gt;
+    &lt;/ns1:PropertyMetaInformation&gt;
+    &lt;ns1:Domain&gt;
+        &lt;ns1:ClassMetaInformation ns2:href="ontologies/http://dbpedia.org/ontology//classes/http://dbpedia.org/ontology/HistoricPlace"&gt;
+            &lt;ns1:URI&gt;http://dbpedia.org/ontology/HistoricPlace&lt;/ns1:URI&gt;
+            &lt;ns1:Description&gt;&lt;/ns1:Description&gt;
+            &lt;ns1:Namespace&gt;http://dbpedia.org/ontology/&lt;/ns1:Namespace&gt;
+            &lt;ns1:LocalName&gt;HistoricPlace&lt;/ns1:LocalName&gt;
+        &lt;/ns1:ClassMetaInformation&gt;
+    &lt;/ns1:Domain&gt;
+    &lt;ns1:Range&gt;
+        &lt;ns1:BuiltInResource&gt;
+            &lt;ns1:URI&gt;http://www.w3.org/2001/XMLSchema#date&lt;/ns1:URI&gt;
+        &lt;/ns1:BuiltInResource&gt;
+    &lt;/ns1:Range&gt;
+    &lt;ns1:EquivalentProperties/&gt;
+    &lt;ns1:SuperProperties/&gt;
+&lt;/ns1:DatatypePropertyContext&gt;
+</pre>
+
+<p>Datatype property Context contains following information:
+	<ul>
+	    <li><b>Equivalent Properties</b> as a list of PropertyMetaInformation</li>
+		<li><b>Super Properties</b> as a list of PropertyMetaInformation</li>
+		<li>Whether the datatype property is <b>functional</b> or not</li>
+		<li><b>Domains</b> as a list of resource URIs or ClassMetaInformation</li>
+		<li><b>Ranges</b> as a list of resource URIs</li>
+	</ul>
+</p>
+
+<h3>Updating datatype property context of an datatype property</h3>
+<fieldset>
+	<legend>Form Paramaters</legend>
+	<table class="formParams">
+		<head>
+			<th width="20%">Parameter Name</th>
+			<th width="10%">Type</th>
+			<th width="70%">Explanation</th>
+		</head>
+			<tr>
+				<td>isFunctional</td>
+				<td>boolean</td>
+				<td>Boolean value indicating whether the datatype property is functional</td>
+			</tr>
+		<body>
+		</body>
+	</table>
+</fieldset>
+
+<fieldset>
+	<legend><b>SubPath: /domains  Method: POST </b></legend>
+	<table class="formParams">
+		<head>
+			<th width="20%">POST Parameter</th>
+			<th width="10%">Type</th>
+			<th width="70%">Explanation</th>
+		</head>
+		<body>
+			<tr>
+				<td>domainURIs</td>
+				<td>List&lt;String&gt;</td>
+				<td>A list of existing class URIs which will be added as a domain to this datatype property</td>
+			</tr>
+		</body>
+	</table>
+</fieldset>
+<fieldset>
+	<legend><b>SubPath:  /domains/{domainURI} Method : DELETE</b></legend> 
+	<p>Delete domain indicated by domainURI at path parameter from the domain list of this datatype property</p>
+</fieldset>
+
+<fieldset>
+	<legend><b>SubPath: /ranges  Method: POST </b></legend>
+	<table class="formParams">
+		<head>
+			<th width="20%">POST Parameter</th>
+			<th width="10%">Type</th>
+			<th width="70%">Explanation</th>
+		</head>
+		<body>
+			<tr>
+				<td>rangeURIs</td>
+				<td>List&lt;String&gt;</td>
+				<td>A list of existing class URIs which will be added as a range to this datatype property</td>
+			</tr>
+		</body>
+	</table>
+</fieldset>
+<fieldset>
+	<legend><b>SubPath:  /ranges/{rangeURI} Method : DELETE</b></legend> 
+	<p>Delete range indicated by rangeURI at path parameter from the range list of this datatype property</p>
+</fieldset>
+
+<fieldset>
+	<legend><b>SubPath: /superProperties  Method: POST </b></legend>
+	<table class="formParams">
+		<head>
+			<th width="20%">POST Parameter</th>
+			<th width="10%">Type</th>
+			<th width="70%">Explanation</th>
+		</head>
+		<body>
+			<tr>
+				<td>superPropertyURIs</td>
+				<td>List&lt;String&gt;</td>
+				<td>A list of existing datatype property URIs which will be added as a super property to this datatype property</td>
+			</tr>
+		</body>
+	</table>
+</fieldset>
+<fieldset>
+	<legend><b>SubPath:  /superProperties/{propertyURI} Method : DELETE</b></legend> 
+	<p>Delete datatype property indicated by propertyURI at path parameter from the super properties list of this datatype property</p>
+</fieldset>
+<p>Example curl command</p>
+<pre>
+curl -i -X POST -H "Accept:application/xml" --data-urlencode isFuntional=true  http://localhost:8080/persistencestore/${it.metadata.propertyMetaInformation.href}
+</pre>
+<p>Response is the updated class context of the class</p>
+
+</div>
+<script>
+	
+	PAGING.adjustVisibility("domainList");
+	PAGING.adjustVisibility("rangeList");
+	PAGING.adjustVisibility("equProps");
+	PAGING.adjustVisibility("superProps");
+	<@propSerializer.property it=it.metadata/>
+ 		
+ 	
+	
+	var propUtil = this.PSTORE.propUtil; 
+
+	$('[name="propFeatFunc"]').click(function(){
+		propUtil.setFunctional($(this)[0].checked);
+	});
+
+	$(".ontology .ontologyHeader").click(function () {
+	  $(this).parent().toggleClass("collapsed");
+	});
+	
+	$(".ontology .ontologySubmitHeader").click(function () {
+	  $(this).parents("div").toggleClass("collapsed");
+	});
+</script>
+</...@common.page>
\ No newline at end of file

Propchange: incubator/stanbol/trunk/kres/ontologymanager/store/rest/src/main/resources/META-INF/templates/org/apache/stanbol/ontologymanager/store/rest/resources/particularDatatypeProperty.ftl
------------------------------------------------------------------------------
    svn:executable = *