/** Return all WasDerivedFrom edges with artifact a as an effect . */ public Collection<WasDerivedFrom> getWasDerivedFromWithEffect(Artifact a) { return artifactEffectWasDerivedFromMap.get(a.getId()); }
public void hashCode(HashCodeBuilder hashCodeBuilder) { hashCodeBuilder.append(this.getAccount()); hashCodeBuilder.append(this.getAnnotation()); hashCodeBuilder.append(this.getId()); }
public RdfArtifact(ElmoManager manager, QName qname) { this.manager=manager; this.qname=qname; this.prefix=qname.getNamespaceURI(); super.setId(qname.getLocalPart()); }
Resource res=Resource.uriRef(urify(a.getId())); ProvenanceArtifact rdfArtifact; rdfArtifact = pcf.newArtifact((String)oFactory.getLabel(a),res); artifactTable.put(a.getId(),rdfArtifact); idTable.put(a.getId(),subject); if (!(a.getAnnotation().isEmpty())) { mc.addTriples(triplifyAnnotations(subject,a.getAnnotation()));
Resource res=Resource.uriRef(urify(a.getId())); ProvenanceArtifact rdfArtifact; if (a.getValue() instanceof String) { rdfArtifact = pcf.newArtifact((String)a.getValue(),res); } else { logger.warn("how to serialise artifact value? " + a.getValue().toString()); rdfArtifact = pcf.newArtifact("hello",res); artifactTable.put(a.getId(),rdfArtifact);
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 artifactColor(Artifact 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); } public String agentColor(Agent p) {
/** * Create an instance of {@link Artifact } * */ public Artifact createArtifact() { return new Artifact(); }
public boolean equals(Object object) { if (!(object instanceof Artifact)) { 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=a.getAccount();
/** Return all used edges with artifact a as a cause. */ public Collection<Used> getUsed(Artifact p) { return artifactUsedMap.get(p.getId()); }
public void equals(Object object, EqualsBuilder equalsBuilder) { if (!(object instanceof Artifact)) { equalsBuilder.appendSuper(false); return ; } if (this == object) { return ; } final Artifact that = ((Artifact) 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); org.openprovenance.rdf.Artifact a0_ = (org.openprovenance.rdf.Artifact) manager.designate(qname, org.openprovenance.rdf.Artifact.class); }
/** Return all WasDerivedFrom edges with artifact a as a cause. */ public Collection<WasDerivedFrom> getWasDerivedFromWithCause(Artifact a) { return artifactCauseWasDerivedFromMap.get(a.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 Artifact newArtifact(String id, Collection<Account> accounts, String label) { Artifact res=of.createArtifact(); res.setId(id); addAccounts(res,accounts,null); if (label!=null) addAnnotation(res,newLabel(label)); return res; }
/** Return all WasGeneratedBy edges with artifact a as a cause. */ public Collection<WasGeneratedBy> getWasGeneratedBy(Artifact p) { return artifactWasGeneratedByMap.get(p.getId()); }
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) {