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

Examples of org.apache.stanbol.rules.base.api.Recipe


      return false;
    }
  }

  public Recipe next() {
    Recipe recipe = recipes[currentIndex];
    currentIndex++;
    return recipe;
  }
View Full Code Here


  }

  public boolean remove(Object o) {
    boolean removed = false;
    for(int i=0; i<recipes.length && !removed; i++){
      Recipe recipe = recipes[i];
      if(recipe.equals(o)){
        Recipe[] recipesCopy = new Recipe[recipes.length-1];
        System.arraycopy(recipes, 0, recipesCopy, 0, i);
        System.arraycopy(recipes, i+1, recipesCopy, 0, recipesCopy.length-i);
        recipes = recipesCopy;
        removed = true;
View Full Code Here

  public boolean removeAll(Collection<?> c) {
    if(contains(c)){
      for(Object o : c){
        boolean removed = false;
        for(int i=0; i<recipes.length && !removed; i++){
          Recipe recipe = recipes[i];
          if(recipe.equals(o)){
            Recipe[] recipesCopy = new Recipe[recipes.length-1];
            System.arraycopy(recipes, 0, recipesCopy, 0, i);
            System.arraycopy(recipes, i+1, recipesCopy, 0, recipesCopy.length-i);
            recipes = recipesCopy;
            removed = true;
View Full Code Here

     *            the rule in Rule syntax
     */
    @Override
    public Recipe addRuleToRecipe(String recipeID, String stanbolRule) throws NoSuchRecipeException {

        Recipe recipe = getRecipe(IRI.create(recipeID));
        return addRuleToRecipe(recipe, stanbolRule);

    }
View Full Code Here

     *            the rule in Rule syntax
     */
    @Override
    public Recipe addRuleToRecipe(String recipeID, InputStream rulesStream) throws NoSuchRecipeException {

        Recipe recipe = getRecipe(IRI.create(recipeID));
        return addRuleToRecipe(recipe, rulesStream);

    }
View Full Code Here

    }

    @Override
    public Recipe getRecipe(IRI recipeIRI) throws NoSuchRecipeException {
        log.debug("Called get recipe for id: " + recipeIRI.toString());
        Recipe recipe = null;

        if (recipeIRI != null) {
            OWLDataFactory factory = OWLManager.getOWLDataFactory();
            OWLIndividual recipeIndividual = factory.getOWLNamedIndividual(recipeIRI);
            if (recipeIndividual != null) {
View Full Code Here

        return recipies;
    }

    @Override
    public boolean removeRecipe(IRI recipeIRI) {
        Recipe recipe;
        try {
            recipe = getRecipe(recipeIRI);
            return removeRecipe(recipe);
        } catch (NoSuchRecipeException ex) {
            log.error("Exception cougth: ", ex);
View Full Code Here

        OWLOntology refactoredOntology = null;

        // ClerezzaOntologyStorage ontologyStorage = onManager.getOntologyStore();

        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

        // JenaToOwlConvert jenaToOwlConvert = new JenaToOwlConvert();

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

        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

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

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

TOP

Related Classes of org.apache.stanbol.rules.base.api.Recipe

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.