@Override public String getDescription() { return parent.getDescription(); }
public String getValue(ONDEXEntity cOrr) throws InvalidOndexEntityException { if(AbstractConcept.class.isAssignableFrom(cOrr.getClass())){ return ((ONDEXConcept)cOrr).getDescription(); } throw new InvalidOndexEntityException(cOrr.getClass()+": is not an Ondex class for which a description is known"); }
public String getName(ONDEXConcept ac) { String label = ""; // get first preferred name as label for (ConceptName cn : ac.getConceptNames()) { if (cn.isPreferred()) { label = cn.getName(); break; } } // next try annotation if (label == null || label.trim().length() == 0) { label = ac.getAnnotation(); } // next try description if (label == null || label.trim().length() == 0) { label = ac.getDescription(); } // next try pid if (label == null || label.trim().length() == 0) { label = ac.getPID(); } // last resort to concept id if (label == null || label.trim().length() == 0) { label = String.valueOf(ac.getId()); } return label; }
/** * Returns a JLabel for the concept */ @Override public Object getElementAt(int index) { JLabel label = null; if (index > -1) { ONDEXConcept ac = concepts.get(index); String name = null; ConceptName cn = ac.getConceptName(); if (cn != null) name = cn.getName(); else name = String.valueOf(ac.getId()); label = new JLabel(name); label.setName(String.valueOf(ac.getId())); label.setToolTipText("(" + ac.getId() + ") " + ac.getDescription()); } return label; }
else if (c.getDescription().length() > 0) name = c.getDescription().trim(); else name = "n/a";
/** * Tries to get the most worthwhile identifier for the concept * * @param c * - concept * @return - some id (in order of decreasing preference: name, pid, * description, concepts class+is) */ private static String getSomething(ONDEXConcept c) { if (c.getConceptName() != null) { return c.getConceptName().getName(); } if (c.getPID() != null && c.getPID().equals("")) { return c.getPID(); } if (c.getDescription() != null && c.getDescription().equals("")) { return c.getDescription(); } return "[" + c.getOfType().getId() + " " + c.getId() + "]"; }
else if (c.getDescription().length() > 0) name = c.getDescription().trim(); else name = c.getId() + " - n/a";
anno = c.getAnnotation(); String desc = ""; if (c.getDescription() != null) desc = c.getDescription(); for (EvidenceType et : c.getEvidence()) { clause.delete(0, clause.length());
defaultName = concept.getDescription();
/** * Copies all of the attributes from one concept to another (only if they do * not already exist at target) * * @param from * - concept to copy from * @param to * - concept to copy to * @throws AccessDeniedException * @throws NullValueException * @throws EmptyStringException */ public static void copyConceptAttributes(ONDEXConcept from, ONDEXConcept to) throws NullValueException, AccessDeniedException, EmptyStringException { for (EvidenceType et : from.getEvidence()) addNewEvidence(to, et); for (ConceptAccession ca : from.getConceptAccessions()) addNewAccession(to, ca); for (ConceptName cn : from.getConceptNames()) addNewName(to, cn); for (Attribute attribute : from.getAttributes()) addNewAttribute(to, attribute); if (from.getAnnotation() != null && to.getDescription() == null) to.setAnnotation(from.getAnnotation()); if (from.getDescription() != null && to.getDescription() == null) to.setDescription(from.getDescription()); }
else if (concept.getAnnotation() != null) name = concept.getAnnotation(); else if (concept.getDescription() != null) name = concept.getDescription(); else
/** * Clone concept with having a new DataSource. * * @param oldC * old ONDEXConcept * @param newDataSource * new DataSource to use * @return new ONDEXConcept */ public ONDEXConcept clone(ONDEXConcept oldC, DataSource newDataSource) { // first clone concept with new DataSource ONDEXConcept newC = graph.createConcept(oldC.getPID(), oldC.getAnnotation(), oldC.getDescription(), newDataSource, oldC.getOfType(), oldC.getEvidence()); // copies everything else copyEverythingElse(oldC, newC); return newC; }
/** * Clone concept with having a new PID. * * @param oldC * old ONDEXConcept * @param newPID * new PID to use * @return new ONDEXConcept */ public ONDEXConcept clone(ONDEXConcept oldC, String newPID) { // first clone concept with new PID ONDEXConcept newC = graph.createConcept(newPID, oldC.getAnnotation(), oldC.getDescription(), oldC.getElementOf(), oldC.getOfType(), oldC.getEvidence()); // copies everything else copyEverythingElse(oldC, newC); return newC; }
/** * Clone concept with having a new ConceptClass. * * @param oldC * old ONDEXConcept * @param newCC * new ConceptClass to use * @return new ONDEXConcept */ public ONDEXConcept clone(ONDEXConcept oldC, ConceptClass newCC) { // first clone concept with new ConceptClass ONDEXConcept newC = graph.createConcept(oldC.getPID(), oldC.getAnnotation(), oldC.getDescription(), oldC.getElementOf(), newCC, oldC.getEvidence()); // copies everything else copyEverythingElse(oldC, newC); return newC; }
/** * Initialises table data with the given ONDEXGraph. * * @param graph * ONDEXGraph to extract concepts from */ public ConceptPanel(ONDEXGraph graph) { Object[][] data = new Object[graph.getConcepts().size()][]; int i = 0; for (ONDEXConcept concept : graph.getConcepts()) { // first entry in table row is concept itself Object[] row = { concept, concept.getPID(), concept.getAnnotation(), concept.getDescription(), concept.getElementOf(), concept.getOfType(), concept.getEvidence() }; data[i] = row; i++; } // initialise table model and populate table DefaultTableModel model = new DefaultTableModel(); model.setDataVector(data, header); table = new ConceptTable(model, graph); // add table to panel this.setLayout(new GridLayout(1, 1)); this.add(new JScrollPane(table)); Util.calcColumnWidths(table, 150); }
String desc = ac.getDescription(); if (isMatching(p, search, desc)) found = true;
String desc = ac.getDescription(); if (isMatching(p, desc)) found = true;
copyTargetConcept.setAnnotation(copySourceConcept.getAnnotation()); if (copySourceConcept.getDescription() != null) copyTargetConcept .setDescription(copySourceConcept.getDescription());
String desc = conceptToClone.getDescription(); String anno = conceptToClone.getAnnotation();
cR.addProperty(model.createProperty(ONDEXRdf.conceptNameUri), cn.getName()); cRap(cR, model.createProperty(ONDEXRdf.descriptionUri), c.getDescription()); cR.addProperty(model.createProperty(ONDEXRdf.elementOfUri), model.createResource(ONDEXRdf.dataSourceToUri(graphURI, c.getElementOf())));