code: public Document parseRDF(InputStream inputStream, 
                               RDFParser rdfParser, 
                               String baseuri)
                                       throws IOException,
                                       RDFParseException,
                                       RDFHandlerException {
          RdfCollector rdfCollector = new QualifiedCollector(pFactory, onto);
          rdfParser.setRDFHandler(rdfCollector);
          rdfParser.parse(inputStream, baseuri);
          Document doc = rdfCollector.getDocument();
          Namespace ns = doc.getNamespace();
          return doc;
      }
docs: Parse from input stream passing base uri .