summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorJim McCusker <jmccusker@5amsolutions.com>2014-11-21 01:51:35 -0500
committerJim McCusker <jmccusker@5amsolutions.com>2014-11-21 01:51:35 -0500
commit86e324e4092e5951c9031c041f5ea16ad59a0b47 (patch)
treee6523ca2f83fd66a5ccec7005d7e6edb305a289e /examples
parenta69c22afed817c932518542bf69be7cd19a7d824 (diff)
downloadrdflib-86e324e4092e5951c9031c041f5ea16ad59a0b47.tar.gz
serial loading of ontologies.
Diffstat (limited to 'examples')
-rw-r--r--examples/graph_digest_benchmark.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/examples/graph_digest_benchmark.py b/examples/graph_digest_benchmark.py
index dca8e91f..c3d69239 100644
--- a/examples/graph_digest_benchmark.py
+++ b/examples/graph_digest_benchmark.py
@@ -63,10 +63,9 @@ def bioportal_benchmark(apikey, output_file, threads):
try:
while True:
stats = q.get()
+ og = stats['graph']
print stats['ontology'], stats['download_url']
try:
- og = Graph()
- og.load(stats['download_url']+"?apikey=%s"%apikey)
ig = to_isomorphic(og)
graph_digest = ig.graph_digest(stats)
except Exception as e:
@@ -87,7 +86,13 @@ def bioportal_benchmark(apikey, output_file, threads):
"ontology": title,
"download_url": download
})
- tasks.put(stats)
+ try:
+ og = Graph()
+ og.load(stats['download_url']+"?apikey=%s"%apikey)
+ stats['graph'] = og
+ tasks.put(stats)
+ except Exception as e:
+ print ontology, e
tasks.close()
written_tasks = 0
while written_tasks < task_count: