Groovie example

3 views
Skip to first unread message

Pedro Ferreira

unread,
Feb 26, 2008, 10:58:18 AM2/26/08
to xOperator Open Discussion
Hello all.
First of all, congratulations for the project, I really like the
concept.
I've been trying to make some templates for DBPedia queries, and i
noticed that it is currently impossible to customize the output format
of the query. I've read in the documentation that the only way to have
output formatting is through the use of Groovy scripts. However, I
could not find, until now, a single example script (or documentation).
Is there any place where can I get information about the groovy
extensions?

Thanks a lot,

Pedro

Sebastian Hellmann

unread,
Feb 27, 2008, 7:39:50 AM2/27/08
to xope...@googlegroups.com
Hi,
normally there should be an extensive documentation here:
http://aksw.org/Projects/xOperator/QueryScripts?v=12nb

But we haven't done it yet, because of the lack of time, but will come
up with it in a view days.

There exist some working examples already though:
After you started the xOperator the first time, there is a new folder
like your jabber id. e.g. xOperator-0.1\kurzum_at_googlemail_dot_com and
in that there are some scripts which end on .groovy in the folder:
xOperator-0.1\kurzum_at_googlemail_dot_com\aiml\templates\

You can also find them in the SVN:
http://code.google.com/p/xoperator/source/browse/trunk/xOperator/src/net/sf/xoperator/ui/aiml/conf/templates/

I hope this helps a bit, I'll write another short mail after we updated
the Wiki Documentation page,
Sebastian

PS: this is the homepage of groovy: http://groovy.codehaus.org/
PPS: Please tell us about the outcome

Pedro Ferreira schrieb:

Sebastian Dietzold

unread,
Feb 27, 2008, 8:27:21 AM2/27/08
to xope...@googlegroups.com
quote Sebastian Hellmann (27.2.2008):

Hi Pedro,

after you created a new groovy script, you have change the file
default.aiml and create or change a category according to your groovy
script

-> ./sebastian_at_dietzold_dot_de/aiml/templates/default.aiml
<category>
<pattern>WHERE IS * NOW</pattern>
<template><external name="groovy" param="foo.groovy"/></template>
</category>

./sebastian_at_dietzold_dot_de/aiml/templates/foo.groovy

regards

SD

--
Sebastian Dietzold - Department of Computer Science; University of Leipzig
Tel/Fax: +49 341 97 323-66/-29 http://bis.uni-leipzig.de/SebastianDietzold

Pedro Ferreira

unread,
Feb 28, 2008, 4:34:27 AM2/28/08
to xOperator Open Discussion
Hello.
Thanks for all the help guys.
I have a working example for dbpedia.
Something like:

<quote>
ilzo...@gmail.com/Home: define FUBAR
str...@jabber.org: FUBAR: FUBAR is an acronym that commonly means
"Fucked Up Beyond All Repair", "Fucked Up Beyond Any Recognition",
(the recognition version was most often used to describe a situation)
or the most common translation "Fucked Up Beyond All Recognition". See
below for other variations. It is attested in the United States Army
and other military settings, as well as civilian environments."
str...@jabber.org: see also: FUBAR, FUBAR: The Movie
</quote>

You can find the groovy script here: http://rafb.net/p/Y5e54U69.html
I was wondering if it is possible to send messages to other users, in
order to do stuff like: "describe FUBAR to m...@friend.com". I haven't
found any support for this in the Context object, so I guess it's not
possible for now (?). And what about roster management? Is there any
command to force the bot to add a particular Jabber contact?

I hope you like the example, use it and modify it as you like...

Cheers,

Pedro

On Feb 27, 2:27 pm, Sebastian Dietzold <dietz...@informatik.uni-
leipzig.de> wrote:
> quote Sebastian Hellmann (27.2.2008):
>
> Hi Pedro,
>
> after you created a new groovy script, you have change the file
> default.aiml and create or change a category according to your groovy
> script
>
> -> ./sebastian_at_dietzold_dot_de/aiml/templates/default.aiml
>    <category>
>      <pattern>WHERE IS * NOW</pattern>
>      <template><external name="groovy" param="foo.groovy"/></template>
>    </category>
>
> ./sebastian_at_dietzold_dot_de/aiml/templates/foo.groovy
>
> regards
>
> SD
>
>
>
> > Hi, normally there should be an extensive documentation here:
> >http://aksw.org/Projects/xOperator/QueryScripts?v=12nb
>
> > But we haven't done it yet, because of the lack of time, but will come up
> > with it in a view days.
>
> > There exist some working examples already though:
> > After you started the xOperator the first time, there is a new folder like
> > your jabber id. e.g. xOperator-0.1\kurzum_at_googlemail_dot_com and in that
> > there are some scripts which end on .groovy in the folder:
> > xOperator-0.1\kurzum_at_googlemail_dot_com\aiml\templates\
>
> > You can also find them in the SVN:
> >http://code.google.com/p/xoperator/source/browse/trunk/xOperator/src/...

Sebastian Dietzold

unread,
Feb 28, 2008, 5:17:12 AM2/28/08
to xOperator Open Discussion
quote Pedro Ferreira (28.2.2008):

> I was wondering if it is possible to send messages to other users, in
> order to do stuff like: "describe FUBAR to m...@friend.com". I haven't
> found any support for this in the Context object, so I guess it's not
> possible for now (?).

For now, only the autodiscovery of neighbouring xmpp agents works but
SPARQL over XMPP is a litte bit buggy so this feature is disabled in
version 0.1 - we will release this in 0.2

> And what about roster management? Is there any command to force the bot
> to add a particular Jabber contact?

Such a feature is not implemented but we have a workaround. You can login
with a standard jabber client as your agent and manage the roster there.

regards

SD

Pedro Ferreira

unread,
Mar 13, 2008, 10:55:08 AM3/13/08
to xOperator Open Discussion
> For now, only the autodiscovery of neighbouring xmpp agents works but
> SPARQL over XMPP is a litte bit buggy so this feature is disabled in
> version 0.1 - we will release this in 0.2
>

Well, I meant sending messages to other human users, pretty much like
and IRC bot does. A permissions scheme would be great as well.

> Such a feature is not implemented but we have a workaround. You can login
> with a standard jabber client as your agent and manage the roster there.
>

Yes, of course, but the point was to make it easier to add people.
In any case, I bet you guys have already thought about all that. I
hope to see it in future versions of the bot.

Keep the good work,

Pedro

Sebastian Dietzold

unread,
Mar 13, 2008, 11:51:09 AM3/13/08
to xOperator Open Discussion
quote Pedro Ferreira (13.3.2008):

Hi Pedro,

i've created two issues for that.
If you have more ideas, feel free to add them too :-)

Allow xOperator to communicate in a MultiUser Chat
http://code.google.com/p/xoperator/issues/detail?id=30

Administration commands for roster management
http://code.google.com/p/xoperator/issues/detail?id=31

SD

--

Reply all
Reply to author
Forward
0 new messages