public synchronized ONDEXConcept getConcept ( String id ) { return this.cacheGet ( ONDEXConcept.class, id ); }
public synchronized ConceptAccession getAccession ( String accession, DataSource dataSrc, boolean isAmbiguous, ONDEXConcept concept ) { // TODO: is the ID unique? Is it concept-unique? return this.cacheGet ( ConceptAccession.class, accession, () -> concept.createConceptAccession ( accession, dataSrc, isAmbiguous ) ); }
public synchronized DataSource getDataSource ( String id, String fullName, String description ) { return this.cacheGet ( DataSource.class, id, () -> this.graph.getMetaData ().createDataSource ( id, fullName, description ) ); }
public synchronized ConceptClass getConceptClass ( String id, String fullName, String description, ConceptClass specialisationOf ) { return this.cacheGet ( ConceptClass.class, id, () -> this.graph.getMetaData ().createConceptClass ( id, fullName, description, specialisationOf ) ); }
public synchronized ONDEXConcept getConcept ( String id, String annotation, String description, DataSource ds, ConceptClass conceptClass, EvidenceType evidence ) { return this.cacheGet ( ONDEXConcept.class, id, () -> this.graph.getFactory ().createConcept ( id, annotation, description, ds, conceptClass, evidence ) ); }
public synchronized EvidenceType getEvidenceType ( String id, String fullName, String description ) { return this.cacheGet ( EvidenceType.class, id, () -> this.graph.getMetaData ().createEvidenceType ( id, fullName, description ) ); }
public synchronized RelationType getRelationType ( String id, boolean isAntisymmetric, boolean isReflexive, boolean isSymmetric, boolean isTransitive ) { return this.cacheGet ( RelationType.class, id, () -> this.graph.getMetaData ().getFactory ().createRelationType ( id, isAntisymmetric, isReflexive, isSymmetric, isTransitive ) ); }
public synchronized ONDEXRelation getRelation ( ONDEXConcept from, ONDEXConcept to, RelationType type, EvidenceType evidence ) { String id = from.getPID () + to.getPID () + type.getId () + evidence.getId (); return this.cacheGet ( ONDEXRelation.class, id, () -> this.graph.getFactory ().createRelation ( from, to, type, evidence ) ); }
public synchronized ConceptClass getConceptClass ( ConceptClassPrototype proto ) { try { // Let's see if it has a parent if ( proto.getParent () == null ) { // Or a prototype to build it. In case of loops, this will lead to stack overflow ConceptClassPrototype parentProto = proto.getParentPrototype (); if ( parentProto != null ) proto.setParent ( this.getConceptClass ( parentProto ) ); } return this.cacheGet ( ConceptClass.class, proto.getId (), () -> this.graph.getMetaData ().getFactory ().createConceptClass ( proto.getId (), proto.getFullName (), proto.getDescription (), proto.getParent () ) ); } catch ( StackOverflowError ex ) { log.error ( "Stackoverflow error while creating the concept class '{}'. Do you have circular references?", proto.getId () ); throw ex; } }
public synchronized RelationType getRelationType ( RelationTypePrototype proto ) { try { // Let's see if it has a parent if ( proto.getParent () == null ) { // Or a prototype to build it. In case of loops, this will lead to stack overflow RelationTypePrototype parentProto = proto.getParentPrototype (); if ( parentProto != null ) proto.setParent ( this.getRelationType ( parentProto ) ); } return this.cacheGet ( RelationType.class, proto.getId (), () -> this.graph.getMetaData ().getFactory ().createRelationType ( proto.getId (), proto.getFullName (), proto.getDescription (), proto.isAntisymmetric (), proto.isReflexive (), proto.isSymmetric (), proto.isTransitive (), proto.getParent () ) ); } catch ( StackOverflowError ex ) { log.error ( "Stack Overflow error while creating relation '{}'. Do you have circular references?", proto.getId () ); throw ex; } }