public static KB parse( String namespace, InputStream inStream ) { kb = new KB(namespace); Reader reader = new InputStreamReader(inStream); RuleParserImpl parser = new RuleParserImpl(reader); try { parser.start(); } catch (TokenMgrError e) { throw new IllegalStateException(e); } catch (ParseException e) { throw new IllegalStateException(e); } return kb; }
/** Reinitialise. */ public void ReInit(java.io.InputStream stream) { ReInit(stream, null); } /** Reinitialise. */
final public AtomList atomListRest() throws ParseException { AtomList atomList = new AtomList(); RuleAtom kReSAtom; switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case AND: jj_consume_token(AND); atomList = atomList(); {if (true) return atomList;} break; default: jj_la1[3] = jj_gen; {if (true) return atomList;} } throw new Error("Missing return statement in function"); }
final public AtomList[] ruleDefinition() throws ParseException { AtomList body; AtomList head; Token t; body = atomList(); jj_consume_token(LARROW); head = atomList(); {if (true) return new AtomList[]{body, head};} throw new Error("Missing return statement in function"); }
final public RuleAtom atom() throws ParseException { RuleAtom ruleAtom; switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case IS: ruleAtom = classAtom(); {if (true) return ruleAtom;} break; case HAS: ruleAtom = individualPropertyAtom(); {if (true) return ruleAtom;} break; case VALUES: ruleAtom = datavaluedPropertyAtom(); {if (true) return ruleAtom;} break; case LET: ruleAtom = letAtom(); {if (true) return ruleAtom;} break; case NEW_IRI: ruleAtom = newIRIAtom(); {if (true) return ruleAtom;} break; case NEW_LITERAL: ruleAtom = newLiteralAtom(); {if (true) return ruleAtom;} break; case NOT: case IS_BLANK:
public static void main(String[] args){ InputStream inputStream; try { inputStream = new FileInputStream(new File("/Users/mac/Desktop/domain.rule")); RuleList ruleList = RuleParserImpl.parse("http://www.prova.it/", inputStream).getRuleList(); for (Rule rule : ruleList) { } } catch (FileNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } } }
final public AtomList atomList() throws ParseException { AtomList atomList = new AtomList(); RuleAtom kReSAtom; switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case SAME: case DIFFERENT: case LESSTHAN: case GREATERTHAN: case IS: case NEW_IRI: case NEW_LITERAL: case STARTS_WITH: case ENDS_WITH: case LET: case HAS: case VALUES: case NOT: case UNION: case IS_BLANK: kReSAtom = atom(); atomList = atomListRest(); atomList.addToHead(kReSAtom); {if (true) return atomList;} break; default: jj_la1[2] = jj_gen; {if (true) return atomList;} } throw new Error("Missing return statement in function"); }
final public RuleAtom atom() throws ParseException { RuleAtom ruleAtom; switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case IS: ruleAtom = classAtom(); {if (true) return ruleAtom;} break; case HAS: ruleAtom = individualPropertyAtom(); {if (true) return ruleAtom;} break; case VALUES: ruleAtom = datavaluedPropertyAtom(); {if (true) return ruleAtom;} break; case LET: ruleAtom = letAtom(); {if (true) return ruleAtom;} break; case NEW_IRI: ruleAtom = newIRIAtom(); {if (true) return ruleAtom;} break; case NEW_LITERAL: ruleAtom = newLiteralAtom(); {if (true) return ruleAtom;} break; case NOT: case IS_BLANK:
public static void main(String[] args){ InputStream inputStream; try { inputStream = new FileInputStream(new File("/Users/mac/Desktop/domain.rule")); RuleList ruleList = RuleParserImpl.parse("http://www.prova.it/", inputStream).getRuleList(); for (Rule rule : ruleList) { } } catch (FileNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } } }
final public AtomList atomList() throws ParseException { AtomList atomList = new AtomList(); RuleAtom kReSAtom; switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case SAME: case DIFFERENT: case LESSTHAN: case GREATERTHAN: case IS: case NEW_IRI: case NEW_LITERAL: case STARTS_WITH: case ENDS_WITH: case LET: case HAS: case VALUES: case NOT: case UNION: case IS_BLANK: kReSAtom = atom(); atomList = atomListRest(); atomList.addToHead(kReSAtom); {if (true) return atomList;} break; default: jj_la1[2] = jj_gen; {if (true) return atomList;} } throw new Error("Missing return statement in function"); }
final public AtomList[] ruleDefinition() throws ParseException { AtomList body; AtomList head; Token t; body = atomList(); jj_consume_token(LARROW); head = atomList(); {if (true) return new AtomList[]{body, head};} throw new Error("Missing return statement in function"); }
try { output = doRefactoring(input, RuleParserImpl.parse("http://incubator.apache.com/stanbol/rules/refactor/", recipe)); } catch (OWLOntologyCreationException e1) { throw new WebApplicationException(e1, INTERNAL_SERVER_ERROR);
final public AtomList atomListRest() throws ParseException { AtomList atomList = new AtomList(); RuleAtom kReSAtom; switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case AND: jj_consume_token(AND); atomList = atomList(); {if (true) return atomList;} break; default: jj_la1[3] = jj_gen; {if (true) return atomList;} } throw new Error("Missing return statement in function"); }
final public RuleAtom unionAtom() throws ParseException { AtomList atomList1; AtomList atomList2; jj_consume_token(UNION); jj_consume_token(LPAR); atomList1 = atomList(); jj_consume_token(COMMA); atomList2 = atomList(); jj_consume_token(RPAR); {if (true) return new UnionAtom(atomList1, atomList2);} throw new Error("Missing return statement in function"); }
public static KB parse( String namespace, InputStream inStream ) { kb = new KB(namespace); Reader reader = new InputStreamReader(inStream); RuleParserImpl parser = new RuleParserImpl(reader); try { parser.start(); } catch (TokenMgrError e) { throw new IllegalStateException(e); } catch (ParseException e) { throw new IllegalStateException(e); } return kb; }
/** Reinitialise. */ public void ReInit(java.io.InputStream stream) { ReInit(stream, null); } /** Reinitialise. */
/** * * Parse the set of rules provided by the rulesStream parameter as Stanbol syntax rules and add them to * the Recipe in the store.<br/> * The recipe is a {@link Graph} managed by the {@link TcManager}. * * * @param recipe * {@link Recipe} the recipe * @param rulesStream * {@link InputStream} the rule in Stanbol syntax * * @return the recipe with the new rule. */ @Override public Recipe addRulesToRecipe(Recipe recipe, InputStream rulesStream, String description) { log.debug("Adding rule to recipe " + recipe); IRI recipeID = recipe.getRecipeID(); String namespace = recipeID.toString().substring(1, recipeID.toString().length() - 1) + "/"; log.info("Rule Namespace is " + namespace); RuleList ruleList = RuleParserImpl.parse(namespace, rulesStream).getRuleList(); for (Rule rule : ruleList) { recipe = addRuleToRecipe(recipe, rule, description); } return recipe; }
final public RuleAtom unionAtom() throws ParseException { AtomList atomList1; AtomList atomList2; jj_consume_token(UNION); jj_consume_token(LPAR); atomList1 = atomList(); jj_consume_token(COMMA); atomList2 = atomList(); jj_consume_token(RPAR); {if (true) return new UnionAtom(atomList1, atomList2);} throw new Error("Missing return statement in function"); }
public static KB parse( String namespace, String inString ) { { kb = new KB(namespace); Reader reader = new StringReader( inString ) ; RuleParserImpl parser = new RuleParserImpl(reader); StringBuffer buffer = new StringBuffer() ; try { parser.start( ) ; } catch( TokenMgrError e ) { throw new IllegalStateException(e) ; } catch( ParseException e ) { throw new IllegalStateException(e) ; } return kb ; } }
/** * * @param recipeIRI * the IRI of the recipe * @param stanbolRule * the rule in Rule syntax */ @Override public Recipe addRulesToRecipe(Recipe recipe, String stanbolRule, String description) { IRI recipeID = recipe.getRecipeID(); String namespace = recipeID.toString().substring(1, recipeID.toString().length() - 1) + "/"; RuleList ruleList = RuleParserImpl.parse(namespace, stanbolRule).getRuleList(); for (Rule rule : ruleList) { recipe = addRuleToRecipe(recipe, rule, description); } return recipe; }