title: How to load an N-Triples model and obtain the namespaces from RDF file?(newbie)
body: <p>I have an RDF/XML file like this:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;rdf:RDF
  xmlns:go="http://www.geneontology.org/dtds/go.dtd#"
  xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"&gt;
          &lt;go:term rdf:about="http://www.geneontology.org/go#GO:0000001"&gt;
              &lt;go:accession&gt;GO:0000001&lt;/go:accession&gt;
              &lt;go:name&gt;mitochondrion inheritance&lt;/go:name&gt;
              &lt;go:synonym&gt;mitochondrial inheritance&lt;/go:synonym&gt;
              &lt;go:definition&gt;The distribution of mitochondria, including the mitochondrial genome, into daughter cells after mitosis or meiosis, mediated by interactions between mitochondria and the cytoskeleton.&lt;/go:definition&gt;
              &lt;go:is_a rdf:resource="http://www.geneontology.org/go#GO:0048308" /&gt;
              &lt;go:is_a rdf:resource="http://www.geneontology.org/go#GO:0048311" /&gt;
          &lt;/go:term&gt;
  &lt;/rdf:RDF&gt;
  </code></pre>
  
  <p>Then I have to convert this RDF/XML into the N-Triples format, and I have done this automatically with Jena:</p>
  
  <pre class="lang-java prettyprint-override"><code>FileManager.get().addLocatorClassLoader(Converter.class.getClassLoader());
      Model model = FileManager.get().loadModel("smallfacts.rdf");
      try {
  
            File file= new File("outputsmall.txt");
            model.write(new FileOutputStream(file), "N-Triples");
          } catch (IOException e) {
            e.printStackTrace();
  </code></pre>
  
  <p>But then I need to shorten each predicate with a prefix.  I have to obtain something like this:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;http://www.geneontology.org/go#GO:2000391&gt; is_a &lt;http://www.geneontology.org/go#GO:2000389&gt;.
  &lt;http://www.geneontology.org/go#GO:2000391&gt; accession "GO:2000391".
  </code></pre>
  
  <p>I have read about <code>getNSPrefix()</code> and have made some attempts, such as:</p>
  
  <pre class="lang-java prettyprint-override"><code>FileManager.get().addLocatorClassLoader(Converter.class.getClassLoader());
      Model model = FileManager.get().loadModel("smallfacts.rdf");
      try {
  
            File file= new File("outputsmall.txt");
            model.getNsPrefixURI("http://www.geneontology.org/dtds/go.dtd#");
            model.write(new FileOutputStream(file), "N-Triples", "http://www.geneontology.org/dtds/go.dtd#");
          } catch (IOException e) {
            e.printStackTrace();
  </code></pre>
  
  <p>How do I use <code>getNsPrefixURI()</code> in this case? Should I use another method?</p>