Package org.apache.stanbol.rules.manager.changes

Examples of org.apache.stanbol.rules.manager.changes.AddRule


        // RuleStore store = new RuleStoreImpl("./src/main/resources/RuleOntology/TestKReSOntologyRules.owl");

        String ruleName = "MyRuleA";
        String ruleBodyHead = "MyRuleABody -> MyRuleAHead";
        String ruleDescription = "My comment to the rule A";
        AddRule instance = new AddRule(store);

        boolean result = instance.addRule(ruleName, ruleBodyHead, ruleDescription);
        OWLOntology newonto = instance.getStore().getOntology();
        String ID = newonto.getOntologyID().toString().replace("<", "").replace(">", "") + "#";

        if (result) {
            OWLNamedIndividual ruleind = newonto.getOWLOntologyManager().getOWLDataFactory()
                    .getOWLNamedIndividual(IRI.create(ID + "MyRuleA"));
View Full Code Here


        OWLOntology owl = store.getOntology();
        String ID = owl.getOntologyID().toString().replace("<", "").replace(">", "") + "#";
        IRI ruleName = IRI.create(ID + "MyRuleA");
        String ruleBodyHead = "MyRuleABody -> MyRuleAHead";
        String ruleDescription = "My comment to the rule A";
        AddRule instance = new AddRule(store);

        boolean result = instance.addRule(ruleName, ruleBodyHead, ruleDescription);
        OWLOntology newonto = instance.getStore().getOntology();

        if (result) {
            OWLNamedIndividual ruleind = newonto.getOWLOntologyManager().getOWLDataFactory()
                    .getOWLNamedIndividual(ruleName);
            int axiom = newonto.getAxioms(ruleind).size();
View Full Code Here

        ruleBodyHeadMap.put("MyRuleA", "MyRuleABody -> MyRuleAHead");
        ruleBodyHeadMap.put("MyRuleB", "MyRuleBBody -> MyRuleBHead");
        ruleDescriptionMap.put("MyRuleA", "My comment to the rule A");
        ruleDescriptionMap.put("MyRuleB", "My comment to the rule B");

        AddRule instance = new AddRule(store);

        boolean result = instance.addRuleMap(ruleBodyHeadMap, ruleDescriptionMap);
        OWLOntology newonto = instance.getStore().getOntology();

        if (result) {
            Iterator<String> keys = ruleBodyHeadMap.keySet().iterator();
            int axiom = 0;
            while (keys.hasNext()) {
View Full Code Here

        ruleBodyHeadMap.put(IRI.create(ID + "MyRuleA"), "MyRuleABody -> MyRuleAHead");
        ruleBodyHeadMap.put(IRI.create(ID + "MyRuleB"), "MyRuleBBody -> MyRuleBHead");
        ruleDescriptionMap.put(IRI.create(ID + "MyRuleA"), "My comment to the rule A");
        ruleDescriptionMap.put(IRI.create(ID + "MyRuleB"), "My comment to the rule B");

        AddRule instance = new AddRule(store);

        boolean result = instance.addRuleMapIRI(ruleBodyHeadMap, ruleDescriptionMap);
        OWLOntology newonto = instance.getStore().getOntology();

        if (result) {
            Iterator<IRI> keys = ruleBodyHeadMap.keySet().iterator();
            int axiom = 0;
            while (keys.hasNext()) {
View Full Code Here

            }

            // The rule is added to the store and to the recipe
            if ((kres_syntax != null) & (description != null)) {
                // Get the rule
                AddRule inrule = new AddRule(ruleStore);
                boolean ok = inrule.addRule(IRI.create(rule), kres_syntax, description);
                if (!ok) {
                    log.error("Problem to add: " + rule);
                    ResponseBuilder rb = Response.status(Status.CONFLICT);
                    MediaType mediaType = MediaTypeUtil.getAcceptableMediaType(headers, null);
                    if (mediaType != null) rb.header(HttpHeaders.CONTENT_TYPE, mediaType);
View Full Code Here

        // RuleStore store = new RuleStoreImpl("./src/main/resources/RuleOntology/TestKReSOntologyRules.owl");

        // Load the example file
        LoadRuleFile load = new LoadRuleFile("./src/main/resources/RuleOntology/TestRuleFileExample.txt",
                store);
        AddRule rule = new AddRule(load.getStore());
        rule.addRule("MyRuleProva", "Body -> Head", null);
        String ruleName = "MyRuleProva";
        RemoveRule instance = new RemoveRule(rule.getStore());
        boolean expResult = true;
        boolean result = instance.removeRule(ruleName);
        if (result) {
            assertEquals(expResult, result);
            // TODO review the generated test code and remove the default call to fail.
View Full Code Here

TOP

Related Classes of org.apache.stanbol.rules.manager.changes.AddRule

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.