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

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


                UriRef ruleID = (UriRef) solutionMapping.get("rule");
                Literal description = (Literal) solutionMapping.get("description");

                try {
                    Recipe recipe = getRecipe(recipeID);
                    Rule rule = new RecipeRule(recipe, getRule(recipe, ruleID));
                    if (description != null) {
                        rule.setDescription(description.getLexicalForm());
                    }

                    matchingRules.add(rule);
                } catch (NoSuchRecipeException e) {
                    // in this case go on in the iteration by fetching other matching recipes
View Full Code Here


                UriRef ruleID = (UriRef) solutionMapping.get("rule");
                Literal description = (Literal) solutionMapping.get("description");

                try {
                    Recipe recipe = getRecipe(recipeID);
                    Rule rule = new RecipeRule(recipe, getRule(recipe, ruleID));
                    if (description != null) {
                        rule.setDescription(description.getLexicalForm());
                    }

                    matchingRules.add(rule);
                } catch (NoSuchRecipeException e) {
                    // in this case go on in the iteration by fetching other matching recipes
View Full Code Here

    }
  }

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

    prefix();
    expressionCont();
  }

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

            if (ruleList != null && !ruleList.isEmpty()) {

                Iterator<Rule> ruleIterator = ruleList.iterator();

                while (ruleIterator.hasNext()) {
                    Rule rule = ruleIterator.next();
                    swrlRules.add(adaptRuleTo(rule, SWRLRule.class));
                }
            }

        } else {
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 < rules.length && !removed; i++) {
            Rule semionRule = rules[i];
            if (semionRule.equals(o)) {
                Rule[] semionRulesCopy = new Rule[rules.length - 1];
                System.arraycopy(rules, 0, semionRulesCopy, 0, i);
                System.arraycopy(rules, i + 1, semionRulesCopy, 0, semionRulesCopy.length - i);
                rules = semionRulesCopy;
                removed = true;
View Full Code Here

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

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

        try {
            Rule rule = recipe.getRule(recipe.listRuleIDs().get(0));
            Assert.assertNotNull(rule);
        } catch (NoSuchRuleInRecipeException e) {
            Assert.fail();
        }
View Full Code Here

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

        try {
            Rule rule = recipe.getRule(recipe.listRuleNames().get(0));
            Assert.assertNotNull(rule);
        } catch (NoSuchRuleInRecipeException e) {
            Assert.fail();
        }
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.