owl_api.binding.DefaultOWLAPIBinding Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of brunner-owlAPI Show documentation
Show all versions of brunner-owlAPI Show documentation
OWLAPI module for the BRunner project
package owl_api.binding;
import java.io.FileNotFoundException;
import java.io.Serializable;
import api.definition.ITask;
import api.running.IService;
import api.running.IToolBinding;
import menu.OWLAPIKeywords;
import owl_api.services.concrete.ExplanationOWLAPI;
import tools.utils.InputInterpreter;
/**
* A binding for the OWL API.
*/
public class DefaultOWLAPIBinding implements IToolBinding, Serializable {
private static final long serialVersionUID = -4633010468343572147L;
@Override
public IService createServiceFrom(ITask task) throws FileNotFoundException {
OWLAPIInputInterpreter.checkServiceKeyAndValue(task);
var scenario = OWLAPIInputInterpreter.translateInputDataScenarioFor(task);
var algoParams = OWLAPIInputInterpreter.translateAlgorithmParametersFor(task);
var halt = OWLAPIInputInterpreter.getExperimentTimeoutConditionsFor(task);
var serviceType = InputInterpreter.getServiceTypeFor(task, OWLAPIKeywords.Service.class);
return switch (serviceType) {
case EXPLANATION -> new ExplanationOWLAPI(scenario, algoParams);
default -> throw new IllegalArgumentException("Unexpected value: " + serviceType);
};
}
public static void main(String[] args) {
var x = new DefaultOWLAPIBinding();
System.out.println(x.getClass());
}
}