diff graphconvert.py @ 43:b5d3d9a8c83d

new graph of just the events happening now
author drewp@bigasterisk.com
date Mon, 19 Feb 2024 13:53:46 -0800
parents 7d9609edcf9c
children e53a1bc87f99
line wrap: on
line diff
--- a/graphconvert.py	Sun Feb 18 12:34:53 2024 -0800
+++ b/graphconvert.py	Mon Feb 19 13:53:46 2024 -0800
@@ -18,7 +18,9 @@
             graph.add((feed, EV['description'], Literal(doc['description'].strip()), ctx))
 
     for ev in events:
-        uri = URIRef(ev['uri'])
+        uri = URIRef(ev.get('uri', ev.get('_id')))
+        if uri is None:
+            raise ValueError(f"{ev=} had no event uri")
 
         def add(p: URIRef, o: URIRef|Literal):
             return graph.add((uri, p, o, ctx))