public void convert (String inFilename, String outFilename) throws OperatorException, IOException, JAXBException { OPMGraph graph=convert(inFilename); OPMSerialiser serial=OPMSerialiser.getThreadOPMSerialiser(); serial.serialiseOPMGraph(new File(outFilename),graph,true); }
protected synchronized OPMSerialiser initialValue () { try { return new OPMSerialiser(); } catch (JAXBException jxb) { throw new RuntimeException("OPMDeserialiser: serialiser init failure()"); } } };
public Document serialiseOPMGraph (OPMGraph request) throws JAXBException { return (Document) serialiseOPMGraph (defaultEmptyDocument(), request); }
public void serialiseOPMGraph (File file, OPMGraph graph, boolean format) throws JAXBException { Marshaller m=jc.createMarshaller(); m.setProperty("jaxb.formatted.output",format); configurePrefixes(m); m.marshal(of.createOpmGraph(graph),file); }
public String serialiseOPMGraph (StringWriter sw, OPMGraph graph, boolean format) throws JAXBException { Marshaller m=jc.createMarshaller(); m.setProperty("jaxb.formatted.output",format); configurePrefixes(m); m.marshal(of.createOpmGraph(graph),sw); return sw.toString(); }
public void convert (String inFilename, String outFilename) throws OperatorException, IOException, JAXBException { OPMGraph graph=convert(inFilename); OPMSerialiser serial=OPMSerialiser.getThreadOPMSerialiser(); serial.serialiseOPMGraph(new File(outFilename),graph,true); }
public void rdfToXml(String fileIn, String fileOut, String NS, String graphId) throws Exception { ElmoModule module = new ElmoModule(); registerConcepts(module); ElmoManagerFactory factory=new SesameManagerFactory(module); ElmoManager manager = factory.createElmoManager(); RdfOPMFactory oFactory=new RdfOPMFactory(new RdfObjectFactory(manager,NS), manager); File file = new File(fileIn); readFromRDF(file,null,(SesameManager)manager,RDFFormat.RDFXML); QName qname = new QName(NS, graphId); Object o=manager.find(qname); org.openprovenance.rdf.OPMGraph gr=(org.openprovenance.rdf.OPMGraph)o; OPMGraph oGraph=oFactory.newOPMGraph(gr); OPMSerialiser.getThreadOPMSerialiser().serialiseOPMGraph(new File(fileOut),oGraph,true); }