Reasoner
Base
- class evowluator.reasoner.base.Reasoner
Abstract reasoner interface.
- abstract property name: str
Display name of the reasoner.
- Return type
str
- abstract property path: str
Path to the reasoner binary, either absolute or relative to the bin subdirectory of the framework.
- Return type
str
- abstract args(task, mode)
Command line arguments to pass to the reasoner executable for each task and evaluation mode. Variable arguments, such as paths to the input ontology and classification output, must be provided using the
MetaArgs
enumeration.- Parameters
task (
ReasoningTask
) – Reasoning task.mode (
EvaluationMode
) – Evaluation mode.
- Return type
List
[str
]- Returns
Command line arguments.
- property supported_syntaxes: List[evowluator.data.ontology.Syntax]
OWL syntaxes supported by the reasoner. By default, this property returns all the syntaxes supported by evOWLuator.
- Return type
List
[Syntax
]
- property supported_tasks: List[evowluator.reasoner.base.ReasoningTask]
Reasoning tasks supported by the reasoner. By default, this property returns the ontology classification and consistency tasks.
- Return type
List
[ReasoningTask
]
- property preferred_syntax: evowluator.data.ontology.Syntax
Default syntax for the reasoner, used if the user does not specify a syntax explicitly via command line options. By default, this property returns the first entry in the
supported_syntaxes
list.- Return type
- setup()
Called at the beginning of the evaluation.
- Return type
None
- teardown()
Called at the end of the evaluation.
- Return type
None
- property results_parser: evowluator.reasoner.results.ResultsParser
Overriding this property is necessary if a reasoner offers no control over its output format. The returned object must be a suitable subclass of the
ResultsParser
base class.- Return type
- classmethod is_template()
The returned boolean signals whether the class is a template used for multiple reasoners. This is useful if, for example, several reasoners expose the same command line interface, in which case most of the logic can be reused by wrapping it in a template class that can be further subclassed.
- Return type
bool
- Returns
True if this class is a template, False otherwise.
Enumerations
- class evowluator.reasoner.base.ReasoningTask(value)
Available reasoning tasks.
- CLASSIFICATION = 'classification'
Classification task.
- CONSISTENCY = 'consistency'
Consistency task.
- MATCHMAKING = 'matchmaking'
Matchmaking task.
- classmethod standard()
Returns the standard reasoning tasks.
- Return type
List
[ReasoningTask
]
- class evowluator.reasoner.base.MetaArgs
Meta-arguments.
- INPUT = '<input_meta_arg>'
Meta-argument representing the input ontology.
- OUTPUT = '<output_meta_arg>'
Meta-argument representing the output file path.
- REQUEST = '<request_meta_arg>'
Meta-argument representing the request ontology for the matchmaking task.
- class evowluator.evaluation.mode.EvaluationMode(value)
Evaluation modes.
- CORRECTNESS = 'correctness'
Correctness evaluation.
- PERFORMANCE = 'performance'
Performance evaluation.
- ENERGY = 'energy'
Energy impact evaluation.
- class evowluator.data.ontology.Syntax(value)
OWL ontology syntaxes.
- DL = 'dl'
DL syntax.
- FUNCTIONAL = 'functional'
Functional syntax.
- KRSS = 'krss'
KRSS syntax.
- KRSS2 = 'krss2'
KRSS2 syntax.
- MANCHESTER = 'manchester'
Manchester syntax.
- OBO = 'obo'
OBO syntax.
- OWLXML = 'owlxml'
OWL/XML syntax.
- RDFXML = 'rdfxml'
RDF/XML syntax.
- TURTLE = 'turtle'
Turtle syntax.
Results
- class evowluator.reasoner.results.ResultsParser
Parses results of reasoning tasks.
- parse_classification_results(task)
Parses the results of a classification task.
- Parameters
task (
Union
[Task
,Benchmark
,EnergyProfiler
]) – Classification task.- Return type
- Returns
Results of the classification task.
- parse_consistency_results(task)
Parses the results of a consistency task.
- Parameters
task (
Union
[Task
,Benchmark
,EnergyProfiler
]) – Consistency task.- Return type
- Returns
Results of the consistency task.
- parse_matchmaking_results(task)
Parses the results of a matchmaking task.
- Parameters
task (
Union
[Task
,Benchmark
,EnergyProfiler
]) – Matchmaking task.- Return type
- Returns
Results of the matchmaking task.
- class evowluator.reasoner.results.ReasoningResults
Contains results of a reasoning task.
- abstract property output: str
Output of the reasoning task. Can be either the output itself, or the path to the file containing the output, depending on
output_is_file
.- Return type
str
- abstract property output_is_file: bool
If True,
output
is the path to a file containing the output of the reasoning task; otherwise,output
contains actual reasoner output.- Return type
bool
- abstract property parsing_ms: float
Parsing time in milliseconds.
- Return type
float
- abstract property reasoning_ms: float
Reasoning time in milliseconds.
- Return type
float
- abstract property max_memory: int
Memory peak in bytes.
- Return type
int
- abstract property energy_stats: evowluator.reasoner.results.EnergyStats
Energy statistics.
- Return type
- class evowluator.reasoner.results.StandardReasoningResults(parsing_ms, reasoning_ms, max_memory, energy_stats, output='', output_is_file=False)
Bases:
evowluator.reasoner.results.ReasoningResults
Contains results of a standard reasoning task.
- class evowluator.reasoner.results.MatchmakingResults(parsing_ms, init_ms, matchmaking_ms, max_memory, energy_stats, output='', output_is_file=False)
Bases:
evowluator.reasoner.results.ReasoningResults
Contains results of a matchmaking task.
- property init_ms: float
Reasoner initialization time in milliseconds.
- Return type
float
- property matchmaking_ms: float
Matchmaking time in milliseconds.
- Return type
float
- class evowluator.reasoner.results.EnergyStats(samples, interval)
Contains energy statistics of a reasoning task.
- property samples: List[float]
Power samples.
- Return type
List
[float
]
- property interval: int
Sampling interval in milliseconds.
- Return type
int
- score(task_duration)
Returns an energy impact score for a reasoning task of the specified duration.
- Parameters
task_duration (
float
) – Duration of the reasoning task in milliseconds.- Return type
float
- Returns
Energy impact score.
Java SE
- class evowluator.reasoner.java.JavaReasoner
Bases:
evowluator.reasoner.base.Reasoner
,abc.ABC
Abstract Java reasoner interface.
- abstract property vm_opts: List[str]
Options to pass to the Java VM.
- Return type
List
[str
]
Mobile
- class evowluator.reasoner.mobile.MobileReasoner
Bases:
evowluator.reasoner.base.Reasoner
,abc.ABC
Abstract mobile reasoner interface.
Android
- class evowluator.reasoner.mobile.AndroidReasoner
Bases:
evowluator.reasoner.mobile.MobileReasoner
,abc.ABC
Abstract Android reasoner interface.
- abstract property target_package: str
Package identifier of the reasoner app.
- Return type
str
- abstract property log_prefix: str
String prepended to log messages, used to filter logcat output.
- Return type
str
iOS
- class evowluator.reasoner.mobile.IOSReasoner
Bases:
evowluator.reasoner.mobile.MobileReasoner
,abc.ABC
Abstract iOS reasoner interface.
- abstract property project: str
Xcode project path.
- Return type
str
- abstract property scheme: str
Xcode scheme containing the tests.
- Return type
str
- abstract test_name_for_task(task)
Returns the name of the test method exposing the specified reasoning task.
- Parameters
task (
ReasoningTask
) – Reasoning task.- Return type
str
- Returns
Test method name.