Search code examples
javaowl-apiturtle-rdf

Does AutoIRIMapper cannot read ontologies from .ttl files?


The AutoIRIMapper does not detect ontologies with turtle format (.ttl file extension), from OWLAPI 5 library.

On the following code, the ontologyIRIs variable, does not contain any ontology with .ttl file extension. It just contains the .owl ontologies.

I've checked and validated the .ttl files to verify there's no mistake there, apart.

Is there any mistake? Is there any other way lo load ontologies with turtle format?

org.semanticweb.owlapi.util.AutoIRIMapper
...
public void myMethod(String folder) {
....
URI uriFolder = new URI(folder);
File folderFile = new File(uriFolder);
AutoIRIMapper mapper = new AutoIRIMapper(folderFile, true);
Set<String> mapperExt = mapper.getFileExtensions();
mapperExt.add(".ttl"); // add .ttl extensions to AutoIRIMapper
mapper.setFileExtensions(mapperExt);
mapper.update();
Set<IRI> ontologyIRIs = mapper.getOntologyIRIs();
....
}

Solution

  • At present AutoIRIMapper only supports functional syntax, manchester syntax and RDF/XML.