Class MergeOperation


  • public class MergeOperation
    extends Object
    Merge multiple ontologies into a single ontology.
    Author:
    James A. Overton
    • Constructor Summary

      Constructors 
      Constructor Description
      MergeOperation()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static Map<String,​String> getDefaultOptions()
      Return a map from option name to default option value, for all the available merge options.
      static org.semanticweb.owlapi.model.OWLOntology merge​(List<org.semanticweb.owlapi.model.OWLOntology> ontologies)
      Merge one or more ontologies with the default merge options (do not include annotations, do not collapse import closure).
      static org.semanticweb.owlapi.model.OWLOntology merge​(List<org.semanticweb.owlapi.model.OWLOntology> ontologies, boolean includeAnnotations, boolean collapseImportsClosure)
      Given one or more ontologies, add all their axioms first ontology, and return the first ontology.
      static org.semanticweb.owlapi.model.OWLOntology merge​(List<org.semanticweb.owlapi.model.OWLOntology> ontologies, Map<String,​String> mergeOptions)
      Given one or more ontologies, add all their axioms (including their imports closures) into the first ontology, and return the first ontology.
      static org.semanticweb.owlapi.model.OWLOntology merge​(org.semanticweb.owlapi.model.OWLOntology ontology)
      Given a single ontology with zero or more imports, add all the imported axioms into the ontology itself, return the modified ontology.
      static void mergeInto​(List<org.semanticweb.owlapi.model.OWLOntology> ontologies, org.semanticweb.owlapi.model.OWLOntology targetOntology)
      Given a list of ontologies and a target ontology, add all the axioms from the listed ontologies and their import closure into the target ontology.
      static void mergeInto​(List<org.semanticweb.owlapi.model.OWLOntology> ontologies, org.semanticweb.owlapi.model.OWLOntology targetOntology, boolean includeAnnotations)
      Given one or more ontologies and a target ontology, add all the axioms from the listed ontologies to the target ontology.
      static void mergeInto​(List<org.semanticweb.owlapi.model.OWLOntology> ontologies, org.semanticweb.owlapi.model.OWLOntology targetOntology, boolean includeAnnotations, boolean collapseImportsClosure)
      Given a list of ontologies and a target ontology, add all the axioms from the listed ontologies and their import closure into the target ontology.
      static void mergeInto​(org.semanticweb.owlapi.model.OWLOntology ontology, org.semanticweb.owlapi.model.OWLOntology targetOntology)
      Given a source ontology and a target ontology, add all the axioms from the source ontology and its import closure into the target ontology.
      static void mergeInto​(org.semanticweb.owlapi.model.OWLOntology ontology, org.semanticweb.owlapi.model.OWLOntology targetOntology, boolean includeAnnotations)
      Given a source ontology and a target ontology, add all the axioms from the source ontology and its import closure into the target ontology.
      static void mergeInto​(org.semanticweb.owlapi.model.OWLOntology ontology, org.semanticweb.owlapi.model.OWLOntology targetOntology, boolean includeAnnotations, boolean collapseImportsClosure)
      Given a source ontology and a target ontology, add all the axioms from the source ontology into the target ontology.
    • Constructor Detail

      • MergeOperation

        public MergeOperation()
    • Method Detail

      • merge

        public static org.semanticweb.owlapi.model.OWLOntology merge​(org.semanticweb.owlapi.model.OWLOntology ontology)
        Given a single ontology with zero or more imports, add all the imported axioms into the ontology itself, return the modified ontology.
        Parameters:
        ontology - the ontology to merge
        Returns:
        the new ontology
      • merge

        public static org.semanticweb.owlapi.model.OWLOntology merge​(List<org.semanticweb.owlapi.model.OWLOntology> ontologies)
        Merge one or more ontologies with the default merge options (do not include annotations, do not collapse import closure).
        Parameters:
        ontologies - the list of ontologies to merge
        Returns:
        the first ontology
      • merge

        public static org.semanticweb.owlapi.model.OWLOntology merge​(List<org.semanticweb.owlapi.model.OWLOntology> ontologies,
                                                                     boolean includeAnnotations,
                                                                     boolean collapseImportsClosure)
        Given one or more ontologies, add all their axioms first ontology, and return the first ontology. Option to include ontology annotations and collapse import closure.

        We use a list instead of a set because OWLAPI judges identity simply by the ontology IRI, even if two ontologies have different axioms.

        Parameters:
        ontologies - the list of ontologies to merge
        includeAnnotations - if true, ontology annotations should be merged; annotations on imports are not merged
        collapseImportsClosure - if true, imports closure from all ontologies included
        Returns:
        the first ontology
      • merge

        public static org.semanticweb.owlapi.model.OWLOntology merge​(List<org.semanticweb.owlapi.model.OWLOntology> ontologies,
                                                                     Map<String,​String> mergeOptions)
        Given one or more ontologies, add all their axioms (including their imports closures) into the first ontology, and return the first ontology. Replaced by with method using explicit options; the mergeOptions map is not used by the MergeCommand.
        Parameters:
        ontologies - the list of ontologies to merge
        mergeOptions - a map of option strings, or null
        Returns:
        the first ontology
      • mergeInto

        public static void mergeInto​(org.semanticweb.owlapi.model.OWLOntology ontology,
                                     org.semanticweb.owlapi.model.OWLOntology targetOntology)
        Given a source ontology and a target ontology, add all the axioms from the source ontology and its import closure into the target ontology. The target ontology is not itself merged, so any of its imports remain distinct.
        Parameters:
        ontology - the source ontology to merge
        targetOntology - the ontology to merge axioms into
      • mergeInto

        public static void mergeInto​(List<org.semanticweb.owlapi.model.OWLOntology> ontologies,
                                     org.semanticweb.owlapi.model.OWLOntology targetOntology,
                                     boolean includeAnnotations)
        Given one or more ontologies and a target ontology, add all the axioms from the listed ontologies to the target ontology. Optionally, include annotations from the ontologies in the list. It is recommended to use mergeInto with both includeAnnotations and collapseImportsClosure options.
        Parameters:
        ontologies - the ontologies to merge
        targetOntology - the ontology to merge axioms into
        includeAnnotations - if true, ontology annotations should be merged; annotations on imports are not merged
      • mergeInto

        public static void mergeInto​(org.semanticweb.owlapi.model.OWLOntology ontology,
                                     org.semanticweb.owlapi.model.OWLOntology targetOntology,
                                     boolean includeAnnotations)
        Given a source ontology and a target ontology, add all the axioms from the source ontology and its import closure into the target ontology. The target ontology is not itself merged, so any of its imports remain distinct.
        Parameters:
        ontology - the source ontology to merge
        targetOntology - the ontology to merge axioms into
        includeAnnotations - true if ontology annotations should be merged; annotations on imports are not merged
      • mergeInto

        public static void mergeInto​(org.semanticweb.owlapi.model.OWLOntology ontology,
                                     org.semanticweb.owlapi.model.OWLOntology targetOntology,
                                     boolean includeAnnotations,
                                     boolean collapseImportsClosure)
        Given a source ontology and a target ontology, add all the axioms from the source ontology into the target ontology. Optionally, include annotations from the source and/or collapse the imports closures.
        Parameters:
        ontology - the source ontology to merge
        targetOntology - the ontology to merge axioms into
        includeAnnotations - if true, ontology annotations should be merged; annotations on imports are not merged
        collapseImportsClosure - if true, imports closure from all ontologies included
      • mergeInto

        public static void mergeInto​(List<org.semanticweb.owlapi.model.OWLOntology> ontologies,
                                     org.semanticweb.owlapi.model.OWLOntology targetOntology)
        Given a list of ontologies and a target ontology, add all the axioms from the listed ontologies and their import closure into the target ontology. The target ontology is not itself merged, so any of its imports remain distinct.
        Parameters:
        ontologies - the list of ontologies to merge
        targetOntology - the ontology to merge axioms into
      • mergeInto

        public static void mergeInto​(List<org.semanticweb.owlapi.model.OWLOntology> ontologies,
                                     org.semanticweb.owlapi.model.OWLOntology targetOntology,
                                     boolean includeAnnotations,
                                     boolean collapseImportsClosure)
        Given a list of ontologies and a target ontology, add all the axioms from the listed ontologies and their import closure into the target ontology. The target ontology is not itself merged, so any of its imports remain distinct, unless collapsing imports closure.
        Parameters:
        ontologies - the list of ontologies to merge
        targetOntology - the ontology to merge axioms into
        includeAnnotations - true if ontology annotations should be merged; annotations on imports are not merged
        collapseImportsClosure - true if imports closure from all ontologies included
      • getDefaultOptions

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