prov/commit

FIXED: can no longer rely on access_file to silently fail on http uris

authorJacco van Ossenbruggen
Tue Mar 26 17:45:11 2019 +0100
committerJacco van Ossenbruggen
Tue Mar 26 17:45:11 2019 +0100
commit3e3bac64dc0e4c2626a67b7b8cbb58ec3c83abf4
tree6ca7bbafef9c7c35525fe633a1ba68672f65c333
parent192a61a1a4e0254da2a014793a3ed230fc52bcd3
Diff style: patch stat
diff --git a/lib/prov_schema.pl b/lib/prov_schema.pl
index 55b23d6..c5692d5 100644
--- a/lib/prov_schema.pl
+++ b/lib/prov_schema.pl
@@ -206,8 +206,14 @@ log_entity_create(File, Options) :-
     option(prov(ProvBundle), Options),
     option(graph(Graph), Options, none),
     (   uri_is_global(File)
-    ->  Entity = File
-    ;   uri_file_name(Entity, File)
+    ->  Entity = File,
+        xsd_now(TimeStamp)
+    ;   uri_file_name(Entity, File),
+        (   access_file(File, read),
+            time_file(File, Time)
+        ->  xsd_timestamp(Time, TimeStamp)
+	;   xsd_now(TimeStamp)
+        )
     ),
     xsd_now(TimeStamp),
     rdf_assert(Entity, rdf:type, prov:'Entity', ProvBundle),