Package org.obolibrary.robot
Class DiffOperation
- java.lang.Object
-
- org.obolibrary.robot.DiffOperation
-
public class DiffOperation extends Object
Get the differences between two ontology files.- Author:
- James A. Overton
-
-
Constructor Summary
Constructors Constructor Description DiffOperation()
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static String
addLabels(Map<org.semanticweb.owlapi.model.IRI,String> labels, String axiom)
Deprecated.This functionality is now provided by the owl-diff library and no longer used to format results in DiffOperation.static String
addLabels(IOHelper ioHelper, Map<org.semanticweb.owlapi.model.IRI,String> labels, String axiom)
Deprecated.This functionality is now provided by the owl-diff library and no longer used to format results in DiffOperation.static boolean
compare(org.semanticweb.owlapi.model.OWLOntology ontology1, org.semanticweb.owlapi.model.OWLOntology ontology2, Writer writer)
Given two ontologies and a Writer, get their differences and write then to the writer.static boolean
compare(org.semanticweb.owlapi.model.OWLOntology ontology1, org.semanticweb.owlapi.model.OWLOntology ontology2, IOHelper ioHelper, Writer writer, Map<String,String> options)
Given two ontologies, a Writer, and a set of diff options, get their differences and write then to the writer.static boolean
equals(org.semanticweb.owlapi.model.OWLOntology ontology1, org.semanticweb.owlapi.model.OWLOntology ontology2)
Given two ontologies, compare their sets of axioms, annotations, imports, and ontology IDs, returning true if they are identical and false otherwise.static Set<String>
getAxiomStrings(org.semanticweb.owlapi.model.OWLOntology ontology)
Deprecated.This functionality is no longer used within DiffOperation.static Map<String,String>
getDefaultOptions()
Return default diff options.
-
-
-
Method Detail
-
getDefaultOptions
public static Map<String,String> getDefaultOptions()
Return default diff options.- Returns:
- diff options
-
equals
public static boolean equals(org.semanticweb.owlapi.model.OWLOntology ontology1, org.semanticweb.owlapi.model.OWLOntology ontology2)
Given two ontologies, compare their sets of axioms, annotations, imports, and ontology IDs, returning true if they are identical and false otherwise.- Parameters:
ontology1
- the first ontologyontology2
- the second ontology- Returns:
- true if the ontologies are the same, false otherwise
-
compare
public static boolean compare(org.semanticweb.owlapi.model.OWLOntology ontology1, org.semanticweb.owlapi.model.OWLOntology ontology2, Writer writer) throws IOException
Given two ontologies and a Writer, get their differences and write then to the writer. The ontologies are not changed.- Parameters:
ontology1
- the first ontologyontology2
- the second ontologywriter
- the Writer for the report, or null- Returns:
- true if the ontologies are the same, false otherwise
- Throws:
IOException
- on writer failure
-
compare
public static boolean compare(org.semanticweb.owlapi.model.OWLOntology ontology1, org.semanticweb.owlapi.model.OWLOntology ontology2, IOHelper ioHelper, Writer writer, Map<String,String> options) throws IOException
Given two ontologies, a Writer, and a set of diff options, get their differences and write then to the writer. The ontologies are not changed.- Parameters:
ontology1
- the first ontologyontology2
- the second ontologyioHelper
- IOHelper to use for prefixeswriter
- the Writer for the report, or nulloptions
- diff options- Returns:
- true if the ontologies are the same, false otherwise
- Throws:
IOException
- on writer failure
-
addLabels
@Deprecated public static String addLabels(Map<org.semanticweb.owlapi.model.IRI,String> labels, String axiom)
Deprecated.This functionality is now provided by the owl-diff library and no longer used to format results in DiffOperation.Given a map from IRIs to labels and an axiom string, add labels next to any IRIs in the string, shorten OBO IRIs, and return the updated string.- Parameters:
labels
- a map from IRIs to label stringsaxiom
- a string representation of an OWLAxiom- Returns:
- a string with labels inserted next to IRIs
-
addLabels
@Deprecated public static String addLabels(IOHelper ioHelper, Map<org.semanticweb.owlapi.model.IRI,String> labels, String axiom)
Deprecated.This functionality is now provided by the owl-diff library and no longer used to format results in DiffOperation.Given an IOHelper to get short form of IRIs, a map from IRIs to labels, and an axiom string, add labels next to any IRIs in the string, shorten OBO IRIs, and return the updated string.- Parameters:
ioHelper
- IOHelper to use for prefixeslabels
- a map from IRIs to label stringsaxiom
- a string representation of an OWLAxiom- Returns:
- a string with labels inserted next to CURIEs
-
getAxiomStrings
@Deprecated public static Set<String> getAxiomStrings(org.semanticweb.owlapi.model.OWLOntology ontology)
Deprecated.This functionality is no longer used within DiffOperation.Given an ontology, return a list of strings for all the axioms of that ontology.- Parameters:
ontology
- the ontology to use- Returns:
- a set of strings, one for each axiom in the ontology
-
-