Package org.obolibrary.robot
Class MeasureOperation
- java.lang.Object
-
- org.obolibrary.robot.MeasureOperation
-
public class MeasureOperation extends Object
Compute metrics for the ontology.- Author:
- Nicolas Matentzoglu
-
-
Constructor Summary
Constructors Constructor Description MeasureOperation()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static MeasureResult
getMetrics(org.semanticweb.owlapi.model.OWLOntology ontology, String metricsType, CURIEShortFormProvider curieShortFormProvider)
Compute metrics for a given ontology.static MeasureResult
getMetrics(org.semanticweb.owlapi.model.OWLOntology ontology, org.semanticweb.owlapi.reasoner.OWLReasonerFactory rf, String metricsType, CURIEShortFormProvider curieShortFormProvider)
Run the metrics command using the reasoner factory.static boolean
maybeWriteResult(MeasureResult result, String format, File output)
If a result set has results, write to the output stream and return true.static void
measure(org.semanticweb.owlapi.model.OWLOntology ontology, org.semanticweb.owlapi.reasoner.OWLReasonerFactory rf, String metricsType, String format, File output, Map<String,String> prefixes)
Running the measure commandstatic void
writeResult(MeasureResult result, String format, File output)
Write a model to an output stream.
-
-
-
Method Detail
-
maybeWriteResult
public static boolean maybeWriteResult(MeasureResult result, String format, File output) throws IOException
If a result set has results, write to the output stream and return true. Otherwise return false.- Parameters:
result
- the results to writeformat
- the name of the file format to write the results tooutput
- the file to write to- Returns:
- true if there were results, false otherwise
- Throws:
IOException
- if writing file failed
-
measure
public static void measure(org.semanticweb.owlapi.model.OWLOntology ontology, org.semanticweb.owlapi.reasoner.OWLReasonerFactory rf, String metricsType, String format, File output, Map<String,String> prefixes) throws IOException
Running the measure command- Parameters:
ontology
- input ontologyrf
- reasoner factory to be used for reasoning metricsmetricsType
- The type of metrics that should be generated, like 'essential', 'extended' or allformat
- the name of the file format to write the results tooutput
- the file to write toprefixes
- prefix map to be used for computing metrics- Throws:
IOException
- if writing file failed
-
getMetrics
public static MeasureResult getMetrics(org.semanticweb.owlapi.model.OWLOntology ontology, String metricsType, CURIEShortFormProvider curieShortFormProvider)
Compute metrics for a given ontology.- Parameters:
ontology
- Ontology to run metricsmetricsType
- what kind of metrics to harvestcurieShortFormProvider
- Shortformprovider to be used for computation of CURIEs- Returns:
- Metrics, if successful
-
getMetrics
public static MeasureResult getMetrics(org.semanticweb.owlapi.model.OWLOntology ontology, org.semanticweb.owlapi.reasoner.OWLReasonerFactory rf, String metricsType, CURIEShortFormProvider curieShortFormProvider)
Run the metrics command using the reasoner factory. Note: when the reasoner factory is passed, it is assumed that reasoner metrics should be harvested. For example: both reasoner-all, and all will collect the same metrics: all metrics, plus the (simple) reasoner metrics.- Parameters:
ontology
- Ontology to run metricsrf
- reasoner factory, in case reasoner metrics should be collectedmetricsType
- what kind of metrics to harvestcurieShortFormProvider
- short form provider- Returns:
- Metrics, if successful
-
writeResult
public static void writeResult(MeasureResult result, String format, File output) throws IOException
Write a model to an output stream.- Parameters:
result
- results of the metrics operationformat
- the language to write in (if null, TTL)output
- the output stream to write to- Throws:
IOException
- on problem writing to output
-
-