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

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


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

        String ID = owl.getOntologyID().toString().replace("<", "").replace(">", "") + "#";
        // Load the example file
        LoadRuleFile load = new LoadRuleFile("./src/main/resources/RuleOntology/TestRuleFileExample.txt",
                store);
        owl = load.getStore().getOntology();
        GetRecipe rule = new GetRecipe(store);
        HashMap<IRI,String> map = rule.getRecipe(IRI
                .create("http://kres.iks-project.eu/ontology/meta/rmi.owl#MyRecipe"));
        HashMap<IRI,String> expmap = new HashMap();
        expmap.put(
View Full Code Here


    public void testGetAllRecipes() {
        // RuleStore store = new RuleStoreImpl("./src/main/resources/RuleOntology/TestKReSOntologyRules.owl");
        OWLOntology owl = store.getOntology();
        String ID = owl.getOntologyID().toString().replace("<", "").replace(">", "") + "#";
        // Load the example file
        LoadRuleFile load = new LoadRuleFile("./src/main/resources/RuleOntology/TestRuleFileExample.txt",
                store);
        owl = load.getStore().getOntology();

        GetRecipe rule = new GetRecipe(store);

        HashMap<IRI,String> map = rule.getAllRecipes();
        HashMap<IRI,String> expmap = new HashMap();
View Full Code Here

        configuration2.put(RuleStore.RULE_NAMESPACE, "http://kres.iks-project.eu/ontology/meta/rmi.owl#");
        RuleStore store = new RuleStoreImpl(configuration2,
                "./src/main/resources/RuleOntology/TestKReSOntologyRules.owl");
        RuleStore newstore = new RuleStoreImpl(configuration2, store.getOntology());
        // Load the example file
        LoadRuleFile load = new LoadRuleFile("./src/main/resources/RuleOntology/TestRuleFileExample.txt",
                store);
        OWLOntology result = load.getStore().getOntology();

        // //////////////////////////////////////////////////////////////////
        // Create ontology
        OWLOntologyManager owlmanager = OWLManager.createOWLOntologyManager();
        OWLOntology owlmodel = newstore.getOntology();
View Full Code Here

    @Test
    public void testAddRecipe_3args_1() {
//        RuleStore store  = new RuleStoreImpl("./src/main/resources/RuleOntology/TestKReSOntologyRules.owl");
        OWLOntology owl = store.getOntology();
        //Load the example file
        LoadRuleFile load = new LoadRuleFile("./src/main/resources/RuleOntology/TestRuleFileExample.txt",store);

        String ID = owl.getOntologyID().toString().replace("<","").replace(">","")+"#";
       
        String recipeName = "MyRecipeNew";
        Vector<IRI> rules = new Vector();
        rules.add(IRI.create(ID+"MyRuleC"));
        rules.add(IRI.create(ID+"MyRuleB"));
        rules.add(IRI.create(ID+"MyRuleA"));
        String recipeDescription = "My comment to the recipe";
        AddRecipe instance = new AddRecipe(load.getStore());
        boolean result = instance.addRecipe(recipeName, rules, recipeDescription);
        OWLOntology newonto = instance.getStore().getOntology();
        if(result){
            OWLNamedIndividual ruleind = newonto.getOWLOntologyManager().getOWLDataFactory().getOWLNamedIndividual(IRI.create(ID + "MyRecipeNew"));
            int axiom = newonto.getAxioms(ruleind).size();
View Full Code Here

    @Test
    public void testAddRecipe_3args_2() {
//     RuleStore store  = new RuleStoreImpl("./src/main/resources/RuleOntology/TestKReSOntologyRules.owl");
        OWLOntology owl = store.getOntology();
        //Load the example file
        LoadRuleFile load = new LoadRuleFile("./src/main/resources/RuleOntology/TestRuleFileExample.txt",store);
        String ID = owl.getOntologyID().toString().replace("<","").replace(">","")+"#";

        IRI recipeName = IRI.create(ID+"MyRecipeNew");
        Vector<IRI> rules = new Vector();
        rules.add(IRI.create(ID+"MyRuleC"));
        rules.add(IRI.create(ID+"MyRuleB"));
        rules.add(IRI.create(ID+"MyRuleA"));
        String recipeDescription = "My comment to the recipe";
        AddRecipe instance = new AddRecipe(load.getStore());
        boolean result = instance.addRecipe(recipeName, rules, recipeDescription);
        OWLOntology newonto = instance.getStore().getOntology();

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

    @Test
    public void testAddRecipeMap() {
//        RuleStore store  = new RuleStoreImpl("./src/main/resources/RuleOntology/TestKReSOntologyRules.owl");
        OWLOntology owl = store.getOntology();
        //Load the example file
        LoadRuleFile load = new LoadRuleFile("./src/main/resources/RuleOntology/TestRuleFileExample.txt",store);
        String ID = owl.getOntologyID().toString().replace("<","").replace(">","")+"#";
        HashMap<String, Vector<IRI>> recipeMap = new HashMap();
        HashMap<String, String> recipeDescriptionMap = new HashMap();
        AddRecipe instance = new AddRecipe(load.getStore());

        Vector<IRI> rules = new Vector();
        rules.add(IRI.create(ID+"MyRuleC"));
        rules.add(IRI.create(ID+"MyRuleB"));
        rules.add(IRI.create(ID+"MyRuleA"));
View Full Code Here

    @Test
    public void testAddRecipeMapIRI() {
//        RuleStore store  = new RuleStoreImpl("./src/main/resources/RuleOntology/TestKReSOntologyRules.owl");
        OWLOntology owl = store.getOntology();
        //Load the example file
        LoadRuleFile load = new LoadRuleFile("./src/main/resources/RuleOntology/TestRuleFileExample.txt",store);

        String ID = owl.getOntologyID().toString().replace("<","").replace(">","")+"#";
        HashMap<IRI, Vector<IRI>> recipeMap = new HashMap();
        HashMap<IRI, String> recipeDescriptionMap = new HashMap();
        AddRecipe instance = new AddRecipe(load.getStore());

        Vector<IRI> rules = new Vector();
        rules.add(IRI.create(ID+"MyRuleC"));
        rules.add(IRI.create(ID+"MyRuleB"));
        rules.add(IRI.create(ID+"MyRuleA"));
View Full Code Here

    @Test
    public void testRemoveRule() {
        // 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);
View Full Code Here

    public void testRemoveSingleRule() throws OWLOntologyStorageException {
        // RuleStore store = new RuleStoreImpl("./src/main/resources/RuleOntology/TestKReSOntologyRules.owl");
        String owlID = store.getOntology().getOntologyID().toString().replace("<", "").replace(">", "") + "#";

        // Load the example file
        LoadRuleFile load = new LoadRuleFile("./src/main/resources/RuleOntology/TestRuleFileExample.txt",
                store);
        IRI rule = IRI.create(owlID + "MyRuleB");
        IRI recipe = IRI.create(owlID + "MyRecipe");
        RemoveRule instance = new RemoveRule(load.getStore());
        boolean expResult = true;
        boolean result = instance.removeRuleFromRecipe(rule, recipe);

        if (result) {
            assertEquals(expResult, result);
View Full Code Here

    @Test
    public void testRemoveRule_String() throws OWLOntologyCreationException {
        // RuleStore store = new RuleStoreImpl("./src/main/resources/RuleOntology/TestKReSOntologyRules.owl");
        String owlID = store.getOntology().getOntologyID().toString().replace("<", "").replace(">", "") + "#";
        // Load the example file
        LoadRuleFile load = new LoadRuleFile("./src/main/resources/RuleOntology/TestRuleFileExample.txt",
                store);
        OWLOntology owlstart = load.getStore().getOntology();
        String recipeName = owlID + "MyRecipe";
        RemoveRecipe instance = new RemoveRecipe(load.getStore());

        boolean expResult = true;
        boolean result = instance.removeRecipe(IRI.create(recipeName));
        OWLOntology owlend = instance.getStore().getOntology();
View Full Code Here

TOP

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

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.