net.sourceforge.ondex.core.DataSource.getId()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(9.0k)|赞(0)|评价(0)|浏览(126)

本文整理了Java中net.sourceforge.ondex.core.DataSource.getId()方法的一些代码示例,展示了DataSource.getId()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。DataSource.getId()方法的具体详情如下:
包路径:net.sourceforge.ondex.core.DataSource
类名称:DataSource
方法名:getId

DataSource.getId介绍

暂无

代码示例

代码示例来源:origin: net.sourceforge.ondex.apps/ovtk2

  1. @Override
  2. public int compare(DataSource o1, DataSource o2) {
  3. return o1.getId().compareToIgnoreCase(o2.getId());
  4. }
  5. });

代码示例来源:origin: net.sourceforge.ondex.apps/ovtk2

  1. /**
  2. * Returns node color for a given DataSource.
  3. *
  4. * @param ds
  5. * DataSource
  6. * @return Color
  7. */
  8. public static Color getColorForDataSource(DataSource ds) {
  9. String key = "DataSource.Color." + ds.getId();
  10. if (visual.getProperty(key) != null) {
  11. return convertToColor(visual.getProperty(key));
  12. }
  13. return defaultColor;
  14. }

代码示例来源:origin: net.sourceforge.ondex.modules/rdf

  1. public static String dataSourceToUri(String graphUri, DataSource dataSource) {
  2. return toUri(graphUri, "cv", dataSource.getId());
  3. }
  4. public static String ccToUri(String graphUri, ConceptClass cc) {

代码示例来源:origin: net.sourceforge.ondex.apps/ovtk2

  1. /**
  2. * Returns a JLabel for the data source
  3. */
  4. @Override
  5. public Object getElementAt(int index) {
  6. JLabel label = null;
  7. if (index > -1) {
  8. DataSource dataSource = dataSources.get(index);
  9. String name = dataSource.getFullname();
  10. if (name.trim().length() == 0)
  11. name = dataSource.getId();
  12. label = new JLabel(name);
  13. label.setName(dataSource.getId());
  14. label.setToolTipText("(" + dataSource.getId() + ") " + dataSource.getDescription());
  15. }
  16. return label;
  17. }

代码示例来源:origin: net.sourceforge.ondex.modules/tab-tools

  1. public String getValue(ONDEXEntity cOrr) throws InvalidOndexEntityException {
  2. if(AbstractConcept.class.isAssignableFrom(cOrr.getClass())){
  3. return ((ONDEXConcept)cOrr).getElementOf().getId();
  4. }
  5. throw new InvalidOndexEntityException(cOrr.getClass()+": is not an Ondex class for which cv is known");
  6. }

代码示例来源:origin: net.sourceforge.ondex.core/sql

  1. @Override
  2. public Set<ONDEXConcept> getConceptsOfDataSource(DataSource dataSource) {
  3. Set<Integer> is = new HashSet<Integer>();
  4. try {
  5. PreparedStatement getCofDataSource = conn
  6. .prepareStatement("select id from concept where sid = ? and DataSource = ?");
  7. getCofDataSource.setLong(1, sid);
  8. getCofDataSource.setString(2, dataSource.getId());
  9. ResultSet rs = getCofDataSource.executeQuery();
  10. while (rs.next()) {
  11. is.add(rs.getInt(1));
  12. }
  13. rs.close();
  14. getCofDataSource.close();
  15. } catch (SQLException e) {
  16. // TODO Auto-generated catch block
  17. e.printStackTrace();
  18. }
  19. return BitSetFunctions.create(this, ONDEXConcept.class, is);
  20. }

代码示例来源:origin: net.sourceforge.ondex.modules/json

  1. /**
  2. * Generate metadata for Data Source.
  3. * @param ds
  4. * A Data Source (from the Ondex API).
  5. * @return JSONObject
  6. * JSONObject containing information about the Data Source.
  7. */
  8. private JSONObject buildDataSource(DataSource ds) {
  9. JSONObject dsJson= new JSONObject();
  10. dsJson.put(JSONAttributeNames.ID, ds.getId());
  11. dsJson.put(JSONAttributeNames.FULLNAME, ds.getFullname());
  12. dsJson.put(JSONAttributeNames.DESCRIPTION, ds.getDescription());
  13. return dsJson;
  14. }

代码示例来源:origin: net.sourceforge.ondex.modules/generic

  1. @Override
  2. public void start() {
  3. for (DataSource dataSource : graph.getMetaData().getDataSources()) {
  4. Set<ONDEXConcept> concepts = graph.getConceptsOfDataSource(dataSource);
  5. System.out.println("Data source C.V. id\tNumber of instances");
  6. if (concepts.size() > 0) {
  7. System.out.println(dataSource.getId() + "\t" + concepts.size());
  8. }
  9. }
  10. }

代码示例来源:origin: net.sourceforge.ondex.core/sql

  1. @Override
  2. public boolean deleteConceptAccession(String accession,
  3. DataSource elementOf) {
  4. try {
  5. PreparedStatement deleteCA = sg.getConnection().prepareStatement("delete from conceptaccession where (sid,id) = (?,?) and accession = ? and DataSource = ?");
  6. deleteCA.setLong(1, getSID());
  7. deleteCA.setInt(2, id);
  8. deleteCA.setString(3, accession);
  9. deleteCA.setString(4, elementOf.getId());
  10. deleteCA.execute();
  11. deleteCA.close();
  12. return true;
  13. } catch (SQLException e) {
  14. // TODO Auto-generated catch block
  15. e.printStackTrace();
  16. }
  17. return false;
  18. }

代码示例来源:origin: net.sourceforge.ondex.apps/ovtk2

  1. private void step() {
  2. boolean match = false;
  3. next = null;
  4. List<String> ofInterest = new ArrayList<String>();
  5. while (!match && view.hasNext()) {
  6. ONDEXRelation r = view.next();
  7. String[] cCvs = arrAnd(r.getFromConcept().getElementOf().getId().split(":"), r.getToConcept().getElementOf().getId().split(":"), validArgs);
  8. if (cCvs.length > 0) {
  9. match = true;
  10. next = cCvs;
  11. }
  12. }
  13. }
  14. }

代码示例来源:origin: net.sourceforge.ondex.apps/ovtk2

  1. /**
  2. *
  3. * @param conceptAccessions
  4. * @return
  5. */
  6. private static final String getAccessionOfCV(Set<ConceptAccession> conceptAccessions, String cv) {
  7. for (ConceptAccession acc : conceptAccessions) {
  8. if (acc.getElementOf().getId().equals(cv)) {
  9. return acc.getAccession();
  10. }
  11. }
  12. return null;
  13. }

代码示例来源:origin: net.sourceforge.ondex.core/berkeley

  1. @Override
  2. protected boolean removeConceptAccession(String accession,
  3. DataSource elementOf) {
  4. return berkeley.deleteFromDatabase(ConceptAccession.class,
  5. new BerkeleyIntegerName(id, accession + elementOf.getId()));
  6. }

代码示例来源:origin: net.sourceforge.ondex.modules/clustering

  1. @Override
  2. public int compare(ConceptAccession o1, ConceptAccession o2) {
  3. if (o1.getElementOf().equals(o2.getElementOf()))
  4. return o1.getAccession().compareTo(o2.getAccession());
  5. return o1.getElementOf().getId()
  6. .compareTo(o2.getElementOf().getId());
  7. }
  8. });

代码示例来源:origin: net.sourceforge.ondex.core/berkeley

  1. @Override
  2. protected DataSource storeDataSource(DataSource dataSource) {
  3. BerkeleyDataSource bcv = BerkeleyDataSource.FACTORY.convert(dataSource);
  4. if (berkeley.existsInDatabase(DataSource.class, dataSource.getId())) {
  5. berkeley.fireEventOccurred(new DuplicatedEntryEvent(
  6. Config.properties
  7. .getProperty("persistent.BerkeleyONDEXGraphMetaData.DuplicatedDataSource")
  8. + dataSource.getId(),
  9. "[BerkeleyONDEXGraphMetaData - storeDataSource]"));
  10. } else {
  11. berkeley.insertIntoDatabase(DataSource.class, dataSource.getId(),
  12. bcv.serialise());
  13. }
  14. bcv.setUpdateListener(this);
  15. return bcv;
  16. }

代码示例来源:origin: net.sourceforge.ondex.webservices/soapgraph

  1. @Override
  2. public ConceptAccession createConceptAccession(String accession,
  3. DataSource elementOf, boolean ambiguous) {
  4. try {
  5. soapGraph.createConceptAccession(graphId, id, new Holder<String>(
  6. accession), elementOf.getId(), Boolean.valueOf(ambiguous));
  7. return new SOAPConceptAccession(parent, id, accession,
  8. elementOf.getId());
  9. } catch (WebserviceException_Exception e) {
  10. parent.fireActionEvent(e, e.getMessage());
  11. e.printStackTrace();
  12. }
  13. return null;
  14. }

代码示例来源:origin: net.sourceforge.ondex.webservices/soapgraph

  1. @Override
  2. public ConceptAccession getConceptAccession(String accession,
  3. DataSource elementOf) {
  4. try {
  5. if (soapGraph.getConceptAccession(graphId, id, accession,
  6. elementOf.getId()) != null)
  7. return new SOAPConceptAccession(parent, id, accession,
  8. elementOf.getId());
  9. } catch (WebserviceException_Exception e) {
  10. parent.fireActionEvent(e, e.getMessage());
  11. e.printStackTrace();
  12. }
  13. return null;
  14. }

代码示例来源:origin: net.sourceforge.ondex.apps/ovtk2

  1. @Override
  2. public int compare(ConceptAccession o1, ConceptAccession o2) {
  3. // within same DataSource sort first by ambiguity, than by accession
  4. if (o1.getElementOf().equals(o2.getElementOf())) {
  5. if (!o1.isAmbiguous() && o2.isAmbiguous())
  6. return -1;
  7. else if (o1.isAmbiguous() && !o2.isAmbiguous())
  8. return 1;
  9. else
  10. return o1.getAccession().compareTo(o2.getAccession());
  11. } else {
  12. // sort according to DataSource
  13. return o1.getElementOf().getId().compareTo(o2.getElementOf().getId());
  14. }
  15. }

代码示例来源:origin: net.sourceforge.ondex.webservices/soapgraph

  1. @Override
  2. public boolean deleteConceptAccession(String accession, DataSource elementOf) {
  3. try {
  4. return soapGraph.deleteConceptAccession(graphId, id, accession,
  5. elementOf.getId());
  6. } catch (WebserviceException_Exception e) {
  7. parent.fireActionEvent(e, e.getMessage());
  8. e.printStackTrace();
  9. }
  10. return false;
  11. }

代码示例来源:origin: net.sourceforge.ondex.modules/generic

  1. public void start() {
  2. ONDEXGraphMetaData metadata = graph.getMetaData();
  3. for (ConceptClass cc : metadata.getConceptClasses()) {
  4. System.out.println("ConceptClass " + cc.getId() + " " + cc.getFullname());
  5. System.out.println("\tConcepts = " + graph.getConceptsOfConceptClass(cc).size());
  6. }
  7. for (DataSource dataSource : metadata.getDataSources()) {
  8. System.out.println("DataSource " + dataSource.getId() + " " + dataSource.getFullname());
  9. System.out.println("\tConcepts = " + graph.getConceptsOfDataSource(dataSource).size());
  10. }
  11. for (AttributeName att : metadata.getAttributeNames()) {
  12. System.out.println("AttributeName " + att.getId() + " " + att.getFullname());
  13. System.out.println("\tConcepts = " + graph.getConceptsOfAttributeName(att).size());
  14. System.out.println("\tRelations = " + graph.getRelationsOfAttributeName(att).size());
  15. }
  16. for (RelationType rt : metadata.getRelationTypes()) {
  17. System.out.println("RelationType " + rt.getId() + " " + rt.getFullname());
  18. System.out.println("\tRelations = " + graph.getRelationsOfRelationType(rt).size());
  19. }
  20. }

代码示例来源:origin: net.sourceforge.ondex.core/berkeley

  1. @Override
  2. protected ConceptAccession retrieveConceptAccession(String accession,
  3. DataSource elementOf) {
  4. byte[] array = berkeley.getFromDatabase(ConceptAccession.class,
  5. new BerkeleyIntegerName(id, accession + elementOf.getId()));
  6. if (array != null) {
  7. BerkeleyConceptAccession conceptAccession = BerkeleyConceptAccession
  8. .deserialise(berkeley.getAbstractONDEXGraph(), array);
  9. array = null;
  10. conceptAccession.setUpdateListener(this);
  11. return conceptAccession;
  12. }
  13. return null;
  14. }

相关文章