Fwd: Re: [protege-dev] Problem with events and database backing

clemens utschig <[email protected]> Sun, 16 Feb 2014 21:48:09 +0100
Newsgroups gmane.comp.misc.ontology.protege.general
Message-ID <CAHBV8m+s5Z8YdcQk9yKFgVgCc6jbaxBT2KQrpV95CQjws7Ye7Q@mail.gmail.com>
--===============4316530665912211073==
Content-Type: multipart/alternative; boundary=001a11351c9a26b9b904f28c28ee

--001a11351c9a26b9b904f28c28ee
Content-Type: text/plain; charset=ISO-8859-1

---------- Forwarded message ----------
From: clemens utschig <[email protected]>
Date: Sunday, February 16, 2014
Subject: Fwd: Re: [protege-dev] [protege-discussion] Problem with events
and database backing
To: Timothy Redmond <[email protected]>


So, i got to the point of sneaking a kb under the protege app at runtime -
pretty much a new constructor in project (using the code from the one with
uri, and calling all the methods) and then
projectmanager.getpm.setcurrentproject... Almost there, but now i really
need your help - all the default widgets are working - but when i click on
an instance within the instance widget the form does not show? ... If i use
the default project constructor (with a string) and do the same thing - it
does show up.. Unfortunately i cant debug into this with all the threads
running around, so i really need some advice here - is there some other
magic?

On Sunday, February 16, 2014, clemens utschig <[email protected]>
wrote:
> Hey timothy - first of all thanks a ton for the reply.
>
> Yes i am on version 3.5.. The problem is that i cant create a server
project first as i use the ontology to configure a (remote) application on
the fly - and want to use the protege app to do configuration on top of
that - think of the ontology as a graph within a deployable server app. And
i dont want to start messing with two servers (my own and its lifecyle and
the protege one ;-)
>
> I'll try to tweak the protege app tmrw a little - and see if i can sneak
a project instance underneath it on the fly (rather than it *owning* and
opening a uri..)..
>
> If you have some other super smart idea, any help is appreciated...
>
> Cheers from germany, i actually studied at stanford during my time in san
francisco ;-)
>
> On Saturday, February 15, 2014, Timothy Redmond <[email protected]>
wrote:
>>
>> Just in case you didn't see my reply.
>>
>> -Timothy
>>
>> -------- Original Message --------
>> Subject: Re: [protege-dev] [protege-discussion] Problem with events and
database backing
>> Date: Sat, 15 Feb 2014 09:39:14 -0800
>> From: Timothy Redmond <[email protected]>
>> Reply-To: [email protected]
>> To: [email protected], [email protected]
>>
>> I am a bit confused getting this message because I think that the new
>> lists are protege-users and protege-dev. So I am forwarded this message
>> to protege-dev just in case.
>>
>> On 02/15/2014 07:23 AM, clemens utschig wrote:
>>> folks - this is rather urgent...
>>> I try to get the listener magic to work (e.g. new instance created,
>>> frame update, browser text changed) - between the protege application
>>> and and multiple api based consumers all using the same - database
>>> backed - project.
>>>
>>> It seems somehow events / listeners are not firing / generated by
>>> default?
>>>
>>> Any help much appreciated.
>>
>> This is just a thought and may not be related to what you are
>> experiencing. I am assuming that you are talking about Protege 3
>> although -- even though the implementations are completely different --
>> the same comments apply to Protege 4 and 5.
>>
>> If you create two separate Protege knowledge bases (e.g. separate java
>> objects) that point to the same database then you will have several
>> problems. These problems only occur when modifying the knowledge bases;
>> I think that things will work if all the callers are in read-only mode.
>>
>> The most obvious problem is that changes in one Protege knowledge base
>> will only generate events in that knowledge base and not in the other
>> knowledge bases. A less obvious problem is that, in certain
>> circumstances, changes made with one knowledge base will not be seen in
>> other knowledge bases. There may be other problems as well.
>>
>> If this is in fact your problem then there are two obvious fixes to the
>> problem. If everything is happening in a single JVM, then it is
>> possible that you can refactor your code so that all callers requesting
>> a knowledge base will get the same one. Maybe there would be a static
>> method or something that manages the process of getting the knowledge
>> base. Since the code will no longer be reentrant, you may need to also
>> add some synchronization.
>>
>> If you have more than one JVM or there is some other reason why the
>> above solution is not practical then the other approach is to use a
>> Protege server. If you have several clients accessing the same server
>> all the events and other synchronization will be taken care of. This is
>> easier than it sounds and there is a wiki page telling you how to do
this:
>>
>> Protege 3 --

--001a11351c9a26b9b904f28c28ee
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<br><br>---------- Forwarded message ----------<br>From: clemens utschig &l=
t;<a href=3D"mailto:[email protected]">[email protected]</a=
>&gt;<br>Date: Sunday, February 16, 2014<br>Subject: Fwd: Re: [protege-dev]=
 [protege-discussion] Problem with events and database backing<br>
To: Timothy Redmond &lt;<a href=3D"mailto:[email protected]">tredmond@s=
tanford.edu</a>&gt;<br><br><br>So, i got to the point of sneaking a kb unde=
r the protege app at runtime - pretty much a new constructor in project (us=
ing the code from the one with uri, and calling all the methods) and then p=
rojectmanager.getpm.setcurrentproject... Almost there, but now i really nee=
d your help - all the default widgets are working - but when i click on an =
instance within the instance widget the form does not show? ... If i use th=
e default project constructor (with a string) and do the same thing - it do=
es show up.. Unfortunately i cant debug into this with all the threads runn=
ing around, so i really need some advice here - is there some other magic?<=
br>
<br>On Sunday, February 16, 2014, clemens utschig &lt;<a href=3D"mailto:cle=
[email protected]">[email protected]</a>&gt; wrote:<br>&gt; He=
y timothy - first of all thanks a ton for the reply.<br>&gt;<br>&gt; Yes i =
am on version 3.5.. The problem is that i cant create a server project firs=
t as i use the ontology to configure a (remote) application on the fly - an=
d want to use the protege app to do configuration on top of that - think of=
 the ontology as a graph within a deployable server app. And i dont want to=
 start messing with two servers (my own and its lifecyle and the protege on=
e ;-)<br>
&gt;<br>&gt; I&#39;ll try to tweak the protege app tmrw a little - and see =
if i can sneak a project instance underneath it on the fly (rather than it =
*owning* and opening a uri..)..<br>&gt;<br>&gt; If you have some other supe=
r smart idea, any help is appreciated...<br>
&gt;<br>&gt; Cheers from germany, i actually studied at stanford during my =
time in san francisco ;-) =A0<br>&gt;<br>&gt; On Saturday, February 15, 201=
4, Timothy Redmond &lt;<a href=3D"mailto:[email protected]">tredmond@st=
anford.edu</a>&gt; wrote:<br>
&gt;&gt;<br>&gt;&gt; Just in case you didn&#39;t see my reply.<br>&gt;&gt;<=
br>&gt;&gt; -Timothy<br>&gt;&gt;<br>&gt;&gt; -------- Original Message ----=
----<br>&gt;&gt; Subject: Re: [protege-dev] [protege-discussion] Problem wi=
th events and database backing<br>
&gt;&gt; Date: Sat, 15 Feb 2014 09:39:14 -0800<br>&gt;&gt; From: Timothy Re=
dmond &lt;<a href=3D"mailto:[email protected]">[email protected]</a=
>&gt;<br>&gt;&gt; Reply-To: <a href=3D"mailto:[email protected]=
u">[email protected]</a><br>
&gt;&gt; To: <a href=3D"mailto:[email protected]">prote=
[email protected]</a>, <a href=3D"mailto:[email protected]=
tanford.edu">[email protected]</a><br>&gt;&gt;<br>&gt;&gt; I a=
m a bit confused getting this message because I think that the new<br>
&gt;&gt; lists are protege-users and protege-dev. So I am forwarded this me=
ssage<br>&gt;&gt; to protege-dev just in case.<br>&gt;&gt;<br>&gt;&gt; On 0=
2/15/2014 07:23 AM, clemens utschig wrote:<br>&gt;&gt;&gt; folks - this is =
rather urgent...<br>
&gt;&gt;&gt; I try to get the listener magic to work (e.g. new instance cre=
ated,<br>&gt;&gt;&gt; frame update, browser text changed) - between the pro=
tege application<br>&gt;&gt;&gt; and and multiple api based consumers all u=
sing the same - database<br>
&gt;&gt;&gt; backed - project.<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; It seems som=
ehow events / listeners are not firing / generated by<br>&gt;&gt;&gt; defau=
lt?<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; Any help much appreciated.<br>&gt;&gt;<=
br>
&gt;&gt; This is just a thought and may not be related to what you are<br>&=
gt;&gt; experiencing. I am assuming that you are talking about Protege 3<br=
>&gt;&gt; although -- even though the implementations are completely differ=
ent --<br>
&gt;&gt; the same comments apply to Protege 4 and 5.<br>&gt;&gt;<br>&gt;&gt=
; If you create two separate Protege knowledge bases (e.g. separate java<br=
>&gt;&gt; objects) that point to the same database then you will have sever=
al<br>
&gt;&gt; problems. These problems only occur when modifying the knowledge b=
ases;<br>&gt;&gt; I think that things will work if all the callers are in r=
ead-only mode.<br>&gt;&gt;<br>&gt;&gt; The most obvious problem is that cha=
nges in one Protege knowledge base<br>
&gt;&gt; will only generate events in that knowledge base and not in the ot=
her<br>&gt;&gt; knowledge bases. A less obvious problem is that, in certain=
<br>&gt;&gt; circumstances, changes made with one knowledge base will not b=
e seen in<br>
&gt;&gt; other knowledge bases. There may be other problems as well.<br>&gt=
;&gt;<br>&gt;&gt; If this is in fact your problem then there are two obviou=
s fixes to the<br>&gt;&gt; problem. If everything is happening in a single =
JVM, then it is<br>
&gt;&gt; possible that you can refactor your code so that all callers reque=
sting<br>&gt;&gt; a knowledge base will get the same one. Maybe there would=
 be a static<br>&gt;&gt; method or something that manages the process of ge=
tting the knowledge<br>
&gt;&gt; base. Since the code will no longer be reentrant, you may need to =
also<br>&gt;&gt; add some synchronization.<br>&gt;&gt;<br>&gt;&gt; If you h=
ave more than one JVM or there is some other reason why the<br>&gt;&gt; abo=
ve solution is not practical then the other approach is to use a<br>
&gt;&gt; Protege server. If you have several clients accessing the same ser=
ver<br>&gt;&gt; all the events and other synchronization will be taken care=
 of. This is<br>&gt;&gt; easier than it sounds and there is a wiki page tel=
ling you how to do this:<br>
&gt;&gt;<br>&gt;&gt; Protege 3 --<br>

--001a11351c9a26b9b904f28c28ee--

--===============4316530665912211073==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
protege-discussion mailing list
[email protected]
https://mailman.stanford.edu/mailman/listinfo/protege-discussion

Instructions for unsubscribing: http://protege.stanford.edu/doc/faq.html#01a.03

--===============4316530665912211073==--