From 6889cff096d30e76cc5379ee68da42b555895eed Mon Sep 17 00:00:00 2001 From: Matthias Baumgartner Date: Fri, 17 Feb 2023 08:32:27 +0100 Subject: info tile update and port data loading --- tagit/apps/port_data.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'tagit/apps') diff --git a/tagit/apps/port_data.py b/tagit/apps/port_data.py index cda2d63..fc11b4d 100644 --- a/tagit/apps/port_data.py +++ b/tagit/apps/port_data.py @@ -1,8 +1,20 @@ + +# standard imports import os +import pickle + +# tagit imports from tagit.utils import ns from tagit.utils.bsfs import URI +# load data def add_port_data(store): + with open(os.path.join(os.path.dirname(__file__), 'port-data.pkl'), 'rb') as ifile: + for triple in pickle.load(ifile): + store._backend._graph.add(triple) + + +def add_port_data2(store): # tags t_hello = store.node(ns.bsfs.Tag, URI('http://example.com/me/tag#hello')) \ .set(ns.bst.label, 'hello') -- cgit v1.2.3