title: Read an rdf model from a String
body: <p>I'm using Jena, and I want to create a model and then read its contents from a String that contains RDF.  For instance: </p>
  
  <pre class="lang-xml prettyprint-override"><code>String s= "&lt;rdf:RDF 
      xmlns:res="http://www.w3.org/2005/sparql-results#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"&gt; 
     &lt;rdf:Description rdf:about="http://www.w3.org/2005/sparql-results#ResultSet"&gt;  
      &lt;res:solution rdf:nodeID="r0"/&gt; 
      &lt;res:solution rdf:nodeID="r1"/&gt; 
      &lt;res:solution rdf:nodeID="r2"/&gt; 
     &lt;/rdf:Description&gt;
     &lt;/rdf:RDF&gt;"; 
  </code></pre>
  
  <p>At the moment, I use these instructions:</p>
  
  <pre class="lang-java prettyprint-override"><code>    Model rdf = ModelFactory.createDefaultModel(); 
      InputStream in = FileManager.get().open(s);
      if (in == null) {
          throw new IllegalArgumentException("File: " + s+ " not found");
      }
      rdf.read(in, "");
  </code></pre>
  
  <p>These work only when <code>s</code> is the filename (such as <code>s="./myFile.rdf"</code>), and not when I put the String that contains the whole RDF.</p>