Hi
 
I'm getting an NPE when refactoring using the Java API:
 
java.lang.NullPointerException
        at
org.apache.stanbol.rules.refactor.impl.RefactorerImpl.ontologyRefactoring(Re
factorerImpl.java:284)
 
This is something that used to work with an old svn revision, current rev is
1236695.
 
I'm creating a Recipe with some rules, following the code in the REST API as
an example.
 
My Bundle is getting the rule store with
 
@Reference
protected RuleStore m_ruleStore;
 
I'm adding rules to the store with:
 
AddRule adder = new AddRule(m_ruleStore);
adder.addRule(ruleIRI, rule, description);
 
(which is returning true)
 
I'm adding the recipe by creating a Vector<IRI> ruleIris and populating with
the rule IRIs, then
 
AddRecipe recipeAdder = new AddRecipe(m_ruleStore);
recipeAdder.addRecipe(recipeIri, ruleIris, "my rule");
 
(returns true)
 
and
m_ruleStore.saveOntology().
 
I can query for the recipe and list the rules fine using a
GetRecipe#getAllRecipes();
 
However, on refactoring with a Refactorer, got in my bundle using:
 
@Reference
Refactorer m_refactorer;
 
Then
 
m_refactorer.ontologyRefactoring(outputIri, inputIri, recipeIri)
 
But this is throwing the NPE above.
 
(I notice it is using
RuleStore#getRecipe  and then Recipe#getkReSRuleList  
And if I try to get the recipes using
m_ruleStore.listRecipes();
this returns Null, which is odd...)
 
So how do I get this working?  There seem to be "two APIs" in a sense, the
AddRule/GetRule etc stuff and the methods directly on the RuleStore.
 
Thanks
Steve

Reply via email to