/** * Returns true if the information in this link should take * precedence over the information in the other link. */ public boolean overrides(Link other) { if (other.getStatus() == LinkStatus.ASSERTED && status != LinkStatus.ASSERTED) return false; else if (status == LinkStatus.ASSERTED && other.getStatus() != LinkStatus.ASSERTED) return true; // the two links are from equivalent sources of information, so we // believe the most recent return timestamp > other.getTimestamp(); }
if (oldl.getStatus() == LinkStatus.INFERRED) {
private void copyall(String id1, String id2) { Collection<String> class1 = getClass(id1); for (String id : class1) { for (Link tocopy : getAllLinksFor(id2)) { String other = tocopy.getOtherId(id2); if (id.equals(other)) continue; addLink2(new Link(id, other, tocopy.getStatus(), tocopy.getKind(), tocopy.getConfidence())); } } }
link.getID2()); query = "update " + tblprefix + "links set status = " + link.getStatus().getId() + " , kind = " + link.getKind().getId() + " , timestamp = " + dbtype.getNow() + " " + query = "insert into " + tblprefix + "links values ('" + escape(link.getID1()) + "', " + " '" + escape(link.getID2()) + "', " + link.getKind().getId() + " , " + link.getStatus().getId() + ", " + dbtype.getNow() + ", " + link.getConfidence() + ") ";
public static void verifySame(Link l1, Link l2) { assertEquals("wrong ID1", l1.getID1(), l2.getID1()); assertEquals("wrong ID2", l1.getID2(), l2.getID2()); assertEquals("wrong status", l1.getStatus(), l2.getStatus()); assertEquals("wrong kind", l1.getKind(), l2.getKind()); assertEquals(l1.getConfidence(), l2.getConfidence(), 0.0001); }
/** * Returns true if the information in this link should take * precedence over the information in the other link. */ public boolean overrides(Link other) { if (other.getStatus() == LinkStatus.ASSERTED && status != LinkStatus.ASSERTED) return false; else if (status == LinkStatus.ASSERTED && other.getStatus() != LinkStatus.ASSERTED) return true; // the two links are from equivalent sources of information, so we // believe the most recent return timestamp > other.getTimestamp(); }
if (oldl.getStatus() == LinkStatus.INFERRED) {
private void copyall(String id1, String id2) { Collection<String> class1 = getClass(id1); for (String id : class1) { for (Link tocopy : getAllLinksFor(id2)) { String other = tocopy.getOtherId(id2); if (id.equals(other)) continue; addLink2(new Link(id, other, tocopy.getStatus(), tocopy.getKind(), tocopy.getConfidence())); } } }
link.getID2()); query = "update " + tblprefix + "links set status = " + link.getStatus().getId() + " , kind = " + link.getKind().getId() + " , timestamp = " + dbtype.getNow() + " " + query = "insert into " + tblprefix + "links values ('" + escape(link.getID1()) + "', " + " '" + escape(link.getID2()) + "', " + link.getKind().getId() + " , " + link.getStatus().getId() + ", " + dbtype.getNow() + ", " + link.getConfidence() + ") ";