@Override public void doAction(WasInvalidatedBy s) { WasInvalidatedBy res = pf.newWasInvalidatedBy(s.getId(), s.getEntity(), s.getActivity()); res.setTime(s.getTime()); QualifiedName id = res.getId(); boolean updated1 = setExpand(res, id, 0); QualifiedName en = res.getEntity(); boolean updated2 = setExpand(res, en, 1); QualifiedName act = res.getActivity(); boolean updated3 = setExpand(res, act, 2); boolean updated4 = expandAttributes(s, res); boolean updated = updated1 || updated2 || updated3 || updated4; boolean allUpdated = updated1 && updated2 && updated3 ; allExpanded=allExpanded && allUpdated; if (!allUpdatedRequired || allUpdated) { ll.add(res); } if (updated) addOrderAttribute(res); }
public WasInvalidatedBy newWasInvalidatedBy(WasInvalidatedBy u) { WasInvalidatedBy u1 = newWasInvalidatedBy(u.getId(), u.getEntity(), u.getActivity()); u1.setTime(u.getTime()); u1.getOther().addAll(u.getOther()); u1.getType().addAll(u.getType()); u.getRole().addAll(u.getRole()); u1.getLabel().addAll(u.getLabel()); u1.getLocation().addAll(u.getLocation()); return u1; }
public void doAction(org.openprovenance.prov.model.WasInvalidatedBy inv) { if (inv.getId()!=null) inv.setId(uniquify(inv.getId())); inv.setEntity(uniquify(inv.getEntity())); inv.setActivity(uniquify(inv.getActivity())); doActionAttributes(inv); }
public WasInvalidatedBy addAttributes(WasInvalidatedBy from, WasInvalidatedBy to) { to.getLabel().addAll(from.getLabel()); to.getType().addAll(from.getType()); to.getLocation().addAll(from.getLocation()); to.getRole().addAll(from.getRole()); to.getOther().addAll(from.getOther()); return to; }
/** A factory method to create an instance of an invalidation {@link WasInvalidatedBy} * @param id an optional identifier for a usage * @param entity an identifier for the created <a href="http://www.w3.org/TR/prov-dm/#invalidation.entity">entity</a> * @param activity an optional identifier for the <a href="http://www.w3.org/TR/prov-dm/#invalidation.activity">activity</a> that creates the entity * @return an instance of {@link WasInvalidatedBy} */ public WasInvalidatedBy newWasInvalidatedBy(QualifiedName id, QualifiedName entity, QualifiedName activity) { WasInvalidatedBy res = of.createWasInvalidatedBy(); res.setId(id); res.setEntity(entity); res.setActivity(activity); return res; }
@Override public void doAction(WasInvalidatedBy inv) { register(inv.getId()); register(inv.getEntity()); register(inv.getActivity()); registerLocation(inv.getLocation()); registerRole(inv.getRole()); registerType(inv.getType()); registerOther(inv.getOther()); }
switch (i) { case 0: a.setId((QualifiedName) val); return; case 1: a.setEntity((QualifiedName) val); return; case 2: a.setActivity((QualifiedName) val); return; case 3: a.setTime((XMLGregorianCalendar) val); return; default:
public WasInvalidatedBy newWasInvalidatedBy(QualifiedName id, QualifiedName entity, QualifiedName activity, XMLGregorianCalendar time, Collection<Attribute> attributes) { WasInvalidatedBy res=newWasInvalidatedBy(id,entity,activity); res.setTime(time); setAttributes(res, attributes); return res; }
public void testScruffyInvalidation2() { WasInvalidatedBy inv1 = pFactory.newWasInvalidatedBy(q("inv1"), q("e1"), q("a1")); inv1.setTime(pFactory.newTimeNow()); inv1.getOther().add(pFactory.newOther(EX_NS, "tag2", EX_PREFIX, "hello", name.XSD_STRING)); WasInvalidatedBy inv2 = pFactory.newWasInvalidatedBy(q("inv1"), q("e1"), q("a1")); inv2.setTime(pFactory.newISOTime("2012-12-03T21:08:16.686Z")); inv2.getOther().add(pFactory.newOther(EX_NS, "tag2", EX_PREFIX, "hi", name.XSD_STRING)); Entity e1 = pFactory.newEntity(q("e1")); Activity a1 = pFactory.newActivity(q("a1")); Statement[] opt = new Statement[] { e1, a1 }; Statement[] statements = new Statement[] { inv1, inv2 }; makeDocAndTest(statements, opt, "target/scruffy-invalidation2"); }
public WasInvalidatedBy newWasInvalidatedBy(QualifiedName eid, QualifiedName aid) { WasInvalidatedBy res = of.createWasInvalidatedBy(); res.setEntity(eid); res.setActivity(aid); return res; }
public void testDoc1103() { Document idoc1103=new IndexedDocument(pFactory,makeDoc1103()).toDocument(); assertEquals(idoc1103.getStatementOrBundle().size(),1); WasInvalidatedBy u=(WasInvalidatedBy) idoc1103.getStatementOrBundle().get(0); assertEquals("label",1,u.getLabel().size()); assertEquals("other",2,u.getOther().size()); }
return ((WasInvalidatedBy) r).getEntity();
return ((WasInvalidatedBy) r).getActivity();
public void testDoc1102() { Document idoc1102=new IndexedDocument(pFactory,makeDoc1102()).toDocument(); assertEquals(idoc1102.getStatementOrBundle().size(),1); WasInvalidatedBy u=(WasInvalidatedBy) idoc1102.getStatementOrBundle().get(0); assertEquals("label",1,u.getLabel().size()); }
@Override public void doAction(WasInvalidatedBy inv) { register(inv.getId()); register(inv.getEntity()); register(inv.getActivity()); registerLocation(inv.getLocation()); registerRole(inv.getRole()); registerType(inv.getType()); registerOther(inv.getOther()); }
switch (i) { case 0: a.setId((QualifiedName) val); return; case 1: a.setEntity((QualifiedName) val); return; case 2: a.setActivity((QualifiedName) val); return; case 3: a.setTime((XMLGregorianCalendar) val); return; default:
public WasInvalidatedBy addAttributes(WasInvalidatedBy from, WasInvalidatedBy to) { to.getLabel().addAll(from.getLabel()); to.getType().addAll(from.getType()); to.getLocation().addAll(from.getLocation()); to.getRole().addAll(from.getRole()); to.getOther().addAll(from.getOther()); return to; }
public void testInvalidation7() { WasInvalidatedBy inv = pFactory.newWasInvalidatedBy((QualifiedName) null, q("e1"), q("a1")); inv.getRole().add(pFactory.newRole("someRole", name.XSD_STRING)); inv.setTime(pFactory.newTimeNow()); addTypes(inv); addLocations(inv); addLabels(inv); addFurtherAttributes(inv); makeDocAndTest(inv, "target/invalidation7"); }