@Override protected Set<ONDEXConcept> retrieveConceptAllDataSource( DataSource dataSource) { return parent.getConceptsOfDataSource(dataSource); }
/** * @param dataSource * @return * @see net.sourceforge.ondex.core.ONDEXGraph#getConceptsOfDataSource(net.sourceforge.ondex.core.DataSource) */ public Set<ONDEXConcept> getConceptsOfDataSource(DataSource dataSource) { return og.getConceptsOfDataSource(dataSource); }
int counting(DataSource dataSource) { return graph.getConceptsOfDataSource(dataSource).size(); } }.count();
@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()); } } }
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); } };
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()); } }
/** * 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(); }
for (ONDEXConcept c : graph.getConceptsOfDataSource(dataSource)) { idOfCV.add(c.getId());
continue; concepts.addAll(graph.getConceptsOfDataSource(dataSource)); relations.addAll(graph.getRelationsOfDataSource(dataSource));
concepts.retainAll(graph.getConceptsOfDataSource(concept_dataSource)); System.out.println("restrict on cv: " + concept_dataSource.getId() + " " + concepts.size());
BitSetFunctions.and(concepts, graph.getConceptsOfDataSource(concept_dataSource));
DataSource dataSourceSource = md.getDataSource(cv); Set<ONDEXConcept> cvConcepts = graph.getConceptsOfDataSource(dataSourceSource); Set<ONDEXConcept> ccConcepts = graph.getConceptsOfConceptClass(conceptClassSource);
graph.getConceptsOfDataSource(dataSourceUniProtSP), graph.getConceptsOfDataSource(dataSourceUniProtTR)); RelationType rtSimSeq = md.getRelationType(MetaData.RT_HSS);
RelationType rtMISP = md.getRelationType("member_of"); Set<ONDEXConcept> view1 = graph.getConceptsOfConceptClass(ccProtein); Set<ONDEXConcept> view2 = graph.getConceptsOfDataSource(dataSourceUniprot); Set<ONDEXConcept> poplarProts = BitSetFunctions.andNot(view1, view2);
BitSetFunctions.and(concepts, graph.getConceptsOfDataSource(concept_dataSource));
concepts = BitSetFunctions.copy(graph.getConceptsOfDataSource(dataSource)); } else { concepts.addAll(graph.getConceptsOfDataSource(dataSource));
/** * 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(); } } }
} else { concepts.addAll(graph.getConceptsOfDataSource(ds)); fireEventOccurred(new GeneralOutputEvent( "Adding DataSource " + dsId,
} else { concepts.addAll(graph.getConceptsOfDataSource(ds)); fireEventOccurred(new GeneralOutputEvent( "Adding DataSource " + dsId, getCurrentMethodName()));
Set<ONDEXConcept> concepts = graph.getConceptsOfDataSource(ds); if (concepts.size() > 0) { Set<ONDEXRelation> relations = graph