@Override protected Set<DataSource> retrieveDataSourceAll() { return parent.getDataSources(); }
Set<DataSource> loopsOver() { return metadata.getDataSources(); } int counting(DataSource dataSource) { return graph.getConceptsOfDataSource(dataSource).size(); }
@Override public void start() { for (DataSource dataSource : graph.getMetaData().getDataSources()) { Set<ONDEXConcept> concepts = graph.getConceptsOfDataSource(dataSource); System.out.println("Data source C.V. id\tNumber of instances"); if (concepts.size() > 0) { System.out.println(dataSource.getId() + "\t" + concepts.size()); } } }
/** * Populates a alphabetically sorted box of all data sources and NONE label. * * @return JComboBox of String */ private JComboBox populateAccessionDataSources() { // get all data sources Set<String> dataSources = new HashSet<String>(); for (DataSource ds : graph.getMetaData().getDataSources()) { dataSources.add(ds.getId()); } // sort data sources String[] sorted = dataSources.toArray(new String[0]); Arrays.sort(sorted); // add default label String[] all = new String[sorted.length + 1]; all[0] = Config.language.getProperty("Dialog.ConceptLabel.None"); for (int i = 0; i < sorted.length; i++) { all[i + 1] = sorted[i]; } // select default case JComboBox box = new JComboBox(all); box.setSelectedIndex(0); return box; }
/** * Loads available DataSources into ComboBox. * */ protected void initDataSource(String selected) { // get list of available data sources Vector<String> dataSources = new Vector<String>(); dataSources.add(""); dataSources.add(Config.language.getProperty("Dialog.Concept.CreateDataSource")); DataSource[] sorted = graph.getMetaData().getDataSources().toArray(new DataSource[0]); Arrays.sort(sorted, new CaseInsensitiveMetaDataComparator()); for (DataSource dataSource : sorted) { dataSources.add(dataSource.getId()); } dataSource.removeAllItems(); for (String ds : dataSources) { dataSource.addItem(ds); } if (selected != null) dataSource.setSelectedItem(selected); dataSource.revalidate(); }
/** * Populates a alphabetically sorted box of non empty data sources and ALL * label. * * @return JComboBox of String */ private JComboBox populateFilterDataSources() { // only display non-empty data sources Set<String> nonEmpty = new HashSet<String>(); for (DataSource ds : graph.getMetaData().getDataSources()) { if (graph.getConceptsOfDataSource(ds).size() > 0) nonEmpty.add(ds.getId()); } // sort data sources String[] sorted = nonEmpty.toArray(new String[0]); Arrays.sort(sorted); // add default label String[] all = new String[nonEmpty.size() + 1]; all[0] = Config.language.getProperty("Dialog.ConceptLabel.All"); for (int i = 0; i < sorted.length; i++) { all[i + 1] = sorted[i]; } // select default case JComboBox box = new JComboBox(all); box.setSelectedIndex(0); return box; }
/** * Fakes a table cell editor based around a JTextField. * */ public ConceptTableCellEditor(ONDEXGraph graph) { super(new JTextField()); // keep local graph reference this.graph = graph; cloner = new ConceptCloner(graph); cvComboBox = new JComboBox(graph.getMetaData().getDataSources().toArray(new DataSource[graph.getMetaData().getDataSources().size()])); ccComboBox = new JComboBox(graph.getMetaData().getConceptClasses().toArray(new ConceptClass[graph.getMetaData().getConceptClasses().size()])); etComboBox = new JComboBox(graph.getMetaData().getEvidenceTypes().toArray(new EvidenceType[graph.getMetaData().getEvidenceTypes().size()])); }
public void run() { if (supportDataSource != null && supportDataSource.isInstalled()) supportDataSource.uninstall(); dataSources.removeAllItems(); list.add(Config.language.getProperty("ToolBar.Search.DataSource")); dataSources.addItem(Config.language.getProperty("ToolBar.Search.DataSource")); boolean hasDSs = false; for (DataSource dataSource : graph.getMetaData().getDataSources()) { Set<ONDEXConcept> view = graph.getConceptsOfDataSource(dataSource); if (view.size() > 0) { hasDSs = true; MetaDataWrapper wrapper = new MetaDataWrapper(dataSource); dataSources.addItem(wrapper); list.add(wrapper); } } dataSources.setEnabled(hasDSs); if (hasDSs) addAutoCompleteSupport(list, dataSources); } };
/** * Modify given concept accession * * @param editor * to propagate changes to element of upwards */ public ConceptAccessionPopup(ConceptAccessionTableCellEditor editor) { this.editor = editor; // editor panel BoxLayout layout = new BoxLayout(this, BoxLayout.LINE_AXIS); this.setLayout(layout); // selection of DataSource for element of this.add(new JLabel("Element of: ")); Object[] cvs = editor.graph.getMetaData().getDataSources().toArray(); Arrays.sort(cvs, new Util()); selection = new JComboBox(cvs); selection.setSelectedItem(editor.acc.getElementOf()); this.add(selection); // check box for ambiguity box = new JCheckBox("Is ambiguous concept accession?"); box.setSelected(editor.acc.isAmbiguous()); this.add(box); // button to close popup JButton close = new JButton("close"); close.addActionListener(this); this.add(close); }
DataSource[] sorted = viewer.getONDEXJUNGGraph().getMetaData().getDataSources().toArray(new DataSource[0]); Arrays.sort(sorted, new CaseInsensitiveMetaDataComparator()); JComboBox cb = new JComboBox();
/** * Adds concept data sources to drop down box */ private void populateRestrictDataSource() { restrictDataSource.setEnabled(withinDataSource.isSelected()); // check only for data sources with concepts Set<DataSource> dataSources = new HashSet<DataSource>(); for (DataSource dataSource : graph.getMetaData().getDataSources()) { if (graph.getConceptsOfDataSource(dataSource).size() > 0) { dataSources.add(dataSource); } } // sort data sources DataSource[] array = dataSources.toArray(new DataSource[0]); Arrays.sort(array); // dummy data source DataSource none = graph.getMetaData().getDataSource("NONE"); if (none == null) none = graph.getMetaData().getFactory().createDataSource("NONE"); // add data source to drop-down box restrictDataSource.removeActionListener(this); restrictDataSource.removeAll(); restrictDataSource.addItem(none); for (DataSource dataSource : array) { restrictDataSource.addItem(dataSource); } restrictDataSource.addActionListener(this); restrictDataSource.setSelectedIndex(0); restrictDataSource.revalidate(); }
public void start() { ONDEXGraphMetaData metadata = graph.getMetaData(); for (ConceptClass cc : metadata.getConceptClasses()) { System.out.println("ConceptClass " + cc.getId() + " " + cc.getFullname()); System.out.println("\tConcepts = " + graph.getConceptsOfConceptClass(cc).size()); } for (DataSource dataSource : metadata.getDataSources()) { System.out.println("DataSource " + dataSource.getId() + " " + dataSource.getFullname()); System.out.println("\tConcepts = " + graph.getConceptsOfDataSource(dataSource).size()); } for (AttributeName att : metadata.getAttributeNames()) { System.out.println("AttributeName " + att.getId() + " " + att.getFullname()); System.out.println("\tConcepts = " + graph.getConceptsOfAttributeName(att).size()); System.out.println("\tRelations = " + graph.getRelationsOfAttributeName(att).size()); } for (RelationType rt : metadata.getRelationTypes()) { System.out.println("RelationType " + rt.getId() + " " + rt.getFullname()); System.out.println("\tRelations = " + graph.getRelationsOfRelationType(rt).size()); } }
for (DataSource dataSource : graph.getMetaData().getDataSources()) { Set<ONDEXConcept> concepts = graph .getConceptsOfDataSource(dataSource);
/** * Builds an XML ondex meta data XML Element. * * @param xmlw * xml stream to write in * @param graphdata * AbstractONDEXGraphMetaData * @throws XMLStreamException * if xml writing fails */ private void buildOndexMetaDataTag(XMLStreamWriter2 xmlw, ONDEXGraphMetaData graphdata) throws XMLStreamException { Set<DataSource> itDataSource = graphdata.getDataSources(); Set<Unit> itUnit = graphdata.getUnits(); Set<AttributeName> itAn = graphdata.getAttributeNames(); Set<EvidenceType> itEt = graphdata.getEvidenceTypes(); Set<ConceptClass> itCc = graphdata.getConceptClasses(); Set<RelationType> itRt = graphdata.getRelationTypes(); buildOndexMetaDataTag(xmlw, itDataSource, itUnit, itAn, itEt, itCc, itRt); }
/** * Writes out statistics for each existing data source * * @param xmlWriteStream * @throws XMLStreamException */ private void writeDataSources(XMLStreamWriter2 xmlWriteStream) throws XMLStreamException { // iterate over all data sources for (DataSource ds : graph.getMetaData().getDataSources()) { // check this data source has concepts Set<ONDEXConcept> set = graph.getConceptsOfDataSource(ds); if (set.size() > 0) { // new DATASOURCE xmlWriteStream.writeStartElement(DATASOURCE); // write ID xmlWriteStream.writeStartElement(ID); xmlWriteStream.writeCharacters(ds.getId()); xmlWriteStream.writeEndElement(); // write COUNT xmlWriteStream.writeStartElement(COUNT); xmlWriteStream.writeInt(set.size()); xmlWriteStream.writeEndElement(); // end DATASOURCE xmlWriteStream.writeEndElement(); } } }
xmlw.writeEndElement(); for (DataSource dataSource : graphData.getDataSources()) { writeMetaDataTable(dataSource, xmlw);
Set<DataSource> cvit = graph.getMetaData().getDataSources(); fireEventOccurred(new GeneralOutputEvent("\nDataSources: " + cvit.size(), getCurrentMethodName())); cvit = null;
for (DataSource ds : graph.getMetaData().getDataSources()) { Set<ONDEXConcept> concepts = graph.getConceptsOfDataSource(ds); if (concepts.size() > 0) {
copyConceptClasses(ccs, omd, nomd); for (DataSource dataSource : omd.getDataSources()) { if (!nomd.checkDataSource(dataSource.getId())) nomd
for(DataSource dataSource : md.getDataSources()) rdfMetadata(model.createResource(ONDEXRdf.dataSourceToUri(graphURI, dataSource)), dataSource); for(EvidenceType et : md.getEvidenceTypes()) rdfMetadata(model.createResource(ONDEXRdf.etToUri(graphURI, et)), et);