@Override public Object doAction(Agent s) { return newAgent(s); }
@Override public Object doAction(Agent s) { return newAgent(s); }
/** * Creates a new {@link Agent} with provided identifier and attributes * @param id a {@link QualifiedName} for the agent * @param attributes a collection of {@link Attribute} for the agent * @return an object of type {@link Agent} */ public Agent newAgent(QualifiedName id, Collection<Attribute> attributes) { Agent res = newAgent(id); setAttributes(res, attributes); return res; }
/** * Creates a new {@link Agent} with provided identifier and attributes * @param id a {@link QualifiedName} for the agent * @param attributes a collection of {@link Attribute} for the agent * @return an object of type {@link Agent} */ public Agent newAgent(QualifiedName id, Collection<Attribute> attributes) { Agent res = newAgent(id); setAttributes(res, attributes); return res; }
/** * Creates a new {@link Agent} with provided identifier and label * @param ag a {@link QualifiedName} for the agent * @param label a String for the label property (see {@link HasLabel#getLabel()} * @return an object of type {@link Agent} */ public Agent newAgent(QualifiedName ag, String label) { Agent res = newAgent(ag); if (label != null) res.getLabel().add(newInternationalizedString(label)); return res; }
/** * Creates a new {@link Agent} with provided identifier and label * @param ag a {@link QualifiedName} for the agent * @param label a String for the label property (see {@link HasLabel#getLabel()} * @return an object of type {@link Agent} */ public Agent newAgent(QualifiedName ag, String label) { Agent res = newAgent(ag); if (label != null) res.getLabel().add(newInternationalizedString(label)); return res; }
private void createAgent(QualifiedName context, QualifiedName qualifiedName) { List<Attribute> attributes = collectAttributes(context, qualifiedName, Types.ProvType.AGENT); org.openprovenance.prov.model.Agent agent = pFactory.newAgent(qualifiedName, attributes); getBundleHolder(context).store(agent); }
private void createAgent(QualifiedName context, QualifiedName qualifiedName) { List<Attribute> attributes = collectAttributes(context, qualifiedName, Types.ProvType.AGENT); org.openprovenance.prov.model.Agent agent = pFactory.newAgent(qualifiedName, attributes); getBundleHolder(context).store(agent); }
/** * Creates a copy of an agent. The copy is shallow in the sense that the new Agent shares the same attributes as the original Agent. * @param a an {@link Agent} to copy * @return a copy of the input {@link Agent} */ public Agent newAgent(Agent a) { Agent res = newAgent(a.getId()); res.getType().addAll(a.getType()); res.getLabel().addAll(a.getLabel()); return res; }
/** * Creates a copy of an agent. The copy is shallow in the sense that the new Agent shares the same attributes as the original Agent. * @param a an {@link Agent} to copy * @return a copy of the input {@link Agent} */ public Agent newAgent(Agent a) { Agent res = newAgent(a.getId()); res.getType().addAll(a.getType()); res.getLabel().addAll(a.getLabel()); return res; }
@Override public void doAction(Agent e) { Agent res = pf.newAgent(e.getId()); QualifiedName id = res.getId(); boolean updated1 = setExpand(res, id, 0); boolean updated2 = expandAttributes(e, res); boolean updated = updated1 || updated2; boolean allUpdated = updated1; allExpanded=allExpanded && allUpdated; if (!allUpdatedRequired || allUpdated) { ll.add(res); } if (updated) addOrderAttribute(res); }
@Override public void doAction(Agent e) { Agent res = pf.newAgent(e.getId()); QualifiedName id = res.getId(); boolean updated1 = setExpand(res, id, 0); boolean updated2 = expandAttributes(e, res); boolean updated = updated1 || updated2; boolean allUpdated = updated1; allExpanded=allExpanded && allUpdated; if (!allUpdatedRequired || allUpdated) { ll.add(res); } if (updated) addOrderAttribute(res); }
public void testAgent1() { Agent a = pFactory.newAgent(q("ag1")); makeDocAndTest(a, "target/agent1"); }
public void testAgent2() { Agent a = pFactory.newAgent(q("ag2"), "agent2"); makeDocAndTest(a, "target/agent2"); }
public void testAgent3() { Agent a = pFactory.newAgent(q("ag2"), "agent2"); a.getLabel().add(pFactory.newInternationalizedString("hello")); makeDocAndTest(a, "target/agent3"); }
public void testAgent6() { Agent a = pFactory.newAgent(q("ag6"), "agent6"); addTypes(a); makeDocAndTest(a, "target/agent6"); }
public void testAgent4() { Agent a = pFactory.newAgent(q("ag2"), "agent2"); a.getLabel().add(pFactory.newInternationalizedString("hello")); a.getLabel().add(pFactory.newInternationalizedString("bye", "en")); makeDocAndTest(a, "target/agent4"); }
public void testAgent5() { Agent a = pFactory.newAgent(q("ag2"), "agent2"); a.getLabel().add(pFactory.newInternationalizedString("hello")); a.getLabel().add(pFactory.newInternationalizedString("bye", "en")); a.getLabel().add(pFactory.newInternationalizedString("bonjour", "fr")); makeDocAndTest(a, "target/agent5"); }
public void testAgent7() { Agent a = pFactory.newAgent(q("ag7"), "agent7"); addTypes(a); a.getLabel().add(pFactory.newInternationalizedString("hello")); a.getLabel().add(pFactory.newInternationalizedString("bye", "en")); a.getLabel().add(pFactory.newInternationalizedString("bonjour", "fr")); a.getLocation().add(pFactory.newLocation("London", name.XSD_STRING)); a.getLocation().add(pFactory.newLocation(1, name.XSD_INT)); a.getLocation().add(pFactory.newLocation(1.0, name.XSD_FLOAT)); a.getLocation().add(pFactory.newLocation(true, name.XSD_BOOLEAN)); // a.getLocation().add(pFactory.newLocation(new QName(EX_NS, "london", // EX_PREFIX),vconv)); a.getLocation().add(pFactory.newLocation(pFactory.newTimeNow(), name.XSD_DATETIME)); a.getLocation().add(pFactory.newLocation(EX_NS+"london", name.XSD_ANY_URI)); makeDocAndTest(a, "target/agent7"); }
public void testAgent0() { Agent a = pFactory.newAgent(q("ag0")); addOthers(a, pFactory.newQualifiedName(EX_NS, "tag2", EX_PREFIX)); addOthers(a, pFactory.newQualifiedName(EX_NS, "tag3", EX2_PREFIX)); addOthers(a, pFactory.newQualifiedName(EX2_NS, "tag4", "ex4")); addOthers(a, pFactory.newQualifiedName(EX2_NS, "tag5", EX_PREFIX)); addLabels(a); addTypes(a); addLocations(a); makeDocAndTest(a,"target/attr_agent0"); }