public void addAnnotation(org.openprovenance.model.Annotable annotable, org.openprovenance.model.Annotation ann) { System.out.println("*********** adding a annotations "); annotable.getAnnotation().add(of.createAnnotation(ann)); }
public OPMFactory() { of=new ObjectFactory(); init(); }
public Account newAccount(String id, String label) { Account res=of.createAccount(); res.setId(id); res.getAnnotation().add(of.createLabel(newLabel(label))); return res; }
Collection<Annotation> anns) OPMGraph res=of.createOPMGraph(); res.setId(autoGenerateId(opmGraphIdPrefix,id)); if (accs!=null) { Accounts aaccs=of.createAccounts(); aaccs.getAccount().addAll(accs); if (ops!=null) Processes pps=of.createProcesses(); pps.getProcess().addAll(ps); res.setProcesses(pps); Artifacts aas=of.createArtifacts(); aas.getArtifact().addAll(as); res.setArtifacts(aas); Agents aags=of.createAgents(); aags.getAgent().addAll(ags); res.setAgents(aags); Dependencies ccls=of.createDependencies(); ccls.getUsedOrWasGeneratedByOrWasTriggeredBy().addAll(lks); res.setDependencies(ccls); Annotations l=of.createAnnotations(); l.getAnnotation().addAll(anns); res.setAnnotations(l);
public JAXBElement<? extends EmbeddedAnnotation> compactAnnotation(EmbeddedAnnotation ann) { if (ann instanceof Label) { Label label=(Label) ann; return of.createLabel(label); return of.createType(type); return of.createProfile(profile); return of.createValue(value); return of.createPname(pname); Label label=newLabel((String)prop.getValue()); setIdForCompactAnnotation(label,ann.getId()); return of.createLabel(label); return of.createType(type); return of.createProfile(profile); return of.createPname(pname); (String)properties.get(1).getValue()); setIdForCompactAnnotation(value,ann.getId()); return of.createValue(value); } else if ((properties.get(1).getKey().equals(VALUE_PROPERTY)) && (String)properties.get(0).getValue());
public Accounts newAccounts(Collection<Account> accs, Collection<Overlaps> ovlps) { Accounts res=of.createAccounts(); if (accs!=null) { res.getAccount().addAll(accs); } if (ovlps!=null) { res.getOverlaps().addAll(ovlps); } return res; }
public AgentRef newAgentRef(Agent a) { AgentRef res=of.createAgentRef(); res.setRef(a); return res; }
public AnnotationRef newAnnotationRef(Annotation a) { AnnotationRef res=of.createAnnotationRef(); res.setRef(a); return res; }
public Account newAccount(String id) { Account res=of.createAccount(); res.setId(id); return res; } public Account newAccount(String id, String label) {
public AccountRef newAccountRef(Account acc) { AccountRef res=of.createAccountRef(); res.setRef(acc); return res; }
public Agent addAgent(String name, Agent agent) { Agent existing=agentMap.get(name); if (existing!=null) { return existing; } else { agentMap.put(name,agent); Agents agents=getAgents(); if (agents==null) { agents=of.createAgents(); setAgents(agents); } agents.getAgent().add(agent); return agent; } }
public Agent newAgent(String ag, Collection<Account> accounts, String label) { Agent res=of.createAgent(); res.setId(ag); addAccounts(res,accounts,null); if (label!=null) addAnnotation(res,newLabel(label)); return res; }
public void sortGraph(OPMGraph graph) { graph.setAnnotations(oFactory.getObjectFactory().createAnnotations()); sortById((List)graph.getAccounts().getAccount()); if (graph.getProcesses()!=null && graph.getProcesses().getProcess()!=null) { sortById((List)graph.getProcesses().getProcess()); for (Process p: graph.getProcesses().getProcess()) { sortAnnotations(p.getAnnotation()); sortByRef(p.getAccount()); } } if (graph.getArtifacts()!=null && graph.getArtifacts().getArtifact()!=null) { sortById((List)graph.getArtifacts().getArtifact()); for (Artifact a: graph.getArtifacts().getArtifact()) { sortAnnotations(a.getAnnotation()); sortByRef(a.getAccount()); } } if (graph.getAgents()!=null && graph.getAgents().getAgent()!=null) { sortById((List)graph.getAgents().getAgent()); for (Agent a: graph.getAgents().getAgent()) { sortAnnotations(a.getAnnotation()); sortByRef(a.getAccount()); } } for (Object e: graph.getDependencies().getUsedOrWasGeneratedByOrWasTriggeredBy()) { sortAnnotations(((Edge)e).getAnnotation()); sortByRef(((Edge)e).getAccount()); } sortEdges(graph.getDependencies().getUsedOrWasGeneratedByOrWasTriggeredBy()); }
public Account addAccount(String name, Account account) { Account existing=accountMap.get(name); if (existing!=null) { return existing; } else { accountMap.put(name,account); Accounts accounts=getAccounts(); if (accounts==null) { accounts=of.createAccounts(); setAccounts(accounts); } accounts.getAccount().add(account); return account; } } public Account addAccount(Account account) {
public void addAnnotation(Annotable annotable, List<EmbeddedAnnotation> anns) { List<JAXBElement<? extends EmbeddedAnnotation>> annotations=annotable.getAnnotation(); for (EmbeddedAnnotation ann: anns) { annotations.add(of.createAnnotation(ann)); } }
public void addAnnotation(Annotable annotable, EmbeddedAnnotation ann) { annotable.getAnnotation().add(of.createAnnotation(ann)); }
public Annotation newAnnotation(String id, Object o, List<Property> properties, Collection<AccountRef> accs) { Annotation res=of.createAnnotation(); res.setId(id); res.setLocalSubject(o); for (Property property: properties) { addProperty(res,property); } addAccounts(res,accs); return res; }
public Annotation newAnnotation(String id, Ref ref, String property, Object value, Collection<AccountRef> accs) { Annotation res=of.createAnnotation(); res.setId(id); res.setLocalSubject(ref.getRef()); addProperty(res,newProperty(property,value)); addAccounts(res,accs); return res; }