Examples of RuleList


Examples of org.apache.stanbol.rules.base.api.util.RuleList

        List<com.hp.hpl.jena.reasoner.rulesys.Rule> jenaRules = null;

        if (type == com.hp.hpl.jena.reasoner.rulesys.Rule.class) {

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

            jenaRules = new ArrayList<com.hp.hpl.jena.reasoner.rulesys.Rule>();
            for (int i = 0; ruleIterator.hasNext(); i++) {
                jenaRules.add((com.hp.hpl.jena.reasoner.rulesys.Rule) adaptRuleTo(ruleIterator.next(), type));
            }
View Full Code Here

Examples of org.apache.stanbol.rules.base.api.util.RuleList

        List<SWRLRule> swrlRules = null;

        if (type == SWRLRule.class) {

            RuleList ruleList = recipe.getRuleList();

            swrlRules = new ArrayList<SWRLRule>();

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

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

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

Examples of org.apache.stanbol.rules.base.api.util.RuleList

        List<SPARQLObject> sparqlObjects = null;

        if (type == SPARQLObject.class) {

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

            sparqlObjects = new ArrayList<SPARQLObject>();
            for (int i = 0; ruleIterator.hasNext(); i++) {
                sparqlObjects.add((SPARQLObject) adaptRuleTo(ruleIterator.next(), type));
            }
View Full Code Here

Examples of org.apache.stanbol.rules.base.api.util.RuleList

    public KB(String ruleNamespace) {
        log.debug("Setting up a KReSKB");
        prefixes = new Hashtable<String,String>();
        prefixes.put("var", Symbols.variablesPrefix);
        prefixes.put("rmi2", ruleNamespace);
        ruleList = new RuleList();
    }
View Full Code Here

Examples of org.apache.stanbol.rules.base.api.util.RuleList

        if (type == ConstructQuery.class) {

            constructQueries = new ArrayList<ConstructQuery>();

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

            for (int i = 0; ruleIterator.hasNext(); i++) {
                constructQueries.add((ConstructQuery) adaptRuleTo(ruleIterator.next(), type));
            }
View Full Code Here

Examples of org.apache.stanbol.rules.base.api.util.RuleList

        }

    }

    private void findRulesByDescriptionTest() throws Exception {
        RuleList rules = store.findRulesByDescription("a test rule.");
        if (rules.isEmpty()) {
            Assert.fail();
        } else {
            Assert.assertTrue(true);
        }
    }
View Full Code Here

Examples of org.apache.stanbol.rules.base.api.util.RuleList

            Assert.assertTrue(true);
        }
    }

    private void findRulesByNameTest() throws Exception {
        RuleList rules = store.findRulesByName("1");

        if (rules.isEmpty()) {
            Assert.fail();
        } else {
            Assert.assertTrue(true);
        }
    }
View Full Code Here

Examples of org.apache.stanbol.rules.base.api.util.RuleList

    @Test
    public void testParser() {
        try {
            KB kReSKB = RuleParserImpl.parse("http://incubator.apache.org/stanbol/rules/test/", kReSRule);
            if (kReSKB != null) {
                RuleList kReSRuleList = kReSKB.getRuleList();
                if (kReSRuleList != null) {
                    for (Rule kReSRule : kReSRuleList) {
                        log.debug("RULE : " + kReSRule.toString());
                    }
                }
View Full Code Here

Examples of org.apache.stanbol.rules.base.api.util.RuleList

     * @throws RefactoringException
     */
    private OWLOntology doRefactoring(InputStream input, KB kb) throws OWLOntologyCreationException,
                                                               RefactoringException {
        if (kb == null) return null;
        RuleList ruleList = kb.getRuleList();
        if (ruleList == null) return null;
        Recipe actualRecipe = new RecipeImpl(null, null, ruleList);

        // Parse the input ontology
        OWLOntologyManager manager = OWLManager.createOWLOntologyManager();
View Full Code Here

Examples of org.apache.stanbol.rules.base.api.util.RuleList

    @Produces(value = {MediaType.APPLICATION_JSON, KRFormat.RDF_XML, KRFormat.TURTLE, KRFormat.OWL_XML,
                       KRFormat.RDF_JSON, KRFormat.FUNCTIONAL_OWL, KRFormat.MANCHESTER_OWL,
                       MediaType.TEXT_PLAIN})
    @Path("/find/rules")
    public Response findRules(@QueryParam("name") String name, @QueryParam("description") String description) {
        RuleList rules = new RuleList();
        if (name != null && !name.isEmpty()) {
            rules.addAll(ruleStore.findRulesByName(name));
        } else {
            rules.addAll(ruleStore.findRulesByDescription(description));
        }

        if (rules.isEmpty()) {
            return Response.status(Status.NOT_FOUND).build();
        }

        return Response.ok(rules).build();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.