Commit aaa3c205 authored by Maxime Lefrançois's avatar Maxime Lefrançois
Browse files

now also import external ontologies

parent e66bcb65
......@@ -32,6 +32,7 @@ import org.semanticweb.owlapi.profiles.OWL2DLProfile;
import org.semanticweb.owlapi.profiles.OWLProfileReport;
import org.semanticweb.owlapi.profiles.OWLProfileViolation;
import org.semanticweb.owlapi.reasoner.OWLReasonerConfiguration;
import org.semanticweb.owlapi.util.PriorityCollection;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
......@@ -52,8 +53,9 @@ public class CheckOWLProfile extends JobRunner {
final OWLOntologyManager ontologyManager = OWLManager.createOWLOntologyManager();
OWLParserFactory jenaModelParserFactory = new JenaModelOntologyParserFactory(dataset);
Set<OWLParserFactory> ontologyParsers = Collections.singleton(jenaModelParserFactory);
ontologyManager.setOntologyParsers(ontologyParsers);
PriorityCollection<OWLParserFactory> ontologyParsers = ontologyManager.getOntologyParsers();
ontologyParsers.add(jenaModelParserFactory);
// ontologyManager.setOntologyParsers(ontologyParsers);
final Supplier<OWLOntologyManager> m = () -> ontologyManager;
final OWLOntology ontology;
......
......@@ -196,10 +196,10 @@ public class ReadExamples extends JobRunner {
String uri = s.asResource().getURI();
if(uri.equals(version.getRepository().getNamespace())) {
found = true;
} else {
if(!uri.matches("^https://saref.etsi.org/(core|saref4[a-z]{4})/v[1-9][0-9]*\\\\.[1-9][0-9]*\\\\.[1-9][0-9]*/$")) {
logger.error("Only SAREF ontologies with specific versions shall be imported. Their URIs conform to the regular expression `^https://saref.etsi.org/(core|saref4[a-z]{4})/v[1-9][0-9]*\\\\.[1-9][0-9]*\\\\.[1-9][0-9]*/$`");
}
// } else {
// if(!uri.matches("^https://saref.etsi.org/(core|saref4[a-z]{4})/v[1-9][0-9]*\\\\.[1-9][0-9]*\\\\.[1-9][0-9]*/$")) {
// logger.error("Only SAREF ontologies with specific versions shall be imported. Their URIs conform to the regular expression `^https://saref.etsi.org/(core|saref4[a-z]{4})/v[1-9][0-9]*\\\\.[1-9][0-9]*\\\\.[1-9][0-9]*/$`");
// }
}
}
if(!found) {
......
......@@ -83,7 +83,7 @@ public class JenaModelOntologyParser extends AbstractOWLParser {
consumer.handleTriple(s2, p2, object, language);
} else if ( dt != null) {
IRI dt2 = IRI.create(dt);
consumer.handleTriple(s2, p2, object, language);
consumer.handleTriple(s2, p2, object, dt2);
} else {
consumer.handleTriple(s2, p2, object);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment