Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added WorkbenchProject/Cache/hostname.encrypted
Binary file not shown.
Binary file added WorkbenchProject/Cache/username.encrypted
Binary file not shown.
Binary file added WorkbenchProject/Key
Binary file not shown.
Binary file added WorkbenchProject/LastSimulation/message
Binary file not shown.
108 changes: 108 additions & 0 deletions WorkbenchProject/LastSimulation/model.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix xsd: <http://www.w3.org/2000/10/XMLSchema#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix remote: <otachi.uwb.edu#> .
@prefix prov: <http://www.w3.org/ns/prov#> .
@prefix local: <DESKTOP-3N8B16A@205.175.118.10#> .

<local:~/WorkbenchSimulations/trial404/configfilestrial404.xml>
a prov:Entity ;
rdfs:label "simulationConfigurationFile" ;
prov:wasDerivedFrom <local:C:/Users/Administrator/WorkbenchProjects/Default/trial404/configfiles/trial404.xml> ;
prov:wasGeneratedBy <local:upload_SimConfig> .

<local:~/WorkbenchSimulations/trial404/configfiles/NListActiveNList.xml>
a prov:Entity ;
rdfs:label "nlist" ;
prov:wasDerivedFrom <local:C:/Users/Administrator/WorkbenchProjects/Default/trial404/configfiles/NList/ActiveNList.xml> ;
prov:wasGeneratedBy <local:upload_ACTIVE_NList> .

<local:upload_SimConfig>
a prov:Activity ;
rdfs:label "upload" ;
prov:endedAtTime "2023-03-01T00:04:26.626Z"^^<http://www.w3.org/2001/XMLSchema#dateTime> ;
prov:generated <local:~/WorkbenchSimulations/trial404/configfilestrial404.xml> ;
prov:startedAtTime "2023-03-01T00:04:26.298Z"^^<http://www.w3.org/2001/XMLSchema#dateTime> ;
prov:used <local:C:/Users/Administrator/WorkbenchProjects/Default/trial404/configfiles/trial404.xml> ;
prov:wasAssociatedWith <local:workbench> .

<local:C:/Users/Administrator/WorkbenchProjects/Default/trial404/configfiles/NList/ActiveNList.xml>
a prov:Entity ;
rdfs:label "nlist" .

<local:~/WorkbenchSimulations/trial404/configfiles/NListprobedNList.xml>
a prov:Entity ;
rdfs:label "nlist" ;
prov:wasDerivedFrom <local:C:/Users/Administrator/WorkbenchProjects/Default/trial404/configfiles/NList/probedNList.xml> ;
prov:wasGeneratedBy <local:upload_PROBED_NList> .

<local:C:/Users/Administrator/WorkbenchProjects/Default/trial404/configfiles/NList/probedNList.xml>
a prov:Entity ;
rdfs:label "nlist" .

<local:uploadScript> a prov:Activity ;
rdfs:label "upload" ;
prov:endedAtTime "2023-03-01T00:04:25.333Z"^^<http://www.w3.org/2001/XMLSchema#dateTime> ;
prov:generated <local:~/WorkbenchSimulations/trial404/trial404_script.sh> ;
prov:startedAtTime "2023-03-01T00:04:25.026Z"^^<http://www.w3.org/2001/XMLSchema#dateTime> ;
prov:used <local:C:/Users/Administrator/WorkbenchProjects/Default/trial404/script/trial404_script.sh> ;
prov:wasAssociatedWith <local:workbench> .

<local:workbench> a prov:SoftwareAgent .

<local:upload_INHIBITORY_NList>
a prov:Activity ;
rdfs:label "upload" ;
prov:endedAtTime "2023-03-01T00:04:25.99Z"^^<http://www.w3.org/2001/XMLSchema#dateTime> ;
prov:generated <local:~/WorkbenchSimulations/trial404/configfiles/NListInhibitoryNList.xml> ;
prov:startedAtTime "2023-03-01T00:04:25.682Z"^^<http://www.w3.org/2001/XMLSchema#dateTime> ;
prov:used <local:C:/Users/Administrator/WorkbenchProjects/Default/trial404/configfiles/NList/InhibitoryNList.xml> ;
prov:wasAssociatedWith <local:workbench> .

<local:upload_PROBED_NList>
a prov:Activity ;
rdfs:label "upload" ;
prov:endedAtTime "2023-03-01T00:04:26.298Z"^^<http://www.w3.org/2001/XMLSchema#dateTime> ;
prov:generated <local:~/WorkbenchSimulations/trial404/configfiles/NListprobedNList.xml> ;
prov:startedAtTime "2023-03-01T00:04:25.991Z"^^<http://www.w3.org/2001/XMLSchema#dateTime> ;
prov:used <local:C:/Users/Administrator/WorkbenchProjects/Default/trial404/configfiles/NList/probedNList.xml> ;
prov:wasAssociatedWith <local:workbench> .

<local:C:/Users/Administrator/WorkbenchProjects/Default/trial404/configfiles/NList/InhibitoryNList.xml>
a prov:Entity ;
rdfs:label "nlist" .

<local:upload_ACTIVE_NList>
a prov:Activity ;
rdfs:label "upload" ;
prov:endedAtTime "2023-03-01T00:04:25.682Z"^^<http://www.w3.org/2001/XMLSchema#dateTime> ;
prov:generated <local:~/WorkbenchSimulations/trial404/configfiles/NListActiveNList.xml> ;
prov:startedAtTime "2023-03-01T00:04:25.333Z"^^<http://www.w3.org/2001/XMLSchema#dateTime> ;
prov:used <local:C:/Users/Administrator/WorkbenchProjects/Default/trial404/configfiles/NList/ActiveNList.xml> ;
prov:wasAssociatedWith <local:workbench> .

<local:simulation_input_file_generation>
a prov:Activity ;
prov:generated <local:C:/Users/Administrator/WorkbenchProjects/Default/trial404/configfiles/trial404.xml> ;
prov:wasAssociatedWith <local:workbench> .

<local:C:/Users/Administrator/WorkbenchProjects/Default/trial404/configfiles/trial404.xml>
a prov:Entity ;
rdfs:label "simulationConfigurationFile" ;
prov:wasGeneratedBy <local:simulation_input_file_generation> .

<local:~/WorkbenchSimulations/trial404/configfiles/NListInhibitoryNList.xml>
a prov:Entity ;
rdfs:label "nlist" ;
prov:wasDerivedFrom <local:C:/Users/Administrator/WorkbenchProjects/Default/trial404/configfiles/NList/InhibitoryNList.xml> ;
prov:wasGeneratedBy <local:upload_INHIBITORY_NList> .

<local:C:/Users/Administrator/WorkbenchProjects/Default/trial404/script/trial404_script.sh>
a prov:Entity ;
rdfs:label "script" .

<local:~/WorkbenchSimulations/trial404/trial404_script.sh>
a prov:Entity ;
rdfs:label "script" ;
prov:wasDerivedFrom <local:C:/Users/Administrator/WorkbenchProjects/Default/trial404/script/trial404_script.sh> ;
prov:wasGeneratedBy <local:uploadScript> .
Binary file added WorkbenchProject/LastSimulation/simName
Binary file not shown.
Binary file added WorkbenchProject/LastSimulation/simdir
Binary file not shown.
Binary file added WorkbenchProject/LastSimulation/simulation
Binary file not shown.
3 changes: 3 additions & 0 deletions WorkbenchProject/LastSimulation/uri
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
C:\Users\Administrator\WorkbenchProjects\Default\trial404\provenance\trial404.ttl
DESKTOP-3N8B16A@205.175.118.10#
null
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintStream;
import java.io.Serializable;
import java.net.InetAddress;
import java.net.URL;
import java.net.URLConnection;
Expand Down Expand Up @@ -50,7 +51,7 @@
* @author Del Davis, Extended by Joseph Conquest
* @version 1.2
*/
public class ProvMgr {
public class ProvMgr implements Serializable {

// <editor-fold defaultstate="collapsed" desc="Members">
private static final Logger LOG = Logger.getLogger(ProvMgr.class.getName());
Expand All @@ -63,14 +64,60 @@ public class ProvMgr {
public static final String LOCAL_NS_PREFIX = "local";

/* URIs used to describe the provenance */
private String provOutputFileURI;
private String localNameSpaceURI;
private String remoteNameSpaceURI;
private String provOutputFileUri;
private String localNameSpaceUri;
private String remoteNameSpaceUri;

/* RDF in-memory representation of the provenance */
private Model model;
// </editor-fold>

/**
* The getter for provURI.
*
* @return return the provURI.
*
*/
public String getProvUri() {
return provOutputFileUri;
}

/**
* The getter for LocalURI.
*
* @return return the LocalURI.
*
*/
public String getLocalUri() {
return localNameSpaceUri;
}

/**
* The getter for RemoteURI.
*
* @return return the RemoteURI.
*
*/
public String getRemoteUri() {
return remoteNameSpaceUri;
}

/**
* The constructor used by resume Lastsimulation.
*
* @param provUri the provURI
* @param localUri the localURI
* @param remoteUri the remoteURI
* @param model the model
*/

public ProvMgr(String provUri, String localUri, String remoteUri, Model model) {
this.provOutputFileUri = provUri;
this.localNameSpaceUri = localUri;
this.remoteNameSpaceUri = remoteUri;
this.model = model;
}

// <editor-fold defaultstate="collapsed" desc="Construction">
/**
* Constructs the Provenance Constructor object from a previously recorded provenance file.
Expand All @@ -97,7 +144,7 @@ public ProvMgr(Simulation simulation, boolean load) throws IOException, RiotNotF
private void init(Simulation simulation) {
// create RDF model
model = ModelFactory.createDefaultModel();
provOutputFileURI = simulation.getProvLocation()
provOutputFileUri = simulation.getProvLocation()
.resolve(simulation.getName() + ".ttl").toString();
// set prefixes for...
// RDF syntax
Expand All @@ -108,9 +155,9 @@ private void init(Simulation simulation) {
model.setNsPrefix("prov", ProvOntology.getPROVNameSpaceURI());
// XML schema
model.setNsPrefix("xsd", ProvOntology.getXSDNameSpaceURI());
localNameSpaceURI = getLocalNameSpaceURI();
localNameSpaceUri = getLocalNameSpaceURI();
// Graphitti Prov
model.setNsPrefix(LOCAL_NS_PREFIX, localNameSpaceURI);
model.setNsPrefix(LOCAL_NS_PREFIX, localNameSpaceUri);
}

/**
Expand All @@ -120,11 +167,11 @@ private void init(Simulation simulation) {
*/
private void load(Simulation simulation) throws RiotNotFoundException {
String name = simulation.getName();
provOutputFileURI = simulation.getProvLocation().resolve(name + ".ttl").toString();
model = RDFDataMgr.loadModel(provOutputFileURI);
localNameSpaceURI = getLocalNameSpaceURI();
model.setNsPrefix(LOCAL_NS_PREFIX, localNameSpaceURI);
trimRemoteNS();
provOutputFileUri = simulation.getProvLocation().resolve(name + ".ttl").toString();
model = RDFDataMgr.loadModel(provOutputFileUri);
localNameSpaceUri = getLocalNameSpaceURI();
model.setNsPrefix(LOCAL_NS_PREFIX, localNameSpaceUri);
trimRemoteNS();
}

/**
Expand All @@ -137,8 +184,8 @@ private void trimRemoteNS() {
String nameSpace = entry.getKey();
String uri = entry.getValue();
if (nameSpace.startsWith(REMOTE_NS_PREFIX)) {
remoteNameSpaceURI = uri.substring(uri.lastIndexOf('/') + 1);
model.setNsPrefix(nameSpace, remoteNameSpaceURI);
remoteNameSpaceUri = uri.substring(uri.lastIndexOf('/') + 1);
model.setNsPrefix(nameSpace, remoteNameSpaceUri);
}
}
}
Expand Down Expand Up @@ -166,9 +213,9 @@ public void setNsPrefix(String prefix, String uri) {
*
* @return The URI of the provenance output file
*/
public String getProvFileURI() {
return provOutputFileURI;
}
public String getProvFileUri() {
return provOutputFileUri;
}

/**
* Gets the RDF model maintained by the manager.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,14 +175,23 @@ public static Path getCurrentProjectDirectory() {
return getProjectsDirectory().resolve(WorkbenchManager.getInstance().getProjectName());
}

private static String workingDir() {
String dir = System.getProperty("user.dir");
String target = "\\target";
if (dir.endsWith(target)) {
dir = dir.substring(0, dir.length() - target.length());
}
return dir;
}

/**
* Provides the working directory of the current user.
*
* @return The working directory of the current user
*/
public static Path getUserDir() {
return Paths.get(System.getProperty("user.dir"));
}
public static Path getUserDir() {
return Paths.get(workingDir());
}

/**
* Provides the home directory of the current user.
Expand Down
Loading