@Override protected RelationType retrieveRelationType(String id) { return parent.getRelationType(id); }
@Override protected RelationType resolveExternally(String id) { return og.getMetaData().getRelationType(id); } };
private RelationType getRelationType(ONDEXGraph aog, String str) { RelationType rt; rt = aog.getMetaData().getRelationType(str); if (rt == null) { rt = rtype; } return rt; }
/** * constructor. * @throws IllegalArgumentException if ccs.length != rts.length + 1 */ public PathSearcher(ONDEXGraph og, ConceptClass[] ccs, RelationType[] rts) throws IllegalArgumentException { if (ccs.length != rts.length + 1) throw new IllegalArgumentException("Invalid path definition"); this.ccs = ccs; this.rts = rts; this.og = og; rt_eq = og.getMetaData().getRelationType("equ"); }
@Override public RelationType getSpecialisationOf() { String rtName = MetaDataHelper.fetchString(sg, tableName, "specOf", mid); if (rtName == null || rtName.isEmpty()) { return null; } return sg.getMetaData().getRelationType(rtName); }
@Override public RelationType getOfType() { String a = EntityHelper.fetchString(sg, "relation", "relationType", id); return sg.getMetaData().getRelationType(a); }
public RelationType safeFetchRelationType(String id, String description) { RelationType rt = metaData.getRelationType(id); if (rt == null) { rt = metaData.getFactory().createRelationType(id, description); } return rt; }
/** * fetches the required metadata or throws a respective runtime * exception if it doesn't exist. * * @param id the id of the metadata object. */ public RelationType requireRelationType(String id) throws RelationTypeMissingException { RelationType rt = graph.getMetaData().getRelationType(id); if (rt == null) throw new RelationTypeMissingException("Relation Type " + id + " missing"); else return rt; }
protected static RelationType createRT(ONDEXGraphMetaData meta, String type) throws NullValueException, EmptyStringException{ RelationType rt = meta.getRelationType(type); if(rt == null)rt = meta.getFactory().createRelationType(type); return rt; }
protected static RelationType createRT(ONDEXGraphMetaData meta, String type) throws NullValueException, EmptyStringException{ RelationType rt = meta.getRelationType(type); if(rt == null)rt = meta.getFactory().createRelationType(type); return rt; }
/** * fetches the required metadata or throws a respective runtime * exception if it doesn't exist. * * @param id the id of the metadata object. */ public RelationType requireRelationType(String id) throws RelationTypeMissingException { RelationType rt = graph.getMetaData().getRelationType(id); if (rt == null) throw new RelationTypeMissingException("relation type " + id + " missing"); else return rt; }
/** * fetches the required metadata or throws a respective runtime * exception if it doesn't exist. * * @param id the id of the metadata object. */ public RelationType requireRelationType(String id) throws RelationTypeMissingException { RelationType rt = graph.getMetaData().getRelationType(id); if (rt == null) throw new RelationTypeMissingException("relation type " + id + " missing"); else return rt; }
/** * fetches the required metadata or throws a respective runtime * exception if it doesn't exist. * * @param id the id of the metadata object. */ public RelationType requireRelationType(String id) throws RelationTypeMissingException { RelationType rt = graph.getMetaData().getRelationType(id); if (rt == null) throw new RelationTypeMissingException("relation type " + id + " missing"); else return rt; }
/** * fetches the required metadata or throws a respective runtime exception if * it doesn't exist. * * @param id * the id of the metadata object. */ public RelationType requireRelationType(String id) throws RelationTypeMissingException { RelationType rt = graph.getMetaData().getRelationType(id); if (rt == null) throw new RelationTypeMissingException("relation type " + id + " missing"); else return rt; }
public static void changeRelationDirection(ONDEXGraph graph, String originaRT, String newRT) { ONDEXGraphMetaData meta = graph.getMetaData(); RelationType original = meta.getRelationType(originaRT); String invName = original.getInverseName(); if (invName == null) { invName = newRT; } else { System.err.println("Inverse type found: " + invName); } RelationType inverse = createRT(graph, invName); }
/** * Get relation type * * @param graph * @param type * @return */ public static RelationType createRT(final ONDEXGraph graph, final String type) { ONDEXGraphMetaData meta = graph.getMetaData(); RelationType rt = meta.getRelationType(type); if (rt == null) rt = meta.getFactory().createRelationType(type); return rt; }
/** * Get relation type * * @param graph * @param type * @return */ public static RelationType createRT(final ONDEXGraph graph, final String type) { ONDEXGraphMetaData meta = graph.getMetaData(); RelationType rt = meta.getRelationType(type); if (rt == null) rt = meta.getFactory().createRelationType(type); return rt; }
public PathwayTransformer(Parser parser) { super(parser); ccPathway = graph.getMetaData().getConceptClass(MetaData.CC_PATHWAY); if (ccPathway == null) { Parser.propagateEventOccurred(new ConceptClassMissingEvent(MetaData.CC_PATHWAY, Parser.getCurrentMethodName())); } rtMemberIsPart = graph.getMetaData() .getRelationType(MetaData.RT_MEMBER_IS_PART_OF); if (rtMemberIsPart == null) { Parser.propagateEventOccurred(new RelationTypeMissingEvent(MetaData.RT_MEMBER_IS_PART_OF, Parser.getCurrentMethodName())); } rtPrecededBy = graph.getMetaData() .getRelationType(MetaData.RT_PRECEDED_BY); if (rtPrecededBy == null) { Parser.propagateEventOccurred(new RelationTypeMissingEvent(MetaData.RT_PRECEDED_BY, Parser.getCurrentMethodName())); } }
/** * Create a RelationType, if missing in metadata. * * @param name - Name of RelationType to be contained * @return RelationType */ private RelationType getRelationType(String name) { RelationType rt = aog.getMetaData().getRelationType(name); if (rt != null) { return aog.getMetaData().getFactory().createRelationType(rt.getId(),rt); } else { Parser.propagateEventOccurred( new RelationTypeMissingEvent("Missing RelationType: "+name, "getRelationType(String name)")); } return null; }
/** * initialise Ondex meta-data */ private void initMetaData() { // basic concept meta data dsCHEMBL = graph.getMetaData().getDataSource(DS_CHEMBL); dsVO = graph.getMetaData().getDataSource(DS_VO); ccComp = graph.getMetaData().getConceptClass(CC_COMP); ccThing = graph.getMetaData().getConceptClass(CC_THING); evidencetype = graph.getMetaData().getEvidenceType(ET_IMPD); rtIsa = graph.getMetaData().getRelationType(RT_ISA); }