[Swift-commit] r2681 - provenancedb

noreply at svn.ci.uchicago.edu noreply at svn.ci.uchicago.edu
Wed Mar 11 10:16:45 CDT 2009


Author: benc
Date: 2009-03-11 10:16:44 -0500 (Wed, 11 Mar 2009)
New Revision: 2681

Modified:
   provenancedb/prov-to-opm.sh
Log:
separate IDs and URIs, so that IDs are now syntactically valid, and the
global URI identifiers are separately represented

Modified: provenancedb/prov-to-opm.sh
===================================================================
--- provenancedb/prov-to-opm.sh	2009-03-11 15:16:13 UTC (rev 2680)
+++ provenancedb/prov-to-opm.sh	2009-03-11 15:16:44 UTC (rev 2681)
@@ -13,9 +13,12 @@
 
 while read time duration globalthread localthread endstate app scratch; do
 
-echo "  <process id=\"$globalthread\">"
+threadid=$(echo $globalthread | sed 's/[:, at .]/-/g')
+
+echo "  <process id=\"$threadid\">"
 echo "    <account id=\"base\" />"
 echo "    <swift:info starttime=\"$time\" duration=\"$duration\" endstate=\"$endstate\" app=\"$app\" scratch=\"$scratch\"/>"
+echo "    <swift:uri>$globalthread</swift:uri>"
 # TODO no value here - this is some URI into an ontology, which is don't
 # really know how should be mapped from Swift
 echo "  </process>"
@@ -44,8 +47,10 @@
 cat tmp-dshandles.txt | sort | uniq > tmp-dshandles2.txt
 
 while read artifact ; do
-echo "  <artifact id=\"$artifact\">"
+artifactid=$(echo $artifact | sed 's/[:, at .]/-/g')
+echo "  <artifact id=\"$artifactid\">"
 echo "    <account id=\"base\" />"
+echo "    <swift:uri>$artifact</swift:uri>"
 echo "  </artifact>"
 done < tmp-dshandles2.txt >> opm.xml
 
@@ -59,18 +64,20 @@
 # but for now do it in a single pass...
 
 while read thread direction dataset variable rest; do 
+  datasetid=$(echo $dataset | sed 's/[:, at .]/-/g')
+  threadid=$(echo $thread | sed 's/[:, at .]/-/g')
   if [ "$direction" == "input" ] ; then
     echo "  <used>"
-    echo "    <effect id=\"$thread\" />"
+    echo "    <effect id=\"$threadid\" />"
     echo "    <role value=\"$variable\" />"
-    echo "    <cause id=\"$dataset\" />"
+    echo "    <cause id=\"$datasetid\" />"
     echo "    <account id=\"base\" />"
     echo "  </used>"
   else
     echo "  <wasGeneratedBy>"
-    echo "    <effect id=\"$dataset\" />"
+    echo "    <effect id=\"$datasetid\" />"
     echo "    <role value=\"$variable\" />"
-    echo "    <cause id=\"$thread\" />"
+    echo "    <cause id=\"$threadid\" />"
     echo "    <account id=\"base\" />"
     echo "  </wasGeneratedBy>"
   fi




More information about the Swift-commit mailing list