@Override public Set<ConceptName> getConceptNames() { return parent.getConceptNames(); }
public ONDEXConcept lookupProtein(String id, String name) { String id1 = id.toUpperCase(); Holder h = lookupConcept(proteinIndex, protein, id1); ONDEXConcept c = h.concept; if (h.isNew) { if (c.getConceptNames().size() == 0 && name != null && name.length() != 0) { c.createConceptName(name, true); } } return c; }
for (ONDEXConcept c : concepts.get(key)) { for (ConceptName cn : c.getConceptNames()) { clause.delete(0, clause.length()); clause.append("concept_name");
for (ConceptName cn : concept.getConceptNames()) { names.put(cn.getName(), cn.isPreferred());
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; }
public String getValue(ONDEXEntity cOrr) throws InvalidOndexEntityException { if(AbstractConcept.class.isAssignableFrom(cOrr.getClass())){ String preferedName = ""; for(ConceptName cn : ((ONDEXConcept)cOrr).getConceptNames()){ if(cn.isPreferred()){ preferedName = cn.getName(); } } if (preferedName.length() ==0) { preferedName = ((ONDEXConcept)cOrr).getPID(); } /** if (useLinks && preferedName.length() > 0 && ((AbstractConcept)cOrr).getElementOf().getId().endsWith("PlnTFDB")) { AbstractONDEXValidator validator = ONDEXRegistry.validators.get("htmlaccessionlink"); Condition condition = new Condition(((AbstractConcept)cOrr).getElementOf().getId(), ((AbstractConcept)cOrr).getOfType().getId()); String url = (String) validator.validate(condition); if (url != null) { return "=HYPERLINK(\""+url+preferedName +"\",\""+preferedName+"\")"; } } */ return preferedName; } throw new InvalidOndexEntityException(cOrr.getClass()+": is not an Ondex class for which a name is known"); }
for (ConceptName cn : c.getConceptNames()) { names.add(cn.getName());
Iterator<ConceptName> it_cn = concept.getConceptNames().iterator(); writer.append("["); if(it_cn.hasNext()) {
boolean hasOneEntry = false; for (ConceptName cn : ((ONDEXConcept) cOrr).getConceptNames()) { if (cn != null) { String tmp = cn.getName().trim(); for (ConceptName cn : ((ONDEXConcept) cOrr).getConceptNames()) { if (cn != null) { String tmp = cn.getName().trim();
/** * Copies all names from old concept to new concept. * * @param oldC * old ONDEXConcept * @param newC * new ONDEXConcept */ private void copyNames(ONDEXConcept oldC, ONDEXConcept newC) { // iterate over all old names for (ConceptName name : oldC.getConceptNames()) { // clone old name on new concept newC.createConceptName(name.getName(), name.isPreferred()); } }
for (ConceptName conceptName : concept.getConceptNames()) { cn = conceptName; if (cn.isPreferred()) {
Set<ConceptName> it = concept.getConceptNames(); if (it.size() > maxNames) maxNames = it.size();
for (ConceptName n : c.getConceptNames()) { nameToConceptIndexBuider.addEntry(n.getName(), c.getId()); conceptToNameIndexBuider.addEntry(c.getId(), n.getName());
for (ConceptName cn : concept.getConceptNames()) { existing.put(cn.getName(), cn.isPreferred());
for (ConceptName cn : ondexConcept.getConceptNames()) { String name = cn.getName(); concepts = nameToConcepts.get(name);
ConceptClass cls = MdHelper.createCC(graph, ontoCls); for (ONDEXConcept c : graph.getConceptsOfConceptClass(cls)) { for (ConceptName n : c.getConceptNames()) { if (n.getName().equals(name)) { seed = c;
@Override public boolean map ( ONDEXConcept concept, Map<String, Object> params ) { if ( !super.map ( concept, params ) ) return false; RdfMapperFactory xfact = this.getMapperFactory (); Graph graphModel = xfact.getGraphModel (); String myiri = this.getRdfUriGenerator ().getUri ( concept, params ); ConceptClass cc = concept.getOfType (); String cciri = cc == null ? iri ( "bk:Concept" ) : xfact.getUri ( cc, params ); COMMUTILS.assertResource ( graphModel, myiri, iri ( "rdf:type" ), cciri ); // Names split into 1 preferred and alternatives Pair<Optional<String>, Stream<String>> nameStrings = OndexRDFUtils.normalizeNames ( concept.getConceptNames (), ConceptName::isPreferred, ConceptName::getName ); nameStrings.getLeft () .ifPresent ( prefName -> COMMUTILS.assertLiteral ( graphModel, myiri, iri ( "bk:prefName" ), prefName ) ); nameStrings.getRight () .forEach ( altName -> COMMUTILS.assertLiteral ( graphModel, myiri, iri ( "bk:altName" ), altName ) ); return true; }
Set<ConceptName> names = concept.getConceptNames(); if (names.size() > 0) {
/** * 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()); }
for (ConceptName name : copySourceConcept.getConceptNames()) { copyTargetConcept.createConceptName(name.getName(), name.isPreferred());