1. okfn
  2. ordf

Commits

w...@styx.org  committed 56fe0c2

tweak provenance, add a label

Comments (0)

Files changed (1)

File ordf/vocab/opmv.py Modified

View file
  • Ignore whitespace
  • Hide word diff
 from pkg_resources import get_distribution
 from datetime import datetime
 from socket import gethostname
-from os import getpid
+import sys, os
 
 class Agent(foaf.Agent):
     """
         self._finished = False
         self.add((self.identifier, ORDF["cmdline"], Literal(self.cmdline())))
         self.add((self.identifier, ORDF["hostname"], Literal(gethostname())))
-        self.add((self.identifier, ORDF["pid"], Literal(getpid())))
+        self.add((self.identifier, ORDF["pid"], Literal(os.getpid())))
+        descr = "%s on %s (%s)" % (os.path.basename(sys.argv[0]), gethostname(), os.getpid())
+        self.add((self.identifier, RDFS["label"], Literal(descr)))
 
         for name, dist in self.__distributions__.items():
             b = BNode()
         graph.add((graph.identifier, RDF["type"], OPMV["Artifact"]))
         graph.remove((graph.identifier, OPMV["wasGenereatedBy"], None))
         graph.add((graph.identifier, OPMV["wasGeneratedBy"], self.identifier))
-        graph.remove((graph.identifier, OPMV["wasGenereatedAt"], None))
-        graph.add((graph.identifier, OPMV["wasGeneratedAt"], self.time))
         graph += self
 Process.add_distribution("ordf")