org.openprovenance.model
Class IndexedOPMGraph

java.lang.Object
  extended by org.openprovenance.model.OPMGraph
      extended by org.openprovenance.model.IndexedOPMGraph
All Implemented Interfaces:
org.jvnet.jaxb2_commons.lang.Equals, org.jvnet.jaxb2_commons.lang.HashCode, org.jvnet.jaxb2_commons.lang.ToString, Annotable, Identifiable

public class IndexedOPMGraph
extends OPMGraph

This class provides a set of indexes over information contained in an OPMGraph, facilitating its navigation. Its constructor takes an OPMGraph builds an index for it. Of course, for the index to be maintained, one cannot access, say the list of edges, and mutate it. Instead, one has to use the add methods provided.

Note that code is not thread-safe. TODO: index annotation, index edges


Field Summary
protected  ObjectFactory of
           
 
Fields inherited from class org.openprovenance.model.OPMGraph
accounts, agents, annotation, annotations, artifacts, causalDependencies, id, processes
 
Constructor Summary
IndexedOPMGraph(OPMFactory oFactory, OPMGraph graph)
           
 
Method Summary
 Account addAccount(Account account)
           
 Account addAccount(String name, Account account)
           
 Agent addAgent(Agent agent)
           
 Agent addAgent(String name, Agent agent)
           
 Artifact addArtifact(Artifact artifact)
           
 Artifact addArtifact(String name, Artifact artifact)
           
 Process addProcess(Process process)
           
 Process addProcess(String name, Process process)
           
 Used addUsed(Used used)
          Add a used edge to the graph.
 WasControlledBy addWasControlledBy(WasControlledBy wasControlledBy)
          Add a wasControlledBy edge to the graph.
 WasDerivedFrom addWasDerivedFrom(WasDerivedFrom wasDerivedFrom)
          Add a wasDerivedFrom edge to the graph.
 WasGeneratedBy addWasGeneratedBy(WasGeneratedBy wasGeneratedBy)
          Add a wasGeneratedBy edge to the graph.
 WasTriggeredBy addWasTriggeredBy(WasTriggeredBy wasTriggeredBy)
          Add a wasTriggeredBy edge to the graph.
 Account getAccount(String name)
           
 Agent getAgent(String name)
           
 Artifact getArtifact(String name)
           
 Process getProcess(String name)
           
 Collection<Used> getUsed()
          Return all used edges for this graph.
 Collection<Used> getUsed(Artifact p)
          Return all used edges with artifact a as a cause.
 Collection<Used> getUsed(Process p)
          Return all used edges with process p as an effect.
 Collection<WasControlledBy> getWasControlledBy()
          Return all WasControlledBy edges for this graph.
 Collection<WasControlledBy> getWasControlledBy(Agent a)
          Return all WasControlledBy edges with artifact a as a cause.
 Collection<WasControlledBy> getWasControlledBy(Process p)
          Return all WasControlledBy edges with process p as an effect.
 Collection<WasDerivedFrom> getWasDerivedFrom()
          Return all WasDerivedFrom edges for this graph.
 Collection<WasDerivedFrom> getWasDerivedFromWithCause(Artifact a)
          Return all WasDerivedFrom edges with artifact a as a cause.
 Collection<WasDerivedFrom> getWasDerivedFromWithEffect(Artifact a)
          Return all WasDerivedFrom edges with artifact a as an effect .
 Collection<WasGeneratedBy> getWasGeneratedBy()
          Return all WasGeneratedBy edges for this graph.
 Collection<WasGeneratedBy> getWasGeneratedBy(Artifact p)
          Return all WasGeneratedBy edges with artifact a as a cause.
 Collection<WasGeneratedBy> getWasGeneratedBy(Process p)
          Return all WasGeneratedBy edges with process p as an effect.
 Collection<WasTriggeredBy> getWasTriggeredBy()
          Return all WasTriggeredBy edges for this graph.
 Collection<WasTriggeredBy> getWasTriggeredByWithCause(Process a)
          Return all WasTriggeredBy edges with process p as a cause.
 Collection<WasTriggeredBy> getWasTriggeredByWithEffect(Process a)
          Return all WasTriggeredBy edges with process a as an effect.
 
Methods inherited from class org.openprovenance.model.OPMGraph
equals, equals, getAccounts, getAgents, getAnnotation, getAnnotations, getArtifacts, getCausalDependencies, getId, getProcesses, hashCode, hashCode, setAccounts, setAgents, setAnnotations, setArtifacts, setCausalDependencies, setId, setProcesses, toString, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

of

protected final ObjectFactory of
Constructor Detail

IndexedOPMGraph

public IndexedOPMGraph(OPMFactory oFactory,
                       OPMGraph graph)
Method Detail

getUsed

public Collection<Used> getUsed()
Return all used edges for this graph.


getUsed

public Collection<Used> getUsed(Process p)
Return all used edges with process p as an effect.


getUsed

public Collection<Used> getUsed(Artifact p)
Return all used edges with artifact a as a cause.


getWasGeneratedBy

public Collection<WasGeneratedBy> getWasGeneratedBy()
Return all WasGeneratedBy edges for this graph.


getWasGeneratedBy

public Collection<WasGeneratedBy> getWasGeneratedBy(Process p)
Return all WasGeneratedBy edges with process p as an effect.


getWasGeneratedBy

public Collection<WasGeneratedBy> getWasGeneratedBy(Artifact p)
Return all WasGeneratedBy edges with artifact a as a cause.


getWasDerivedFrom

public Collection<WasDerivedFrom> getWasDerivedFrom()
Return all WasDerivedFrom edges for this graph.


getWasDerivedFromWithCause

public Collection<WasDerivedFrom> getWasDerivedFromWithCause(Artifact a)
Return all WasDerivedFrom edges with artifact a as a cause.


getWasDerivedFromWithEffect

public Collection<WasDerivedFrom> getWasDerivedFromWithEffect(Artifact a)
Return all WasDerivedFrom edges with artifact a as an effect .


getWasTriggeredBy

public Collection<WasTriggeredBy> getWasTriggeredBy()
Return all WasTriggeredBy edges for this graph.


getWasTriggeredByWithCause

public Collection<WasTriggeredBy> getWasTriggeredByWithCause(Process a)
Return all WasTriggeredBy edges with process p as a cause.


getWasTriggeredByWithEffect

public Collection<WasTriggeredBy> getWasTriggeredByWithEffect(Process a)
Return all WasTriggeredBy edges with process a as an effect.


getWasControlledBy

public Collection<WasControlledBy> getWasControlledBy()
Return all WasControlledBy edges for this graph.


getWasControlledBy

public Collection<WasControlledBy> getWasControlledBy(Process p)
Return all WasControlledBy edges with process p as an effect.


getWasControlledBy

public Collection<WasControlledBy> getWasControlledBy(Agent a)
Return all WasControlledBy edges with artifact a as a cause.


getAccount

public Account getAccount(String name)

addAccount

public Account addAccount(String name,
                          Account account)

addAccount

public Account addAccount(Account account)

addArtifact

public Artifact addArtifact(Artifact artifact)

addArtifact

public Artifact addArtifact(String name,
                            Artifact artifact)

addAgent

public Agent addAgent(Agent agent)

addAgent

public Agent addAgent(String name,
                      Agent agent)

addProcess

public Process addProcess(Process process)

addProcess

public Process addProcess(String name,
                          Process process)

getProcess

public Process getProcess(String name)

getArtifact

public Artifact getArtifact(String name)

getAgent

public Agent getAgent(String name)

addUsed

public Used addUsed(Used used)
Add a used edge to the graph. Update processUsedMap and artifactUsedMap accordingly. By doing so, aggregate all used edges (p,r,a) with different accounts in a single edge. Return the used edge itself (if it had not been encountered before), or the instance encountered before.


addWasGeneratedBy

public WasGeneratedBy addWasGeneratedBy(WasGeneratedBy wasGeneratedBy)
Add a wasGeneratedBy edge to the graph. Update processWasGeneratedByMap and artifactWasGeneratedByMap accordingly. By doing so, aggregate all wasGeneratedBy edges (a,r,p) with different accounts in a single edge. Return the wasGeneratedBy edge itself (if it had not been encountered before), or the instance encountered before.


addWasDerivedFrom

public WasDerivedFrom addWasDerivedFrom(WasDerivedFrom wasDerivedFrom)
Add a wasDerivedFrom edge to the graph. Update processWasDerivedFromMap and artifactWasDerivedFromMap accordingly. By doing so, aggregate all wasDerivedFrom edges (a1,r,a2) with different accounts in a single edge. Return the wasDerivedFrom edge itself (if it had not been encountered before), or the instance encountered before.


addWasControlledBy

public WasControlledBy addWasControlledBy(WasControlledBy wasControlledBy)
Add a wasControlledBy edge to the graph. Update processWasControlledByMap and agentWasControlledByMap accordingly. By doing so, aggregate all wasControlledBy edges (p,r,a) with different accounts in a single edge. Return the wasControlledBy edge itself (if it had not been encountered before), or the instance encountered before.


addWasTriggeredBy

public WasTriggeredBy addWasTriggeredBy(WasTriggeredBy wasTriggeredBy)
Add a wasTriggeredBy edge to the graph. Update processWasTriggeredByMap and artifactWasTriggeredByMap accordingly. By doing so, aggregate all wasTriggeredBy edges (p1,r,p2) with different accounts in a single edge. Return the wasTriggeredBy edge itself (if it had not been encountered before), or the instance encountered before.



Copyright © 2010. All Rights Reserved.