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(); } } }
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(); } } }
/** * * 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; }
/** * * 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; }
try { output = doRefactoring(input, RuleParserImpl.parse("http://incubator.apache.com/stanbol/rules/refactor/", recipeStream)); } catch (OWLOntologyCreationException e1) { throw new WebApplicationException(e1, INTERNAL_SERVER_ERROR);
try { output = doRefactoring(input, RuleParserImpl.parse("http://incubator.apache.com/stanbol/rules/refactor/", recipe)); } catch (OWLOntologyCreationException e1) { throw new WebApplicationException(e1, INTERNAL_SERVER_ERROR);
/** * * @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; }
/** * * @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; }
if (!stanbolSyntax.isEmpty()) { String namespace = recipeID.toString().substring(1, recipeID.toString().length() - 1) + "/"; ruleList = RuleParserImpl.parse(namespace, stanbolSyntax).getRuleList();
if (!stanbolSyntax.isEmpty()) { String namespace = recipeID.toString().substring(1, recipeID.toString().length() - 1) + "/"; ruleList = RuleParserImpl.parse(namespace, stanbolSyntax).getRuleList();
public static void main(String[] args){ RuleAdapter ruleAdapter = new ClerezzaAdapter(); try { KB kb = RuleParserImpl.parse("http://sssw.org/2012/rules/", new FileInputStream("/Users/mac/Documents/CNR/SSSW2012/construct/exercise3")); System.out.println("Rules: " + kb.getRuleList().size()); Recipe recipe = new RecipeImpl(new IRI("http://sssw.org/2012/rules/"), "Recipe", kb.getRuleList());
public static void main(String[] args){ RuleAdapter ruleAdapter = new JenaAdapter(); try { KB kb = RuleParserImpl.parse("http://sssw.org/2012/rules/", new FileInputStream("/Users/mac/Documents/CNR/SSSW2012/rules/exercise1")); System.out.println("Rules: " + kb.getRuleList().size()); Recipe recipe = new RecipeImpl(new IRI("http://sssw.org/2012/rules/"), "Recipe", kb.getRuleList());