/** Return all WasTriggeredBy edges with process a as an effect. */ public Collection<WasTriggeredBy> getWasTriggeredByWithEffect(Process a) { return processEffectWasTriggeredByMap.get(a.getId()); }
public void hashCode(HashCodeBuilder hashCodeBuilder) { hashCodeBuilder.append(this.getAccount()); hashCodeBuilder.append(this.getAnnotation()); hashCodeBuilder.append(this.getId()); }
public RdfProcess(ElmoManager manager, QName qname) { this.manager=manager; this.qname=qname; this.prefix=qname.getNamespaceURI(); super.setId(qname.getLocalPart()); }
Resource res=Resource.uriRef(urify(p.getId())); ProvenanceProcess rdfProcess; rdfProcess = pcf.newProcess((String)oFactory.getLabel(p),res); processTable.put(p.getId(),rdfProcess); idTable.put(p.getId(),subject); if (!(p.getAnnotation().isEmpty())) { mc.addTriples(triplifyAnnotations(subject,p.getAnnotation()));
Resource res=Resource.uriRef(urify(p.getId())); ProvenanceProcess rdfProcess; if (p.getValue() instanceof String) { rdfProcess = pcf.newProcess((String)p.getValue(),res); } else { logger.warn("how to serialise process value? " + p.getValue().toString()); rdfProcess = pcf.newProcess(p.getValue().toString(),res); processTable.put(p.getId(),rdfProcess);
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 void embedExternalAnnotations(OPMGraph graph) { IndexedOPMGraph igraph=new IndexedOPMGraph(oFactory,graph); // embed external annotations if (graph.getAnnotations()!=null) { List<Annotation> anns=graph.getAnnotations().getAnnotation(); for (Annotation ann: anns) { String id=(((Identifiable)ann.getLocalSubject()).getId()); EmbeddedAnnotation embedded=oFactory.newEmbeddedAnnotation(ann.getId(), ann.getProperty(), ann.getAccount(), null); Process p=igraph.getProcess(id); if (p!=null) { p.getAnnotation().add(oFactory.compactAnnotation(embedded)); } else { Artifact a=igraph.getArtifact(id); if (a!=null) { a.getAnnotation().add(oFactory.compactAnnotation(embedded)); } else { Agent ag=igraph.getAgent(id); if (ag!=null) { ag.getAnnotation().add(oFactory.compactAnnotation(embedded)); } } } } graph.setAnnotations(null); } }
public String processColor(Process p) { // Note, I should compute effective account membership List<String> colors=new LinkedList(); for (AccountRef acc: p.getAccount()) { String accountLabel=((Account)acc.getRef()).getId(); String colour=convertAccount(accountLabel); colors.add(colour); } return selectColor(colors); }
/** * Create an instance of {@link Process } * */ public Process createProcess() { return new Process(); }
public boolean equals(Object object) { if (!(object instanceof Process)) { return false; } if (this == object) { return true; } final EqualsBuilder equalsBuilder = new JAXBEqualsBuilder(); equals(object, equalsBuilder); return equalsBuilder.isEquals(); }
public void noAnnotation(OPMGraph graph) { graph.setAnnotations(null); destroy(graph.getAnnotation()); if (graph.getProcesses()!=null && graph.getProcesses().getProcess()!=null) { for (Process p: graph.getProcesses().getProcess()) { destroy(p.getAnnotation()); } } if (graph.getArtifacts()!=null && graph.getArtifacts().getArtifact()!=null) { for (Artifact a: graph.getArtifacts().getArtifact()) { destroy(a.getAnnotation()); } } if (graph.getAgents()!=null && graph.getAgents().getAgent()!=null) { for (Agent a: graph.getAgents().getAgent()) { destroy(a.getAnnotation()); } } for (Object e: graph.getDependencies().getUsedOrWasGeneratedByOrWasTriggeredBy()) { destroy(((Edge)e).getAnnotation()); } }
List<AccountRef> accRefs=p.getAccount();
/** Return all WasTriggeredBy edges with process p as a cause. */ public Collection<WasTriggeredBy> getWasTriggeredByWithCause(Process a) { return processCauseWasTriggeredByMap.get(a.getId()); }
public void equals(Object object, EqualsBuilder equalsBuilder) { if (!(object instanceof Process)) { equalsBuilder.appendSuper(false); return ; } if (this == object) { return ; } final Process that = ((Process) object); equalsBuilder.append(this.getAccount(), that.getAccount()); equalsBuilder.append(this.getAnnotation(), that.getAnnotation()); equalsBuilder.append(this.getId(), that.getId()); }
public void setId(String value) { super.setId(value); qname = new QName(prefix, value); manager.designate(qname, org.openprovenance.rdf.Process.class); }
/** Return all WasControlledBy edges with process p as an effect. */ public Collection<WasControlledBy> getWasControlledBy(Process p) { return processWasControlledByMap.get(p.getId()); }
public void toString(ToStringBuilder toStringBuilder) { { List<AccountRef> theAccount; theAccount = this.getAccount(); toStringBuilder.append("account", theAccount); } { List<JAXBElement<? extends EmbeddedAnnotation>> theAnnotation; theAnnotation = this.getAnnotation(); toStringBuilder.append("annotation", theAnnotation); } { String theId; theId = this.getId(); toStringBuilder.append("id", theId); } }
public Process newProcess(String pr, Collection<Account> accounts, String label) { Process res=of.createProcess(); res.setId(pr); addAccounts(res,accounts,null); if (label!=null) addAnnotation(res,newLabel(label)); return res; }
/** Return all used edges with process p as an effect. */ public Collection<Used> getUsed(Process p) { return processUsedMap.get(p.getId()); }
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) {