public OPMGraph newOPMGraph(Collection<Account> accs, Collection<Overlaps> ops, Collection<Process> ps, Collection<Artifact> as, Collection<Agent> ags, Collection<Object> lks, Collection<Annotation> anns) { return newOPMGraph(null,accs,ops,ps,as,ags,lks,anns); }
public Account newAccount(Account acc) { Account res=newAccount(acc.getId()); addNewAnnotations(res,acc.getAnnotation()); return res; }
public Agent newAgent(String ag, Collection<Account> accounts) { return newAgent(ag,accounts,null); }
public Role newRole(String value) { return newRole(autoGenerateId(roleIdPrefix),value); }
public WasDerivedFrom newWasDerivedFrom(String id, Artifact a1, Artifact a2, Collection<Account> accounts) { ArtifactRef aid1=newArtifactRef(a1); ArtifactRef aid2=newArtifactRef(a2); LinkedList ll=new LinkedList(); for (Account acc: accounts) { ll.add(newAccountRef(acc)); } return newWasDerivedFrom(id,aid1,aid2,ll); }
public WasGeneratedBy newWasGeneratedBy(String id, Artifact a, Role role, Process p, Collection<Account> accounts) { ArtifactRef aid=newArtifactRef(a); ProcessRef pid=newProcessRef(p); LinkedList ll=new LinkedList(); for (Account acc: accounts) { ll.add(newAccountRef(acc)); } return newWasGeneratedBy(id,aid,role,pid,ll); }
Process process=getProcess(pProcess); ProvenanceRole pRole=used.getRole(); Role role=pFactory.newRole(pRole.getName()); ProvenanceAccount pAccount=used.getAccount(); Account account=getAccount(pAccount); Used u2=pFactory.newUsed(process,role,artifact,Collections.singleton(account)); graph.getCausalDependencies().getUsedOrWasGeneratedByOrWasTriggeredBy().add(u2); Process process=getProcess(pProcess); ProvenanceRole pRole=generated.getRole(); Role role=pFactory.newRole(pRole.getName()); ProvenanceAccount pAccount=generated.getAccount(); Account account=getAccount(pAccount); WasGeneratedBy g2=pFactory.newWasGeneratedBy(artifact,role,process,Collections.singleton(account)); graph.getCausalDependencies().getUsedOrWasGeneratedByOrWasTriggeredBy().add(g2); Process process=getProcess(pProcess); ProvenanceRole pRole=controlled.getRole(); Role role=pFactory.newRole(pRole.getName()); ProvenanceAccount pAccount=controlled.getAccount(); Account account=getAccount(pAccount); WasControlledBy g2=pFactory.newWasControlledBy(process,role,agent,Collections.singleton(account)); graph.getCausalDependencies().getUsedOrWasGeneratedByOrWasTriggeredBy().add(g2); WasDerivedFrom d2=pFactory.newWasDerivedFrom(artifact2,artifact1,Collections.singleton(account)); graph.getCausalDependencies().getUsedOrWasGeneratedByOrWasTriggeredBy().add(d2);
public IndexedOPMGraph(OPMFactory oFactory, OPMGraph graph) { this.oFactory=oFactory; this.of=oFactory.getObjectFactory(); if (graph.getAccounts()!=null) { for (Account acc: graph.getAccounts().getAccount()) { if (edge instanceof Used) { addUsed(oFactory.newUsed((Used) edge)); addWasGeneratedBy(oFactory.newWasGeneratedBy((WasGeneratedBy) edge)); addWasDerivedFrom(oFactory.newWasDerivedFrom((WasDerivedFrom) edge)); addWasControlledBy(oFactory.newWasControlledBy((WasControlledBy) edge)); addWasTriggeredBy(oFactory.newWasTriggeredBy((WasTriggeredBy) edge));
public WasControlledBy newWasControlledBy(String id, Process p, Role role, Agent ag, Collection<Account> accounts) { AgentRef agid=newAgentRef(ag); ProcessRef pid=newProcessRef(p); LinkedList ll=new LinkedList(); for (Account acc: accounts) { ll.add(newAccountRef(acc)); } return newWasControlledBy(id,pid,role,agid,ll); }
public Used newUsed(String id, Process p, Role role, Artifact a, Collection<Account> accounts) { ProcessRef pid=newProcessRef(p); ArtifactRef aid=newArtifactRef(a); LinkedList ll=new LinkedList(); if (accounts!=null) { for (Account acc: accounts) { ll.add(newAccountRef(acc)); } } return newUsed(id,pid,role,aid,ll); } public UsedStar newUsedStar(Process p,
public Process newProcess(Process a) { LinkedList<Account> ll=new LinkedList(); for (AccountRef acc: a.getAccount()) { ll.add(newAccount((Account)acc.getRef())); } Process res=newProcess(a.getId(),ll); addNewAnnotations(res,a.getAnnotation()); return res; } public Agent newAgent(Agent a) {
public Agent newAgent(Agent a) { LinkedList<Account> ll=new LinkedList(); for (AccountRef acc: a.getAccount()) { ll.add(newAccount((Account)acc.getRef())); } Agent res=newAgent(a.getId(),ll); addNewAnnotations(res,a.getAnnotation()); return res; }
public Artifact newArtifact(Artifact a) { LinkedList<Account> ll=new LinkedList(); for (AccountRef acc: a.getAccount()) { ll.add(newAccount((Account)acc.getRef())); } Artifact res=newArtifact(a.getId(),ll); addNewAnnotations(res,a.getAnnotation()); return res; } public Process newProcess(Process a) {
public Used newUsed(String id, Process p, Role role, Artifact a, String type, Collection<Account> accounts) { Used res=newUsed(id,p,role,a,accounts); addAnnotation(res,of.createType(newType(type))); return res; }
public WasControlledBy newWasControlledBy(String id, Process p, Role role, Agent ag, String type, Collection<Account> accounts) { WasControlledBy wcb=newWasControlledBy(id,p,role,ag,accounts); addAnnotation(wcb,of.createType(newType(type))); return wcb; }
public WasDerivedFrom newWasDerivedFrom(String id, Artifact a1, Artifact a2, String type, Collection<Account> accounts) { WasDerivedFrom wdf=newWasDerivedFrom(id,a1,a2,accounts); addAnnotation(wdf,of.createType(newType(type))); return wdf; }
public WasGeneratedBy newWasGeneratedBy(String id, Artifact a, Role role, Process p, String type, Collection<Account> accounts) { WasGeneratedBy wgb=newWasGeneratedBy(id,a,role,p,accounts); addAnnotation(wgb,of.createType(newType(type))); return wgb; }
public WasControlledBy newWasControlledBy(String id, ProcessRef pid, Role role, AgentRef agid, Collection<AccountRef> accounts) { WasControlledBy res=of.createWasControlledBy(); res.setId(autoGenerateId(wasControlledByIdPrefix,id)); res.setEffect(pid); res.setRole(role); res.setCause(agid); addAccounts(res,accounts); return res; }
OPMGraph res=super.newOPMGraph(qname.getLocalPart(), accs, new LinkedList(), super.addAnnotation(res,ann2);
public void emitDependency(Edge e, PrintStream out) { HashMap<String,String> properties=new HashMap(); List<AccountRef> accounts=e.getAccount(); if (accounts.isEmpty()) { accounts=new LinkedList(); accounts.add(of.newAccountRef(of.newAccount(defaultAccountLabel))); } for (AccountRef acc: accounts) { String accountLabel=((Account)acc.getRef()).getId(); addEdgeAttributes(accountLabel,e,properties); emitEdge( ((Node)e.getEffect().getRef()).getId(), ((Node)e.getCause().getRef()).getId(), properties, out, true); } }