Index: tika-bundle/pom.xml
===================================================================
--- tika-bundle/pom.xml	(revision 1722931)
+++ tika-bundle/pom.xml	(working copy)
@@ -143,7 +143,7 @@
               sis-storage, apache-mime4j-core, apache-mime4j-dom,
               jsr-275, jhighlight, java-libpst, jwnl,
               netcdf4, grib, cdm, httpservices, jcip-annotations,
-              jmatio, guava
+              jmatio, guava, owlapi-oboformat
             </Embed-Dependency>
             <Embed-Transitive>true</Embed-Transitive>
             <Bundle-DocURL>${project.url}</Bundle-DocURL>
@@ -185,7 +185,7 @@
               javax.xml.stream;version="[1.0,2)";resolution:=optional,
               javax.xml.stream.events;version="[1.0,2)";resolution:=optional,
               javax.xml.stream.util;version="[1.0,2)";resolution:=optional,
-	      javax.ws.rs.core;resolution:=optional,
+              javax.ws.rs.core;resolution:=optional,
               net.sf.ehcache;resolution:=optional,
               nu.xom;resolution:=optional,
               opendap.dap.http;resolution:=optional,
@@ -194,8 +194,8 @@
               opennlp.maxent;resolution:=optional,
               opennlp.tools.namefind;resolution:=optional,
               net.didion.jwnl;resolution:=optional,
-	      org.apache.cxf.jaxrs.client;resolution:=optional,
-	      org.apache.cxf.jaxrs.ext.multipart;resolution:=optional,
+              org.apache.cxf.jaxrs.client;resolution:=optional,
+              org.apache.cxf.jaxrs.ext.multipart;resolution:=optional,
               org.apache.commons.exec;resolution:=optional,
               org.apache.commons.io;resolution:=optional,
               org.apache.commons.httpclient;resolution:=optional,
@@ -248,7 +248,7 @@
               org.jdom2.input;resolution:=optional,
               org.jdom2.output;resolution:=optional,
               org.json.simple;resolution:=optional,
-	      org.json;resolution:=optional,
+              org.json;resolution:=optional,
               org.openxmlformats.schemas.officeDocument.x2006.math;resolution:=optional,
               org.openxmlformats.schemas.schemaLibrary.x2006.main;resolution:=optional,
               org.osgi.framework;resolution:=optional,
@@ -350,7 +350,21 @@
               org.apache.http.message;resolution:=optional,
               org.apache.http.params;resolution:=optional,
               org.apache.http.protocol;resolution:=optional,
-              org.apache.http.util;resolution:=optional
+              org.apache.http.util;resolution:=optional,
+              org.semanticweb.owlapi;resolution:=optional,
+              org.semanticweb.owlapi.annotations;resolution:=optional,
+              org.semanticweb.owlapi.expression;resolution:=optional,
+              org.semanticweb.owlapi.formats;resolution:=optional,
+              org.semanticweb.owlapi.functional.parser;resolution:=optional,
+              org.semanticweb.owlapi.functional.renderer;resolution:=optional,
+              org.semanticweb.owlapi.io;resolution:=optional,
+              org.semanticweb.owlapi.manchestersyntax.parser;resolution:=optional,
+              org.semanticweb.owlapi.model;resolution:=optional,
+              org.semanticweb.owlapi.model.parameters;resolution:=optional,
+              org.semanticweb.owlapi.search;resolution:=optional,
+              org.semanticweb.owlapi.util;resolution:=optional,
+              org.semanticweb.owlapi.util.mansyntax;resolution:=optional,
+              org.semanticweb.owlapi.vocab;resolution:=optional
             </Import-Package>
           </instructions>
         </configuration>
Index: tika-core/src/main/resources/org/apache/tika/mime/tika-mimetypes.xml
===================================================================
--- tika-core/src/main/resources/org/apache/tika/mime/tika-mimetypes.xml	(revision 1722931)
+++ tika-core/src/main/resources/org/apache/tika/mime/tika-mimetypes.xml	(working copy)
@@ -3573,6 +3573,11 @@
     <glob pattern="*.nc"/>
     <glob pattern="*.cdf"/>
   </mime-type>
+  
+  <mime-type type="application/x-obo">
+    <glob pattern="*.obo"/>
+  </mime-type>
+  
   <mime-type type="application/x-pkcs12">
     <glob pattern="*.p12"/>
     <glob pattern="*.pfx"/>
Index: tika-parsers/pom.xml
===================================================================
--- tika-parsers/pom.xml	(revision 1722931)
+++ tika-parsers/pom.xml	(working copy)
@@ -230,6 +230,11 @@
       <artifactId>cxf-rt-rs-client</artifactId>
       <version>${cxf.version}</version>
     </dependency>
+    <dependency>
+      <groupId>net.sourceforge.owlapi</groupId>
+      <artifactId>owlapi-oboformat</artifactId>
+      <version>4.1.0-RC2</version>
+    </dependency>
 	
 
     <!-- Provided dependencies -->
Index: tika-parsers/src/main/java/org/apache/tika/parser/obo/OBOFlatFileParser.java
===================================================================
--- tika-parsers/src/main/java/org/apache/tika/parser/obo/OBOFlatFileParser.java	(revision 0)
+++ tika-parsers/src/main/java/org/apache/tika/parser/obo/OBOFlatFileParser.java	(working copy)
@@ -0,0 +1,165 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.tika.parser.obo;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Set;
+
+import org.apache.tika.exception.TikaException;
+import org.apache.tika.io.TemporaryResources;
+import org.apache.tika.io.TikaInputStream;
+import org.apache.tika.metadata.Metadata;
+import org.apache.tika.mime.MediaType;
+import org.apache.tika.parser.AbstractParser;
+import org.apache.tika.parser.ParseContext;
+import org.apache.tika.sax.XHTMLContentHandler;
+import org.xml.sax.ContentHandler;
+import org.xml.sax.SAXException;
+import org.obolibrary.oboformat.model.Frame;
+import org.obolibrary.oboformat.model.OBODoc;
+import org.obolibrary.oboformat.parser.OBOFormatParser;
+
+/**
+ * This {@link org.apache.tika.parser.AbstractParser} implementation
+ * caters for files offering the 
+ * <a href="http://purl.obolibrary.org/obo/oboformat/spec.html">
+ * OBO Flat File Format Guide, version 1.4</a>. 
+ * The OBO format is the text file format used by OBO-Edit, the open source, 
+ * platform-independent application for viewing and editing ontologies. This file format
+ * is used heavily within the clinical and biomedical fields as a particular
+ * flat file serialization for ontologies. .obo files are 'typically' accompanied
+ * with corresponding .owl serializations as this is also another file format
+ * used pervasively within the clinical and biomedical fields.
+ */
+public class OBOFlatFileParser extends AbstractParser {
+
+  /**
+   * 
+   */
+  private static final long serialVersionUID = 1L;
+  
+  private final Set<MediaType> SUPPORTED_TYPES =
+      Collections.singleton(MediaType.application("x-obo"));
+  
+  public static final String OBO_MIME_TYPE = "application/x-obo";
+
+  /**
+   * @see org.apache.tika.parser.Parser#getSupportedTypes(org.apache.tika.parser.ParseContext)
+   */
+  @Override
+  public Set<MediaType> getSupportedTypes(ParseContext context) {
+      return SUPPORTED_TYPES;
+  }
+
+  /**
+   * Within the paring process there exists five concepts we are interested in:
+   * <ul>
+   * <li>OBO Header</li>,
+   * <li>Imported Documents</li>,
+   * <li>Instance Frames</li>,
+   * <li>Term Frames</li>, and
+   * <li>Typedef Frames</li>
+   * </ul>
+   * All of these are documented within the specification document under the 
+   * <a href="http://owlcollab.github.io/oboformat/doc/obo-syntax.html#4">
+   * OBO Document Structure section</a>.
+   * @see org.apache.tika.parser.Parser#parse(java.io.InputStream, org.xml.sax.ContentHandler, org.apache.tika.metadata.Metadata, org.apache.tika.parser.ParseContext)
+   */
+  @Override
+  public void parse(InputStream stream, ContentHandler handler,
+      Metadata metadata, ParseContext context) throws IOException,
+      SAXException, TikaException {
+    
+      TemporaryResources tmp = new TemporaryResources();
+      metadata.set(Metadata.CONTENT_TYPE, OBO_MIME_TYPE);
+      try {
+          TikaInputStream tis = TikaInputStream.get(stream, tmp);
+          OBOFormatParser parser = new OBOFormatParser();
+          OBODoc obodoc = parser.parse(new BufferedReader(new InputStreamReader(tis, "UTF-8")));
+          XHTMLContentHandler xhtml = new XHTMLContentHandler(handler, metadata);
+          xhtml.startDocument();
+          // Process OBO Header
+          processFrames(metadata, xhtml, java.util.Collections.singleton(obodoc.getHeaderFrame()), "HeaderFrame");
+          // Process Imported Docs
+          //processImportedOBODocs(metadata, xhtml, obodoc.getImportedOBODocs(), "ImportedOBODoc");
+          // Process Instance Frames
+          //processFrames(metadata, obodoc.getInstanceFrames(), "InstanceFrame");
+          // Process Term Frames
+          processFrames(metadata, xhtml, obodoc.getTermFrames(), "TermFrame(s)");
+          // Process Typedef Frames
+          processFrames(metadata, xhtml, obodoc.getTypedefFrames(), "TypedefFrame");
+          xhtml.endDocument();
+          
+      } catch (IOException ioe) {
+          throw new TikaException("OBO parse error", ioe);
+      } finally {
+        tmp.close();
+      }
+  }
+  
+  private void processFrames(Metadata metadata, XHTMLContentHandler xhtml, Collection<Frame> frames, String typeString) throws SAXException {
+    if (frames.size() > 0) {
+      xhtml.newline();
+      xhtml.startElement("ul");
+      if (!typeString.equals("TermFrame(s)")) {
+        xhtml.characters(typeString);
+        xhtml.newline();
+      }
+      for (Frame frame : frames) {
+        xhtml.characters(frame.getId());
+        xhtml.newline();
+        // Get Tags
+        for (String tag : frame.getTags()) {
+          xhtml.element("li", tag + "=" + Arrays.toString(frame.getTagValues(tag).toArray()) + ";");
+          xhtml.newline();
+        }
+        // Get Clauses
+//        Collection<Clause> frameClauses = frame.getClauses();
+//        //metadata.add("OBO:" + typeString + "ClauseCount", Integer.toString(frameClauses.size()));
+//        for (Clause clause : frameClauses) {
+//          metadata.add(clause.getTag(), Arrays.toString(clause.getValues().toArray()));
+//        }
+      }
+    }
+
+  }
+  
+  @SuppressWarnings("unused")
+  private void processImportedOBODocs(Metadata metadata, XHTMLContentHandler xhtml, Collection<OBODoc> importedDocs, String typeString) throws SAXException {
+    metadata.add("OBO:" + typeString + "Count", Integer.toString(importedDocs.size()));
+    for (OBODoc importedDoc : importedDocs) {
+      // Process OBO Header
+      processFrames(metadata, xhtml, java.util.Collections.singleton(importedDoc.getHeaderFrame()), "HeaderFrame");
+      // Process Imported Docs
+      processImportedOBODocs(metadata, xhtml, importedDoc.getImportedOBODocs(), typeString);
+      // Process Instance Frames
+      processFrames(metadata, xhtml, importedDoc.getInstanceFrames(), "InstanceFrame");
+      // Process term Frames
+      processFrames(metadata, xhtml, importedDoc.getTermFrames(), "TermFrame");
+      // Process Typedef Frames
+      processFrames(metadata, xhtml, importedDoc.getTypedefFrames(), "TypedefFrame");
+
+    }
+  }
+
+}
Index: tika-parsers/src/main/java/org/apache/tika/parser/obo/package-info.java
===================================================================
--- tika-parsers/src/main/java/org/apache/tika/parser/obo/package-info.java	(revision 0)
+++ tika-parsers/src/main/java/org/apache/tika/parser/obo/package-info.java	(working copy)
@@ -0,0 +1,20 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * Package containing the {@link org.apache.tika.parser.obo.OBOFlatFileParser}
+ */
+package org.apache.tika.parser.obo;
\ No newline at end of file
Index: tika-parsers/src/main/resources/META-INF/services/org.apache.tika.parser.Parser
===================================================================
--- tika-parsers/src/main/resources/META-INF/services/org.apache.tika.parser.Parser	(revision 1722931)
+++ tika-parsers/src/main/resources/META-INF/services/org.apache.tika.parser.Parser	(working copy)
@@ -44,6 +44,7 @@
 org.apache.tika.parser.mp4.MP4Parser
 org.apache.tika.parser.hdf.HDFParser
 org.apache.tika.parser.netcdf.NetCDFParser
+org.apache.tika.parser.obo.OBOFlatFileParser
 org.apache.tika.parser.odf.OpenDocumentParser
 org.apache.tika.parser.pdf.PDFParser
 org.apache.tika.parser.pkg.CompressorParser
Index: tika-parsers/src/test/java/org/apache/tika/parser/obo/OBOFilatFileParserTest.java
===================================================================
--- tika-parsers/src/test/java/org/apache/tika/parser/obo/OBOFilatFileParserTest.java	(revision 0)
+++ tika-parsers/src/test/java/org/apache/tika/parser/obo/OBOFilatFileParserTest.java	(working copy)
@@ -0,0 +1,59 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.tika.parser.obo;
+
+import static org.junit.Assert.*;
+
+import java.io.InputStream;
+import java.util.Arrays;
+
+import org.apache.tika.metadata.Metadata;
+import org.apache.tika.parser.ParseContext;
+import org.apache.tika.parser.Parser;
+import org.apache.tika.sax.BodyContentHandler;
+import org.junit.Test;
+import org.xml.sax.ContentHandler;
+
+/**
+ *
+ */
+public class OBOFilatFileParserTest {
+
+    @Test
+    public void testParseOBOParser() throws Exception {
+      Parser parser = new OBOFlatFileParser();
+      ContentHandler handler = new BodyContentHandler();
+      Metadata metadata = new Metadata();
+
+      InputStream stream = OBOFlatFileParser.class
+              .getResourceAsStream("/test-documents/obo_parser_test.obo");
+      try {
+          parser.parse(stream, handler, metadata, new ParseContext());
+      } finally {
+          stream.close();
+      }
+
+      // Check for OBO Header
+      assertEquals("application/x-obo", metadata.get("Content-Type"));
+      // Check for Header Frame
+      assertTrue(handler.toString().contains("HeaderFrame"));
+      // Check for both Term Frames
+      assertTrue(handler.toString().contains("GO:0008150"));
+      assertTrue(handler.toString().contains("GO:0000003"));
+  }
+
+}
Index: tika-parsers/src/test/java/org/apache/tika/parser/obo/package-info.java
===================================================================
--- tika-parsers/src/test/java/org/apache/tika/parser/obo/package-info.java	(revision 0)
+++ tika-parsers/src/test/java/org/apache/tika/parser/obo/package-info.java	(working copy)
@@ -0,0 +1,17 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.tika.parser.obo;
\ No newline at end of file
Index: tika-parsers/src/test/resources/test-documents/obo_parser_test.obo
===================================================================
--- tika-parsers/src/test/resources/test-documents/obo_parser_test.obo	(revision 0)
+++ tika-parsers/src/test/resources/test-documents/obo_parser_test.obo	(working copy)
@@ -0,0 +1,47 @@
+format-version: 1.4
+subsetdef: goslim_candida "Candida GO slim"
+subsetdef: goslim_generic "Generic GO slim"
+subsetdef: goslim_pir "PIR GO slim"
+subsetdef: goslim_plant "Plant GO slim"
+subsetdef: goslim_pombe "Fission yeast GO slim"
+subsetdef: goslim_yeast "Yeast GO slim"
+subsetdef: gosubset_prok "Prokaryotic GO subset"
+subsetdef: high_level_annotation_qc "High-level terms not to be used for direct annotation"
+subsetdef: unvetted "unvetted"
+synonymtypedef: systematic_synonym "Systematic synonym" EXACT
+ontology: subset_test
+
+! Note that the gosubset_prok assignment deliberately has a space character at the end;
+! Leave this here, it is for testing purposes
+[Term]
+id: GO:0008150
+name: biological_process
+namespace: biological_process
+alt_id: GO:0000004
+alt_id: GO:0007582
+def: "Any process specifically pertinent to the functioning of integrated living units: cells, tissues, organs, and organisms. A process is a collection of molecular events with a defined beginning and end." [GOC:go_curators, GOC:isa_complete]
+comment: Note that, in addition to forming the root of the biological process ontology, this term is recommended for use for the annotation of gene products whose biological process is unknown. Note that when this term is used for annotation, it indicates that no information was available about the biological process of the gene product annotated as of the date the annotation was made; the evidence code ND, no data, is used to indicate this.
+subset: goslim_candida
+subset: goslim_pir
+subset: goslim_plant
+subset: goslim_yeast
+subset: gosubset_prok 
+synonym: "biological process" EXACT []
+synonym: "biological process unknown" NARROW []
+synonym: "physiological process" EXACT []
+xref: Wikipedia:Biological_process
+
+[Term]
+id: GO:0000003
+name: reproduction
+namespace: biological_process
+alt_id: GO:0019952
+alt_id: GO:0050876
+def: "The production by an organism of new individuals that contain some portion of their genetic material inherited from that organism." [GOC:go_curators, GOC:isa_complete, ISBN:0198506732 "Oxford Dictionary of Biochemistry and Molecular Biology"]
+subset: goslim_generic
+subset: goslim_pir
+subset: goslim_plant
+subset: gosubset_prok
+synonym: "reproductive physiological process" EXACT []
+xref: Wikipedia:Reproduction
+is_a: GO:0008150 ! biological_process
\ No newline at end of file
