Getting started with Yarta

 

First get the latest framework libraries:

 

     mse-middleware.jar

 

Second (not mandatory) the java documentation

 

     mse-doc.zip

 

Third, get latest RDF files

 

     base MSE rdf

     extended MSE rdf

 

Last, but not least, get the YartaGEN tool, which will help you generate Java code for your sample extended application based on the extended ontology model.

 

     YartaGEN

 

 

Android

 

 

Install the following APK from this location. This is the YartaLibrary core which will be used by all applications built with Yarta.

 

Download the two sample applications built using the framework.

 

     YartaUIAndroid - contains all the basic functionalities for creating, sharing and distributing information through the Android device. Works with the basic mse-1.2.rdf.

 

     YartaUIXAndroid - contains extended functionalities upon creating new Classes and defining new rules in the rdf model, which can be extended.

 

 

Java SE

 

 

Download the following sample projects build with Yarta.

 

     YartaUI - contains all the basic functionalities for creating, sharing and distributing information through Java. Works with the basic mse model defined in this document.

 

     YartaUIX - contains extended functionalities upon creating new Classes and defining new rules in the rdf model, which can be extended.

 

In this case you need to download the following prerequisites before building with Yarta (can be found in the sample application zip files as well):

 

     IbicoopSE.jar

     arq-2.8.1.jar

     icu4j-3.4.4.jar

     iri-0.7.jar

     jena-2.6.2.jar

     kxml2-2.3.0.jar

     log4j-1.2.13.jar

     slf4j-api-1.5.6.jar

     slf4j-log4j12-1.5.6.jar

     xercesImpl-2.7.1.jar

     xmlpull_1_1_3_4c.jar

 

Download the two files (certificate & prop) which needs to be placed in the /res folder of the application (same, can be found in the sample zip file as well):

 

     res/ibicoopcacert.crt

     res/ibicoop.properties

 

The last two are needed for the IBICOOP library (communication) to work properly.


 

Building an Yarta app from scratch (Android)

 

1.       Create a new Android project.

 

2.       Add in your AndroidManifest.xml the following permission (to be able to access the Yarta Library which should be already installed on your device.

 

 

<uses-permission android:name="fr.inria.arles.yarta.ACCESS_DATA"/>

 

3.       Add the latest mse-middleware.jar in your libs folder and also add it as a project dependency in Eclipse.

 

4.       In case your application extends the base model, use YartaGen to generate app specific code and place the code in your Android project.

 

java -jar YartaGen.jar mse-conf.rdf http://yarta.gforge.inria.fr/ontologies/mse-conf.rdf . com.example.helloyarta

 

This will generate the code in the current directory for the hello world application. Move this into the application src folder.

 

Your RDF extension file (in this case mse-conf.rdf) needs to be accessible on the Android device as well for passing it to the Yarta middleware (to learn it). In this case we will place it in the assets folder and unpack it at runtime.

 

Moreover you need some base policies defined in your application. For now use this file. More information about the policy file format you can find in the Policy Manager section.

 

 

5.       Initialize the MSE middleware and get the needed objects.

 

              try {

                     mseManager.initialize("path-to-your-conf-rdf",

                                  "path-to-your-base-policy-file", "Person_" + userId,

                                  userId, this, this);

 

                     mseComm = mseManager.getCommunicationManager();

                     mseSAM = mseManager.getStorageAccessManagerEx();

              } catch (KBException ex) {

                     // handle exception

                     ex.printStackTrace();

              }

 

You need to pass an Android context (this in our case) and an MSEApplication implementation (same in our case: this).

 

6.       Write code.

 

When the knowledge base (KB) will be ready (in case of no errors) handleKBReady from MSEApplication will be fired. After this event, we can work with the middleware.

 

Download the hello world application.

 


 

The Policy File

 

Through the policy file you can define base rules each user will have on their app, but also offer the user the ability to define its own custom sharing rules (e.g. who will have access to what kind of information from its knowledge base).

 

The policy file contains SPARQL queries on each line (each line is a different sharing rule).

 

For more information about the power and flexibility of the Yarta Policy Manager please read this.