querying ELK from multiple threads

17 views
Skip to first unread message

Jim Balhoff

unread,
Aug 13, 2013, 11:15:43 AM8/13/13
to elk-reasone...@googlegroups.com
I am interested in using ELK in web services (e.g. Apache Jersey) to answer DL queries. Ideally the application would load the ontology into ELK once, at startup, and provide a global reasoner object to be used by the services. Independent web service requests run on simultaneous threads. Will this cause problems? Is it safe to use the reasoner interface from multiple threads?

Thank you,
Jim Balhoff

Pavel Klinov

unread,
Aug 13, 2013, 1:07:31 PM8/13/13
to elk-reasone...@googlegroups.com
Jim,

This shouldn't cause problems but also won't achieve what you're
trying to do: currently all such requests will be serviced
sequentially.

One thing you might do is create an extra layer to buffer several
requests (class expressions), materialize (introduce concept names for
them), and add to the ontology. Then the new concepts will all be
saturated in parallel and you can send the answers back to the
clients. See https://code.google.com/p/elk-reasoner/wiki/QueryingComplexClasses
for an example how to materialize queries. You will have to do the
clean-up manually.

Whether this makes sense depends on the server load. Obviously if the
average query answering time is less than the average time between two
consecutive requests, then it makes little sense.

Hope this helps,

Pavel

PS. We thought about implementing a generic server module for ELK to
address scenarios like yours but it's unclear when/if we will have
time for it.
> --
> You received this message because you are subscribed to the Google Groups
> "elk-reasoner-discussion" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to elk-reasoner-disc...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

Jim Balhoff

unread,
Aug 13, 2013, 1:24:57 PM8/13/13
to elk-reasone...@googlegroups.com
Thank you, Pavel, this is very helpful. It's good to know that it can be used in this way, even if with somewhat of a bottleneck.

- Jim
Reply all
Reply to author
Forward
0 new messages