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/10/16 14:17:27 UTC

[1/5] git commit: reformatting

Repository: marmotta
Updated Branches:
  refs/heads/develop fa8ef614e -> bac15e8ca


reformatting


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

Branch: refs/heads/develop
Commit: f4f77bfb15c927663a5b52061030ffa3e63e61e7
Parents: fa8ef61
Author: Sergio Fernández <wi...@apache.org>
Authored: Thu Oct 16 13:31:15 2014 +0200
Committer: Sergio Fernández <wi...@apache.org>
Committed: Thu Oct 16 13:31:15 2014 +0200

----------------------------------------------------------------------
 .../webservices/SparqlWebServiceTest.java       | 188 +++++++++----------
 1 file changed, 93 insertions(+), 95 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/marmotta/blob/f4f77bfb/platform/marmotta-sparql/src/test/java/org/apache/marmotta/platform/sparql/webservices/SparqlWebServiceTest.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-sparql/src/test/java/org/apache/marmotta/platform/sparql/webservices/SparqlWebServiceTest.java b/platform/marmotta-sparql/src/test/java/org/apache/marmotta/platform/sparql/webservices/SparqlWebServiceTest.java
index e0841b6..ce12c00 100644
--- a/platform/marmotta-sparql/src/test/java/org/apache/marmotta/platform/sparql/webservices/SparqlWebServiceTest.java
+++ b/platform/marmotta-sparql/src/test/java/org/apache/marmotta/platform/sparql/webservices/SparqlWebServiceTest.java
@@ -17,12 +17,7 @@
 
 package org.apache.marmotta.platform.sparql.webservices;
 
-import static com.jayway.restassured.RestAssured.expect;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URISyntaxException;
-
+import com.jayway.restassured.RestAssured;
 import org.apache.marmotta.platform.core.api.importer.ImportService;
 import org.apache.marmotta.platform.core.api.triplestore.ContextService;
 import org.apache.marmotta.platform.core.api.user.UserService;
@@ -34,31 +29,34 @@ import org.junit.Test;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import com.jayway.restassured.RestAssured;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URISyntaxException;
+
+import static com.jayway.restassured.RestAssured.expect;
 
 /**
  * Tests for testing the SPAQL endpoint
- * 
- * @author Sergio Fernández
  *
+ * @author Sergio Fernández
  */
 public class SparqlWebServiceTest {
 
-	private static Logger log = LoggerFactory.getLogger(SparqlWebServiceTest.class);
-	
+    private static Logger log = LoggerFactory.getLogger(SparqlWebServiceTest.class);
+
     private static JettyMarmotta marmotta;
 
     @BeforeClass
     public static void setUp() throws MarmottaImportException, URISyntaxException {
         marmotta = new JettyMarmotta("/marmotta", SparqlWebService.class);
-        
+
         ImportService importService = marmotta.getService(ImportService.class);
         UserService userService = marmotta.getService(UserService.class);
         ContextService contextService = marmotta.getService(ContextService.class);
-        InputStream is = Thread.currentThread().getContextClassLoader().getResourceAsStream("foaf.rdf"); 
+        InputStream is = Thread.currentThread().getContextClassLoader().getResourceAsStream("foaf.rdf");
         int n = importService.importData(is, "application/rdf+xml", userService.getAnonymousUser(), contextService.getDefaultContext());
         log.info("Imported RDF test suite with {} triples", n);
-        
+
         RestAssured.baseURI = "http://localhost";
         RestAssured.port = marmotta.getPort();
         RestAssured.basePath = marmotta.getContext();
@@ -69,127 +67,127 @@ public class SparqlWebServiceTest {
     public static void tearDown() {
         marmotta.shutdown();
     }
-    
+
     @Test
     public void testSelect() throws IOException, InterruptedException {
         expect().
-    	log().ifError().
-    		statusCode(200).
-    	given().
-    		param("query", "SELECT ?o WHERE { <http://www.wikier.org/foaf#wikier> ?p ?o }").
-		when().
-    		get("/sparql/select");
+                log().ifError().
+                statusCode(200).
+            given().
+                param("query", "SELECT ?o WHERE { <http://www.wikier.org/foaf#wikier> ?p ?o }").
+                when().
+            get("/sparql/select");
     }
-    
+
     @Test
     public void testSelectContentNegotiation() throws IOException, InterruptedException {
         expect().
-    	log().ifError().
-    		statusCode(200).
-    		contentType("application/sparql-results+xml").
-    	given().
-			header("Accept", "application/xml").
-    		param("query", "SELECT ?o WHERE { <http://www.wikier.org/foaf#wikier> ?p ?o }").
-		when().
-    		get("/sparql/select");
+                log().ifError().
+                statusCode(200).
+                contentType("application/sparql-results+xml").
+            given().
+                header("Accept", "application/xml").
+                param("query", "SELECT ?o WHERE { <http://www.wikier.org/foaf#wikier> ?p ?o }").
+            when().
+                get("/sparql/select");
     }
-    
+
     @Test
     public void testAsk() throws IOException, InterruptedException {
         expect().
-    	log().ifError().
-    		statusCode(200).
-    	given().
-    		param("query", "ASK WHERE { <http://www.wikier.org/foaf#wikier> ?p ?o }").
-		when().
-    		get("/sparql/select");
+                log().ifError().
+                statusCode(200).
+            given().
+                param("query", "ASK WHERE { <http://www.wikier.org/foaf#wikier> ?p ?o }").
+            when().
+                get("/sparql/select");
     }
-    
+
     @Test
     public void testConstruct() throws IOException, InterruptedException {
         expect().
-    	log().ifError().
-    		statusCode(200).
-    		contentType("application/rdf+xml").
-    	given().
-    		param("query", "CONSTRUCT { <http://www.wikier.org/foaf#wikier> ?p ?o } WHERE { <http://www.wikier.org/foaf#wikier> ?p ?o }").
-		when().
-    		get("/sparql/select");
+                log().ifError().
+                statusCode(200).
+                contentType("application/rdf+xml").
+            given().
+                param("query", "CONSTRUCT { <http://www.wikier.org/foaf#wikier> ?p ?o } WHERE { <http://www.wikier.org/foaf#wikier> ?p ?o }").
+            when().
+                get("/sparql/select");
     }
-    
+
     @Test
     public void testConstructContentNegotiationXml() throws IOException, InterruptedException {
         expect().
-        	log().ifError().
-    		statusCode(200).
-    		contentType("application/rdf+xml").
-    	given().
-    		header("Accept", "application/xml").
-    		param("query", "CONSTRUCT { <http://www.wikier.org/foaf#wikier> ?p ?o } WHERE { <http://www.wikier.org/foaf#wikier> ?p ?o }").
-		when().
-    		get("/sparql/select");
+                log().ifError().
+                statusCode(200).
+                contentType("application/rdf+xml").
+            given().
+                header("Accept", "application/xml").
+                param("query", "CONSTRUCT { <http://www.wikier.org/foaf#wikier> ?p ?o } WHERE { <http://www.wikier.org/foaf#wikier> ?p ?o }").
+            when().
+                get("/sparql/select");
     }
-    
+
     @Test
     public void testConstructContentNegotiationPlain() throws IOException, InterruptedException {
         expect().
-        	log().ifError().
-    		statusCode(415).
-    	given().
-    		header("Accept", "text/plain").
-    		param("query", "CONSTRUCT { <http://www.wikier.org/foaf#wikier2> ?p ?o } WHERE { <http://www.wikier.org/foaf#wikier> ?p ?o }").
-		when().
-    		get("/sparql/select");
+                log().ifError().
+                statusCode(415).
+            given().
+                header("Accept", "text/plain").
+                param("query", "CONSTRUCT { <http://www.wikier.org/foaf#wikier2> ?p ?o } WHERE { <http://www.wikier.org/foaf#wikier> ?p ?o }").
+            when().
+                get("/sparql/select");
     }
-    
+
     @Test
     public void testConstructContentNegotiationTurtle() throws IOException, InterruptedException {
         expect().
-        	log().ifError().
-    		statusCode(200).
-    		contentType("text/turtle").
-    	given().
-    		header("Accept", "text/turtle").
-    		param("query", "CONSTRUCT { <http://www.wikier.org/foaf#wikier2> ?p ?o } WHERE { <http://www.wikier.org/foaf#wikier> ?p ?o }").
-		when().
-    		get("/sparql/select");
+                log().ifError().
+                statusCode(200).
+                contentType("text/turtle").
+            given().
+                header("Accept", "text/turtle").
+                param("query", "CONSTRUCT { <http://www.wikier.org/foaf#wikier2> ?p ?o } WHERE { <http://www.wikier.org/foaf#wikier> ?p ?o }").
+            when().
+                get("/sparql/select");
     }
 
     @Test
     public void testDescribe() throws IOException, InterruptedException {
         expect().
-    	log().ifError().
-    		statusCode(200).
-    		contentType("application/rdf+xml").
-    	given().
-    		param("query", "DESCRIBE <http://www.wikier.org/foaf#wikier>").
-		when().
-    		get("/sparql/select");
+                log().ifError().
+                statusCode(200).
+                contentType("application/rdf+xml").
+            given().
+                param("query", "DESCRIBE <http://www.wikier.org/foaf#wikier>").
+            when().
+                get("/sparql/select");
     }
-    
+
     @Test
     public void testDescribeContentNegotiationXml() throws IOException, InterruptedException {
         expect().
-        	log().ifError().
-    		statusCode(200).
-    		contentType("application/rdf+xml").
-    	given().
-    		header("Accept", "application/xml").
-    		param("query", "DESCRIBE <http://www.wikier.org/foaf#wikier>").
-		when().
-    		get("/sparql/select");
+                log().ifError().
+                statusCode(200).
+                contentType("application/rdf+xml").
+            given().
+                header("Accept", "application/xml").
+                param("query", "DESCRIBE <http://www.wikier.org/foaf#wikier>").
+            when().
+                get("/sparql/select");
     }
-    
+
     @Test
     public void testDescribeContentNegotiationPlain() throws IOException, InterruptedException {
         expect().
-        	log().ifError().
-    		statusCode(415).
-    	given().
-    		header("Accept", "plain/text").
-    		param("query", "DESCRIBE <http://www.wikier.org/foaf#wikier>").
-		when().
-    		get("/sparql/select");
+                log().ifError().
+                statusCode(415).
+            given().
+                header("Accept", "plain/text").
+                param("query", "DESCRIBE <http://www.wikier.org/foaf#wikier>").
+            when().
+                get("/sparql/select");
     }
 
 }


[2/5] git commit: added missing favicons

Posted by wi...@apache.org.
added missing favicons


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

Branch: refs/heads/develop
Commit: 13745f42099f12439c14aa1d4925f973b3f6ecdc
Parents: f4f77bf
Author: Sergio Fernández <wi...@apache.org>
Authored: Thu Oct 16 13:35:09 2014 +0200
Committer: Sergio Fernández <wi...@apache.org>
Committed: Thu Oct 16 13:35:09 2014 +0200

----------------------------------------------------------------------
 platform/marmotta-core/src/main/resources/templates/404.ftl     | 1 +
 platform/marmotta-core/src/main/resources/templates/error.ftl   | 1 +
 platform/marmotta-core/src/main/resources/templates/rdfhtml.ftl | 1 +
 3 files changed, 3 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/marmotta/blob/13745f42/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 6cc4715..68cb658 100644
--- a/platform/marmotta-core/src/main/resources/templates/404.ftl
+++ b/platform/marmotta-core/src/main/resources/templates/404.ftl
@@ -29,6 +29,7 @@
     <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" />
+    <link href="${SERVER_URL}core/public/img/icon/marmotta.ico" rel="SHORTCUT ICON">
   </head>
 
   <body>

http://git-wip-us.apache.org/repos/asf/marmotta/blob/13745f42/platform/marmotta-core/src/main/resources/templates/error.ftl
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/resources/templates/error.ftl b/platform/marmotta-core/src/main/resources/templates/error.ftl
index 9e1f35d..a63227b 100644
--- a/platform/marmotta-core/src/main/resources/templates/error.ftl
+++ b/platform/marmotta-core/src/main/resources/templates/error.ftl
@@ -29,6 +29,7 @@
     <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}error.css" rel="stylesheet" type="text/css" />
+    <link href="${SERVER_URL}core/public/img/icon/marmotta.ico" rel="SHORTCUT ICON">
   </head>
 
   <body>

http://git-wip-us.apache.org/repos/asf/marmotta/blob/13745f42/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 45d8e5d..fd2d816 100644
--- a/platform/marmotta-core/src/main/resources/templates/rdfhtml.ftl
+++ b/platform/marmotta-core/src/main/resources/templates/rdfhtml.ftl
@@ -27,6 +27,7 @@
   <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" />
+  <link href="${SERVER_URL}core/public/img/icon/marmotta.ico" rel="SHORTCUT ICON">
   <#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" /> 


[5/5] git commit: MARMOTTA-553: cleanup

Posted by wi...@apache.org.
MARMOTTA-553: cleanup


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

Branch: refs/heads/develop
Commit: bac15e8caedaf07550457df337ee00e55ff15d4a
Parents: 63832d4
Author: Sergio Fernández <wi...@apache.org>
Authored: Thu Oct 16 14:17:01 2014 +0200
Committer: Sergio Fernández <wi...@apache.org>
Committed: Thu Oct 16 14:17:01 2014 +0200

----------------------------------------------------------------------
 .../platform/core/webservices/resource/MetaWebService.java       | 4 ----
 .../core/webservices/resource/ResourceWebServiceHelper.java      | 2 --
 2 files changed, 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/marmotta/blob/bac15e8c/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 ae3fb48..e599e9a 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
@@ -26,7 +26,6 @@ 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;
 import org.apache.marmotta.platform.core.api.io.MarmottaIOService;
-import org.apache.marmotta.platform.core.api.templating.TemplatingService;
 import org.apache.marmotta.platform.core.api.triplestore.ContextService;
 import org.apache.marmotta.platform.core.api.triplestore.SesameService;
 import org.apache.marmotta.platform.core.exception.HttpErrorException;
@@ -69,9 +68,6 @@ public class MetaWebService {
     private ConfigurationService configurationService;
 
     @Inject
-    private TemplatingService templatingService;
-
-    @Inject
     private ContextService contextService;
 
     @Inject

http://git-wip-us.apache.org/repos/asf/marmotta/blob/bac15e8c/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 55f54d8..5c57c59 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
@@ -39,8 +39,6 @@ import java.util.Map;
  */
 public class ResourceWebServiceHelper {
 
-    private static final String TEMPLATE_404 = "404.ftl";
-
     public static void addHeader(Response response, String name, String value) {
         response.getMetadata().add(name, value);
     }


[4/5] git commit: MARMOTTA-553: cosmetics

Posted by wi...@apache.org.
MARMOTTA-553: cosmetics


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

Branch: refs/heads/develop
Commit: 63832d43c828f64721ed5b32945727d18bdc5c7d
Parents: a8dc901
Author: Sergio Fernández <wi...@apache.org>
Authored: Thu Oct 16 14:16:27 2014 +0200
Committer: Sergio Fernández <wi...@apache.org>
Committed: Thu Oct 16 14:16:27 2014 +0200

----------------------------------------------------------------------
 .../src/main/resources/templates/rdfhtml.ftl        | 16 ++++++++--------
 .../main/resources/web/public/html/reasoning.html   |  4 ++--
 2 files changed, 10 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/marmotta/blob/63832d43/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 fd2d816..a60302e 100644
--- a/platform/marmotta-core/src/main/resources/templates/rdfhtml.ftl
+++ b/platform/marmotta-core/src/main/resources/templates/rdfhtml.ftl
@@ -230,11 +230,11 @@
             <#if resources?has_content>
                 <#list resources as resource>
                     <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 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">
@@ -259,7 +259,7 @@
                                 <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>
@@ -336,14 +336,14 @@
                 <!--
                 <div class="introspectionDetails">
                     <h4><a href="${resources[0].uri}" class="ldcache">${resources[0].uri}</a> as Context</h4>
-                	<table id="inspect_context">
+                    <table id="inspect_context">
                       <tr class="trClassHeader">
                         <th>Subject</th>
                         <th>Property</th>
                         <th>Object</th>
                         <th>Context<th>
                       </tr>
-                	</table>
+                    </table>
                 </div>
                 -->
             </div>

http://git-wip-us.apache.org/repos/asf/marmotta/blob/63832d43/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 75597af..dcfc077 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
@@ -53,7 +53,7 @@
             $("#content").append();
             $("#content").append("<br>has been inferred because of<br>");
             for(var i=0; i<data.justifications.length;i++) {
-                var box = $("<div style='border:1px solid black;'/>");
+                var box = $("<div style='font-family:monospace; border:1px solid black;'/>");
                 box.append("Triples<br>");
                 box.append(triplesToTable(data.justifications[i].triples));
                 box.append("<br>and Rules<br>");
@@ -103,7 +103,7 @@
 </head>
 <body>
     <div id="tooltip">
-        <h2 style="color:#006D8F;margin:0;">Reasoning-Maintenance</h2>
+        <h2 style="color:#0B61A4;margin:0;">Reasoning-Maintenance</h2>
         <div id="content"></div>
     </div>
 </body>


[3/5] git commit: MARMOTTA-553: recovered reasoner justifications

Posted by wi...@apache.org.
MARMOTTA-553: recovered reasoner justifications


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

Branch: refs/heads/develop
Commit: a8dc9014d44922c46e5b03cb036ccdd79e8c0d26
Parents: 13745f4
Author: Sergio Fernández <wi...@apache.org>
Authored: Thu Oct 16 14:16:01 2014 +0200
Committer: Sergio Fernández <wi...@apache.org>
Committed: Thu Oct 16 14:16:01 2014 +0200

----------------------------------------------------------------------
 .../platform/core/rio/RDFHtmlWriterImpl.java    | 28 +++++++++-----------
 1 file changed, 12 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/marmotta/blob/a8dc9014/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 4d73a9c..bf7a5dc 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
@@ -47,8 +47,6 @@ import java.util.*;
  */
 public class RDFHtmlWriterImpl implements RDFHtmlWriter {
 
-    protected final String TEMPLATE = "rdfhtml.ftl";
-
     protected ConfigurationService configurationService;
 
     protected PrefixService prefixService;
@@ -148,7 +146,6 @@ public class RDFHtmlWriterImpl implements RDFHtmlWriter {
                 String predicateCurie = prefixService.getCurie(predicateUri);
                 predicate.put("curie", StringUtils.isNotBlank(predicateCurie) ? predicateCurie : predicateUri);
                 triple.put("predicate", predicate);
-                predicate = null;
 
                 //object
                 Map<String, String> object = new HashMap<String, String>();
@@ -162,7 +159,7 @@ public class RDFHtmlWriterImpl implements RDFHtmlWriter {
                 } else if (value instanceof BNode) { //blank node
                     object.put("genid", objectValue);
                     try {
-                    	object.put("encoded_genid", URLEncoder.encode(objectValue, "UTF-8"));
+                        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);
@@ -190,7 +187,6 @@ public class RDFHtmlWriterImpl implements RDFHtmlWriter {
                     object.put("value", objectValue);
                 }
                 triple.put("object", object);
-                object = null;
 
                 if(t.getContext() != null) {
                     Map<String, String> context = new HashMap<String, String>();
@@ -199,15 +195,15 @@ public class RDFHtmlWriterImpl implements RDFHtmlWriter {
                     String contextCurie = prefixService.getCurie(contextUri);
                     context.put("curie", StringUtils.isNotBlank(contextCurie) ? contextCurie : contextUri);
                     triple.put("context", context);
-                    context = null;
                 } else {
                     triple.put("context", ImmutableMap.of("uri","","curie",""));
                 }
 
+                //write reasoner justifications
                 if (ResourceUtils.isInferred(t)) {
-                    triple.put("info", ResourceUtils.getId(t));
+                    triple.put("info", createInfo(ResourceUtils.getId(t)));
                 } else {
-                    triple.put("info", "-");
+                    triple.put("info", "");
                 }
 
                 triples.add(triple);
@@ -222,12 +218,12 @@ public class RDFHtmlWriterImpl implements RDFHtmlWriter {
             data.put("resources", resources);
             data.put("prefixMappings", prefixService.serializePrefixMapping());
 
-            //set timemap link
+            //set timestamp link
             if(configurationService.getBooleanConfiguration("versioning.enabled")) {
                 data.put("timemaplink", configurationService.getStringConfiguration("versioning.memento.timemap"));
             }
 
-            templatingService.process(TEMPLATE, data, writer);
+            templatingService.process(TemplatingService.RDF_HTML_TPL, data, writer);
         } catch (Exception e) {
             log.error(e.getMessage(), e);
             throw new RDFHandlerException(e);
@@ -329,8 +325,8 @@ public class RDFHtmlWriterImpl implements RDFHtmlWriter {
      *         RDFWriter.
      * @since 2.7.0
      */
-	@Override
-	public Collection<RioSetting<?>> getSupportedSettings() {
+    @Override
+    public Collection<RioSetting<?>> getSupportedSettings() {
 		return new ArrayList<RioSetting<?>>();
 	}
 
@@ -341,8 +337,8 @@ public class RDFHtmlWriterImpl implements RDFHtmlWriter {
      *         configuration of the writer.
      * @since 2.7.0
      */
-	@Override
-	public WriterConfig getWriterConfig() {
+    @Override
+    public WriterConfig getWriterConfig() {
 		return config;
 	}
 
@@ -353,8 +349,8 @@ public class RDFHtmlWriterImpl implements RDFHtmlWriter {
      *        a writer configuration object.
      * @since 2.7.0
      */
-	@Override
-	public void setWriterConfig(WriterConfig config) {
+    @Override
+    public void setWriterConfig(WriterConfig config) {
 		this.config = config;
 	}