Class ExtractOperation


  • public class ExtractOperation
    extends Object
    Extract a set of OWLEntities from the input ontology to an output ontology. Uses the OWLAPI's SyntacticLocalityModuleExtractor (SLME).
    Author:
    James A. Overton
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static org.semanticweb.owlapi.model.OWLOntology extract​(org.semanticweb.owlapi.model.OWLOntology inputOntology, Set<org.semanticweb.owlapi.model.IRI> terms, org.semanticweb.owlapi.model.IRI outputIRI, uk.ac.manchester.cs.owlapi.modularity.ModuleType moduleType)
      Extract a set of terms from an ontology using the OWLAPI's SyntacticLocalityModuleExtractor (SLME) with default options.
      static org.semanticweb.owlapi.model.OWLOntology extract​(org.semanticweb.owlapi.model.OWLOntology inputOntology, Set<org.semanticweb.owlapi.model.IRI> terms, org.semanticweb.owlapi.model.IRI outputIRI, uk.ac.manchester.cs.owlapi.modularity.ModuleType moduleType, Map<String,​String> options)  
      static org.semanticweb.owlapi.model.OWLOntology extract​(org.semanticweb.owlapi.model.OWLOntology inputOntology, Set<org.semanticweb.owlapi.model.IRI> terms, org.semanticweb.owlapi.model.IRI outputIRI, uk.ac.manchester.cs.owlapi.modularity.ModuleType moduleType, Map<String,​String> options, Map<org.semanticweb.owlapi.model.IRI,​org.semanticweb.owlapi.model.IRI> sourceMap)
      Extract a set of terms from an ontology using the OWLAPI's SyntacticLocalityModuleExtractor (SLME).
      static org.semanticweb.owlapi.model.OWLOntology extractSubset​(org.semanticweb.owlapi.model.OWLOntology inputOntology, Set<org.semanticweb.owlapi.model.IRI> terms, org.semanticweb.owlapi.model.IRI outputIRI, Map<String,​String> options, Map<org.semanticweb.owlapi.model.IRI,​org.semanticweb.owlapi.model.IRI> sourceMap, org.semanticweb.owlapi.model.parameters.Imports imports)
      Extracts a materialized sub-ontology from the given ontology that only contains the given terms and the relations between them.
      static Map<String,​String> getDefaultOptions()
      Return a map from option name to default option value.
      protected static org.semanticweb.owlapi.model.OWLAnnotationAxiom getIsDefinedBy​(org.semanticweb.owlapi.model.OWLEntity entity, Map<org.semanticweb.owlapi.model.IRI,​org.semanticweb.owlapi.model.IRI> sourceMap)
      Given an OWLEntity, return an OWLAnnotationAssertionAxiom indicating the source ontology with rdfs:isDefinedBy.
    • Constructor Detail

      • ExtractOperation

        public ExtractOperation()
    • Method Detail

      • getDefaultOptions

        public static Map<String,​String> getDefaultOptions()
        Return a map from option name to default option value.
        Returns:
        a map with default values for all available options
      • extract

        public static org.semanticweb.owlapi.model.OWLOntology extract​(org.semanticweb.owlapi.model.OWLOntology inputOntology,
                                                                       Set<org.semanticweb.owlapi.model.IRI> terms,
                                                                       org.semanticweb.owlapi.model.IRI outputIRI,
                                                                       uk.ac.manchester.cs.owlapi.modularity.ModuleType moduleType)
                                                                throws org.semanticweb.owlapi.model.OWLOntologyCreationException
        Extract a set of terms from an ontology using the OWLAPI's SyntacticLocalityModuleExtractor (SLME) with default options. The input ontology is not changed.
        Parameters:
        inputOntology - the ontology to extract from
        terms - a set of IRIs for terms to extract
        outputIRI - the OntologyIRI of the new ontology
        moduleType - determines the type of extraction; defaults to STAR
        Returns:
        a new ontology (with a new manager)
        Throws:
        org.semanticweb.owlapi.model.OWLOntologyCreationException - on any OWLAPI problem
      • extract

        public static org.semanticweb.owlapi.model.OWLOntology extract​(org.semanticweb.owlapi.model.OWLOntology inputOntology,
                                                                       Set<org.semanticweb.owlapi.model.IRI> terms,
                                                                       org.semanticweb.owlapi.model.IRI outputIRI,
                                                                       uk.ac.manchester.cs.owlapi.modularity.ModuleType moduleType,
                                                                       Map<String,​String> options)
                                                                throws org.semanticweb.owlapi.model.OWLOntologyCreationException
        Throws:
        org.semanticweb.owlapi.model.OWLOntologyCreationException
      • extract

        public static org.semanticweb.owlapi.model.OWLOntology extract​(org.semanticweb.owlapi.model.OWLOntology inputOntology,
                                                                       Set<org.semanticweb.owlapi.model.IRI> terms,
                                                                       org.semanticweb.owlapi.model.IRI outputIRI,
                                                                       uk.ac.manchester.cs.owlapi.modularity.ModuleType moduleType,
                                                                       Map<String,​String> options,
                                                                       Map<org.semanticweb.owlapi.model.IRI,​org.semanticweb.owlapi.model.IRI> sourceMap)
                                                                throws org.semanticweb.owlapi.model.OWLOntologyCreationException
        Extract a set of terms from an ontology using the OWLAPI's SyntacticLocalityModuleExtractor (SLME). The input ontology is not changed.
        Parameters:
        inputOntology - the ontology to extract from
        terms - a set of IRIs for terms to extract
        outputIRI - the OntologyIRI of the new ontology
        moduleType - determines the type of extraction; defaults to STAR
        options - map of extract options
        sourceMap - map of term IRI to source IRI, or null (only used with annotate-with-source)
        Returns:
        a new ontology (with a new manager)
        Throws:
        org.semanticweb.owlapi.model.OWLOntologyCreationException - on any OWLAPI problem
      • extractSubset

        public static org.semanticweb.owlapi.model.OWLOntology extractSubset​(org.semanticweb.owlapi.model.OWLOntology inputOntology,
                                                                             Set<org.semanticweb.owlapi.model.IRI> terms,
                                                                             org.semanticweb.owlapi.model.IRI outputIRI,
                                                                             Map<String,​String> options,
                                                                             Map<org.semanticweb.owlapi.model.IRI,​org.semanticweb.owlapi.model.IRI> sourceMap,
                                                                             org.semanticweb.owlapi.model.parameters.Imports imports)
                                                                      throws org.semanticweb.owlapi.model.OWLOntologyCreationException
        Extracts a materialized sub-ontology from the given ontology that only contains the given terms and the relations between them. The input ontology is not changed.
        Parameters:
        inputOntology - the ontology to extract from
        terms - a set of IRIs for terms to extract
        outputIRI - the OntologyIRI of the new ontology
        options - map of extract options
        sourceMap - map of term IRI to source IRI, or null (only used with annotate-with-source)
        imports - handle imports option (default: include)
        Returns:
        a new ontology (with a new manager)
        Throws:
        org.semanticweb.owlapi.model.OWLOntologyCreationException - on any OWLAPI problem
      • getIsDefinedBy

        protected static org.semanticweb.owlapi.model.OWLAnnotationAxiom getIsDefinedBy​(org.semanticweb.owlapi.model.OWLEntity entity,
                                                                                        Map<org.semanticweb.owlapi.model.IRI,​org.semanticweb.owlapi.model.IRI> sourceMap)
        Given an OWLEntity, return an OWLAnnotationAssertionAxiom indicating the source ontology with rdfs:isDefinedBy.
        Parameters:
        entity - entity to get source of
        sourceMap - map of term IRI to source IRI, or null
        Returns:
        OWLAnnotationAssertionAxiom with rdfs:isDefinedBy as the property