-
Notifications
You must be signed in to change notification settings - Fork 55
ANY23-321 Add openie toggle functionality to service #56
Conversation
@HansBrende @jgrzebyta can you both please have a look at dynamic plugin loading in this patch? I am at a loss, having tried to debug this with no progress. Thanks in advance, |
@lewismc you said you had some specific lines for debugging? |
Thanks @HansBrende :) |
Signed-off-by: Jacek Grzebyta <[email protected]>
@lewismc I really have no idea how to deploy to Tomcat, being a bit of a noob, but have you tried doing something like this in
|
I have:
@HansBrende did you had that problem as well? I have it also when I exec mvn in command line. |
@jgrzebyta Yes, I had that problem too. Mvn build fails, but that's not related to the classloader problem @lewismc is having (which my comment above should fix--the extractor registry automatically registers classes only via the system classloader, so extractors that are loaded by other means have to be explicitly registered). |
@lewismc have you been able to test whether or not my suggested insertion fixes your problem? |
@HansBrende not yet sorry, I have been overloaded :( I will try tonight. |
I don't have time right now to debug this or work on its design. It isn't a pattern I have worked on in the past. All Is this issue attempting to delay/extract the OpenIE initialisation by delaying/postponing the Factory initialisation? If so, the focus could possibly be on making the OpenIE initialisation lazy to only occur when the Factory is actually required/used to create an object instance. A more configurable lifecycle possibly requires OSGi, which I again have absolutely no experience with, but from the little understanding each time I look, it appears to allow user driven initialisation (push rather than pull, if that makes sense). |
Hi @HansBrende your suggestion fixed the code so I have pushed for further review. |
I've messed this PR up now so I will close and reopen another once I have the dependency issue resolved. I'll also provide an update to the documentation as to how dynamic classloading is done per example. |
OK folks, so this issue is now available for testing. I can see two immediate issues
|
Any comments here folks? |
I mean, I'm not sure what kind of resources you want your webservice to be using, but 6GB memory sounds like a blocker to me. Using OpenIE with the core api would be opt-in only, right? |
Yes this is optizonal for the core API and would really only be used to
demonstrate applications that can be built using Any23’s dynamic plugin
loading capabilities. This is a good excuse to update he Documentation
regardless of whether we decide to merge it into master.
Did you try it locally and see what kind of results you get? It’s pretty
cool and would nicely complement something like Jena’s full text search
https://jena.apache.org/documentation/query/text-query.html
Relistically the triples which are extracted using OpenIE are free text,
not defined vocabulary hence personally I think it highlights quite a nice
use case.
On Mon, Feb 26, 2018 at 19:13 Hans Brende ***@***.***> wrote:
I mean, I'm not sure what kind of resources you want your webservice to be
using, but 6GB memory sounds like a blocker to me. Using OpenIE with the
core api would be opt-in only, right?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#56 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ABHJlxLAaAzyXR3gLi0Gm5QRjEzBUl5Tks5tY3LZgaJpZM4RROYY>
.
|
I haven't tried it locally, but I agree it's pretty cool functionality and would aptly demonstrate that plugin-loading works. My main concern, if this will be deployed to any23.org, would be the RAM usage. One solution might be to add a configuration flag that either enables or disables OpenIE processing (the OpenIE toggle would only be displayed if the flag were enabled)--and disable the flag by default. (Unless whoever's paying for the any23.org web service doesn't mind each request using 6 GB--in that case I guess it wouldn't matter.) |
(The flag could even be read at the build-level: for example, you might add a build step that reads your configuration file and modifies the HTML to show/enable or hide/disable the toggle according to whether or not the OpenIE flag is enabled--so as not to make an unnecessary web request. Of course on the server side, you could just read the config file in on the fly--and respond with an error if the user requested OpenIE, but it was disabled in the config. I personally have no experience with building complex build tasks, so I have no idea whether or not this is feasible, or even a good idea. But just a thought.) |
We can always request more RAM for the dedicated VM powering any23.org
This is exactly whats provided in the patch. I guessed the it should be disabled by default. You can see examples of the toggle functionality in the snapshot's below Note the new OpenIE toggle box above The above information is displayed when you click on the '?' icon. |
@lewismc my suggestion was to provide a config flag in addition to the existing checkbox (the difference being: the config flag would not be controlled by the user accessing the webpage--but by the server itself, in order to specify whether or not the server allows the user to switch OpenIE "on".) (It would have been just a way to leave the plugin-loading code there so that people could look it over and test it out locally by changing the config flag, while not actually allowing them to do so on the any23 webservice.) But if the RAM usage is not a problem for any23.org, then there's no need for it. |
In lieu of the config flag, it might be nice to just handle
In any case, if any23.org can handle 6 GB of memory per instance (or rather, 10 GB, the -Xmx value recommended by the OpenIE readme), then I say +1. Cool functionality, and it would be great to be able to use it in the any23 webservice! |
On a slightly tangential topic, according to this github page, the current version of OpenIE is OpenIE 5, located here, whereas it looks like we are using OpenIE 4.2.6. |
I logged an issue in JIRA about this. I’ve also been over to see that
disappointingly there is not Maven artifact available for OpenIE 5.
I didn’t hear anything back from the OpenIE team either
dair-iitd/OpenIE-standalone#6
I suppose one of us could go and contribute the module, however at that
time, I believe I just started working on the Any23 Service + OpenIE
integration. As I said it was a while ago.
On Tue, Feb 27, 2018 at 06:34 Hans Brende ***@***.***> wrote:
On a slightly unrelated topic, according to this github page
<https://github.com/knowitall/openie>, the current version of OpenIE is
OpenIE 5, located here <https://github.com/dair-iitd/OpenIE-standalone>,
whereas it looks like we are using OpenIE 4.2.6.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#56 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ABHJl-Ek4C9mQYf7-23oCUzOq8erMT21ks5tZBJegaJpZM4RROYY>
.
|
Ah, I see. Well, it may not be the end of the world if we stick with 4.2.6 for now--looks like that version requires less memory anyway. What do you think about my OOM handling suggestion? I edited my comment to provide some sample code. |
Excellent suggestion, I've accommodated it. I also agree that another setting, possibly within core Any23 Configuration would be good, however i think that this can be added if the exception handling is not sufficient. That would be a different issue. |
This issue is a large step towards addressing https://issues.apache.org/jira/browse/ANY23-321
I am however not able to currently register the OpenIEExtractor within the ExtractorGroup/Factory when undertaking an extractor. I've debugged this down to the code in the URLClassLoader.addURL of Any23PluginManager. The OpenIE JAR's are dynamically loaded however the Extractor implementation does not seem to be registered when the extraction is executed.
@ansell if you are able to pull this code and debug it would be greatly appreciated. I have specific lines for debugging if this would be helpful. Thank you in advance for any assistance here.
P.S. you will also see that I've been making attempts to update the plugin documentation.
P.P.S I actually remember encountering a similar issue previously when attempting to register a plugin via the command line... I think dynamic ClassLoading is broken in Any23 right now. I am keen to fix it so any help here is appreciated folks.