/** * @return * @see net.sourceforge.ondex.core.ONDEXGraph#getName() */ public String getName() { return og.getName(); }
/** * @param og * ONDEXGraph to wrap */ LuceneONDEXGraph(ONDEXGraph og) { this(og.getName(), og.getMetaData()); this.parent = og; super.readOnly = true; }
public OVTKGraphManager(JDesktopPane desktopPane) { for (Component c : desktopPane.getComponents()) { if (c instanceof OVTK2PropertiesAggregator) { OVTK2PropertiesAggregator v = (OVTK2PropertiesAggregator) c; ONDEXGraph g = v.getONDEXJUNGGraph(); graphsByName.put(g.getName(), g); List<OVTK2PropertiesAggregator> viewers = graphsToViewer.get(g); if (viewers == null) { viewers = new ArrayList<OVTK2PropertiesAggregator>(); graphsToViewer.put(g, viewers); } viewers.add(v); } } }
/** * public static AbstractONDEXGraphMetaData * getMetaData(OVTK2PropertiesAggregator viewer) throws FunctionException { * mdResolver AbstractONDEXGraphMetaData result = viewer.getJUNGGraph() * .getMetaData(); if (result == null) { throw new * FunctionException("No meta data is available.", -4); } return result; } */ private static LuceneEnv loadLuceneEnv(ONDEXGraph graph) { Engine engine = Engine.getEngine(); return engine.getIndex(graph, graph.getName()); } }
private static LuceneEnv loadLuceneEnv(ONDEXGraph graph) { Engine engine = Engine.getEngine(); return engine.getIndex(graph, graph.getName()); }
/** * Generate metadata object in JSON format. * @return A JSONObject containing information about all concepts, relations & metadata. */ private JSONObject getJsonMetadata() { JSONObject mdJson= new JSONObject(); // Write graph name in the metadata (allGraphDataJson) JSONObject. mdJson.put(JSONAttributeNames.GRAPHNAME, graph.getName()); // graph name // Write JSON Exporter Plugin version in the JSONObject. mdJson.put(JSONAttributeNames.VERSION, version); // Write the number of concepts in the JSONObject. mdJson.put(JSONAttributeNames.NUMBERCONCEPTS, concepts.size()); // Write the number of relations in the JSONObject. mdJson.put(JSONAttributeNames.NUMBERRELATIONS, relations.size()); // Build JSON for all the Concepts. JSONArray conceptsJsonArray= new JSONArray(); for(ONDEXConcept con : concepts) { conceptsJsonArray.add(buildConcept(con)); } mdJson.put(JSONAttributeNames.CONCEPTS, conceptsJsonArray); // Build JSON for all the Relations. JSONArray relationsJsonArray= new JSONArray(); for(ONDEXRelation rel : relations) { relationsJsonArray.add(buildRelation(rel)); } mdJson.put(JSONAttributeNames.RELATIONS, relationsJsonArray); return mdJson; }
public LuceneEnv getIndex(ONDEXGraph graph, String name) {//pluginInit.makeSimplePlugin().getName() long start = System.currentTimeMillis(); fireEventOccurred(new GeneralOutputEvent("Index required by " + name + " starting index", getCurrentMethodName())); String dir = indexedGraphs.get(graph); if (dir != null && new File(dir).exists()) { LuceneEnv lenv = new LuceneEnv(dir, false); lenv.addONDEXListener(logger); lenv.setONDEXGraph(graph); return lenv; } String graphdir = null; if (Config.ondexDir.endsWith(File.separator)) { graphdir = Config.ondexDir + "index" + File.separator + graph.getName() + File.separator + "index"; } else { graphdir = Config.ondexDir + File.separator + "index" + File.separator + graph.getName() + File.separator + "index"; } dir = graphdir + indexCounter; while (new File(dir).exists()) { dir = graphdir + indexCounter; indexCounter++; } LuceneEnv lenv = new LuceneEnv(dir, true); lenv.addONDEXListener(logger); lenv.setONDEXGraph(graph); LuceneRegistry.sid2luceneEnv.put(graph.getSID(), lenv); indexedGraphs.put(graph, dir); fireEventOccurred(new GeneralOutputEvent("Lucene took " + (System.currentTimeMillis() - start) + " msec.", getCurrentMethodName())); return lenv; }
mdJson.put(JSONAttributeNames.GRAPHNAME, graph.getName()); // graph name
+ File.separator + graph.getName() + File.separator + "validatorsout" + File.separator + validatorInstance.getName());
/** * Initialises GUI and triggers tabbed pane construction. * * @param graph * ONDEXGraph to work with */ public GraphTableEditor(ONDEXGraph graph) { super(graph.getName(), "Editor", "ONDEX Graph Editor", true, true, true, true); this.setDefaultCloseOperation(DISPOSE_ON_CLOSE); // default size this.setSize(800, 600); // only one root component this.setLayout(new GridLayout(1, 1)); // everything goes into the tabbed pane pane = new JTabbedPane(); populatePane(graph, pane); this.add(pane); // listen to changes in tabs for updating selection pane.addChangeListener(this); }
System.out.println("Setting graph: " + graphInput.getName()); ((RequiresGraph) plugin).setONDEXGraph(graphInput);
/** * Writes out general information about the graph * * @param xmlWriteStream * @throws XMLStreamException */ private void writeGraphInfo(XMLStreamWriter2 xmlWriteStream) throws XMLStreamException { // start new section xmlWriteStream.writeStartElement(GENERAL); // write graph name xmlWriteStream.writeStartElement(NAME); xmlWriteStream.writeCharacters(graph.getName()); xmlWriteStream.writeEndElement(); // write number of concepts xmlWriteStream.writeStartElement(NBCONCEPTS); xmlWriteStream.writeInt(concepts.size()); xmlWriteStream.writeEndElement(); // write number of relations xmlWriteStream.writeStartElement(NBRELATIONS); xmlWriteStream.writeInt(relations.size()); xmlWriteStream.writeEndElement(); // end section xmlWriteStream.writeEndElement(); }
/** * Initialises the meta data for a given AbstractONDEXGraph. * * @param og AbstractONDEXGraph * @throws JAXBException */ public void initMetaData(ONDEXGraph og) throws Exception { // // Set the factory to the RI // System.setProperty("javax.xml.stream.XMLInputFactory", "com.ctc.wstx.stax.WstxInputFactory"); XMLInputFactory2 xmlif = (XMLInputFactory2) XMLInputFactory2.newInstance(); xmlif.configureForSpeed(); PluginDescription oxlBean = PluginRegistry.getInstance().getPluginDescription(PluginType.PARSER, "oxl"); if (oxlBean == null) { throw new PluginException("Could not find the OXL parser"); } WorkflowTask oxlConf = new WorkflowTask(oxlBean, new BoundArgumentValue(arg(oxlBean, "InputFile"), file.getAbsolutePath())); oxlConf.addArgument("graphId", og.getName()); WorkflowDescription td = new WorkflowDescription(); td.addPlugin(oxlConf); td.addResource(og.getName(), og); BasicJobImpl je = new BasicJobImpl(new ResourcePool()); td.toOndexJob(je); je.run(); if(je.getErrorState()) throw je.getException(); }
+ graph.getName(), getCurrentMethodName()));
xmlw.writeCharacters(graph.getName()); xmlw.writeEndElement();