You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stanbol.apache.org by co...@apache.org on 2011/03/25 15:26:08 UTC
svn commit: r1085395 [2/2] - in /incubator/stanbol/trunk/kres/rules/manager:
./ src/main/java/org/apache/stanbol/rules/manager/
src/main/java/org/apache/stanbol/rules/manager/atoms/
src/main/java/org/apache/stanbol/rules/manager/changes/ src/main/java/...
Copied: incubator/stanbol/trunk/kres/rules/manager/src/main/java/org/apache/stanbol/rules/manager/changes/RuleStoreImpl.java (from r1085259, incubator/stanbol/trunk/kres/rules/manager/src/main/java/org/apache/stanbol/rules/manager/changes/KReSRuleStore.java)
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/kres/rules/manager/src/main/java/org/apache/stanbol/rules/manager/changes/RuleStoreImpl.java?p2=incubator/stanbol/trunk/kres/rules/manager/src/main/java/org/apache/stanbol/rules/manager/changes/RuleStoreImpl.java&p1=incubator/stanbol/trunk/kres/rules/manager/src/main/java/org/apache/stanbol/rules/manager/changes/KReSRuleStore.java&r1=1085259&r2=1085395&rev=1085395&view=diff
==============================================================================
--- incubator/stanbol/trunk/kres/rules/manager/src/main/java/org/apache/stanbol/rules/manager/changes/KReSRuleStore.java (original)
+++ incubator/stanbol/trunk/kres/rules/manager/src/main/java/org/apache/stanbol/rules/manager/changes/RuleStoreImpl.java Fri Mar 25 14:26:06 2011
@@ -25,15 +25,15 @@ import org.apache.felix.scr.annotations.
import org.apache.felix.scr.annotations.Property;
import org.apache.felix.scr.annotations.Reference;
import org.apache.felix.scr.annotations.Service;
-import org.apache.stanbol.ontologymanager.ontonet.api.KReSONManager;
-import org.apache.stanbol.rules.base.api.KReSRule;
+import org.apache.stanbol.ontologymanager.ontonet.api.ONManager;
+import org.apache.stanbol.rules.base.api.Rule;
import org.apache.stanbol.rules.base.api.NoSuchRecipeException;
import org.apache.stanbol.rules.base.api.Recipe;
import org.apache.stanbol.rules.base.api.RuleStore;
-import org.apache.stanbol.rules.base.api.util.KReSRuleList;
+import org.apache.stanbol.rules.base.api.util.RuleList;
import org.apache.stanbol.rules.base.api.util.RecipeList;
-import org.apache.stanbol.rules.manager.KReSKB;
-import org.apache.stanbol.rules.manager.parse.KReSRuleParser;
+import org.apache.stanbol.rules.manager.KB;
+import org.apache.stanbol.rules.manager.parse.RuleParserImpl;
import org.osgi.service.component.ComponentContext;
import org.semanticweb.owlapi.apibinding.OWLManager;
import org.semanticweb.owlapi.model.IRI;
@@ -65,10 +65,10 @@ import org.slf4j.LoggerFactory;
@Component(immediate = true, metatype = true)
@Service(RuleStore.class)
-public class KReSRuleStore implements RuleStore {
+public class RuleStoreImpl implements RuleStore {
@Reference
- KReSONManager onManager;
+ ONManager onManager;
@Property(value = "")
public static final String RULE_ONTOLOGY = "rule.ontology";
@@ -84,27 +84,27 @@ public class KReSRuleStore implements Ru
private File owlfile;
private String ruleOntologyNS;
- private KReSRuleParser kReSRuleParser;
+ private RuleParserImpl kReSRuleParser;
/**
- * This construct returns KReSRuleStore object with inside an ontology where to store the rules.
+ * This construct returns RuleStoreImpl object with inside an ontology where to store the rules.
*
* This default constructor is <b>only</b> intended to be used by the OSGI environment with Service
* Component Runtime support.
* <p>
- * DO NOT USE to manually create instances - the KReSRuleStore instances do need to be configured! YOU
- * NEED TO USE {@link #KReSRuleStore(KReSONManager, Dictionary)} or its overloads, to parse the
+ * DO NOT USE to manually create instances - the RuleStoreImpl instances do need to be configured! YOU
+ * NEED TO USE {@link #RuleStoreImpl(ONManager, Dictionary)} or its overloads, to parse the
* configuration and then initialise the rule store if running outside a OSGI environment.
*/
- public KReSRuleStore() {
+ public RuleStoreImpl() {
/*
* The constructor should be empty as some issue derives from a filled one. The old version can be invoked
- * with KReSRuleStore(null)
+ * with RuleStoreImpl(null)
*/
}
- public KReSRuleStore(KReSONManager onm, Dictionary<String,Object> configuration) {
+ public RuleStoreImpl(ONManager onm, Dictionary<String,Object> configuration) {
this();
this.onManager = onm;
activate(configuration);
@@ -116,7 +116,7 @@ public class KReSRuleStore implements Ru
* @param filepath
* {Ontology file path previously stored.}
*/
- public KReSRuleStore(KReSONManager onm, Dictionary<String,Object> configuration, String filepath) {
+ public RuleStoreImpl(ONManager onm, Dictionary<String,Object> configuration, String filepath) {
/*
* FIXME : This won't work if the activate() method is called at the end of the constructor, like it
* is for other components. Constructors should not override activate().
@@ -177,7 +177,7 @@ public class KReSRuleStore implements Ru
* @param owl
* {OWLOntology object contains rules and recipe}
*/
- public KReSRuleStore(KReSONManager onm, Dictionary<String,Object> configuration, OWLOntology owl) {
+ public RuleStoreImpl(ONManager onm, Dictionary<String,Object> configuration, OWLOntology owl) {
/*
* FIXME : This won't work if the activate() method is called at the end of the constructor, like it
* is for other components. Constructors should not override activate().
@@ -224,7 +224,7 @@ public class KReSRuleStore implements Ru
@SuppressWarnings("unchecked")
@Activate
protected void activate(ComponentContext context) throws IOException {
- log.info("in " + KReSRuleStore.class + " activate with context " + context);
+ log.info("in " + RuleStoreImpl.class + " activate with context " + context);
if (context == null) {
throw new IllegalStateException("No valid" + ComponentContext.class + " parsed in activate!");
}
@@ -284,7 +284,7 @@ public class KReSRuleStore implements Ru
@Deactivate
protected void deactivate(ComponentContext context) {
- log.info("in " + KReSRuleStore.class + " deactivate with context " + context);
+ log.info("in " + RuleStoreImpl.class + " deactivate with context " + context);
}
@Override
@@ -351,7 +351,7 @@ public class KReSRuleStore implements Ru
log.debug("The recipe " + recipeIRI.toString() + " has " + rules.size() + " rules.");
/**
- * Fetch the rule content expressed as a literal in KReSRule Syntax.
+ * Fetch the rule content expressed as a literal in Rule Syntax.
*/
boolean firstLoop = true;
OWLDataProperty hasBodyAndHead = factory.getOWLDataProperty(IRI.create(ruleNS
@@ -381,7 +381,7 @@ public class KReSRuleStore implements Ru
*/
log.debug("Recipe in KReS Syntax : " + kReSRulesInKReSSyntax);
- KReSRuleList ruleList = null;
+ RuleList ruleList = null;
if (!kReSRulesInKReSSyntax.isEmpty()) {
ruleList = generateKnowledgeBase(kReSRulesInKReSSyntax);
@@ -469,7 +469,7 @@ public class KReSRuleStore implements Ru
}
/*
- * Moved form KReSAddRecipe class. The KReSAddRecipe should not be used anymore.
+ * Moved form AddRecipe class. The AddRecipe should not be used anymore.
*/
@Override
public boolean addRecipe(IRI recipeIRI, String recipeDescription) {
@@ -524,7 +524,7 @@ public class KReSRuleStore implements Ru
* @param recipeIRI
* the IRI of the recipe
* @param kReSRule
- * the rule in KReSRule syntax
+ * the rule in Rule syntax
*/
@Override
public Recipe addRuleToRecipe(String recipeID, String kReSRuleInKReSSyntax) throws NoSuchRecipeException {
@@ -539,7 +539,7 @@ public class KReSRuleStore implements Ru
* @param recipe
* the recipe
* @param kReSRule
- * the rule in KReSRule syntax
+ * the rule in Rule syntax
*
* @return the recipe we the new rule.
*/
@@ -554,7 +554,7 @@ public class KReSRuleStore implements Ru
/**
* Add the rule to the recipe in the rule ontology managed by the RuleStore. First we define the
- * object property hasRule and then we add the literal that contains the rule in KReSRule Syntax to
+ * object property hasRule and then we add the literal that contains the rule in Rule Syntax to
* the recipe individual.
*/
String ruleNS = "http://kres.iks-project.eu/ontology/meta/rmi.owl#";
@@ -573,9 +573,9 @@ public class KReSRuleStore implements Ru
/**
* Finally also the in-memory representation of the Recipe passed as input is modified.
*/
- KReSKB kReSKB = KReSRuleParser.parse(kReSRuleInKReSSyntax);
- KReSRuleList ruleList = kReSKB.getkReSRuleList();
- for (KReSRule rule : ruleList) {
+ KB kReSKB = RuleParserImpl.parse(kReSRuleInKReSSyntax);
+ RuleList ruleList = kReSKB.getkReSRuleList();
+ for (Rule rule : ruleList) {
/**
* The rule must be added to the ontology, so 1. an IRI is created from its name 2. the KReS
@@ -596,7 +596,7 @@ public class KReSRuleStore implements Ru
manager.addAxiom(owlmodel, hasRuleAxiom);
/**
- * The KReSRule is added to the Recipe in-memory object.
+ * The Rule is added to the Recipe in-memory object.
*/
recipe.addKReSRule(rule);
}
@@ -607,14 +607,14 @@ public class KReSRuleStore implements Ru
@Override
public void createRecipe(String recipeID, String rulesInKReSSyntax) {
log.debug("Create recipe " + recipeID + " with rules in kres sytnax " + rulesInKReSSyntax, this);
- KReSKB kb = KReSRuleParser.parse(rulesInKReSSyntax);
- KReSRuleList rules = kb.getkReSRuleList();
+ KB kb = RuleParserImpl.parse(rulesInKReSSyntax);
+ RuleList rules = kb.getkReSRuleList();
- KReSAddRule addRule = new KReSAddRule(this);
+ AddRule addRule = new AddRule(this);
Vector<IRI> ruleVectorIRIs = new Vector<IRI>();
log.debug("Rules are " + rules.size());
- for (KReSRule rule : rules) {
+ for (Rule rule : rules) {
log.debug("Creating rule " + rule.getRuleName());
String kReSSyntax = rule.toKReSSyntax();
@@ -625,14 +625,14 @@ public class KReSRuleStore implements Ru
if (ruleVectorIRIs.size() > 0) {
log.debug("Adding rules: " + ruleVectorIRIs.size());
- KReSAddRecipe addRecipe = new KReSAddRecipe(this);
+ AddRecipe addRecipe = new AddRecipe(this);
addRecipe.addRecipe(IRI.create(recipeID), ruleVectorIRIs, null);
}
}
- private KReSRuleList generateKnowledgeBase(String kReSRulesInKReSSyntax) {
- KReSKB kb = KReSRuleParser.parse(kReSRulesInKReSSyntax);
+ private RuleList generateKnowledgeBase(String kReSRulesInKReSSyntax) {
+ KB kb = RuleParserImpl.parse(kReSRulesInKReSSyntax);
return kb.getkReSRuleList();
}
@@ -672,7 +672,7 @@ public class KReSRuleStore implements Ru
}
@Override
- public boolean removeRule(KReSRule rule) {
+ public boolean removeRule(Rule rule) {
OWLOntologyManager mng = owlmodel.getOWLOntologyManager();
OWLDataFactory factory = mng.getOWLDataFactory();
Copied: incubator/stanbol/trunk/kres/rules/manager/src/main/java/org/apache/stanbol/rules/manager/parse/RuleParserConstants.java (from r1085259, incubator/stanbol/trunk/kres/rules/manager/src/main/java/org/apache/stanbol/rules/manager/parse/KReSRuleParserConstants.java)
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/kres/rules/manager/src/main/java/org/apache/stanbol/rules/manager/parse/RuleParserConstants.java?p2=incubator/stanbol/trunk/kres/rules/manager/src/main/java/org/apache/stanbol/rules/manager/parse/RuleParserConstants.java&p1=incubator/stanbol/trunk/kres/rules/manager/src/main/java/org/apache/stanbol/rules/manager/parse/KReSRuleParserConstants.java&r1=1085259&r2=1085395&rev=1085395&view=diff
==============================================================================
--- incubator/stanbol/trunk/kres/rules/manager/src/main/java/org/apache/stanbol/rules/manager/parse/KReSRuleParserConstants.java (original)
+++ incubator/stanbol/trunk/kres/rules/manager/src/main/java/org/apache/stanbol/rules/manager/parse/RuleParserConstants.java Fri Mar 25 14:26:06 2011
@@ -1,4 +1,4 @@
-/* Generated By:JavaCC: Do not edit this line. KReSRuleParserConstants.java */
+/* Generated By:JavaCC: Do not edit this line. RuleParserConstants.java */
package org.apache.stanbol.rules.manager.parse;
@@ -6,7 +6,7 @@ package org.apache.stanbol.rules.manager
* Token literal values and constants.
* Generated by org.javacc.parser.OtherFilesGen#start()
*/
-public interface KReSRuleParserConstants {
+public interface RuleParserConstants {
/** End of File. */
int EOF = 0;
Copied: incubator/stanbol/trunk/kres/rules/manager/src/main/java/org/apache/stanbol/rules/manager/parse/RuleParserImpl.java (from r1085259, incubator/stanbol/trunk/kres/rules/manager/src/main/java/org/apache/stanbol/rules/manager/parse/KReSRuleParser.java)
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/kres/rules/manager/src/main/java/org/apache/stanbol/rules/manager/parse/RuleParserImpl.java?p2=incubator/stanbol/trunk/kres/rules/manager/src/main/java/org/apache/stanbol/rules/manager/parse/RuleParserImpl.java&p1=incubator/stanbol/trunk/kres/rules/manager/src/main/java/org/apache/stanbol/rules/manager/parse/KReSRuleParser.java&r1=1085259&r2=1085395&rev=1085395&view=diff
==============================================================================
--- incubator/stanbol/trunk/kres/rules/manager/src/main/java/org/apache/stanbol/rules/manager/parse/KReSRuleParser.java (original)
+++ incubator/stanbol/trunk/kres/rules/manager/src/main/java/org/apache/stanbol/rules/manager/parse/RuleParserImpl.java Fri Mar 25 14:26:06 2011
@@ -1,4 +1,4 @@
-/* Generated By:JavaCC: Do not edit this line. KReSRuleParser.java */
+/* Generated By:JavaCC: Do not edit this line. RuleParserImpl.java */
package org.apache.stanbol.rules.manager.parse;
import java.io.Reader;
@@ -7,13 +7,13 @@ import java.net.URI;
import java.net.URISyntaxException;
import java.util.Iterator;
-import org.apache.stanbol.rules.base.api.KReSRule;
-import org.apache.stanbol.rules.base.api.KReSRuleAtom;
-import org.apache.stanbol.rules.base.api.KReSRuleExpressiveness;
+import org.apache.stanbol.rules.base.api.Rule;
+import org.apache.stanbol.rules.base.api.RuleAtom;
+import org.apache.stanbol.rules.base.api.RuleExpressiveness;
import org.apache.stanbol.rules.base.api.URIResource;
import org.apache.stanbol.rules.base.api.util.AtomList;
-import org.apache.stanbol.rules.manager.KReSKB;
-import org.apache.stanbol.rules.manager.KReSRuleImpl;
+import org.apache.stanbol.rules.manager.KB;
+import org.apache.stanbol.rules.manager.RuleImpl;
import org.apache.stanbol.rules.manager.atoms.ClassAtom;
import org.apache.stanbol.rules.manager.atoms.ComparisonAtom;
import org.apache.stanbol.rules.manager.atoms.ConcatAtom;
@@ -24,10 +24,10 @@ import org.apache.stanbol.rules.manager.
import org.apache.stanbol.rules.manager.atoms.GreaterThanAtom;
import org.apache.stanbol.rules.manager.atoms.IndividualPropertyAtom;
import org.apache.stanbol.rules.manager.atoms.IsBlankAtom;
-import org.apache.stanbol.rules.manager.atoms.KReSBlankNode;
-import org.apache.stanbol.rules.manager.atoms.KReSResource;
-import org.apache.stanbol.rules.manager.atoms.KReSTypedLiteral;
-import org.apache.stanbol.rules.manager.atoms.KReSVariable;
+import org.apache.stanbol.rules.manager.atoms.RuleBlankNode;
+import org.apache.stanbol.rules.manager.atoms.ResourceAtom;
+import org.apache.stanbol.rules.manager.atoms.TypedLiteralAtom;
+import org.apache.stanbol.rules.manager.atoms.VariableAtom;
import org.apache.stanbol.rules.manager.atoms.LengthAtom;
import org.apache.stanbol.rules.manager.atoms.LessThanAtom;
import org.apache.stanbol.rules.manager.atoms.LetAtom;
@@ -59,15 +59,15 @@ import com.hp.hpl.jena.rdf.model.Resourc
-public class KReSRuleParser implements KReSRuleParserConstants {
+public class RuleParserImpl implements RuleParserConstants {
- static KReSKB kReSKB;
+ static KB kReSKB;
- public static KReSKB parse( String inString ) {
+ public static KB parse( String inString ) {
{
- kReSKB = new KReSKB();
+ kReSKB = new KB();
Reader reader = new StringReader( inString ) ;
- KReSRuleParser parser = new KReSRuleParser(reader);
+ RuleParserImpl parser = new RuleParserImpl(reader);
StringBuffer buffer = new StringBuffer() ;
try {
parser.start( ) ;
@@ -137,7 +137,7 @@ public class KReSRuleParser implements K
}
final public void expression() throws ParseException {
- KReSRule kReSRule;
+ Rule kReSRule;
prefix();
expressionCont();
}
@@ -163,25 +163,25 @@ public class KReSRuleParser implements K
if(atoms.length == 1){
AtomList body = atoms[0];
if(body.size() == 1){
- Iterator<KReSRuleAtom> it = body.iterator();
- KReSRuleAtom atom = it.next();
+ Iterator<RuleAtom> it = body.iterator();
+ RuleAtom atom = it.next();
if(atom.isSPARQLConstruct()){
- KReSRule kReSRule = new KReSRuleImpl(varPrefix+nsPrefix, atoms[0], null, KReSRuleExpressiveness.SPARQLConstruct);
+ Rule kReSRule = new RuleImpl(varPrefix+nsPrefix, atoms[0], null, RuleExpressiveness.SPARQLConstruct);
kReSKB.addRule(kReSRule);
}
else if(atom.isSPARQLDelete()){
- KReSRule kReSRule = new KReSRuleImpl(varPrefix+nsPrefix, atoms[0], null, KReSRuleExpressiveness.SPARQLDelete);
+ Rule kReSRule = new RuleImpl(varPrefix+nsPrefix, atoms[0], null, RuleExpressiveness.SPARQLDelete);
kReSKB.addRule(kReSRule);
}
else if(atom.isSPARQLDeleteData()){
- KReSRule kReSRule = new KReSRuleImpl(varPrefix+nsPrefix, atoms[0], null, KReSRuleExpressiveness.SPARQLDeleteData);
+ Rule kReSRule = new RuleImpl(varPrefix+nsPrefix, atoms[0], null, RuleExpressiveness.SPARQLDeleteData);
kReSKB.addRule(kReSRule);
}
}
}
else{
- KReSRule kReSRule = new KReSRuleImpl(varPrefix+nsPrefix, atoms[0], atoms[1], KReSRuleExpressiveness.KReSCore);
+ Rule kReSRule = new RuleImpl(varPrefix+nsPrefix, atoms[0], atoms[1], RuleExpressiveness.KReSCore);
kReSKB.addRule(kReSRule);
}
break;
@@ -198,7 +198,7 @@ public class KReSRuleParser implements K
AtomList[] atoms = (AtomList[]) obj;
String varPrefix = kReSKB.getPrefixURI("var");
varPrefix = varPrefix.substring(0, varPrefix.length());
- KReSRule kReSRule = new KReSRuleImpl(varPrefix+nsPrefix, atoms[0], atoms[1], KReSRuleExpressiveness.ForwardChaining);
+ Rule kReSRule = new RuleImpl(varPrefix+nsPrefix, atoms[0], atoms[1], RuleExpressiveness.ForwardChaining);
kReSKB.addRule(kReSRule);
break;
case REFLEXIVE:
@@ -208,7 +208,7 @@ public class KReSRuleParser implements K
AtomList[] kReSAtoms = (AtomList[]) obj;
String pref = kReSKB.getPrefixURI("var");
pref = pref.substring(0, pref.length());
- KReSRule rule = new KReSRuleImpl(pref+nsPrefix, kReSAtoms[0], kReSAtoms[1], KReSRuleExpressiveness.Reflexive);
+ Rule rule = new RuleImpl(pref+nsPrefix, kReSAtoms[0], kReSAtoms[1], RuleExpressiveness.Reflexive);
kReSKB.addRule(rule);
break;
default:
@@ -263,7 +263,7 @@ public class KReSRuleParser implements K
jj_consume_token(LPAR);
t = jj_consume_token(SPARQL_STRING);
jj_consume_token(RPAR);
- KReSRuleAtom sparqlAtom = new SPARQLcAtom(t.image);
+ RuleAtom sparqlAtom = new SPARQLcAtom(t.image);
AtomList atomList = new AtomList();
atomList.addToHead(sparqlAtom);
{if (true) return new AtomList[]{atomList};}
@@ -273,7 +273,7 @@ public class KReSRuleParser implements K
jj_consume_token(LPAR);
t = jj_consume_token(SPARQL_STRING);
jj_consume_token(RPAR);
- KReSRuleAtom sparqlDAtom = new SPARQLdAtom(t.image);
+ RuleAtom sparqlDAtom = new SPARQLdAtom(t.image);
AtomList atomDList = new AtomList();
atomDList.addToHead(sparqlDAtom);
{if (true) return new AtomList[]{atomDList};}
@@ -283,7 +283,7 @@ public class KReSRuleParser implements K
jj_consume_token(LPAR);
t = jj_consume_token(SPARQL_STRING);
jj_consume_token(RPAR);
- KReSRuleAtom sparqlDDAtom = new SPARQLddAtom(t.image);
+ RuleAtom sparqlDDAtom = new SPARQLddAtom(t.image);
AtomList atomDDList = new AtomList();
atomDDList.addToHead(sparqlDDAtom);
{if (true) return new AtomList[]{atomDDList};}
@@ -297,7 +297,7 @@ public class KReSRuleParser implements K
}
final public AtomList atomList() throws ParseException {
- AtomList atomList = new AtomList(); KReSRuleAtom kReSAtom;
+ AtomList atomList = new AtomList(); RuleAtom kReSAtom;
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case SAME:
case DIFFERENT:
@@ -326,7 +326,7 @@ public class KReSRuleParser implements K
}
final public AtomList atomListRest() throws ParseException {
- AtomList atomList = new AtomList(); KReSRuleAtom kReSAtom;
+ AtomList atomList = new AtomList(); RuleAtom kReSAtom;
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case AND:
jj_consume_token(AND);
@@ -341,8 +341,8 @@ public class KReSRuleParser implements K
throw new Error("Missing return statement in function");
}
- final public KReSRuleAtom atom() throws ParseException {
- KReSRuleAtom kReSRuleAtom;
+ final public RuleAtom atom() throws ParseException {
+ RuleAtom kReSRuleAtom;
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case IS:
kReSRuleAtom = classAtom();
@@ -387,7 +387,7 @@ public class KReSRuleParser implements K
throw new Error("Missing return statement in function");
}
- final public KReSRuleAtom unionAtom() throws ParseException {
+ final public RuleAtom unionAtom() throws ParseException {
AtomList atomList1; AtomList atomList2;
jj_consume_token(UNION);
jj_consume_token(LPAR);
@@ -422,7 +422,7 @@ public class KReSRuleParser implements K
}
final public ComparisonAtom endsWithAtom() throws ParseException {
- KReSRuleAtom kReSRuleAtom; StringFunctionAtom arg; StringFunctionAtom stringFunctionAtom;
+ RuleAtom kReSRuleAtom; StringFunctionAtom arg; StringFunctionAtom stringFunctionAtom;
jj_consume_token(ENDS_WITH);
jj_consume_token(LPAR);
arg = stringFunctionAtom();
@@ -434,7 +434,7 @@ public class KReSRuleParser implements K
}
final public ComparisonAtom startsWithAtom() throws ParseException {
- KReSRuleAtom kReSRuleAtom; StringFunctionAtom arg; StringFunctionAtom stringFunctionAtom;
+ RuleAtom kReSRuleAtom; StringFunctionAtom arg; StringFunctionAtom stringFunctionAtom;
jj_consume_token(STARTS_WITH);
jj_consume_token(LPAR);
arg = stringFunctionAtom();
@@ -774,7 +774,7 @@ public class KReSRuleParser implements K
uri1 = getURI();
uri1 = uri1.substring(1, uri1.length()-1);
try {
- {if (true) return new KReSResource(new URI(uri1));}
+ {if (true) return new ResourceAtom(new URI(uri1));}
} catch (URISyntaxException e) {
e.printStackTrace();
}
@@ -783,7 +783,7 @@ public class KReSRuleParser implements K
uri1 = getVariable();
colon = jj_consume_token(COLON);
uri3 = getVariable();
- {if (true) return new KReSResource(getSWRLArgument(uri1+colon.image+uri3));}
+ {if (true) return new ResourceAtom(getSWRLArgument(uri1+colon.image+uri3));}
break;
default:
jj_la1[10] = jj_gen;
@@ -801,7 +801,7 @@ public class KReSRuleParser implements K
case URI:
uri1 = getURI();
try {
- {if (true) return new KReSResource(new URI(uri1));}
+ {if (true) return new ResourceAtom(new URI(uri1));}
} catch (URISyntaxException e) {
e.printStackTrace();
}
@@ -810,7 +810,7 @@ public class KReSRuleParser implements K
uri1 = getVariable();
colon = jj_consume_token(COLON);
uri3 = getVariable();
- {if (true) return new KReSResource(getSWRLArgument(uri1+colon.image+uri3));}
+ {if (true) return new ResourceAtom(getSWRLArgument(uri1+colon.image+uri3));}
break;
default:
jj_la1[11] = jj_gen;
@@ -935,7 +935,7 @@ public class KReSRuleParser implements K
throw new ParseException();
}
if(typedLiteral != null){
- {if (true) return new KReSTypedLiteral(literal, typedLiteral);}
+ {if (true) return new TypedLiteralAtom(literal, typedLiteral);}
}
else{
{if (true) return literal;}
@@ -969,7 +969,7 @@ public class KReSRuleParser implements K
jj_consume_token(RPAR);
var=t.image; var=kReSKB.getPrefixURI("var") + var.substring(1);
try{
- {if (true) return new KReSVariable(new URI(var), true);}
+ {if (true) return new VariableAtom(new URI(var), true);}
} catch (URISyntaxException e) {
e.printStackTrace();
{if (true) return null;}
@@ -979,7 +979,7 @@ public class KReSRuleParser implements K
t = jj_consume_token(VARIABLE);
var=t.image; var=kReSKB.getPrefixURI("var") + var.substring(1);
try{
- {if (true) return new KReSVariable(new URI(var), false);}
+ {if (true) return new VariableAtom(new URI(var), false);}
} catch (URISyntaxException e) {
e.printStackTrace();
{if (true) return null;}
@@ -987,7 +987,7 @@ public class KReSRuleParser implements K
break;
case BNODE:
t = jj_consume_token(BNODE);
- var=t.image; {if (true) return new KReSBlankNode(var);}
+ var=t.image; {if (true) return new RuleBlankNode(var);}
break;
default:
jj_la1[17] = jj_gen;
@@ -1054,7 +1054,7 @@ public class KReSRuleParser implements K
}
/** Generated Token Manager. */
- public KReSRuleParserTokenManager token_source;
+ public RuleParserTokenManager token_source;
SimpleCharStream jj_input_stream;
/** Current token. */
public Token token;
@@ -1077,13 +1077,13 @@ public class KReSRuleParser implements K
}
/** Constructor with InputStream. */
- public KReSRuleParser(java.io.InputStream stream) {
+ public RuleParserImpl(java.io.InputStream stream) {
this(stream, null);
}
/** Constructor with InputStream and supplied encoding */
- public KReSRuleParser(java.io.InputStream stream, String encoding) {
+ public RuleParserImpl(java.io.InputStream stream, String encoding) {
try { jj_input_stream = new SimpleCharStream(stream, encoding, 1, 1); } catch(java.io.UnsupportedEncodingException e) { throw new RuntimeException(e); }
- token_source = new KReSRuleParserTokenManager(jj_input_stream);
+ token_source = new RuleParserTokenManager(jj_input_stream);
token = new Token();
jj_ntk = -1;
jj_gen = 0;
@@ -1105,9 +1105,9 @@ public class KReSRuleParser implements K
}
/** Constructor. */
- public KReSRuleParser(java.io.Reader stream) {
+ public RuleParserImpl(java.io.Reader stream) {
jj_input_stream = new SimpleCharStream(stream, 1, 1);
- token_source = new KReSRuleParserTokenManager(jj_input_stream);
+ token_source = new RuleParserTokenManager(jj_input_stream);
token = new Token();
jj_ntk = -1;
jj_gen = 0;
@@ -1125,7 +1125,7 @@ public class KReSRuleParser implements K
}
/** Constructor with generated Token Manager. */
- public KReSRuleParser(KReSRuleParserTokenManager tm) {
+ public RuleParserImpl(RuleParserTokenManager tm) {
token_source = tm;
token = new Token();
jj_ntk = -1;
@@ -1134,7 +1134,7 @@ public class KReSRuleParser implements K
}
/** Reinitialise. */
- public void ReInit(KReSRuleParserTokenManager tm) {
+ public void ReInit(RuleParserTokenManager tm) {
token_source = tm;
token = new Token();
jj_ntk = -1;
Copied: incubator/stanbol/trunk/kres/rules/manager/src/main/java/org/apache/stanbol/rules/manager/parse/RuleParserTokenManager.java (from r1085259, incubator/stanbol/trunk/kres/rules/manager/src/main/java/org/apache/stanbol/rules/manager/parse/KReSRuleParserTokenManager.java)
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/kres/rules/manager/src/main/java/org/apache/stanbol/rules/manager/parse/RuleParserTokenManager.java?p2=incubator/stanbol/trunk/kres/rules/manager/src/main/java/org/apache/stanbol/rules/manager/parse/RuleParserTokenManager.java&p1=incubator/stanbol/trunk/kres/rules/manager/src/main/java/org/apache/stanbol/rules/manager/parse/KReSRuleParserTokenManager.java&r1=1085259&r2=1085395&rev=1085395&view=diff
==============================================================================
--- incubator/stanbol/trunk/kres/rules/manager/src/main/java/org/apache/stanbol/rules/manager/parse/KReSRuleParserTokenManager.java (original)
+++ incubator/stanbol/trunk/kres/rules/manager/src/main/java/org/apache/stanbol/rules/manager/parse/RuleParserTokenManager.java Fri Mar 25 14:26:06 2011
@@ -1,8 +1,8 @@
-/* Generated By:JavaCC: Do not edit this line. KReSRuleParserTokenManager.java */
+/* Generated By:JavaCC: Do not edit this line. RuleParserTokenManager.java */
package org.apache.stanbol.rules.manager.parse;
/** Token Manager. */
-public class KReSRuleParserTokenManager implements KReSRuleParserConstants
+public class RuleParserTokenManager implements RuleParserConstants
{
/** Debug output. */
@@ -835,14 +835,14 @@ private final int[] jjrounds = new int[1
private final int[] jjstateSet = new int[32];
protected char curChar;
/** Constructor. */
-public KReSRuleParserTokenManager(SimpleCharStream stream){
+public RuleParserTokenManager(SimpleCharStream stream){
if (SimpleCharStream.staticFlag)
throw new Error("ERROR: Cannot use a static CharStream class with a non-static lexical analyzer.");
input_stream = stream;
}
/** Constructor. */
-public KReSRuleParserTokenManager(SimpleCharStream stream, int lexState){
+public RuleParserTokenManager(SimpleCharStream stream, int lexState){
this(stream);
SwitchTo(lexState);
}
Copied: incubator/stanbol/trunk/kres/rules/manager/src/test/java/org/apache/stanbol/rules/manager/AddRecipeTest.java (from r1085259, incubator/stanbol/trunk/kres/rules/manager/src/test/java/org/apache/stanbol/rules/manager/KReSAddRecipeTest.java)
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/kres/rules/manager/src/test/java/org/apache/stanbol/rules/manager/AddRecipeTest.java?p2=incubator/stanbol/trunk/kres/rules/manager/src/test/java/org/apache/stanbol/rules/manager/AddRecipeTest.java&p1=incubator/stanbol/trunk/kres/rules/manager/src/test/java/org/apache/stanbol/rules/manager/KReSAddRecipeTest.java&r1=1085259&r2=1085395&rev=1085395&view=diff
==============================================================================
--- incubator/stanbol/trunk/kres/rules/manager/src/test/java/org/apache/stanbol/rules/manager/KReSAddRecipeTest.java (original)
+++ incubator/stanbol/trunk/kres/rules/manager/src/test/java/org/apache/stanbol/rules/manager/AddRecipeTest.java Fri Mar 25 14:26:06 2011
@@ -14,12 +14,12 @@ import java.util.Hashtable;
import java.util.Iterator;
import java.util.Vector;
-import org.apache.stanbol.ontologymanager.ontonet.api.KReSONManager;
-import org.apache.stanbol.ontologymanager.ontonet.impl.ONManager;
+import org.apache.stanbol.ontologymanager.ontonet.api.ONManager;
+import org.apache.stanbol.ontologymanager.ontonet.impl.ONManagerImpl;
import org.apache.stanbol.rules.base.api.RuleStore;
-import org.apache.stanbol.rules.manager.changes.KReSAddRecipe;
-import org.apache.stanbol.rules.manager.changes.KReSLoadRuleFile;
-import org.apache.stanbol.rules.manager.changes.KReSRuleStore;
+import org.apache.stanbol.rules.manager.changes.AddRecipe;
+import org.apache.stanbol.rules.manager.changes.LoadRuleFile;
+import org.apache.stanbol.rules.manager.changes.RuleStoreImpl;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
@@ -34,9 +34,9 @@ import org.semanticweb.owlapi.model.OWLO
*
* @author elvio
*/
-public class KReSAddRecipeTest {
+public class AddRecipeTest {
- public KReSAddRecipeTest() {
+ public AddRecipeTest() {
}
@BeforeClass
@@ -50,8 +50,8 @@ public class KReSAddRecipeTest {
@Before
public void setUp() {
Dictionary<String, Object> configuration = new Hashtable<String, Object>();
- onm = new ONManager(null,null, new Hashtable<String, Object>());
- store = new KReSRuleStore(onm, configuration,"./src/main/resources/RuleOntology/TestKReSOntologyRules.owl");
+ onm = new ONManagerImpl(null,null, new Hashtable<String, Object>());
+ store = new RuleStoreImpl(onm, configuration,"./src/main/resources/RuleOntology/TestKReSOntologyRules.owl");
}
@After
@@ -61,17 +61,17 @@ public class KReSAddRecipeTest {
}
public RuleStore store = null;
- public KReSONManager onm = null;
+ public ONManager onm = null;
/**
- * Test of addRecipe method, of class KReSAddRecipe.
+ * Test of addRecipe method, of class AddRecipe.
*/
@Test
public void testAddRecipe_3args_1() {
-// RuleStore store = new KReSRuleStore("./src/main/resources/RuleOntology/TestKReSOntologyRules.owl");
+// RuleStore store = new RuleStoreImpl("./src/main/resources/RuleOntology/TestKReSOntologyRules.owl");
OWLOntology owl = store.getOntology();
//Load the example file
- KReSLoadRuleFile load = new KReSLoadRuleFile("./src/main/resources/RuleOntology/TestRuleFileExample.txt",store);
+ LoadRuleFile load = new LoadRuleFile("./src/main/resources/RuleOntology/TestRuleFileExample.txt",store);
String ID = owl.getOntologyID().toString().replace("<","").replace(">","")+"#";
@@ -81,7 +81,7 @@ public class KReSAddRecipeTest {
rules.add(IRI.create(ID+"MyRuleB"));
rules.add(IRI.create(ID+"MyRuleA"));
String recipeDescription = "My comment to the recipe";
- KReSAddRecipe instance = new KReSAddRecipe(load.getStore());
+ AddRecipe instance = new AddRecipe(load.getStore());
boolean result = instance.addRecipe(recipeName, rules, recipeDescription);
OWLOntology newonto = instance.getStore().getOntology();
if(result){
@@ -95,11 +95,11 @@ public class KReSAddRecipeTest {
}
/**
- * Test of addRecipe method, of class KReSAddRecipe.
+ * Test of addRecipe method, of class AddRecipe.
*/
@Test
public void testAddRecipe_4args_1() {
-// RuleStore store = new KReSRuleStore("./src/main/resources/RuleOntology/TestKReSOntologyRules.owl");
+// RuleStore store = new RuleStoreImpl("./src/main/resources/RuleOntology/TestKReSOntologyRules.owl");
OWLOntology owl = store.getOntology();
@@ -107,7 +107,7 @@ public class KReSAddRecipeTest {
String recipeName = "MyRecipeNew";
String recipeDescription = "My comment to the recipe";
- KReSAddRecipe instance = new KReSAddRecipe(store);
+ AddRecipe instance = new AddRecipe(store);
boolean result = instance.addSimpleRecipe(recipeName,recipeDescription);
OWLOntology newonto = instance.getStore().getOntology();
if(result){
@@ -122,14 +122,14 @@ public class KReSAddRecipeTest {
}
/**
- * Test of addRecipe method, of class KReSAddRecipe.
+ * Test of addRecipe method, of class AddRecipe.
*/
@Test
public void testAddRecipe_3args_2() {
-// RuleStore store = new KReSRuleStore("./src/main/resources/RuleOntology/TestKReSOntologyRules.owl");
+// RuleStore store = new RuleStoreImpl("./src/main/resources/RuleOntology/TestKReSOntologyRules.owl");
OWLOntology owl = store.getOntology();
//Load the example file
- KReSLoadRuleFile load = new KReSLoadRuleFile("./src/main/resources/RuleOntology/TestRuleFileExample.txt",store);
+ LoadRuleFile load = new LoadRuleFile("./src/main/resources/RuleOntology/TestRuleFileExample.txt",store);
String ID = owl.getOntologyID().toString().replace("<","").replace(">","")+"#";
IRI recipeName = IRI.create(ID+"MyRecipeNew");
@@ -138,7 +138,7 @@ public class KReSAddRecipeTest {
rules.add(IRI.create(ID+"MyRuleB"));
rules.add(IRI.create(ID+"MyRuleA"));
String recipeDescription = "My comment to the recipe";
- KReSAddRecipe instance = new KReSAddRecipe(load.getStore());
+ AddRecipe instance = new AddRecipe(load.getStore());
boolean result = instance.addRecipe(recipeName, rules, recipeDescription);
OWLOntology newonto = instance.getStore().getOntology();
@@ -153,18 +153,18 @@ public class KReSAddRecipeTest {
}
/**
- * Test of addRecipeMap method, of class KReSAddRecipe.
+ * Test of addRecipeMap method, of class AddRecipe.
*/
@Test
public void testAddRecipeMap() {
-// RuleStore store = new KReSRuleStore("./src/main/resources/RuleOntology/TestKReSOntologyRules.owl");
+// RuleStore store = new RuleStoreImpl("./src/main/resources/RuleOntology/TestKReSOntologyRules.owl");
OWLOntology owl = store.getOntology();
//Load the example file
- KReSLoadRuleFile load = new KReSLoadRuleFile("./src/main/resources/RuleOntology/TestRuleFileExample.txt",store);
+ LoadRuleFile load = new LoadRuleFile("./src/main/resources/RuleOntology/TestRuleFileExample.txt",store);
String ID = owl.getOntologyID().toString().replace("<","").replace(">","")+"#";
HashMap<String, Vector<IRI>> recipeMap = new HashMap();
HashMap<String, String> recipeDescriptionMap = new HashMap();
- KReSAddRecipe instance = new KReSAddRecipe(load.getStore());
+ AddRecipe instance = new AddRecipe(load.getStore());
Vector<IRI> rules = new Vector();
rules.add(IRI.create(ID+"MyRuleC"));
@@ -199,19 +199,19 @@ public class KReSAddRecipeTest {
}
/**
- * Test of addRecipeMapIRI method, of class KReSAddRecipe.
+ * Test of addRecipeMapIRI method, of class AddRecipe.
*/
@Test
public void testAddRecipeMapIRI() {
-// RuleStore store = new KReSRuleStore("./src/main/resources/RuleOntology/TestKReSOntologyRules.owl");
+// RuleStore store = new RuleStoreImpl("./src/main/resources/RuleOntology/TestKReSOntologyRules.owl");
OWLOntology owl = store.getOntology();
//Load the example file
- KReSLoadRuleFile load = new KReSLoadRuleFile("./src/main/resources/RuleOntology/TestRuleFileExample.txt",store);
+ LoadRuleFile load = new LoadRuleFile("./src/main/resources/RuleOntology/TestRuleFileExample.txt",store);
String ID = owl.getOntologyID().toString().replace("<","").replace(">","")+"#";
HashMap<IRI, Vector<IRI>> recipeMap = new HashMap();
HashMap<IRI, String> recipeDescriptionMap = new HashMap();
- KReSAddRecipe instance = new KReSAddRecipe(load.getStore());
+ AddRecipe instance = new AddRecipe(load.getStore());
Vector<IRI> rules = new Vector();
rules.add(IRI.create(ID+"MyRuleC"));
Copied: incubator/stanbol/trunk/kres/rules/manager/src/test/java/org/apache/stanbol/rules/manager/AddRuleTest.java (from r1085259, incubator/stanbol/trunk/kres/rules/manager/src/test/java/org/apache/stanbol/rules/manager/KReSAddRuleTest.java)
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/kres/rules/manager/src/test/java/org/apache/stanbol/rules/manager/AddRuleTest.java?p2=incubator/stanbol/trunk/kres/rules/manager/src/test/java/org/apache/stanbol/rules/manager/AddRuleTest.java&p1=incubator/stanbol/trunk/kres/rules/manager/src/test/java/org/apache/stanbol/rules/manager/KReSAddRuleTest.java&r1=1085259&r2=1085395&rev=1085395&view=diff
==============================================================================
--- incubator/stanbol/trunk/kres/rules/manager/src/test/java/org/apache/stanbol/rules/manager/KReSAddRuleTest.java (original)
+++ incubator/stanbol/trunk/kres/rules/manager/src/test/java/org/apache/stanbol/rules/manager/AddRuleTest.java Fri Mar 25 14:26:06 2011
@@ -13,11 +13,11 @@ import java.util.HashMap;
import java.util.Hashtable;
import java.util.Iterator;
-import org.apache.stanbol.ontologymanager.ontonet.api.KReSONManager;
-import org.apache.stanbol.ontologymanager.ontonet.impl.ONManager;
+import org.apache.stanbol.ontologymanager.ontonet.api.ONManager;
+import org.apache.stanbol.ontologymanager.ontonet.impl.ONManagerImpl;
import org.apache.stanbol.rules.base.api.RuleStore;
-import org.apache.stanbol.rules.manager.changes.KReSAddRule;
-import org.apache.stanbol.rules.manager.changes.KReSRuleStore;
+import org.apache.stanbol.rules.manager.changes.AddRule;
+import org.apache.stanbol.rules.manager.changes.RuleStoreImpl;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
@@ -31,9 +31,9 @@ import org.semanticweb.owlapi.model.OWLO
*
* @author elvio
*/
-public class KReSAddRuleTest {
+public class AddRuleTest {
- public KReSAddRuleTest() {
+ public AddRuleTest() {
}
@BeforeClass
@@ -47,8 +47,8 @@ public class KReSAddRuleTest {
@Before
public void setUp() {
Dictionary<String, Object> configuration = new Hashtable<String, Object>();
- onm = new ONManager(null,null, new Hashtable<String, Object>());
- store = new KReSRuleStore(onm, configuration,"./src/main/resources/RuleOntology/TestKReSOntologyRules.owl");
+ onm = new ONManagerImpl(null,null, new Hashtable<String, Object>());
+ store = new RuleStoreImpl(onm, configuration,"./src/main/resources/RuleOntology/TestKReSOntologyRules.owl");
}
@After
@@ -58,19 +58,19 @@ public class KReSAddRuleTest {
}
public RuleStore store = null;
- public KReSONManager onm = null;
+ public ONManager onm = null;
/**
- * Test of addRule method, of class KReSAddRule.
+ * Test of addRule method, of class AddRule.
*/
@Test
public void testAddRule_3args_1() {
-// RuleStore store = new KReSRuleStore("./src/main/resources/RuleOntology/TestKReSOntologyRules.owl");
+// RuleStore store = new RuleStoreImpl("./src/main/resources/RuleOntology/TestKReSOntologyRules.owl");
String ruleName = "MyRuleA";
String ruleBodyHead = "MyRuleABody -> MyRuleAHead";
String ruleDescription = "My comment to the rule A";
- KReSAddRule instance = new KReSAddRule(store);
+ AddRule instance = new AddRule(store);
boolean result = instance.addRule(ruleName, ruleBodyHead, ruleDescription);
OWLOntology newonto = instance.getStore().getOntology();
@@ -87,17 +87,17 @@ public class KReSAddRuleTest {
}
/**
- * Test of addRule method, of class KReSAddRule.
+ * Test of addRule method, of class AddRule.
*/
@Test
public void testAddRule_3args_2() {
-// RuleStore store = new KReSRuleStore("./src/main/resources/RuleOntology/TestKReSOntologyRules.owl");
+// RuleStore store = new RuleStoreImpl("./src/main/resources/RuleOntology/TestKReSOntologyRules.owl");
OWLOntology owl = store.getOntology();
String ID = owl.getOntologyID().toString().replace("<","").replace(">","")+"#";
IRI ruleName = IRI.create(ID+"MyRuleA");
String ruleBodyHead = "MyRuleABody -> MyRuleAHead";
String ruleDescription = "My comment to the rule A";
- KReSAddRule instance = new KReSAddRule(store);
+ AddRule instance = new AddRule(store);
boolean result = instance.addRule(ruleName, ruleBodyHead, ruleDescription);
OWLOntology newonto = instance.getStore().getOntology();
@@ -113,11 +113,11 @@ public class KReSAddRuleTest {
}
/**
- * Test of addRuleMap method, of class KReSAddRule.
+ * Test of addRuleMap method, of class AddRule.
*/
@Test
public void testAddRuleMap() {
-// RuleStore store = new KReSRuleStore("./src/main/resources/RuleOntology/TestKReSOntologyRules.owl");
+// RuleStore store = new RuleStoreImpl("./src/main/resources/RuleOntology/TestKReSOntologyRules.owl");
OWLOntology owl = store.getOntology();
String ID = owl.getOntologyID().toString().replace("<","").replace(">","")+"#";
HashMap<String, String> ruleBodyHeadMap = new HashMap();
@@ -128,7 +128,7 @@ public class KReSAddRuleTest {
ruleDescriptionMap.put("MyRuleA","My comment to the rule A");
ruleDescriptionMap.put("MyRuleB","My comment to the rule B");
- KReSAddRule instance = new KReSAddRule(store);
+ AddRule instance = new AddRule(store);
boolean result = instance.addRuleMap(ruleBodyHeadMap, ruleDescriptionMap);
OWLOntology newonto = instance.getStore().getOntology();
@@ -148,11 +148,11 @@ public class KReSAddRuleTest {
}
/**
- * Test of addRuleMapIRI method, of class KReSAddRule.
+ * Test of addRuleMapIRI method, of class AddRule.
*/
@Test
public void testAddRuleMapIRI() {
-// RuleStore store = new KReSRuleStore("./src/main/resources/RuleOntology/TestKReSOntologyRules.owl");
+// RuleStore store = new RuleStoreImpl("./src/main/resources/RuleOntology/TestKReSOntologyRules.owl");
OWLOntology owl = store.getOntology();
String ID = owl.getOntologyID().toString().replace("<","").replace(">","")+"#";
HashMap<IRI, String> ruleBodyHeadMap = new HashMap();
@@ -163,7 +163,7 @@ public class KReSAddRuleTest {
ruleDescriptionMap.put(IRI.create(ID+"MyRuleA"),"My comment to the rule A");
ruleDescriptionMap.put(IRI.create(ID+"MyRuleB"),"My comment to the rule B");
- KReSAddRule instance = new KReSAddRule(store);
+ AddRule instance = new AddRule(store);
boolean result = instance.addRuleMapIRI(ruleBodyHeadMap, ruleDescriptionMap);
OWLOntology newonto = instance.getStore().getOntology();
Copied: incubator/stanbol/trunk/kres/rules/manager/src/test/java/org/apache/stanbol/rules/manager/GetRecipeTest.java (from r1085259, incubator/stanbol/trunk/kres/rules/manager/src/test/java/org/apache/stanbol/rules/manager/KReSGetRecipeTest.java)
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/kres/rules/manager/src/test/java/org/apache/stanbol/rules/manager/GetRecipeTest.java?p2=incubator/stanbol/trunk/kres/rules/manager/src/test/java/org/apache/stanbol/rules/manager/GetRecipeTest.java&p1=incubator/stanbol/trunk/kres/rules/manager/src/test/java/org/apache/stanbol/rules/manager/KReSGetRecipeTest.java&r1=1085259&r2=1085395&rev=1085395&view=diff
==============================================================================
--- incubator/stanbol/trunk/kres/rules/manager/src/test/java/org/apache/stanbol/rules/manager/KReSGetRecipeTest.java (original)
+++ incubator/stanbol/trunk/kres/rules/manager/src/test/java/org/apache/stanbol/rules/manager/GetRecipeTest.java Fri Mar 25 14:26:06 2011
@@ -12,12 +12,12 @@ import java.util.Dictionary;
import java.util.HashMap;
import java.util.Hashtable;
-import org.apache.stanbol.ontologymanager.ontonet.api.KReSONManager;
-import org.apache.stanbol.ontologymanager.ontonet.impl.ONManager;
+import org.apache.stanbol.ontologymanager.ontonet.api.ONManager;
+import org.apache.stanbol.ontologymanager.ontonet.impl.ONManagerImpl;
import org.apache.stanbol.rules.base.api.RuleStore;
-import org.apache.stanbol.rules.manager.changes.KReSGetRecipe;
-import org.apache.stanbol.rules.manager.changes.KReSLoadRuleFile;
-import org.apache.stanbol.rules.manager.changes.KReSRuleStore;
+import org.apache.stanbol.rules.manager.changes.GetRecipe;
+import org.apache.stanbol.rules.manager.changes.LoadRuleFile;
+import org.apache.stanbol.rules.manager.changes.RuleStoreImpl;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
@@ -30,9 +30,9 @@ import org.semanticweb.owlapi.model.OWLO
*
* @author elvio
*/
-public class KReSGetRecipeTest {
+public class GetRecipeTest {
- public KReSGetRecipeTest() {
+ public GetRecipeTest() {
}
@BeforeClass
@@ -46,8 +46,8 @@ public class KReSGetRecipeTest {
@Before
public void setUp() {
Dictionary<String, Object> configuration = new Hashtable<String, Object>();
- onm = new ONManager(null,null, new Hashtable<String, Object>());
- store = new KReSRuleStore(onm, configuration,"./src/main/resources/RuleOntology/TestKReSOntologyRules.owl");
+ onm = new ONManagerImpl(null,null, new Hashtable<String, Object>());
+ store = new RuleStoreImpl(onm, configuration,"./src/main/resources/RuleOntology/TestKReSOntologyRules.owl");
}
@After
@@ -57,21 +57,21 @@ public class KReSGetRecipeTest {
}
public RuleStore store = null;
- public KReSONManager onm = null;
+ public ONManager onm = null;
/**
- * Test of getRule method, of class KReSGetRecipe.
+ * Test of getRule method, of class GetRecipe.
*/
@Test
public void testGetRecipe() {
-// RuleStore store = new KReSRuleStore("./src/main/resources/RuleOntology/TestKReSOntologyRules.owl");
+// RuleStore store = new RuleStoreImpl("./src/main/resources/RuleOntology/TestKReSOntologyRules.owl");
OWLOntology owl = store.getOntology();
String ID = owl.getOntologyID().toString().replace("<", "").replace(">", "")+"#";
//Load the example file
- KReSLoadRuleFile load = new KReSLoadRuleFile("./src/main/resources/RuleOntology/TestRuleFileExample.txt",store);
+ LoadRuleFile load = new LoadRuleFile("./src/main/resources/RuleOntology/TestRuleFileExample.txt",store);
owl = load.getStore().getOntology();
- KReSGetRecipe rule = new KReSGetRecipe(store);
+ GetRecipe rule = new GetRecipe(store);
HashMap<IRI, String> map = rule.getRecipe(IRI.create("http://kres.iks-project.eu/ontology/meta/rmi.owl#MyRecipe"));
HashMap<IRI, String> expmap = new HashMap();
expmap.put(IRI.create(ID+"MyRecipe"), "http://kres.iks-project.eu/ontology/meta/rmi.owl#MyRuleC, http://kres.iks-project.eu/ontology/meta/rmi.owl#MyRuleB, http://kres.iks-project.eu/ontology/meta/rmi.owl#MyRuleA");
@@ -84,18 +84,18 @@ public class KReSGetRecipeTest {
}
/**
- * Test of getAllRecipes method, of class KReSGetRecipe.
+ * Test of getAllRecipes method, of class GetRecipe.
*/
@Test
public void testGetAllRecipes() {
-// RuleStore store = new KReSRuleStore("./src/main/resources/RuleOntology/TestKReSOntologyRules.owl");
+// RuleStore store = new RuleStoreImpl("./src/main/resources/RuleOntology/TestKReSOntologyRules.owl");
OWLOntology owl = store.getOntology();
String ID = owl.getOntologyID().toString().replace("<", "").replace(">", "")+"#";
//Load the example file
- KReSLoadRuleFile load = new KReSLoadRuleFile("./src/main/resources/RuleOntology/TestRuleFileExample.txt",store);
+ LoadRuleFile load = new LoadRuleFile("./src/main/resources/RuleOntology/TestRuleFileExample.txt",store);
owl = load.getStore().getOntology();
- KReSGetRecipe rule = new KReSGetRecipe(store);
+ GetRecipe rule = new GetRecipe(store);
HashMap<IRI, String> map = rule.getAllRecipes();
HashMap<IRI, String> expmap = new HashMap();
Copied: incubator/stanbol/trunk/kres/rules/manager/src/test/java/org/apache/stanbol/rules/manager/GetRuleTest.java (from r1085259, incubator/stanbol/trunk/kres/rules/manager/src/test/java/org/apache/stanbol/rules/manager/KReSGetRuleTest.java)
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/kres/rules/manager/src/test/java/org/apache/stanbol/rules/manager/GetRuleTest.java?p2=incubator/stanbol/trunk/kres/rules/manager/src/test/java/org/apache/stanbol/rules/manager/GetRuleTest.java&p1=incubator/stanbol/trunk/kres/rules/manager/src/test/java/org/apache/stanbol/rules/manager/KReSGetRuleTest.java&r1=1085259&r2=1085395&rev=1085395&view=diff
==============================================================================
--- incubator/stanbol/trunk/kres/rules/manager/src/test/java/org/apache/stanbol/rules/manager/KReSGetRuleTest.java (original)
+++ incubator/stanbol/trunk/kres/rules/manager/src/test/java/org/apache/stanbol/rules/manager/GetRuleTest.java Fri Mar 25 14:26:06 2011
@@ -14,12 +14,12 @@ import java.util.Hashtable;
import java.util.Iterator;
import java.util.Vector;
-import org.apache.stanbol.ontologymanager.ontonet.api.KReSONManager;
-import org.apache.stanbol.ontologymanager.ontonet.impl.ONManager;
+import org.apache.stanbol.ontologymanager.ontonet.api.ONManager;
+import org.apache.stanbol.ontologymanager.ontonet.impl.ONManagerImpl;
import org.apache.stanbol.rules.base.api.RuleStore;
-import org.apache.stanbol.rules.manager.changes.KReSGetRule;
-import org.apache.stanbol.rules.manager.changes.KReSLoadRuleFile;
-import org.apache.stanbol.rules.manager.changes.KReSRuleStore;
+import org.apache.stanbol.rules.manager.changes.GetRule;
+import org.apache.stanbol.rules.manager.changes.LoadRuleFile;
+import org.apache.stanbol.rules.manager.changes.RuleStoreImpl;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
@@ -32,9 +32,9 @@ import org.semanticweb.owlapi.model.OWLO
*
* @author elvio
*/
-public class KReSGetRuleTest {
+public class GetRuleTest {
- public KReSGetRuleTest() {
+ public GetRuleTest() {
}
@BeforeClass
@@ -48,8 +48,8 @@ public class KReSGetRuleTest {
@Before
public void setUp() {
Dictionary<String, Object> configuration = new Hashtable<String, Object>();
- onm = new ONManager(null,null, new Hashtable<String, Object>());
- store = new KReSRuleStore(onm, configuration,"./src/main/resources/RuleOntology/TestKReSOntologyRules.owl");
+ onm = new ONManagerImpl(null,null, new Hashtable<String, Object>());
+ store = new RuleStoreImpl(onm, configuration,"./src/main/resources/RuleOntology/TestKReSOntologyRules.owl");
}
@After
@@ -59,21 +59,21 @@ public class KReSGetRuleTest {
}
public RuleStore store = null;
- public KReSONManager onm = null;
+ public ONManager onm = null;
/**
- * Test of getRule method, of class KReSGetRule.
+ * Test of getRule method, of class GetRule.
*/
@Test
public void testGetRule() {
-// RuleStore store = new KReSRuleStore("./src/main/resources/RuleOntology/TestKReSOntologyRules.owl");
+// RuleStore store = new RuleStoreImpl("./src/main/resources/RuleOntology/TestKReSOntologyRules.owl");
OWLOntology owl = store.getOntology();
String ID = owl.getOntologyID().toString().replace("<", "").replace(">", "")+"#";
//Load the example file
- KReSLoadRuleFile load = new KReSLoadRuleFile("./src/main/resources/RuleOntology/TestRuleFileExample.txt",store);
+ LoadRuleFile load = new LoadRuleFile("./src/main/resources/RuleOntology/TestRuleFileExample.txt",store);
owl = load.getStore().getOntology();
- KReSGetRule rule = new KReSGetRule(store);
+ GetRule rule = new GetRule(store);
HashMap<IRI, String> map = rule.getRule("MyRuleC");
HashMap<IRI, String> expmap = new HashMap();
expmap.put(IRI.create(ID+"MyRuleC"), "MyRuleCBody -> MyRuleCHead");
@@ -86,18 +86,18 @@ public class KReSGetRuleTest {
}
/**
- * Test of getAllRule method, of class KReSGetRule.
+ * Test of getAllRule method, of class GetRule.
*/
@Test
public void testGetAllRule() {
-// KReSRuleStore store = new KReSRuleStore("./src/main/resources/RuleOntology/TestKReSOntologyRules.owl");
+// RuleStoreImpl store = new RuleStoreImpl("./src/main/resources/RuleOntology/TestKReSOntologyRules.owl");
OWLOntology owl = store.getOntology();
String ID = owl.getOntologyID().toString().replace("<", "").replace(">", "")+"#";
//Load the example file
- KReSLoadRuleFile load = new KReSLoadRuleFile("./src/main/resources/RuleOntology/TestRuleFileExample.txt",store);
+ LoadRuleFile load = new LoadRuleFile("./src/main/resources/RuleOntology/TestRuleFileExample.txt",store);
owl = load.getStore().getOntology();
- KReSGetRule rule = new KReSGetRule(store);
+ GetRule rule = new GetRule(store);
HashMap<IRI, String> map = rule.getAllRules();
HashMap<IRI, String> expmap = new HashMap();
@@ -133,18 +133,18 @@ public class KReSGetRuleTest {
}
/**
- * Test of getRule method, of class KReSGetRule.
+ * Test of getRule method, of class GetRule.
*/
@Test
public void testGetRuleUsage() {
-// KReSRuleStore store = new KReSRuleStore("./src/main/resources/RuleOntology/TestKReSOntologyRules.owl");
+// RuleStoreImpl store = new RuleStoreImpl("./src/main/resources/RuleOntology/TestKReSOntologyRules.owl");
OWLOntology owl = store.getOntology();
String ID = owl.getOntologyID().toString().replace("<", "").replace(">", "")+"#";
//Load the example file
- KReSLoadRuleFile load = new KReSLoadRuleFile("./src/main/resources/RuleOntology/TestRuleFileExample.txt",store);
+ LoadRuleFile load = new LoadRuleFile("./src/main/resources/RuleOntology/TestRuleFileExample.txt",store);
owl = load.getStore().getOntology();
- KReSGetRule rule = new KReSGetRule(store);
+ GetRule rule = new GetRule(store);
Vector<IRI> vector = rule.getRuleUsage(IRI.create(ID + "MyRuleC"));
if(vector!=null){
@@ -157,14 +157,14 @@ public class KReSGetRuleTest {
@Test
public void testGetRulesOfRecipe() {
-// KReSRuleStore store = new KReSRuleStore("./src/main/resources/RuleOntology/TestKReSOntologyRules.owl");
+// RuleStoreImpl store = new RuleStoreImpl("./src/main/resources/RuleOntology/TestKReSOntologyRules.owl");
OWLOntology owl = store.getOntology();
String ID = owl.getOntologyID().toString().replace("<", "").replace(">", "")+"#";
//Load the example file
- KReSLoadRuleFile load = new KReSLoadRuleFile("./src/main/resources/RuleOntology/TestRuleFileExample.txt",store);
+ LoadRuleFile load = new LoadRuleFile("./src/main/resources/RuleOntology/TestRuleFileExample.txt",store);
owl = load.getStore().getOntology();
- KReSGetRule rule = new KReSGetRule(store);
+ GetRule rule = new GetRule(store);
Vector<IRI> vector = rule.getRuleUsage(IRI.create(ID + "MyRuleC"));
if(vector!=null){
Copied: incubator/stanbol/trunk/kres/rules/manager/src/test/java/org/apache/stanbol/rules/manager/LoadRuleFileTest.java (from r1085259, incubator/stanbol/trunk/kres/rules/manager/src/test/java/org/apache/stanbol/rules/manager/KReSLoadRuleFileTest.java)
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/kres/rules/manager/src/test/java/org/apache/stanbol/rules/manager/LoadRuleFileTest.java?p2=incubator/stanbol/trunk/kres/rules/manager/src/test/java/org/apache/stanbol/rules/manager/LoadRuleFileTest.java&p1=incubator/stanbol/trunk/kres/rules/manager/src/test/java/org/apache/stanbol/rules/manager/KReSLoadRuleFileTest.java&r1=1085259&r2=1085395&rev=1085395&view=diff
==============================================================================
--- incubator/stanbol/trunk/kres/rules/manager/src/test/java/org/apache/stanbol/rules/manager/KReSLoadRuleFileTest.java (original)
+++ incubator/stanbol/trunk/kres/rules/manager/src/test/java/org/apache/stanbol/rules/manager/LoadRuleFileTest.java Fri Mar 25 14:26:06 2011
@@ -13,11 +13,11 @@ import java.util.Hashtable;
import java.util.Iterator;
import java.util.Set;
-import org.apache.stanbol.ontologymanager.ontonet.api.KReSONManager;
-import org.apache.stanbol.ontologymanager.ontonet.impl.ONManager;
+import org.apache.stanbol.ontologymanager.ontonet.api.ONManager;
+import org.apache.stanbol.ontologymanager.ontonet.impl.ONManagerImpl;
import org.apache.stanbol.rules.base.api.RuleStore;
-import org.apache.stanbol.rules.manager.changes.KReSLoadRuleFile;
-import org.apache.stanbol.rules.manager.changes.KReSRuleStore;
+import org.apache.stanbol.rules.manager.changes.LoadRuleFile;
+import org.apache.stanbol.rules.manager.changes.RuleStoreImpl;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
@@ -42,9 +42,9 @@ import org.semanticweb.owlapi.model.OWLO
*
* @author elvio
*/
-public class KReSLoadRuleFileTest {
+public class LoadRuleFileTest {
- public KReSLoadRuleFileTest() {
+ public LoadRuleFileTest() {
}
@BeforeClass
@@ -64,19 +64,19 @@ public class KReSLoadRuleFileTest {
}
/**
- * Test of KReSLoadRuleFile method, of class KReSLoadRuleFile.
+ * Test of LoadRuleFile method, of class LoadRuleFile.
*/
@Test
public void testKReSLoadRuleFile() throws OWLOntologyStorageException {
Dictionary<String, Object> configuration = new Hashtable<String, Object>();
- KReSONManager onm = new ONManager(null,null,configuration);
+ ONManager onm = new ONManagerImpl(null,null,configuration);
Dictionary<String, Object> configuration2 = new Hashtable<String, Object>();
-// configuration2.put(KReSRuleStore.RULE_ONTOLOGY, "");
- configuration2.put(KReSRuleStore.RULE_ONTOLOGY_NAMESPACE, "http://kres.iks-project.eu/ontology/meta/rmi.owl#");
- RuleStore store = new KReSRuleStore(onm,configuration2,"./src/main/resources/RuleOntology/TestKReSOntologyRules.owl");
- RuleStore newstore = new KReSRuleStore(new ONManager(null,null,configuration),configuration2,store.getOntology());
+// configuration2.put(RuleStoreImpl.RULE_ONTOLOGY, "");
+ configuration2.put(RuleStoreImpl.RULE_ONTOLOGY_NAMESPACE, "http://kres.iks-project.eu/ontology/meta/rmi.owl#");
+ RuleStore store = new RuleStoreImpl(onm,configuration2,"./src/main/resources/RuleOntology/TestKReSOntologyRules.owl");
+ RuleStore newstore = new RuleStoreImpl(new ONManagerImpl(null,null,configuration),configuration2,store.getOntology());
//Load the example file
- KReSLoadRuleFile load = new KReSLoadRuleFile("./src/main/resources/RuleOntology/TestRuleFileExample.txt",store);
+ LoadRuleFile load = new LoadRuleFile("./src/main/resources/RuleOntology/TestRuleFileExample.txt",store);
OWLOntology result = load.getStore().getOntology();
Copied: incubator/stanbol/trunk/kres/rules/manager/src/test/java/org/apache/stanbol/rules/manager/RemoveRecipeTest.java (from r1085259, incubator/stanbol/trunk/kres/rules/manager/src/test/java/org/apache/stanbol/rules/manager/KReSRemoveRecipeTest.java)
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/kres/rules/manager/src/test/java/org/apache/stanbol/rules/manager/RemoveRecipeTest.java?p2=incubator/stanbol/trunk/kres/rules/manager/src/test/java/org/apache/stanbol/rules/manager/RemoveRecipeTest.java&p1=incubator/stanbol/trunk/kres/rules/manager/src/test/java/org/apache/stanbol/rules/manager/KReSRemoveRecipeTest.java&r1=1085259&r2=1085395&rev=1085395&view=diff
==============================================================================
--- incubator/stanbol/trunk/kres/rules/manager/src/test/java/org/apache/stanbol/rules/manager/KReSRemoveRecipeTest.java (original)
+++ incubator/stanbol/trunk/kres/rules/manager/src/test/java/org/apache/stanbol/rules/manager/RemoveRecipeTest.java Fri Mar 25 14:26:06 2011
@@ -11,12 +11,12 @@ import static org.junit.Assert.fail;
import java.util.Dictionary;
import java.util.Hashtable;
-import org.apache.stanbol.ontologymanager.ontonet.api.KReSONManager;
-import org.apache.stanbol.ontologymanager.ontonet.impl.ONManager;
+import org.apache.stanbol.ontologymanager.ontonet.api.ONManager;
+import org.apache.stanbol.ontologymanager.ontonet.impl.ONManagerImpl;
import org.apache.stanbol.rules.base.api.RuleStore;
-import org.apache.stanbol.rules.manager.changes.KReSLoadRuleFile;
-import org.apache.stanbol.rules.manager.changes.KReSRemoveRecipe;
-import org.apache.stanbol.rules.manager.changes.KReSRuleStore;
+import org.apache.stanbol.rules.manager.changes.LoadRuleFile;
+import org.apache.stanbol.rules.manager.changes.RemoveRecipe;
+import org.apache.stanbol.rules.manager.changes.RuleStoreImpl;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
@@ -30,9 +30,9 @@ import org.semanticweb.owlapi.model.OWLO
*
* @author elvio
*/
-public class KReSRemoveRecipeTest {
+public class RemoveRecipeTest {
- public KReSRemoveRecipeTest() {
+ public RemoveRecipeTest() {
}
@BeforeClass
@@ -46,8 +46,8 @@ public class KReSRemoveRecipeTest {
@Before
public void setUp() {
Dictionary<String, Object> configuration = new Hashtable<String, Object>();
- onm = new ONManager(null,null, new Hashtable<String, Object>());
- store = new KReSRuleStore(onm, configuration,"./src/main/resources/RuleOntology/TestKReSOntologyRules.owl");
+ onm = new ONManagerImpl(null,null, new Hashtable<String, Object>());
+ store = new RuleStoreImpl(onm, configuration,"./src/main/resources/RuleOntology/TestKReSOntologyRules.owl");
}
@After
@@ -57,20 +57,20 @@ public class KReSRemoveRecipeTest {
}
public RuleStore store = null;
- public KReSONManager onm = null;
+ public ONManager onm = null;
/**
- * Test of removeRule method, of class KReSRemoveRecipe.
+ * Test of removeRule method, of class RemoveRecipe.
*/
@Test
public void testRemoveRule_String() throws OWLOntologyCreationException {
-// RuleStore store = new KReSRuleStore("./src/main/resources/RuleOntology/TestKReSOntologyRules.owl");
+// RuleStore store = new RuleStoreImpl("./src/main/resources/RuleOntology/TestKReSOntologyRules.owl");
String owlID = store.getOntology().getOntologyID().toString().replace("<", "").replace(">", "") + "#";
//Load the example file
- KReSLoadRuleFile load = new KReSLoadRuleFile("./src/main/resources/RuleOntology/TestRuleFileExample.txt",store);
+ LoadRuleFile load = new LoadRuleFile("./src/main/resources/RuleOntology/TestRuleFileExample.txt",store);
OWLOntology owlstart = load.getStore().getOntology();
String recipeName = owlID+"MyRecipe";
- KReSRemoveRecipe instance = new KReSRemoveRecipe(load.getStore());
+ RemoveRecipe instance = new RemoveRecipe(load.getStore());
boolean expResult = true;
boolean result = instance.removeRecipe(IRI.create(recipeName));
@@ -83,16 +83,16 @@ public class KReSRemoveRecipeTest {
}
/**
- * Test of removeRule method, of class KReSRemoveRecipe.
+ * Test of removeRule method, of class RemoveRecipe.
*/
@Test
public void testRemoveRuleName_String() throws OWLOntologyCreationException {
-// RuleStore store = new KReSRuleStore("./src/main/resources/RuleOntology/TestKReSOntologyRules.owl");
+// RuleStore store = new RuleStoreImpl("./src/main/resources/RuleOntology/TestKReSOntologyRules.owl");
//Load the example file
- KReSLoadRuleFile load = new KReSLoadRuleFile("./src/main/resources/RuleOntology/TestRuleFileExample.txt",store);
+ LoadRuleFile load = new LoadRuleFile("./src/main/resources/RuleOntology/TestRuleFileExample.txt",store);
OWLOntology owlstart = load.getStore().getOntology();
String recipeName ="MyRecipe";
- KReSRemoveRecipe instance = new KReSRemoveRecipe(load.getStore());
+ RemoveRecipe instance = new RemoveRecipe(load.getStore());
boolean expResult = true;
boolean result = instance.removeRecipe(recipeName);
Copied: incubator/stanbol/trunk/kres/rules/manager/src/test/java/org/apache/stanbol/rules/manager/RemoveRuleTest.java (from r1085259, incubator/stanbol/trunk/kres/rules/manager/src/test/java/org/apache/stanbol/rules/manager/KReSRemoveRuleTest.java)
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/kres/rules/manager/src/test/java/org/apache/stanbol/rules/manager/RemoveRuleTest.java?p2=incubator/stanbol/trunk/kres/rules/manager/src/test/java/org/apache/stanbol/rules/manager/RemoveRuleTest.java&p1=incubator/stanbol/trunk/kres/rules/manager/src/test/java/org/apache/stanbol/rules/manager/KReSRemoveRuleTest.java&r1=1085259&r2=1085395&rev=1085395&view=diff
==============================================================================
--- incubator/stanbol/trunk/kres/rules/manager/src/test/java/org/apache/stanbol/rules/manager/KReSRemoveRuleTest.java (original)
+++ incubator/stanbol/trunk/kres/rules/manager/src/test/java/org/apache/stanbol/rules/manager/RemoveRuleTest.java Fri Mar 25 14:26:06 2011
@@ -11,13 +11,13 @@ import static org.junit.Assert.fail;
import java.util.Dictionary;
import java.util.Hashtable;
-import org.apache.stanbol.ontologymanager.ontonet.api.KReSONManager;
-import org.apache.stanbol.ontologymanager.ontonet.impl.ONManager;
+import org.apache.stanbol.ontologymanager.ontonet.api.ONManager;
+import org.apache.stanbol.ontologymanager.ontonet.impl.ONManagerImpl;
import org.apache.stanbol.rules.base.api.RuleStore;
-import org.apache.stanbol.rules.manager.changes.KReSAddRule;
-import org.apache.stanbol.rules.manager.changes.KReSLoadRuleFile;
-import org.apache.stanbol.rules.manager.changes.KReSRemoveRule;
-import org.apache.stanbol.rules.manager.changes.KReSRuleStore;
+import org.apache.stanbol.rules.manager.changes.AddRule;
+import org.apache.stanbol.rules.manager.changes.LoadRuleFile;
+import org.apache.stanbol.rules.manager.changes.RemoveRule;
+import org.apache.stanbol.rules.manager.changes.RuleStoreImpl;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
@@ -30,9 +30,9 @@ import org.semanticweb.owlapi.model.OWLO
*
* @author elvio
*/
-public class KReSRemoveRuleTest {
+public class RemoveRuleTest {
- public KReSRemoveRuleTest() {
+ public RemoveRuleTest() {
}
@BeforeClass
@@ -46,8 +46,8 @@ public class KReSRemoveRuleTest {
@Before
public void setUp() {
Dictionary<String, Object> configuration = new Hashtable<String, Object>();
- onm = new ONManager(null,null, new Hashtable<String, Object>());
- store = new KReSRuleStore(onm, configuration,"./src/main/resources/RuleOntology/TestKReSOntologyRules.owl");
+ onm = new ONManagerImpl(null,null, new Hashtable<String, Object>());
+ store = new RuleStoreImpl(onm, configuration,"./src/main/resources/RuleOntology/TestKReSOntologyRules.owl");
}
@After
@@ -57,21 +57,21 @@ public class KReSRemoveRuleTest {
}
public RuleStore store = null;
- public KReSONManager onm = null;
+ public ONManager onm = null;
/**
- * Test of removeRule method, of class KReSRemoveRule.
+ * Test of removeRule method, of class RemoveRule.
*/
@Test
public void testRemoveRule() {
-// RuleStore store = new KReSRuleStore("./src/main/resources/RuleOntology/TestKReSOntologyRules.owl");
+// RuleStore store = new RuleStoreImpl("./src/main/resources/RuleOntology/TestKReSOntologyRules.owl");
//Load the example file
- KReSLoadRuleFile load = new KReSLoadRuleFile("./src/main/resources/RuleOntology/TestRuleFileExample.txt",store);
- KReSAddRule rule = new KReSAddRule(load.getStore());
+ LoadRuleFile load = new LoadRuleFile("./src/main/resources/RuleOntology/TestRuleFileExample.txt",store);
+ AddRule rule = new AddRule(load.getStore());
rule.addRule("MyRuleProva","Body -> Head",null);
String ruleName = "MyRuleProva";
- KReSRemoveRule instance = new KReSRemoveRule(rule.getStore());
+ RemoveRule instance = new RemoveRule(rule.getStore());
boolean expResult = true;
boolean result = instance.removeRule(ruleName);
if(result){
@@ -81,18 +81,18 @@ public class KReSRemoveRuleTest {
}
/**
- * Test of removeRule method, of class KReSRemoveRule.
+ * Test of removeRule method, of class RemoveRule.
*/
@Test
public void testRemoveSingleRule() throws OWLOntologyStorageException {
-// RuleStore store = new KReSRuleStore("./src/main/resources/RuleOntology/TestKReSOntologyRules.owl");
+// RuleStore store = new RuleStoreImpl("./src/main/resources/RuleOntology/TestKReSOntologyRules.owl");
String owlID = store.getOntology().getOntologyID().toString().replace("<", "").replace(">", "") + "#";
//Load the example file
- KReSLoadRuleFile load = new KReSLoadRuleFile("./src/main/resources/RuleOntology/TestRuleFileExample.txt",store);
+ LoadRuleFile load = new LoadRuleFile("./src/main/resources/RuleOntology/TestRuleFileExample.txt",store);
IRI rule = IRI.create(owlID+"MyRuleB");
IRI recipe = IRI.create(owlID+"MyRecipe");
- KReSRemoveRule instance = new KReSRemoveRule(load.getStore());
+ RemoveRule instance = new RemoveRule(load.getStore());
boolean expResult = true;
boolean result = instance.removeRuleFromRecipe(rule, recipe);
Copied: incubator/stanbol/trunk/kres/rules/manager/src/test/java/org/apache/stanbol/rules/manager/RuleStoreTest.java (from r1085259, incubator/stanbol/trunk/kres/rules/manager/src/test/java/org/apache/stanbol/rules/manager/KReSRuleStoreTest.java)
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/kres/rules/manager/src/test/java/org/apache/stanbol/rules/manager/RuleStoreTest.java?p2=incubator/stanbol/trunk/kres/rules/manager/src/test/java/org/apache/stanbol/rules/manager/RuleStoreTest.java&p1=incubator/stanbol/trunk/kres/rules/manager/src/test/java/org/apache/stanbol/rules/manager/KReSRuleStoreTest.java&r1=1085259&r2=1085395&rev=1085395&view=diff
==============================================================================
--- incubator/stanbol/trunk/kres/rules/manager/src/test/java/org/apache/stanbol/rules/manager/KReSRuleStoreTest.java (original)
+++ incubator/stanbol/trunk/kres/rules/manager/src/test/java/org/apache/stanbol/rules/manager/RuleStoreTest.java Fri Mar 25 14:26:06 2011
@@ -14,9 +14,9 @@ import java.io.File;
import java.util.Dictionary;
import java.util.Hashtable;
-import org.apache.stanbol.ontologymanager.ontonet.impl.ONManager;
+import org.apache.stanbol.ontologymanager.ontonet.impl.ONManagerImpl;
import org.apache.stanbol.rules.base.api.RuleStore;
-import org.apache.stanbol.rules.manager.changes.KReSRuleStore;
+import org.apache.stanbol.rules.manager.changes.RuleStoreImpl;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
@@ -33,11 +33,11 @@ import org.slf4j.LoggerFactory;
*
* @author elvio
*/
-public class KReSRuleStoreTest {
+public class RuleStoreTest {
private Logger log = LoggerFactory.getLogger(getClass());
- public KReSRuleStoreTest() {
+ public RuleStoreTest() {
}
@BeforeClass
@@ -51,10 +51,10 @@ public class KReSRuleStoreTest {
@Before
public void setUp() {
Dictionary<String, Object> configuration = new Hashtable<String, Object>();
- store = new KReSRuleStore(new ONManager(null,null, configuration),
+ store = new RuleStoreImpl(new ONManagerImpl(null,null, configuration),
configuration,
"./src/main/resources/RuleOntology/TestKReSOntologyRules.owl");
- blankStore = new KReSRuleStore(new ONManager(null,null, configuration),
+ blankStore = new RuleStoreImpl(new ONManagerImpl(null,null, configuration),
configuration, "");
}
Copied: incubator/stanbol/trunk/kres/rules/manager/src/test/java/org/apache/stanbol/rules/manager/parse/RuleParserTest.java (from r1085259, incubator/stanbol/trunk/kres/rules/manager/src/test/java/org/apache/stanbol/rules/manager/parse/KReSRuleParserTest.java)
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/kres/rules/manager/src/test/java/org/apache/stanbol/rules/manager/parse/RuleParserTest.java?p2=incubator/stanbol/trunk/kres/rules/manager/src/test/java/org/apache/stanbol/rules/manager/parse/RuleParserTest.java&p1=incubator/stanbol/trunk/kres/rules/manager/src/test/java/org/apache/stanbol/rules/manager/parse/KReSRuleParserTest.java&r1=1085259&r2=1085395&rev=1085395&view=diff
==============================================================================
--- incubator/stanbol/trunk/kres/rules/manager/src/test/java/org/apache/stanbol/rules/manager/parse/KReSRuleParserTest.java (original)
+++ incubator/stanbol/trunk/kres/rules/manager/src/test/java/org/apache/stanbol/rules/manager/parse/RuleParserTest.java Fri Mar 25 14:26:06 2011
@@ -1,9 +1,9 @@
package org.apache.stanbol.rules.manager.parse;
-import org.apache.stanbol.rules.base.api.KReSRule;
-import org.apache.stanbol.rules.base.api.util.KReSRuleList;
-import org.apache.stanbol.rules.manager.KReSKB;
-import org.apache.stanbol.rules.manager.parse.KReSRuleParser;
+import org.apache.stanbol.rules.base.api.Rule;
+import org.apache.stanbol.rules.base.api.util.RuleList;
+import org.apache.stanbol.rules.manager.KB;
+import org.apache.stanbol.rules.manager.parse.RuleParserImpl;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -13,7 +13,7 @@ import org.junit.Test;
* @author andrea.nuzzolese
*
*/
-public class KReSRuleParserTest {
+public class RuleParserTest {
private static String kReSRule;
@@ -27,11 +27,11 @@ public class KReSRuleParserTest {
@Test
public void testParser(){
try{
- KReSKB kReSKB = KReSRuleParser.parse(kReSRule);
+ KB kReSKB = RuleParserImpl.parse(kReSRule);
if(kReSKB != null){
- KReSRuleList kReSRuleList = kReSKB.getkReSRuleList();
+ RuleList kReSRuleList = kReSKB.getkReSRuleList();
if(kReSRuleList != null){
- for(KReSRule kReSRule : kReSRuleList){
+ for(Rule kReSRule : kReSRuleList){
System.out.println("RULE : "+kReSRule.toString());
}
}