Commit e2c3e5cf authored by Tim Bleimehl's avatar Tim Bleimehl 🤸🏼
Browse files

fix and update readme

parent db4269cb
# processing_semspec_init # processing_semspec_init
Runs `call de.derivo.semspect.server.reload`
\ No newline at end of file Maintainer: Tim
Status: Stable, maintained
This is a part of the DZDConnect Graph Dataloading pipeline but can also ran standalone. Find more informations at [DZDConnect Graph Pipeline](https://git.connect.dzd-ev.de/dzdconnectpipeline/pipeline)
This pipelinemember just calls the neo4j procedure `de.derivo.semspect.server.reload` if existent to initialize the cache for the neo4j [SemSpect](https://www.semspect.de/)-Plugin. This enables faster loading of the plugin afterwards.
You can also just run the SemSpect initialization manually with
`call de.derivo.semspect.server.reload`
in the neo4j Browser.
If SemSpect is not installed in the Neo4j Database, this pipeline member will do nothing.
\ No newline at end of file
RUN call de.derivo.semspect.server.reload
RUN call de.derivo.semspect.server.reload
[Procedure.ProcedureNotFound] There is no procedure with the name `de.derivo.semspect.server.reload` registered for this database instance. Please ensure you've spelled the procedure name correctly and that the procedure is properly deployed.
Traceback (most recent call last):
File "/home/tim/Repos/git.connect.dzd-ev.de/DZDConnectPipeline/processing_semspec_init/src/main.py", line 21, in <module>
res = g.run("call de.derivo.semspect.server.reload")
File "/home/tim/.local/lib/python3.9/site-packages/py2neo/database.py", line 405, in run
return self.auto().run(cypher, parameters, **kwparameters)
File "/home/tim/.local/lib/python3.9/site-packages/py2neo/database.py", line 992, in run
self._connector.pull(result, -1)
File "/home/tim/.local/lib/python3.9/site-packages/py2neo/client/__init__.py", line 1434, in pull
cx.pull(result, n=n)
File "/home/tim/.local/lib/python3.9/site-packages/py2neo/client/bolt.py", line 1001, in pull
self._audit(self._transaction)
File "/home/tim/.local/lib/python3.9/site-packages/py2neo/client/bolt.py", line 810, in _audit
task.audit()
File "/home/tim/.local/lib/python3.9/site-packages/py2neo/client/bolt.py", line 1140, in audit
item.audit()
File "/home/tim/.local/lib/python3.9/site-packages/py2neo/client/bolt.py", line 1140, in audit
item.audit()
File "/home/tim/.local/lib/python3.9/site-packages/py2neo/client/bolt.py", line 1303, in audit
raise self._failure
py2neo.errors.ClientError: [Procedure.ProcedureNotFound] There is no procedure with the name `de.derivo.semspect.server.reload` registered for this database instance. Please ensure you've spelled the procedure name correctly and that the procedure is properly deployed.
RUN call de.derivo.semspect.server.reload
[Procedure.ProcedureNotFound] There is no procedure with the name `de.derivo.semspect.server.reload` registered for this database instance. Please ensure you've spelled the procedure name correctly and that the procedure is properly deployed.
Traceback (most recent call last):
File "/home/tim/Repos/git.connect.dzd-ev.de/DZDConnectPipeline/processing_semspec_init/src/main.py", line 21, in <module>
res = g.run("call de.derivo.semspect.server.reload")
File "/home/tim/.local/lib/python3.9/site-packages/py2neo/database.py", line 405, in run
return self.auto().run(cypher, parameters, **kwparameters)
File "/home/tim/.local/lib/python3.9/site-packages/py2neo/database.py", line 992, in run
self._connector.pull(result, -1)
File "/home/tim/.local/lib/python3.9/site-packages/py2neo/client/__init__.py", line 1434, in pull
cx.pull(result, n=n)
File "/home/tim/.local/lib/python3.9/site-packages/py2neo/client/bolt.py", line 1001, in pull
self._audit(self._transaction)
File "/home/tim/.local/lib/python3.9/site-packages/py2neo/client/bolt.py", line 810, in _audit
task.audit()
File "/home/tim/.local/lib/python3.9/site-packages/py2neo/client/bolt.py", line 1140, in audit
item.audit()
File "/home/tim/.local/lib/python3.9/site-packages/py2neo/client/bolt.py", line 1140, in audit
item.audit()
File "/home/tim/.local/lib/python3.9/site-packages/py2neo/client/bolt.py", line 1303, in audit
raise self._failure
py2neo.errors.ClientError: [Procedure.ProcedureNotFound] There is no procedure with the name `de.derivo.semspect.server.reload` registered for this database instance. Please ensure you've spelled the procedure name correctly and that the procedure is properly deployed.
RUN call de.derivo.semspect.server.reload
Procedure
RUN call de.derivo.semspect.server.reload
Neo.ClientError.Procedure.ProcedureNotFound
RUN call de.derivo.semspect.server.reload
True
RUN call de.derivo.semspect.server.reload
Semspect is not installed. No init neccessary.
Try to run call de.derivo.semspect.server.reload
Semspect is not installed. No init neccessary.
import os import os
import logging import logging
from py2neo import Graph from py2neo import Graph
from py2neo.errors import ClientError
import json import json
from py2neo.database.work import ClientError
log = logging.getLogger(__name__) log = logging.getLogger(__name__)
log.addHandler(logging.StreamHandler()) log.addHandler(logging.StreamHandler())
...@@ -15,6 +16,12 @@ NEO4J_CONFIG_DICT = json.loads(NEO4J_CONFIG_STRING) ...@@ -15,6 +16,12 @@ NEO4J_CONFIG_DICT = json.loads(NEO4J_CONFIG_STRING)
log.debug("NEO4J conf: \n{}".format(json.dumps(NEO4J_CONFIG_DICT))) log.debug("NEO4J conf: \n{}".format(json.dumps(NEO4J_CONFIG_DICT)))
g = Graph(**NEO4J_CONFIG_DICT) g = Graph(**NEO4J_CONFIG_DICT)
log.info("RUN call de.derivo.semspect.server.reload") log.info("Try to run call de.derivo.semspect.server.reload")
res = g.run("call de.derivo.semspect.server.reload") try:
log.info(res) res = g.run("call de.derivo.semspect.server.reload")
except ClientError as e:
if e.code == "Neo.ClientError.Procedure.ProcedureNotFound":
log.info("Semspect is not installed. No init neccessary.")
else:
raise e
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment