/** * @param src src * @param tgt tgt * @throws InvalidXrefMapException InvalidXrefMapException */ public XrefExpander(OBODoc src, OBODoc tgt) { sourceOBODoc = src; targetOBODoc = tgt; setUp(); }
protected Frame getTargetFrame(String id) { Frame f = getTargetDoc(idSpace).getTermFrame(id); if (f == null) { try { f = new Frame(); f.setId(id); getTargetDoc(idSpace).addTermFrame(f); } catch (FrameMergeException e) { // this should be impossible e.printStackTrace(); } } return f; }
public void expandXrefs() { for (Frame f : sourceOBODoc.getTermFrames()) { String id = f.getTagValue(OboFormatTag.TAG_ID, String.class); Collection<Clause> clauses = f.getClauses(OboFormatTag.TAG_XREF); for (Clause c : clauses) { Xref x = c.getValue(Xref.class); if (x != null) { String xid = x.getIdref(); String s = getIDSpace(xid); if (treatMap.containsKey(s)) { treatMap.get(s).expand(f, id, xid); } } } } }
addRule(parts[0], new EquivalenceExpansion()); } else if (tag.equals(OboFormatTag.TAG_TREAT_XREFS_AS_GENUS_DIFFERENTIA.getTag())) { addRule(idSpace, new GenusDifferentiaExpansion(parts[1], parts[2])); relationsUseByIdSpace.put(idSpace, parts[1]); relation = parts[1]; } else if (tag .equals(OboFormatTag.TAG_TREAT_XREFS_AS_REVERSE_GENUS_DIFFERENTIA.getTag())) { addRule(idSpace, new ReverseGenusDifferentiaExpansion(parts[1], parts[2])); relationsUseByIdSpace.put(idSpace, parts[1]); relation = parts[1]; } else if (tag.equals(OboFormatTag.TAG_TREAT_XREFS_AS_HAS_SUBCLASS.getTag())) { addRule(idSpace, new HasSubClassExpansion()); } else if (tag.equals(OboFormatTag.TAG_TREAT_XREFS_AS_IS_A.getTag())) { addRule(idSpace, new IsaExpansion()); } else if (tag.equals(OboFormatTag.TAG_TREAT_XREFS_AS_RELATIONSHIP.getTag())) { addRule(idSpace, new RelationshipExpansion(parts[1])); relationsUseByIdSpace.put(idSpace, parts[1]); relation = parts[1];
protected Frame getTargetFrame(String id) { OBODoc targetDoc = getTargetDoc(verifyNotNull(idSpace, "idSpace not set yet")); Frame f = targetDoc.getTermFrame(id); if (f == null) { f = new Frame(); f.setId(id); try { targetDoc.addTermFrame(f); } catch (FrameMergeException e) { // this should be impossible LOG.error("Frame merge exceptions should not be possible", e); } } return f; } }
/** * Expand xrefs. */ public void expandXrefs() { for (Frame f : sourceOBODoc.getTermFrames()) { String id = checkNotNull(f.getTagValue(OboFormatTag.TAG_ID, String.class)); Collection<Clause> clauses = f.getClauses(OboFormatTag.TAG_XREF); for (Clause c : clauses) { Xref x = c.getValue(Xref.class); String xid = x.getIdref(); String s = getIDSpace(xid); if (treatMap.containsKey(s)) { treatMap.get(s).expand(f, id, xid); } } } }
addRule(parts[0], new EquivalenceExpansion()); } else if (tag.equals(OboFormatTag.TAG_TREAT_XREFS_AS_GENUS_DIFFERENTIA.getTag())) { addRule(idSpace, new GenusDifferentiaExpansion(parts[1], parts[2])); relationsUseByIdSpace.put(idSpace, parts[1]); relation = parts[1]; } else if (tag .equals(OboFormatTag.TAG_TREAT_XREFS_AS_REVERSE_GENUS_DIFFERENTIA.getTag())) { addRule(idSpace, new ReverseGenusDifferentiaExpansion(parts[1], parts[2])); relationsUseByIdSpace.put(idSpace, parts[1]); relation = parts[1]; } else if (tag.equals(OboFormatTag.TAG_TREAT_XREFS_AS_HAS_SUBCLASS.getTag())) { addRule(idSpace, new HasSubClassExpansion()); } else if (tag.equals(OboFormatTag.TAG_TREAT_XREFS_AS_IS_A.getTag())) { addRule(idSpace, new IsaExpansion()); } else if (tag.equals(OboFormatTag.TAG_TREAT_XREFS_AS_RELATIONSHIP.getTag())) { addRule(idSpace, new RelationshipExpansion(parts[1])); relationsUseByIdSpace.put(idSpace, parts[1]); relation = parts[1];
/** * @param src src * @param tgt tgt * @throws InvalidXrefMapException InvalidXrefMapException */ public XrefExpander(OBODoc src, OBODoc tgt) { sourceOBODoc = src; targetOBODoc = tgt; setUp(); }
protected Frame getTargetFrame(String id) { OBODoc targetDoc = getTargetDoc(verifyNotNull(idSpace, "idSpace not set yet")); Frame f = targetDoc.getTermFrame(id); if (f == null) { f = new Frame(); f.setId(id); try { targetDoc.addTermFrame(f); } catch (FrameMergeException e) { // this should be impossible LOG.error("Frame merge exceptions should not be possible", e); } } return f; } }
/** * Expand xrefs. */ public void expandXrefs() { for (Frame f : sourceOBODoc.getTermFrames()) { String id = checkNotNull(f.getTagValue(OboFormatTag.TAG_ID, String.class)); Collection<Clause> clauses = f.getClauses(OboFormatTag.TAG_XREF); for (Clause c : clauses) { Xref x = c.getValue(Xref.class); String xid = x.getIdref(); String s = getIDSpace(xid); if (treatMap.containsKey(s)) { treatMap.get(s).expand(f, id, xid); } } } }
addRule(parts[0], new EquivalenceExpansion()); } else if (tag.equals(OboFormatTag.TAG_TREAT_XREFS_AS_GENUS_DIFFERENTIA.getTag())) { addRule(idSpace, new GenusDifferentiaExpansion(parts[1], parts[2])); relationsUseByIdSpace.put(idSpace, parts[1]); relation = parts[1]; } else if (tag .equals(OboFormatTag.TAG_TREAT_XREFS_AS_REVERSE_GENUS_DIFFERENTIA.getTag())) { addRule(idSpace, new ReverseGenusDifferentiaExpansion(parts[1], parts[2])); relationsUseByIdSpace.put(idSpace, parts[1]); relation = parts[1]; } else if (tag.equals(OboFormatTag.TAG_TREAT_XREFS_AS_HAS_SUBCLASS.getTag())) { addRule(idSpace, new HasSubClassExpansion()); } else if (tag.equals(OboFormatTag.TAG_TREAT_XREFS_AS_IS_A.getTag())) { addRule(idSpace, new IsaExpansion()); } else if (tag.equals(OboFormatTag.TAG_TREAT_XREFS_AS_RELATIONSHIP.getTag())) { addRule(idSpace, new RelationshipExpansion(parts[1])); relationsUseByIdSpace.put(idSpace, parts[1]); relation = parts[1];
/** * @param src src * @param tgt tgt * @throws InvalidXrefMapException InvalidXrefMapException */ public XrefExpander(OBODoc src, OBODoc tgt) { sourceOBODoc = src; targetOBODoc = tgt; setUp(); }
protected Frame getTargetFrame(String id) { OBODoc targetDoc = getTargetDoc(verifyNotNull(idSpace, "idSpace not set yet")); Frame f = targetDoc.getTermFrame(id); if (f == null) { f = new Frame(); f.setId(id); try { targetDoc.addTermFrame(f); } catch (FrameMergeException e) { // this should be impossible LOG.error("Frame merge exceptions should not be possible", e); } } return f; } }
/** * Expand xrefs. */ public void expandXrefs() { for (Frame f : sourceOBODoc.getTermFrames()) { String id = checkNotNull(f.getTagValue(OboFormatTag.TAG_ID, String.class)); Collection<Clause> clauses = f.getClauses(OboFormatTag.TAG_XREF); for (Clause c : clauses) { Xref x = c.getValue(Xref.class); String xid = x.getIdref(); String s = getIDSpace(xid); if (treatMap.containsKey(s)) { treatMap.get(s).expand(f, id, xid); } } } }
addRule(parts[0], new EquivalenceExpansion()); } else if (tag.equals(OboFormatTag.TAG_TREAT_XREFS_AS_GENUS_DIFFERENTIA.getTag())) { addRule(idSpace, new GenusDifferentiaExpansion(parts[1], parts[2])); relationsUseByIdSpace.put(idSpace, parts[1]); relation = parts[1]; } else if (tag .equals(OboFormatTag.TAG_TREAT_XREFS_AS_REVERSE_GENUS_DIFFERENTIA.getTag())) { addRule(idSpace, new ReverseGenusDifferentiaExpansion(parts[1], parts[2])); relationsUseByIdSpace.put(idSpace, parts[1]); relation = parts[1]; } else if (tag.equals(OboFormatTag.TAG_TREAT_XREFS_AS_HAS_SUBCLASS.getTag())) { addRule(idSpace, new HasSubClassExpansion()); } else if (tag.equals(OboFormatTag.TAG_TREAT_XREFS_AS_IS_A.getTag())) { addRule(idSpace, new IsaExpansion()); } else if (tag.equals(OboFormatTag.TAG_TREAT_XREFS_AS_RELATIONSHIP.getTag())) { addRule(idSpace, new RelationshipExpansion(parts[1])); relationsUseByIdSpace.put(idSpace, parts[1]); relation = parts[1];
/** * @param src src * @param targetBase targetBase * @throws InvalidXrefMapException InvalidXrefMapException */ public XrefExpander(OBODoc src, String targetBase) { sourceOBODoc = src; this.targetBase = targetBase; setUp(); }
protected Frame getTargetFrame(String id) { OBODoc targetDoc = getTargetDoc(verifyNotNull(idSpace, "idSpace not set yet")); Frame f = targetDoc.getTermFrame(id); if (f == null) { f = new Frame(); f.setId(id); try { targetDoc.addTermFrame(f); } catch (FrameMergeException e) { // this should be impossible LOG.error("Frame merge exceptions should not be possible", e); } } return f; } }
/** * Expand xrefs. */ public void expandXrefs() { for (Frame f : sourceOBODoc.getTermFrames()) { String id = checkNotNull(f.getTagValue(OboFormatTag.TAG_ID, String.class)); Collection<Clause> clauses = f.getClauses(OboFormatTag.TAG_XREF); for (Clause c : clauses) { Xref x = c.getValue(Xref.class); String xid = x.getIdref(); String s = getIDSpace(xid); if (treatMap.containsKey(s)) { treatMap.get(s).expand(f, id, xid); } } } }
String idSpace = parts[0]; if (c.getTag().equals(OboFormatTag.TAG_TREAT_XREFS_AS_EQUIVALENT.getTag())) { addRule(parts[0], new EquivalenceExpansion()); addRule(idSpace, new GenusDifferentiaExpansion(parts[1],parts[2])); addRule(idSpace, new ReverseGenusDifferentiaExpansion(parts[1],parts[2])); addRule(idSpace, new HasSubClassExpansion()); addRule(idSpace, new IsaExpansion()); addRule(idSpace, new RelationshipExpansion(parts[1])); relationsUsed.add(parts[1]); relationsUseByIdSpace.put(idSpace, parts[1]);
/** * @param src src * @param tgt tgt * @throws InvalidXrefMapException InvalidXrefMapException */ public XrefExpander(OBODoc src, OBODoc tgt) { sourceOBODoc = src; targetOBODoc = tgt; setUp(); }