Package org.semanticweb.owlapi.util
Class ZipIRIMapper
java.lang.Object
org.xml.sax.helpers.DefaultHandler
org.semanticweb.owlapi.util.ZipIRIMapper
- All Implemented Interfaces:
Serializable
,OWLOntologyIRIMapper
,ContentHandler
,DTDHandler
,EntityResolver
,ErrorHandler
@HasPriority(1.0)
public class ZipIRIMapper
extends DefaultHandler
implements OWLOntologyIRIMapper, Serializable
A mapper which given a root folder attempts to automatically discover and map files to
ontologies. The mapper is only capable of mapping ontologies in RDF/XML and OWL/XML (other
serialisations are not supported).
- Since:
- 2.0.0
- Author:
- Matthew Horridge, The University Of Manchester, Bio-Health Informatics Group
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionZipIRIMapper
(File zip, String baseIRI) Creates an auto-mapper which examines ontologies that reside in the specified zip file.ZipIRIMapper
(ZipFile zip, String baseIRI) Creates an auto-mapper which examines ontologies that reside in the specified zip file. -
Method Summary
Modifier and TypeMethodDescriptiongetDocumentIRI
(IRI ontologyIRI) Given an ontology IRI, this method maps the ontology IRI to a document IRI.The mapper only examines files that have specified file extensions.Gets the mappings of ontology IRIs that this mapper has found.void
setFileExtensions
(Collection<String> extensions) Sets the extensions of files that are to be examined for ontological content.void
startElement
(String uri, String localName, String qName, Attributes attributes) toString()
Methods inherited from class org.xml.sax.helpers.DefaultHandler
characters, endDocument, endElement, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warning
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.xml.sax.ContentHandler
declaration
-
Constructor Details
-
ZipIRIMapper
Creates an auto-mapper which examines ontologies that reside in the specified zip file.- Parameters:
zip
- The zip file to map.baseIRI
- base iri for physical IRIs- Throws:
IOException
- if an exception reading from input is raised
-
ZipIRIMapper
Creates an auto-mapper which examines ontologies that reside in the specified zip file.- Parameters:
zip
- The zip file to map.baseIRI
- base iri for physical IRIs- Throws:
IOException
- if an exception reading from input is raised
-
-
Method Details
-
getFileExtensions
The mapper only examines files that have specified file extensions. This method returns the file extensions that cause a file to be examined.- Returns:
- A
Set
of file extensions.
-
setFileExtensions
Sets the extensions of files that are to be examined for ontological content. (By default the extensions are, owl, xml and rdf). Only files that have the specified extensions will be examined to see if they contain ontologies.- Parameters:
extensions
- the set of extensions
-
mappedEntries
Gets the mappings of ontology IRIs that this mapper has found.- Returns:
- A
Stream
of map entries, from logical to physical IRI
-
getDocumentIRI
Description copied from interface:OWLOntologyIRIMapper
Given an ontology IRI, this method maps the ontology IRI to a document IRI.- Specified by:
getDocumentIRI
in interfaceOWLOntologyIRIMapper
- Parameters:
ontologyIRI
- The ontology IRI to be mapped.- Returns:
- The document IRI of the ontology, or
null
if the mapper doesn't have mapping for the specified ontology IRI.
-
oboMappings
- Returns:
- obo mappings
-
iriMappings
- Returns:
- iri mappings
-
startElement
public void startElement(@Nullable String uri, @Nullable String localName, @Nullable String qName, @Nullable Attributes attributes) throws SAXException - Specified by:
startElement
in interfaceContentHandler
- Overrides:
startElement
in classDefaultHandler
- Throws:
SAXException
-
toString
-