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

Examples of org.apache.stanbol.rules.manager.changes.AddRule.addRule()


        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()
View Full Code Here


        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);
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

        // 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) {
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.