Package org.apache.stanbol.rules.base.api

Examples of org.apache.stanbol.rules.base.api.Rule


    private void removeRuleInRecipeTest() throws Exception {
        Recipe recipe = store.getRecipe(new UriRef("http://incubator.apache.com/stanbol/rules/test/recipeA"));

        String tmp = recipe.toString();
        Rule rule = recipe.getRule(recipe.listRuleNames().get(0));

        store.removeRule(recipe, rule);

        Recipe recipe2 = store
                .getRecipe(new UriRef("http://incubator.apache.com/stanbol/rules/test/recipeA"));
View Full Code Here


    public Response getRule(@PathParam("recipe") String recipeID,
                            @QueryParam("rule") String ruleID,
                            @Context HttpHeaders headers) {

        Recipe recipe;
        Rule rule;

        ResponseBuilder responseBuilder;
        try {
         
          URI uri = new URI(recipeID);
View Full Code Here

    public Response showRecipe(@PathParam("recipe") String recipeID,
                               @QueryParam("rule") String ruleID,
                               @Context HttpHeaders headers) {

        Recipe recipe;
        Rule rule;

        ResponseBuilder responseBuilder;
        try {
         
          URI uri = new URI(recipeID);
View Full Code Here

          if (rule != null && !rule.isEmpty()) {
 
              Recipe rcp;
              try {
                rcp = ruleStore.getRecipe(new UriRef(recipe));
                  Rule rl = ruleStore.getRule(rcp, new UriRef(rule));
                  ruleStore.removeRule(rcp, rl);
              } catch (NoSuchRecipeException e) {
                  log.error(e.getMessage(), e);
                  responseBuilder = Response.status(Status.PRECONDITION_FAILED);
              } catch (RecipeConstructionException e) {
View Full Code Here

      return false;
    }
  }

  public Rule next() {
    Rule semionRule = semionRules[currentIndex];
    currentIndex++;
    return semionRule;
  }
View Full Code Here

  }

  public boolean remove(Object o) {
    boolean removed = false;
    for (int i = 0; i < kReSRules.length && !removed; i++) {
      Rule semionRule = kReSRules[i];
      if (semionRule.equals(o)) {
        Rule[] semionRulesCopy = new Rule[kReSRules.length - 1];
        System.arraycopy(kReSRules, 0, semionRulesCopy, 0, i);
        System.arraycopy(kReSRules, i + 1, semionRulesCopy, 0,
            semionRulesCopy.length - i);
        kReSRules = semionRulesCopy;
View Full Code Here

  public boolean removeAll(Collection<?> c) {
    if (contains(c)) {
      for (Object o : c) {
        boolean removed = false;
        for (int i = 0; i < kReSRules.length && !removed; i++) {
          Rule semionRule = kReSRules[i];
          if (semionRule.equals(o)) {
            Rule[] semionRulesCopy = new Rule[kReSRules.length - 1];
            System.arraycopy(kReSRules, 0, semionRulesCopy, 0, i);
            System.arraycopy(kReSRules, i + 1, semionRulesCopy, 0,
                semionRulesCopy.length - i);
            kReSRules = semionRulesCopy;
View Full Code Here

    }
  }

  final public void expression() throws ParseException {
    Rule rule;
    prefix();
    expressionCont();
  }
View Full Code Here

  }

  final public void prefix() throws ParseException {
    String nsPrefix;
    Object obj;
    Rule rule;
    switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
    case VAR:
      nsPrefix = getVariable();
      switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
      case EQUAL:
View Full Code Here

TOP

Related Classes of org.apache.stanbol.rules.base.api.Rule

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.