All Downloads are FREE. Search and download functionalities are using the official Maven repository.

it.unibz.inf.ontop.cli.OntopReasoningCommandBase Maven / Gradle / Ivy

There is a newer version: 5.2.1.1
Show newest version
package it.unibz.inf.ontop.cli;


import com.github.rvesse.airline.annotations.Option;
import com.github.rvesse.airline.annotations.OptionType;
import com.github.rvesse.airline.annotations.help.BashCompletion;
import com.github.rvesse.airline.help.cli.bash.CompletionBehaviour;
import org.semanticweb.owlapi.model.*;

import java.util.Set;

public abstract class OntopReasoningCommandBase extends OntopMappingOntologyRelatedCommand {


    @Option(type = OptionType.COMMAND, name = {"--disable-reasoning"},
            description = "disable OWL reasoning. Default: false")
    public boolean disableReasoning = false;

    @Option(type = OptionType.COMMAND, name = {"-x", "--xml-catalog"}, title = "xml catalog file",
            description = "XML Catalog file (e.g. catalog-v001.xml generated by Protege) for redirecting ontologies imported by owl:imports")
    @BashCompletion(behaviour = CompletionBehaviour.FILENAMES)
    String xmlCatalogFile;

    @Option(type = OptionType.COMMAND, name = {"-o", "--output"},
            title = "output", description = "output file (default)")
    //@BashCompletion(behaviour = CompletionBehaviour.FILENAMES)
    protected String outputFile;

    @Option(type = OptionType.COMMAND, name = {"--enable-annotations"},
            description = "enable annotation properties defined in the ontology. Default: false")
    public boolean enableAnnotations = false;

	protected static OWLOntology extractDeclarations(OWLOntologyManager manager, OWLOntology ontology) throws OWLOntologyCreationException {

        OWLOntologyID ontologyId = ontology.getOntologyID();
        System.err.println("Ontology " + ontologyId);

        Set declarationAxioms = ontology.getAxioms(AxiomType.DECLARATION);

        manager.removeOntology(ontology);

        OWLOntology newOntology = manager.createOntology(ontologyId);

        manager.addAxioms(newOntology, declarationAxioms);

        return newOntology;
    }



}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy