本文整理了Java中net.sourceforge.ondex.core.DataSource.getId()
方法的一些代码示例,展示了DataSource.getId()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。DataSource.getId()
方法的具体详情如下:
包路径:net.sourceforge.ondex.core.DataSource
类名称:DataSource
方法名:getId
暂无
代码示例来源:origin: net.sourceforge.ondex.apps/ovtk2
@Override
public int compare(DataSource o1, DataSource o2) {
return o1.getId().compareToIgnoreCase(o2.getId());
}
});
代码示例来源:origin: net.sourceforge.ondex.apps/ovtk2
/**
* Returns node color for a given DataSource.
*
* @param ds
* DataSource
* @return Color
*/
public static Color getColorForDataSource(DataSource ds) {
String key = "DataSource.Color." + ds.getId();
if (visual.getProperty(key) != null) {
return convertToColor(visual.getProperty(key));
}
return defaultColor;
}
代码示例来源:origin: net.sourceforge.ondex.modules/rdf
public static String dataSourceToUri(String graphUri, DataSource dataSource) {
return toUri(graphUri, "cv", dataSource.getId());
}
public static String ccToUri(String graphUri, ConceptClass cc) {
代码示例来源:origin: net.sourceforge.ondex.apps/ovtk2
/**
* Returns a JLabel for the data source
*/
@Override
public Object getElementAt(int index) {
JLabel label = null;
if (index > -1) {
DataSource dataSource = dataSources.get(index);
String name = dataSource.getFullname();
if (name.trim().length() == 0)
name = dataSource.getId();
label = new JLabel(name);
label.setName(dataSource.getId());
label.setToolTipText("(" + dataSource.getId() + ") " + dataSource.getDescription());
}
return label;
}
代码示例来源:origin: net.sourceforge.ondex.modules/tab-tools
public String getValue(ONDEXEntity cOrr) throws InvalidOndexEntityException {
if(AbstractConcept.class.isAssignableFrom(cOrr.getClass())){
return ((ONDEXConcept)cOrr).getElementOf().getId();
}
throw new InvalidOndexEntityException(cOrr.getClass()+": is not an Ondex class for which cv is known");
}
代码示例来源:origin: net.sourceforge.ondex.core/sql
@Override
public Set<ONDEXConcept> getConceptsOfDataSource(DataSource dataSource) {
Set<Integer> is = new HashSet<Integer>();
try {
PreparedStatement getCofDataSource = conn
.prepareStatement("select id from concept where sid = ? and DataSource = ?");
getCofDataSource.setLong(1, sid);
getCofDataSource.setString(2, dataSource.getId());
ResultSet rs = getCofDataSource.executeQuery();
while (rs.next()) {
is.add(rs.getInt(1));
}
rs.close();
getCofDataSource.close();
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return BitSetFunctions.create(this, ONDEXConcept.class, is);
}
代码示例来源:origin: net.sourceforge.ondex.modules/json
/**
* Generate metadata for Data Source.
* @param ds
* A Data Source (from the Ondex API).
* @return JSONObject
* JSONObject containing information about the Data Source.
*/
private JSONObject buildDataSource(DataSource ds) {
JSONObject dsJson= new JSONObject();
dsJson.put(JSONAttributeNames.ID, ds.getId());
dsJson.put(JSONAttributeNames.FULLNAME, ds.getFullname());
dsJson.put(JSONAttributeNames.DESCRIPTION, ds.getDescription());
return dsJson;
}
代码示例来源:origin: net.sourceforge.ondex.modules/generic
@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());
}
}
}
代码示例来源:origin: net.sourceforge.ondex.core/sql
@Override
public boolean deleteConceptAccession(String accession,
DataSource elementOf) {
try {
PreparedStatement deleteCA = sg.getConnection().prepareStatement("delete from conceptaccession where (sid,id) = (?,?) and accession = ? and DataSource = ?");
deleteCA.setLong(1, getSID());
deleteCA.setInt(2, id);
deleteCA.setString(3, accession);
deleteCA.setString(4, elementOf.getId());
deleteCA.execute();
deleteCA.close();
return true;
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return false;
}
代码示例来源:origin: net.sourceforge.ondex.apps/ovtk2
private void step() {
boolean match = false;
next = null;
List<String> ofInterest = new ArrayList<String>();
while (!match && view.hasNext()) {
ONDEXRelation r = view.next();
String[] cCvs = arrAnd(r.getFromConcept().getElementOf().getId().split(":"), r.getToConcept().getElementOf().getId().split(":"), validArgs);
if (cCvs.length > 0) {
match = true;
next = cCvs;
}
}
}
}
代码示例来源:origin: net.sourceforge.ondex.apps/ovtk2
/**
*
* @param conceptAccessions
* @return
*/
private static final String getAccessionOfCV(Set<ConceptAccession> conceptAccessions, String cv) {
for (ConceptAccession acc : conceptAccessions) {
if (acc.getElementOf().getId().equals(cv)) {
return acc.getAccession();
}
}
return null;
}
代码示例来源:origin: net.sourceforge.ondex.core/berkeley
@Override
protected boolean removeConceptAccession(String accession,
DataSource elementOf) {
return berkeley.deleteFromDatabase(ConceptAccession.class,
new BerkeleyIntegerName(id, accession + elementOf.getId()));
}
代码示例来源:origin: net.sourceforge.ondex.modules/clustering
@Override
public int compare(ConceptAccession o1, ConceptAccession o2) {
if (o1.getElementOf().equals(o2.getElementOf()))
return o1.getAccession().compareTo(o2.getAccession());
return o1.getElementOf().getId()
.compareTo(o2.getElementOf().getId());
}
});
代码示例来源:origin: net.sourceforge.ondex.core/berkeley
@Override
protected DataSource storeDataSource(DataSource dataSource) {
BerkeleyDataSource bcv = BerkeleyDataSource.FACTORY.convert(dataSource);
if (berkeley.existsInDatabase(DataSource.class, dataSource.getId())) {
berkeley.fireEventOccurred(new DuplicatedEntryEvent(
Config.properties
.getProperty("persistent.BerkeleyONDEXGraphMetaData.DuplicatedDataSource")
+ dataSource.getId(),
"[BerkeleyONDEXGraphMetaData - storeDataSource]"));
} else {
berkeley.insertIntoDatabase(DataSource.class, dataSource.getId(),
bcv.serialise());
}
bcv.setUpdateListener(this);
return bcv;
}
代码示例来源:origin: net.sourceforge.ondex.webservices/soapgraph
@Override
public ConceptAccession createConceptAccession(String accession,
DataSource elementOf, boolean ambiguous) {
try {
soapGraph.createConceptAccession(graphId, id, new Holder<String>(
accession), elementOf.getId(), Boolean.valueOf(ambiguous));
return new SOAPConceptAccession(parent, id, accession,
elementOf.getId());
} catch (WebserviceException_Exception e) {
parent.fireActionEvent(e, e.getMessage());
e.printStackTrace();
}
return null;
}
代码示例来源:origin: net.sourceforge.ondex.webservices/soapgraph
@Override
public ConceptAccession getConceptAccession(String accession,
DataSource elementOf) {
try {
if (soapGraph.getConceptAccession(graphId, id, accession,
elementOf.getId()) != null)
return new SOAPConceptAccession(parent, id, accession,
elementOf.getId());
} catch (WebserviceException_Exception e) {
parent.fireActionEvent(e, e.getMessage());
e.printStackTrace();
}
return null;
}
代码示例来源:origin: net.sourceforge.ondex.apps/ovtk2
@Override
public int compare(ConceptAccession o1, ConceptAccession o2) {
// within same DataSource sort first by ambiguity, than by accession
if (o1.getElementOf().equals(o2.getElementOf())) {
if (!o1.isAmbiguous() && o2.isAmbiguous())
return -1;
else if (o1.isAmbiguous() && !o2.isAmbiguous())
return 1;
else
return o1.getAccession().compareTo(o2.getAccession());
} else {
// sort according to DataSource
return o1.getElementOf().getId().compareTo(o2.getElementOf().getId());
}
}
代码示例来源:origin: net.sourceforge.ondex.webservices/soapgraph
@Override
public boolean deleteConceptAccession(String accession, DataSource elementOf) {
try {
return soapGraph.deleteConceptAccession(graphId, id, accession,
elementOf.getId());
} catch (WebserviceException_Exception e) {
parent.fireActionEvent(e, e.getMessage());
e.printStackTrace();
}
return false;
}
代码示例来源:origin: net.sourceforge.ondex.modules/generic
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());
}
}
代码示例来源:origin: net.sourceforge.ondex.core/berkeley
@Override
protected ConceptAccession retrieveConceptAccession(String accession,
DataSource elementOf) {
byte[] array = berkeley.getFromDatabase(ConceptAccession.class,
new BerkeleyIntegerName(id, accession + elementOf.getId()));
if (array != null) {
BerkeleyConceptAccession conceptAccession = BerkeleyConceptAccession
.deserialise(berkeley.getAbstractONDEXGraph(), array);
array = null;
conceptAccession.setUpdateListener(this);
return conceptAccession;
}
return null;
}
内容来源于网络,如有侵权,请联系作者删除!