title: OWL API, extracting a string from a URI
body: <p>Given an arbitrary IRI, such as the main ontology or one of the ontologies it imports, I would like to extract the title but the code yields no annotations.</p>
  
  <p>Here's an example of what I'm talking about, from the SKOS ontology:</p>
  
  <pre><code>  &lt;owl:Ontology rdf:about="http://www.w3.org/2004/02/skos/core"&gt;
      &lt;dct:title xml:lang="en"&gt;SKOS Vocabulary&lt;/dct:title&gt;
  </code></pre>
  
  <p>How exactly would I extract, "SKOS Vocabulary".</p>
  
  <p>Here is some code I am currently using from an OWL-API tutorial.</p>
  
  <pre><code>public void testingOWL() throws OWLOntologyCreationException, OWLOntologyStorageException
  {
  
  // Get hold of an ontology manager 
  OWLOntologyManager manager = OWLManager.createOWLOntologyManager(); 
  
  // Load an ontology from the Web.  We load the ontology from a document IRI 
  IRI docIRI = IRI.create("http://www.w3.org/2009/08/skos-reference/skos.rdf"); 
  OWLOntology skos = manager.loadOntologyFromOntologyDocument(docIRI); 
  
  System.out.println("Loaded ontology: " + skos); 
  System.out.println();
  
  // Save a local copy of the ontology.  (Specify a path appropriate to your setup) 
  File file = new File("e:/downloadAndSaveOWLFile.owl"); 
  manager.saveOntology(skos, IRI.create(file.toURI())); 
  
  // Ontologies are saved in the format from which they were loaded.   
  // We can get information about the format of an ontology from its manager 
  OWLOntologyFormat format = manager.getOntologyFormat(skos); 
  System.out.println("    format: " + format); 
  System.out.println();
  
  // Save the ontology in owl/xml format 
  OWLXMLOntologyFormat owlxmlFormat = new OWLXMLOntologyFormat(); 
  
  // Some ontology formats support prefix names and prefix IRIs.   
  // In our case we loaded the pizza ontology from an rdf/xml format, which supports prefixes.  
  // When we save the ontology in the new format we will copy the prefixes over  
  // so that we have nicely abbreviated IRIs in the new ontology document 
  if(format.isPrefixOWLOntologyFormat()) 
  { 
      owlxmlFormat.copyPrefixesFrom(format.asPrefixOWLOntologyFormat()); 
  } 
  
  manager.saveOntology(skos, owlxmlFormat, IRI.create(file.toURI())); 
  
  // Dump an ontology to System.out by specifying a different OWLOntologyOutputTarget 
  // Note that we can write an ontology to a stream in a similar way  
  // using the StreamOutputTarget class 
  OWLOntologyDocumentTarget documentTarget = new SystemOutDocumentTarget(); 
  
  // Try another format - The Manchester OWL Syntax 
  ManchesterOWLSyntaxOntologyFormat manSyntaxFormat = new ManchesterOWLSyntaxOntologyFormat(); 
  
  if(format.isPrefixOWLOntologyFormat()) 
  { 
      manSyntaxFormat.copyPrefixesFrom(format.asPrefixOWLOntologyFormat()); 
  } 
  manager.saveOntology(skos, manSyntaxFormat, documentTarget); 
  }
  </code></pre>
  
  <p>EDIT: Update the code based on the suggestion below but only returns 1 object for rdfs:seeAlso.</p>
  
  <p>public void getData() throws OWLOntologyCreationException</p>
  
  <pre><code>{
      // Get hold of an ontology manager 
      OWLOntologyManager manager = OWLManager.createOWLOntologyManager();
  
      // Load an ontology from the Web.  We load the ontology from a document IRI 
      IRI docIRI = IRI.create("http://www.w3.org/2009/08/skos-reference/skos.rdf"); 
      OWLOntology skos = manager.loadOntologyFromOntologyDocument(docIRI); 
  
      for (OWLAnnotation ann: skos.getAnnotations())
      {
          System.out.println("ann: " + ann.getProperty());
          System.out.println();
      }
  
  
  }
  </code></pre>