You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stanbol.apache.org by an...@apache.org on 2011/03/04 17:29:24 UTC
svn commit: r1078042 -
/incubator/stanbol/trunk/kres/eu.iksproject.kres.semion.refactorer/src/main/java/eu/iksproject/kres/semion/refactorer/SemionRefactorerImpl.java
Author: anuzzolese
Date: Fri Mar 4 16:29:24 2011
New Revision: 1078042
URL: http://svn.apache.org/viewvc?rev=1078042&view=rev
Log:
STANBOL-111 Modified the behavior of the Semion refactorer for forward chaining rules.
Modified:
incubator/stanbol/trunk/kres/eu.iksproject.kres.semion.refactorer/src/main/java/eu/iksproject/kres/semion/refactorer/SemionRefactorerImpl.java
Modified: incubator/stanbol/trunk/kres/eu.iksproject.kres.semion.refactorer/src/main/java/eu/iksproject/kres/semion/refactorer/SemionRefactorerImpl.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/kres/eu.iksproject.kres.semion.refactorer/src/main/java/eu/iksproject/kres/semion/refactorer/SemionRefactorerImpl.java?rev=1078042&r1=1078041&r2=1078042&view=diff
==============================================================================
--- incubator/stanbol/trunk/kres/eu.iksproject.kres.semion.refactorer/src/main/java/eu/iksproject/kres/semion/refactorer/SemionRefactorerImpl.java (original)
+++ incubator/stanbol/trunk/kres/eu.iksproject.kres.semion.refactorer/src/main/java/eu/iksproject/kres/semion/refactorer/SemionRefactorerImpl.java Fri Mar 4 16:29:24 2011
@@ -723,7 +723,9 @@ public class SemionRefactorerImpl implem
constructedGraph = kReSCoreOperation(sparql, mGraph);
break;
case ForwardChaining:
- constructedGraph = forwardChainingOperation(sparql, mGraph);
+ ForwardChainingRefactoringGraph forwardChainingRefactoringGraph = forwardChainingOperation(sparql, mGraph);
+ constructedGraph = forwardChainingRefactoringGraph.getOutputGraph();
+ mGraph = forwardChainingRefactoringGraph.getInputGraph();
break;
case Reflexive:
constructedGraph = kReSCoreOperation(sparql, unionMGraph);
@@ -800,13 +802,13 @@ public class SemionRefactorerImpl implem
}
- private Graph forwardChainingOperation(String query, MGraph mGraph){
+ private ForwardChainingRefactoringGraph forwardChainingOperation(String query, MGraph mGraph){
Graph graph = kReSCoreOperation(query, mGraph);
mGraph.addAll(graph);
- return graph;
+ return new ForwardChainingRefactoringGraph(mGraph, graph);
}
private Graph sparqlUpdateOperation(String query, MGraph mGraph){
@@ -816,3 +818,26 @@ public class SemionRefactorerImpl implem
}
}
+
+class ForwardChainingRefactoringGraph {
+
+ private MGraph inputGraph;
+ private Graph outputGraph;
+
+ public ForwardChainingRefactoringGraph(MGraph inputGraph, Graph outputGraph) {
+ this.inputGraph = inputGraph;
+ this.outputGraph = outputGraph;
+ }
+
+
+ public MGraph getInputGraph() {
+ return inputGraph;
+ }
+
+ public Graph getOutputGraph() {
+ return outputGraph;
+ }
+
+
+
+}