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

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


        TcManager tcm = new SpecialTcManager(qe, wtcp);

        String recipe = "rule[is(<http://kres.iks-project.eu/ontology.owl#Person>, ?x) -> is(<http://xmlns.com/foaf/0.1/Person>, ?x)]";

        KB kb = RuleParserImpl.parse(recipe);
        RuleList ruleList = kb.getkReSRuleList();
        Recipe actualRecipe = new RecipeImpl(null, null, ruleList);

        Refactorer refactorer = new RefactorerImpl(null, new Serializer(), tcm, ruleStore,
                emptyConfig);
        try {
View Full Code Here



  @Override
  public void addKReSRule(Rule kReSRule) {
    if(kReSRuleList == null){
      kReSRuleList = new RuleList();
    }
    kReSRuleList.add(kReSRule);
   
  }
View Full Code Here

        /**
         * Finally also the in-memory representation of the Recipe passed as input is modified.
         */
        KB kb = RuleParserImpl.parse(stanbolSyntaxRule);
        RuleList ruleList = kb.getkReSRuleList();
        for (Rule rule : ruleList) {

            /**
             * The rule must be added to the ontology, so 1. an IRI is created from its name 2. the rule
             * in Stanbol syntax is added to the rule as a literal through the hasBobyAndHe data property. 3. the rule is
View Full Code Here

        /**
         * Finally also the in-memory representation of the Recipe passed as input is modified.
         */
        KB kb = RuleParserImpl.parse(rulesStream);
        RuleList ruleList = kb.getkReSRuleList();
        for (Rule rule : ruleList) {

            /**
             * The rule must be added to the ontology, so 1. an IRI is created from its name 2. the rule
             * in Stanbol syntax is added to the rule as a literal through the hasBobyAndHe data property. 3. the rule is
View Full Code Here

    @Override
    public void createRecipe(String recipeID, String stanbolRule) {
        log.debug("Create recipe " + recipeID + " with rules in Stanbol sytnax " + stanbolRule, this);
        KB kb = RuleParserImpl.parse(stanbolRule);
        RuleList rules = kb.getkReSRuleList();

        AddRule addRule = new AddRule(this);

        Vector<IRI> ruleVectorIRIs = new Vector<IRI>();
        log.debug("Rules are " + rules.size());
        for (Rule rule : rules) {
            log.debug("Creating rule " + rule.getRuleName());
            String stanbolSyntax = rule.toKReSSyntax();

            log.debug("Rule in Stanbol Syntax : " + stanbolSyntax);
View Full Code Here

                /**
                 * Create the Recipe object.
                 */
                log.debug("Recipe in Stanbol Syntax : " + stanbolRule);

                RuleList ruleList = null;

                if (!stanbolRule.isEmpty()) {
                    ruleList = generateKnowledgeBase(stanbolRule);
                }

View Full Code Here

        Recipe recipe;
        try {
            recipe = ruleStore.getRecipe(recipeIRI);

            RuleList kReSRuleList = recipe.getkReSRuleList();

            OWLOntologyManager ontologyManager = OWLManager.createOWLOntologyManager();

            String fingerPrint = "";
            for (Rule kReSRule : kReSRuleList) {
View Full Code Here

        Recipe recipe;
        try {
            recipe = ruleStore.getRecipe(recipeIRI);

            RuleList kReSRuleList = recipe.getkReSRuleList();
            log.info("RULE LIST SIZE : " + kReSRuleList.size());

            MGraph unionMGraph = new SimpleMGraph();

            TripleCollection mGraph = OWLAPIToClerezzaConverter.owlOntologyToClerezzaMGraph(inputOntology);
View Full Code Here

        // OntModel ontModel =
        // jenaToOwlConvert.ModelOwlToJenaConvert(inputOntology, "RDF/XML");

        // OWLOntologyManager manager = OWLManager.createOWLOntologyManager();

        RuleList ruleList = recipe.getkReSRuleList();
        log.info("RULE LIST SIZE : " + ruleList.size());

        // OWLOntologyManager ontologyManager = OWLManager.createOWLOntologyManager();
        // OWLOntologyManager ontologyManager2 = OWLManager.createOWLOntologyManager();

        MGraph unionMGraph = new SimpleMGraph();
View Full Code Here

  @Test
  public void testParser(){
    try{
      KB kReSKB = RuleParserImpl.parse(kReSRule);
      if(kReSKB != null){
        RuleList kReSRuleList = kReSKB.getkReSRuleList();
        if(kReSRuleList != null){
          for(Rule kReSRule : kReSRuleList){
              log.debug("RULE : "+kReSRule.toString());
          }
        }
View Full Code Here

TOP

Related Classes of org.apache.stanbol.rules.base.api.util.RuleList

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.