Project Overview - aantakli/AJAN-service GitHub Wiki
In the following, all sub-projects of the AJAN-service are listed. The most important ones are: Executionservice, where the actual service was implemented and the agent is managed; Common, where the configuration for the triplestores was implemented and which contains several utility classes and the general AJAN vocabulary; and Behaviour, where all AJAN native SPARQL-BT nodes, events and queries were implemented.
Project Structure:
- AJAN Parent Project
- Build-Resources
- RDFBeans
- Behaviour
- Common
- Triplestore
- Executionservice
- PluginSystem
- Loader
- Plugins
- StandardBTNodes
- MOSIMPlugin
- ASPPlugin
- MappingPlugin
- StripsPlugin
Via the PluginSystem project new SPARQL-BT nodes (e.g. domain-specific like MOSIMPlugin) can be defined or implemented. Furthermore, such plugins can be used to extend AJAN with new interfaces. How to create plugins is explained in the subchapter Plugins. One of the most important plugins is the standard BTNodes plugin, which implements the standard behavior tree nodes like Sequence, Parallel, Repeat, etc. according to the BT logic defined by gdx-ai.
This section assumes that the user has some knowledge about Java and Maven. For the sake of example the following variables have been considered:
$ajan = de.dfki.asr.ajan
$name = DummyPlugin
$pkgName = $ajan.pluginsystem.dummyplugin
$className = $ajan.pluginsystem.dummyplugin.DummyPlugin
$actionFile = $ajan.pluginsystem.dummyplugin.extensions.DummyAction
$mosimPkg = $ajan.pluginsystem.mosimplugin
How to create a new Plugin and a Plugin Action:
The easiest way to create a new plugin is to clone an existed plugin from the location ajan-service\pluginsystem\plugins
in the same directory. The following things have to be changed before the newly created plugin could function properly.
-
Rename the folder of the cloned plugin to
$name
. -
In
ajan-service\pluginsystem\plugins\pom.xml
add<module>$name</module>
in the<modules>
tag. -
Change the
<artifactId>
and<name>
inajan-service\pluginsystem\plugins\$name\pom.xml
to$name
. -
Rename the directories such that it is consistent with the
$pkgName
. Make sure that package names in the classes are compatible with the$pkgName
as well. -
Rename the class
$className
and change the content related to debugging. -
In file
ajan-service\pluginsystem\plugins\$name\plugin.properties
, make the following changes:- Change
plugin.class
to$className
- Change
plugin.id
to$name
- Change
plugin.provider
andplugin.version
accordingly.
- Change
-
In file
ajan-service\pluginsystem\plugins\$name\src\main\resources\META-INF\MANIFEST.MF
, make the changes consistent tostep 6
. -
Important: In case you're using new namespaces, make sure they're listed in
package-info.java
file (in the package$pkgName.extensions
). -
Important: Change the content of
$actionFile
according to the requirements. Make sure that the name of annotation@RDFBean
and theResource
in the methodgetType()
are consistent withIRI
used in thettl
files.
How to define a BTNode
:
In order to create a new BTNode
:
- Create a class in the package
$pkgName.extensions
. - The newly created class must extend
$ajan.behaviour.nodes.common.AbstractTDBLeafTask.java
and implements$ajan.pluginsystem.extensionpoints.NodeExtension.java
.
How to define a Thrift Endpoint:
Similar to MOSIMPlugin
:
- The
thrift
compiled files must be placed in the package$pkgName.endpoint
. - Create an interface similar to
$mosimPkg.endpoint.ThriftAction.java
in the package$pkgName.endpoint
. - Define a new thrift endpoint class in the package
$pkgName.extensions
which should implement the newly created interface.
For more details please have a look into the implementation of $mosimPkg.extensions.AbstractInstruction.java