marmotta-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wik...@apache.org
Subject marmotta git commit: some code cleanup
Date Mon, 12 Oct 2015 09:59:06 GMT
Repository: marmotta
Updated Branches:
  refs/heads/develop 9ac05e72b -> 8e97ffc51


some code cleanup


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

Branch: refs/heads/develop
Commit: 8e97ffc51b05c7d1d92a94684308099ab9794ece
Parents: 9ac05e7
Author: Sergio Fernández <wikier@apache.org>
Authored: Mon Oct 12 11:58:47 2015 +0200
Committer: Sergio Fernández <wikier@apache.org>
Committed: Mon Oct 12 11:58:47 2015 +0200

----------------------------------------------------------------------
 .../reasoner/model/program/Justification.java    |  3 ++-
 .../test/engine/JustificationResolutionTest.java | 19 +++++--------------
 2 files changed, 7 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/marmotta/blob/8e97ffc5/libraries/kiwi/kiwi-reasoner/src/main/java/org/apache/marmotta/kiwi/reasoner/model/program/Justification.java
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-reasoner/src/main/java/org/apache/marmotta/kiwi/reasoner/model/program/Justification.java
b/libraries/kiwi/kiwi-reasoner/src/main/java/org/apache/marmotta/kiwi/reasoner/model/program/Justification.java
index 56d982b..ec8f947 100644
--- a/libraries/kiwi/kiwi-reasoner/src/main/java/org/apache/marmotta/kiwi/reasoner/model/program/Justification.java
+++ b/libraries/kiwi/kiwi-reasoner/src/main/java/org/apache/marmotta/kiwi/reasoner/model/program/Justification.java
@@ -71,7 +71,7 @@ public class Justification  {
 
     public Justification() {
         supportingTriples = StatementCommons.newQuadrupleSet();
-        supportingRules   = new HashSet<Rule>();
+        supportingRules   = new HashSet<>();
     }
 
     public long getId() {
@@ -146,4 +146,5 @@ public class Justification  {
                 ", supportingRules=" + supportingRules +
                 '}';
     }
+
 }

http://git-wip-us.apache.org/repos/asf/marmotta/blob/8e97ffc5/libraries/kiwi/kiwi-reasoner/src/test/java/org/apache/marmotta/kiwi/reasoner/test/engine/JustificationResolutionTest.java
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-reasoner/src/test/java/org/apache/marmotta/kiwi/reasoner/test/engine/JustificationResolutionTest.java
b/libraries/kiwi/kiwi-reasoner/src/test/java/org/apache/marmotta/kiwi/reasoner/test/engine/JustificationResolutionTest.java
index 3f1aa48..8229e68 100644
--- a/libraries/kiwi/kiwi-reasoner/src/test/java/org/apache/marmotta/kiwi/reasoner/test/engine/JustificationResolutionTest.java
+++ b/libraries/kiwi/kiwi-reasoner/src/test/java/org/apache/marmotta/kiwi/reasoner/test/engine/JustificationResolutionTest.java
@@ -51,10 +51,8 @@ public class JustificationResolutionTest {
 
     private Map<Statement,Set<Justification>> baseJustifications;
 
-
     protected static Random rnd = new Random();
 
-
     private KiWiTriple t1, t2, t3, t4, t5; // base
     private KiWiTriple i1, i2, i3, i4, i5, i6; // inferred
     private Justification j1, j2, j3, j4, j5, tj1, tj2, tj3;
@@ -68,7 +66,6 @@ public class JustificationResolutionTest {
 
         baseJustifications = StatementCommons.newQuadrupleMap();
 
-
         KiWiUriResource s1 = randomURI();
         KiWiUriResource s2 = randomURI();
         KiWiUriResource s3 = randomURI();
@@ -88,7 +85,6 @@ public class JustificationResolutionTest {
         t4 = new KiWiTriple(s1,p1,o1, randomURI());
         t5 = new KiWiTriple(s3,p1,o1, randomURI());
 
-
         i1 = new KiWiTriple(s1,p2,o1, ctx_inferred); i1.setInferred(true);
         i2 = new KiWiTriple(s1,p1,o2, ctx_inferred); i2.setInferred(true);
         i3 = new KiWiTriple(s3,p1,o3, ctx_inferred); i3.setInferred(true);
@@ -144,8 +140,7 @@ public class JustificationResolutionTest {
         tj2.setTriple(i4);
         tj2.getSupportingTriples().add(i1);
         tj2.getSupportingTriples().add(i2);
-
-
+        
         // i6 is justified by i2 and i5 (so multiplexing needed)
         tj3 = new Justification();
         tj3.setTriple(i6);
@@ -172,9 +167,6 @@ public class JustificationResolutionTest {
         Assert.assertTrue(tj1r.getSupportingTriples().contains(t1));
         Assert.assertTrue(tj1r.getSupportingTriples().contains(t2));
         Assert.assertTrue(tj1r.getSupportingTriples().contains(t3));
-
-
-
     }
 
     /**
@@ -228,7 +220,6 @@ public class JustificationResolutionTest {
         Assert.assertThat(r4,Matchers.<Justification>hasItem(hasProperty("supportingTriples",
allOf(hasItems(t2, t4, t5), not(hasItem(t3))))));
     }
 
-
     // TODO: a test taking into account transaction justifications
 
     /**
@@ -240,7 +231,6 @@ public class JustificationResolutionTest {
 
     }
 
-
     /**
      * Return a random URI, with a 10% chance of returning a URI that has already been used.
      * @return
@@ -276,12 +266,11 @@ public class JustificationResolutionTest {
         return object;
     }
 
-
-
     private class MockReasoningEngine extends ReasoningEngine {
+
         private MockReasoningEngine() {
-        }
 
+        }
 
         /**
          * Return the justifications for the triple passed as argument.
@@ -312,5 +301,7 @@ public class JustificationResolutionTest {
         public Set<Justification> getBaseJustifications(KiWiReasoningConnection connection,
Set<Justification> justifications) throws SQLException, ReasoningException {
             return super.getBaseJustifications(connection, justifications);
         }
+
     }
+
 }


Mime
View raw message