eu.transformproject.provenance.storage
public class ProvenancePersistenceManager extends java.lang.Object implements ProvenanceStorageInterface
| Constructor and Description |
|---|
ProvenancePersistenceManager(ProvenanceServer provenanceServer) |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
addAnnotation(OPMEntity subjectEntity,
Property prop,
java.lang.String value) |
java.lang.String |
addAnnotation(OPMEntity entity,
java.lang.String owl_prop,
java.lang.String value) |
java.lang.String |
addAnnotation(java.lang.String uriEntityOrDependence,
java.lang.String owl_prop,
java.lang.String value)
Adds an annotation to an entity or a dependence, owl_prop is the property to annotate which must appear in the ontology profile
(or set of domain-user ontologies) associated to the server, the value associated to the property is value.
|
java.lang.String[] |
addAnnotations(java.lang.String uriEntityOrDependence,
AnnotationSet annotations) |
OPMDependence |
addCausalDependence(OPMEntityNode entityCause,
OPMEntityNode entityEffect) |
java.lang.String |
addCausalDependence(java.lang.String uriEntityCause,
java.lang.String uriEntityDest)
As the previous method but the causal dependences to create must correspond with one of the five defined in \cite{Moreau2010}.
|
java.lang.String |
addCausalDependence(java.lang.String uriEntityCause,
java.lang.String opmo_dependenceClass,
java.lang.String uriEntityDest)
Defines a causal dependence from the entity uriEntityDest to uriEntityCause in the graph idGraph.
|
java.lang.Object[] |
addOPMEntityToGraph(OPMGraph g,
OPMEntity entity) |
void |
associateToAccount(java.lang.String uriEntity,
java.lang.String uriAccount)
Specify an account for which an specific OPM entity can be viewed.
|
void |
closeSession() |
AnnotationSet |
composeAnnotation(java.lang.String owl_prop,
java.lang.String value)
Create an AnnotationSet object, initialising it with the annotation defined by the pair: owl_prop, value.
|
OPMDependence |
createCausalDependence(OPMEntityNode entityCause,
OPMEntityNode entityEffect) |
void |
endProcess(java.lang.String processUri)
Allows to store the date-time in which a process has finalised.
|
void |
endProcessWithStatus(java.lang.String processUri,
java.lang.String processStatus)
Allows to store the date-time in which a process has finalised together with its status.
|
java.util.List |
executeSQL(java.lang.String sql) |
void |
finalize() |
<T> T |
find(java.lang.Class<T> clazz,
long primaryKey) |
java.lang.Object |
flushAndRefresh(java.lang.Object o) |
java.util.Collection<? extends java.lang.String> |
getColsOfTables(java.lang.String tname) |
OPMGraph |
getCurrGraph() |
java.lang.String |
getEntityURI(EntityType et,
AnnotationSet annotations) |
java.lang.String |
getEntityURI(java.lang.String owl_opm_Class,
AnnotationSet annotations)
Generate or retrieve an URI associated to the given parameters.
|
long |
getKeyFromURI(java.lang.String uri) |
OPMEntity |
getOPMEntity(long key) |
OPMEntity |
getOPMEntity(java.lang.String entityURI)
Recover an OPMEntity given its URI.
|
OPMEntity |
getOPMEntityWithValue(java.lang.String value) |
java.lang.String |
getOPMGraphForProject(java.lang.String projectName)
If it exists a graph associated to this project name, this method returns it, otherwise,
it creates a new graph, and adds to it an annotation associating it with a project.
|
OPMGraph |
getOPMGraphViewForEntities(java.util.HashSet<java.lang.String> entityURIs,
int pathlenght) |
OPMGraph |
getOPMGraphViewForEntities(java.util.HashSet<java.lang.String> entityURIs,
int pathlenght,
java.util.HashMap<java.lang.String,java.lang.Object> cloneMap) |
ProcessStatus |
getProcessStatus(java.lang.String processStatus) |
java.lang.String |
getProjectNameOfEntity(java.lang.String entityURI) |
Property |
getProperty(java.lang.String prop) |
java.util.Date |
getSyncTime() |
java.lang.String |
getTableNameForColumn(java.lang.String col) |
java.lang.String |
getURI(long key) |
java.lang.String |
getURI(OPMDependenceType depType) |
java.lang.String |
getURI(OPMEntity entity) |
java.lang.String |
getURI(OPMEntityType entityType) |
java.lang.String |
newGraph()
Adds a new graph in the provenance store.
|
void |
openSession() |
java.lang.Object[] |
openSession(java.lang.Object[] deAttachObjects) |
void |
setCurrentGraph(java.lang.String uriGraph)
Specify that all the new entity definitions belong to the OPM graph with URI idGraph.
|
void |
setId(java.lang.String entityURI,
java.lang.String newId) |
void |
setOntologies(Ontologies ontos) |
void |
setProcessEndAt(java.lang.String processUri,
java.util.Date timeEnd) |
void |
setProcessStartAt(java.lang.String processUri,
java.util.Date timeStart) |
void |
setProcessStatus(java.lang.String processUri,
java.lang.String processStatus)
Allows to set the status of a process.
|
public ProvenancePersistenceManager(ProvenanceServer provenanceServer) throws org.hibernate.MappingException, java.lang.Exception
org.hibernate.MappingExceptionjava.lang.Exceptionpublic void openSession()
public java.lang.Object[] openSession(java.lang.Object[] deAttachObjects)
public void closeSession()
public <T> T find(java.lang.Class<T> clazz,
long primaryKey)
public java.lang.Object flushAndRefresh(java.lang.Object o)
throws java.lang.Exception
flushAndRefresh in interface ProvenanceStorageInterfacejava.lang.Exceptionpublic java.lang.String getURI(OPMEntity entity)
public java.lang.String getURI(OPMEntityType entityType) throws java.lang.Exception
java.lang.Exceptionpublic java.lang.String getURI(OPMDependenceType depType) throws java.lang.Exception
java.lang.Exceptionpublic long getKeyFromURI(java.lang.String uri)
public java.util.Date getSyncTime()
throws java.lang.Exception
getSyncTime in interface ProvenanceStorageInterfacejava.lang.Exceptionpublic java.lang.String newGraph()
throws java.lang.Exception
ProvenanceStorageInterfacenewGraph in interface ProvenanceStorageInterfacejava.lang.Exceptionpublic java.lang.String getEntityURI(java.lang.String owl_opm_Class,
AnnotationSet annotations)
throws java.lang.Exception
ProvenanceStorageInterfacegetEntityURI in interface ProvenanceStorageInterfaceowl_opm_Class - class to which the opm entity belongsannotations - annotations associated to the entity to create/retrievejava.lang.Exceptionpublic java.lang.String getEntityURI(EntityType et, AnnotationSet annotations) throws java.lang.Exception
java.lang.Exceptionpublic java.lang.String addAnnotation(OPMEntity entity, java.lang.String owl_prop, java.lang.String value) throws java.lang.Exception
java.lang.Exceptionpublic void associateToAccount(java.lang.String uriEntity,
java.lang.String uriAccount)
throws java.lang.Exception
ProvenanceStorageInterfaceassociateToAccount in interface ProvenanceStorageInterfaceuriEntity - OPM entity URI of the entity to associate to the accounturiAccount - OPM Account URI for the OPM entity.java.lang.Exceptionpublic java.lang.String addCausalDependence(java.lang.String uriEntityCause,
java.lang.String opmo_dependenceClass,
java.lang.String uriEntityDest)
throws java.lang.Exception
ProvenanceStorageInterfaceaddCausalDependence in interface ProvenanceStorageInterfacejava.lang.Exceptionpublic java.lang.String addCausalDependence(java.lang.String uriEntityCause,
java.lang.String uriEntityDest)
throws java.lang.Exception
ProvenanceStorageInterfaceaddCausalDependence in interface ProvenanceStorageInterfacejava.lang.Exceptionpublic OPMDependence addCausalDependence(OPMEntityNode entityCause, OPMEntityNode entityEffect) throws java.lang.Exception
java.lang.Exceptionpublic void setOntologies(Ontologies ontos)
public Property getProperty(java.lang.String prop) throws java.lang.Exception
java.lang.Exceptionpublic OPMEntity getOPMEntityWithValue(java.lang.String value)
public java.lang.String addAnnotation(java.lang.String uriEntityOrDependence,
java.lang.String owl_prop,
java.lang.String value)
throws java.lang.Exception
ProvenanceStorageInterfaceaddAnnotation in interface ProvenanceStorageInterfacejava.lang.Exceptionpublic java.lang.String addAnnotation(OPMEntity subjectEntity, Property prop, java.lang.String value) throws java.lang.Exception
java.lang.Exceptionpublic java.lang.String[] addAnnotations(java.lang.String uriEntityOrDependence,
AnnotationSet annotations)
throws java.lang.Exception
addAnnotations in interface ProvenanceStorageInterfacejava.lang.Exceptionpublic java.util.List executeSQL(java.lang.String sql)
public void setCurrentGraph(java.lang.String uriGraph)
throws java.lang.Exception
ProvenanceStorageInterfacesetCurrentGraph in interface ProvenanceStorageInterfaceuriGraph - URI of the graph for all new declared entities.java.lang.Exceptionpublic java.lang.String getOPMGraphForProject(java.lang.String projectName)
throws java.lang.Exception
ProvenanceStorageInterfacegetOPMGraphForProject in interface ProvenanceStorageInterfaceprojectName - name of the project described by the created graph.java.lang.Exceptionpublic java.lang.String getProjectNameOfEntity(java.lang.String entityURI)
throws java.lang.Exception
java.lang.Exceptionpublic void endProcess(java.lang.String processUri)
throws java.lang.Exception
ProvenanceStorageInterfaceendProcess in interface ProvenanceStorageInterfaceprocessUri - the process that has finishedjava.lang.Exceptionpublic ProcessStatus getProcessStatus(java.lang.String processStatus) throws java.lang.Exception
java.lang.Exceptionpublic void endProcessWithStatus(java.lang.String processUri,
java.lang.String processStatus)
throws java.lang.Exception
ProvenanceStorageInterfaceendProcessWithStatus in interface ProvenanceStorageInterfaceprocessUri - the process that has finishedprocessStatus - status of the process that has finishedjava.lang.Exceptionpublic void setProcessStartAt(java.lang.String processUri,
java.util.Date timeStart)
throws java.lang.Exception
setProcessStartAt in interface ProvenanceStorageInterfacejava.lang.Exceptionpublic void setProcessEndAt(java.lang.String processUri,
java.util.Date timeEnd)
throws java.lang.Exception
setProcessEndAt in interface ProvenanceStorageInterfacejava.lang.Exceptionpublic AnnotationSet composeAnnotation(java.lang.String owl_prop, java.lang.String value) throws java.lang.Exception
ProvenanceStorageInterfacecomposeAnnotation in interface ProvenanceStorageInterfacejava.lang.Exceptionpublic void setProcessStatus(java.lang.String processUri,
java.lang.String processStatus)
throws java.lang.Exception
ProvenanceStorageInterfacesetProcessStatus in interface ProvenanceStorageInterfaceprocessStatus - string representing the status of a process. Only the current status of a process is maintained.
In future versions, other status annotations would be maintained at different times.java.lang.Exceptionpublic OPMGraph getCurrGraph() throws java.lang.Exception
getCurrGraph in interface ProvenanceStorageInterfacejava.lang.Exceptionpublic OPMEntity getOPMEntity(java.lang.String entityURI) throws java.lang.Exception
ProvenanceStorageInterfacegetOPMEntity in interface ProvenanceStorageInterfaceentityURI - URI of the entity to recover.java.lang.Exceptionpublic void setId(java.lang.String entityURI,
java.lang.String newId)
throws java.lang.Exception
java.lang.Exceptionpublic OPMEntity getOPMEntity(long key)
public java.lang.String getURI(long key)
public java.lang.String getTableNameForColumn(java.lang.String col)
public java.util.Collection<? extends java.lang.String> getColsOfTables(java.lang.String tname)
public void finalize()
throws java.sql.SQLException
finalize in class java.lang.Objectjava.sql.SQLExceptionpublic OPMDependence createCausalDependence(OPMEntityNode entityCause, OPMEntityNode entityEffect) throws java.lang.Exception
java.lang.Exceptionpublic OPMGraph getOPMGraphViewForEntities(java.util.HashSet<java.lang.String> entityURIs, int pathlenght) throws java.lang.Exception
java.lang.Exceptionpublic OPMGraph getOPMGraphViewForEntities(java.util.HashSet<java.lang.String> entityURIs, int pathlenght, java.util.HashMap<java.lang.String,java.lang.Object> cloneMap) throws java.lang.Exception
java.lang.Exception