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.MappingException
java.lang.Exception
public 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 ProvenanceStorageInterface
java.lang.Exception
public java.lang.String getURI(OPMEntity entity)
public java.lang.String getURI(OPMEntityType entityType) throws java.lang.Exception
java.lang.Exception
public java.lang.String getURI(OPMDependenceType depType) throws java.lang.Exception
java.lang.Exception
public long getKeyFromURI(java.lang.String uri)
public java.util.Date getSyncTime() throws java.lang.Exception
getSyncTime
in interface ProvenanceStorageInterface
java.lang.Exception
public java.lang.String newGraph() throws java.lang.Exception
ProvenanceStorageInterface
newGraph
in interface ProvenanceStorageInterface
java.lang.Exception
public java.lang.String getEntityURI(java.lang.String owl_opm_Class, AnnotationSet annotations) throws java.lang.Exception
ProvenanceStorageInterface
getEntityURI
in interface ProvenanceStorageInterface
owl_opm_Class
- class to which the opm entity belongsannotations
- annotations associated to the entity to create/retrievejava.lang.Exception
public java.lang.String getEntityURI(EntityType et, AnnotationSet annotations) throws java.lang.Exception
java.lang.Exception
public java.lang.String addAnnotation(OPMEntity entity, java.lang.String owl_prop, java.lang.String value) throws java.lang.Exception
java.lang.Exception
public void associateToAccount(java.lang.String uriEntity, java.lang.String uriAccount) throws java.lang.Exception
ProvenanceStorageInterface
associateToAccount
in interface ProvenanceStorageInterface
uriEntity
- OPM entity URI of the entity to associate to the accounturiAccount
- OPM Account URI for the OPM entity.java.lang.Exception
public java.lang.String addCausalDependence(java.lang.String uriEntityCause, java.lang.String opmo_dependenceClass, java.lang.String uriEntityDest) throws java.lang.Exception
ProvenanceStorageInterface
addCausalDependence
in interface ProvenanceStorageInterface
java.lang.Exception
public java.lang.String addCausalDependence(java.lang.String uriEntityCause, java.lang.String uriEntityDest) throws java.lang.Exception
ProvenanceStorageInterface
addCausalDependence
in interface ProvenanceStorageInterface
java.lang.Exception
public OPMDependence addCausalDependence(OPMEntityNode entityCause, OPMEntityNode entityEffect) throws java.lang.Exception
java.lang.Exception
public void setOntologies(Ontologies ontos)
public Property getProperty(java.lang.String prop) throws java.lang.Exception
java.lang.Exception
public 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
ProvenanceStorageInterface
addAnnotation
in interface ProvenanceStorageInterface
java.lang.Exception
public java.lang.String addAnnotation(OPMEntity subjectEntity, Property prop, java.lang.String value) throws java.lang.Exception
java.lang.Exception
public java.lang.String[] addAnnotations(java.lang.String uriEntityOrDependence, AnnotationSet annotations) throws java.lang.Exception
addAnnotations
in interface ProvenanceStorageInterface
java.lang.Exception
public java.util.List executeSQL(java.lang.String sql)
public void setCurrentGraph(java.lang.String uriGraph) throws java.lang.Exception
ProvenanceStorageInterface
setCurrentGraph
in interface ProvenanceStorageInterface
uriGraph
- URI of the graph for all new declared entities.java.lang.Exception
public java.lang.String getOPMGraphForProject(java.lang.String projectName) throws java.lang.Exception
ProvenanceStorageInterface
getOPMGraphForProject
in interface ProvenanceStorageInterface
projectName
- name of the project described by the created graph.java.lang.Exception
public java.lang.String getProjectNameOfEntity(java.lang.String entityURI) throws java.lang.Exception
java.lang.Exception
public void endProcess(java.lang.String processUri) throws java.lang.Exception
ProvenanceStorageInterface
endProcess
in interface ProvenanceStorageInterface
processUri
- the process that has finishedjava.lang.Exception
public ProcessStatus getProcessStatus(java.lang.String processStatus) throws java.lang.Exception
java.lang.Exception
public void endProcessWithStatus(java.lang.String processUri, java.lang.String processStatus) throws java.lang.Exception
ProvenanceStorageInterface
endProcessWithStatus
in interface ProvenanceStorageInterface
processUri
- the process that has finishedprocessStatus
- status of the process that has finishedjava.lang.Exception
public void setProcessStartAt(java.lang.String processUri, java.util.Date timeStart) throws java.lang.Exception
setProcessStartAt
in interface ProvenanceStorageInterface
java.lang.Exception
public void setProcessEndAt(java.lang.String processUri, java.util.Date timeEnd) throws java.lang.Exception
setProcessEndAt
in interface ProvenanceStorageInterface
java.lang.Exception
public AnnotationSet composeAnnotation(java.lang.String owl_prop, java.lang.String value) throws java.lang.Exception
ProvenanceStorageInterface
composeAnnotation
in interface ProvenanceStorageInterface
java.lang.Exception
public void setProcessStatus(java.lang.String processUri, java.lang.String processStatus) throws java.lang.Exception
ProvenanceStorageInterface
setProcessStatus
in interface ProvenanceStorageInterface
processStatus
- 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.Exception
public OPMGraph getCurrGraph() throws java.lang.Exception
getCurrGraph
in interface ProvenanceStorageInterface
java.lang.Exception
public OPMEntity getOPMEntity(java.lang.String entityURI) throws java.lang.Exception
ProvenanceStorageInterface
getOPMEntity
in interface ProvenanceStorageInterface
entityURI
- URI of the entity to recover.java.lang.Exception
public void setId(java.lang.String entityURI, java.lang.String newId) throws java.lang.Exception
java.lang.Exception
public 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.Object
java.sql.SQLException
public OPMDependence createCausalDependence(OPMEntityNode entityCause, OPMEntityNode entityEffect) throws java.lang.Exception
java.lang.Exception
public OPMGraph getOPMGraphViewForEntities(java.util.HashSet<java.lang.String> entityURIs, int pathlenght) throws java.lang.Exception
java.lang.Exception
public 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