public void convert (String inFilename, String outFilename) throws OperatorException, IOException, JAXBException { OPMDeserialiser deserial=OPMDeserialiser.getThreadOPMDeserialiser(); OPMGraph graph=deserial.deserialiseOPMGraph(new File(inFilename)); convert(graph,outFilename); }
protected synchronized OPMDeserialiser initialValue () { try { return new OPMDeserialiser(); } catch (JAXBException jxb) { throw new RuntimeException("OPMDeserialiser: deserialiser init failure()"); } } };
OPMDeserialiser deser = new OPMDeserialiser(); graph = deser.deserialiseOPMGraph(new File(XMLOPMGraphFilename));
public static void main(String [] args) { OPMDeserialiser deserial=OPMDeserialiser.getThreadOPMDeserialiser(); if ((args==null) || (args.length==0)) { System.out.println("Usage: opmxml-validate <filename> {schemaFiles}*"); return; } File f=new File(args[0]); String [] schemas=new String[args.length-1]; for (int i=1; i< args.length; i++) { schemas[i-1]=args[i]; } try { deserial.validateOPMGraph(schemas,f); System.out.println(args[0] + " IS a valid OPM graph"); return ; } catch (JAXBException je) { je.printStackTrace(); System.out.println(args[0] + " IS NOT a valid OPM graph"); } catch (SAXException je) { je.printStackTrace(); System.out.println(args[0] + " IS NOT a valid OPM graph"); } catch (IOException io) { io.printStackTrace(); System.out.println(args[0] + " IS NOT a valid OPM graph"); } } }
public void convert (String inFilename, String outFilename) throws OperatorException, IOException, JAXBException { OPMDeserialiser deserial=OPMDeserialiser.getThreadOPMDeserialiser(); OPMGraph graph=deserial.deserialiseOPMGraph(new File(inFilename)); convert(graph,outFilename); }
public void convert(String opmFile, String dotFile, String pdfFile) throws java.io.FileNotFoundException, java.io.IOException, JAXBException { convert (OPMDeserialiser.getThreadOPMDeserialiser().deserialiseOPMGraph(new File(opmFile)),dotFile,pdfFile); }
public void xmlToRdf(String fileIn, String fileOut, String NS, String gid, RDFFormat format) throws Exception { ElmoModule module = new ElmoModule(); registerConcepts(module); ElmoManagerFactory factory=new SesameManagerFactory(module); ElmoManager manager = factory.createElmoManager(); OPMGraph oGraph=OPMDeserialiser.getThreadOPMDeserialiser().deserialiseOPMGraph(new File(fileIn)); String graphId=oGraph.getId(); String namespace=NS; if ((gid!=null) && (gid.equals("yes"))) namespace=namespace+ graphId +"/"; RdfOPMFactory oFactory=new RdfOPMFactory(new RdfObjectFactory(manager,namespace)); RdfOPMGraph graph2=oFactory.newOPMGraph(oGraph); Collection<String[]> prefixes=Collections.singleton(new String[]{"ex",namespace}); dumpToRDF(new File(fileOut),(SesameManager)manager,format,prefixes); }