The following is my code.
OWLOntologyManager man = OWLManager.createOWLOntologyManager();
           File file = new File("/home/eclipse-workspace/Newwebapp/src/com/gayathri/steels2.owl");
           OWLOntology o;
           try {
                o=man.loadOntologyFromOntologyDocument(file);
                StringDocumentTarget target = new StringDocumentTarget();
                  try {
                        o.saveOntology(new FunctionalSyntaxDocumentFormat(), target);
                        
                        resp.getWriter().write("Hello World!!"+target.toString());
                } catch (OWLOntologyStorageException e) {
                        // TODO Auto-generated catch block
                        e.printStackTrace();
                }	
                 		
        } catch (OWLOntologyCreationException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
        }
Jiba wrote
Hi,
You can use onto.save("filename.nt", format = "ntriples") to export triplets. It will displays full URL, but you can process the file later to remove them if you want so.
Jiba
 
Where should i add the line? Also i am loading a local owl file so should i change the 
filename.nt to 
filepath?