Class MeasureOperation

    • Constructor Detail

      • MeasureOperation

        public MeasureOperation()
    • 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 write
        format - the name of the file format to write the results to
        output - 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 ontology
        rf - reasoner factory to be used for reasoning metrics
        metricsType - The type of metrics that should be generated, like 'essential', 'extended' or all
        format - the name of the file format to write the results to
        output - the file to write to
        prefixes - 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 metrics
        metricsType - what kind of metrics to harvest
        curieShortFormProvider - 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 metrics
        rf - reasoner factory, in case reasoner metrics should be collected
        metricsType - what kind of metrics to harvest
        curieShortFormProvider - 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 operation
        format - the language to write in (if null, TTL)
        output - the output stream to write to
        Throws:
        IOException - on problem writing to output