SPARQLTrainer

Screenshot

learn to query the semantic web

The SparqlTrainer is an e-learning tool to practice SPARQL interactively. With the help of self-developed tests, consisting of individual questions, it is possible to train the different query forms (SELECT, CONSTRUCT, ASK and DESCRIBE). After entering a solution the learner will immediately see an evaluation of the request with the corresponding result. Due to different features, like password protection of tests and E-mail notification, an usage in support of courses is also possible.

Please feel free to test our latest version of SparqlTrainer at http://sparqltrainer.aksw.org. If you do want to provide feedback of your experience please send us an email to danielgerber at me dot com.


Contents

Contact

If you are interested or have any kind of questions, please feel free to send us an email at mailto:danielgerber@me.com or mailto:marvin.frommhold@gmail.com.

Requirements

  • Apache Ant >1.7.x
  • Apache Tomcat 6.x (may also work with previous versions)
  • Subversion

Obtaining

You need to checkout the jawa and the kwieri project from googlecode:


If you do want to use Sparql Trainer in production use you should follow the instructions below. If you just want to use Sparql Trainer in a development environment you should not replace the ROOT context of tomcat and configure the context manually in the config.xml file located in $TOMCAT_HOME/config.

Download the jawa framework


Download the kwieri extension for the jawa framework


  • Go to $TOMCAT_HOME/webapps/ROOT
  • Create a directory called kwieri (you could create the kwieri folder wherever you want, this is not really a webapplication)
  • Go to $TOMCAT_HOME/webapps/ROOT/kwieri
  • svn checkout http://fleischsalat.googlecode.com/svn/kwieri .

Configuration

Jawa and its Sparql Trainer extension get both configured and installed through Apache Ant. So you need to specify the project's settings in the build.properties files in order to generate the corresponding XML-configuration files. For every config file example.xml, there is a template version called example.xml.in located in $TOMCAT_HOME/webapps/ROOT/WEB-INF/config. Ant then takes the filled in project settings from the build.properties and replaces the placeholders in the *.in files to generate the actual config file.

Jawa

  • Go to $TOMCAT_HOME/webapps/ROOT
  • Copy build.properties.default to build.properties
  • Edit the build.properties according to your needs

Kwieri

  • Go to $TOMCAT_HOME/webapps/ROOT/kwieri
  • Copy the build.properties.default to build.properties
  • Edit the build.properties according to your needs

Installation

If you have finished configuring both projects you can then use ant to install these projects. Due to Sparql Trainer depends in the Jawa Framework it's neccessary that you install/compile Jawa first. Afterwards you can install/compile the Sparql Trainer which consists of the two parts, core and view. Both parts get independently packed together to two *.jar files which are then copied to the lib directory of the Jawa Framework.


  • Go to $TOMCAT_HOME/webapps/ROOT
  • $ ant install
  • Go to $TOMCAT_HOME/webapps/ROOT/kwieri
  • $ ant install.kwieriTrainer
  • $ ant install.resources
  • Go to $TOMCAT_HOME/webapps/ROOT/WEB-INF/config/jawa
  • $ cp jawa_extensions.xml.in jawa_extensions.xml
  • edit the property testDir according to where you want to store your test files
  • If you have installed jawa no in the ROOT directory of tomcat you need to specify the context path in $TOMCAT_HOME/conf/context.xml

Advice

Due to the project configuration it might be inconvenient to know all neccessary folders. So for example you want change translations you need to rebuild the Sparql Trainer, because these files are located in the generated jar files. It also would be nice to have instant access to the test and the models itself. Also the user management is file based (it's not possible to register new users trough the web interface), so a link to the “user database” should be helpful. For automation purposes you can use the two scripts at the end of this page (you probably need to adept them).


  • you should create a new user called sparqltrainer
  • and install the tomcat into the sparqltrainer's home directory
  • and create the following symlinks after you installed Sparql Trainer:
    • $ cd /home/sparqltrainer
    • to change the language files, you need to run $ ant install.kwieriTrainer (in the kwieri direcotory)
      • $ ln -s /home/sparqltrainer/$TOMCAT_HOME/webapps/kwieri/src/de/unileipzig/kwieri/jawaView/_i18n .
    • to be able to change the test easily
      • $ ln -s /home/sparqltrainer/$TOMCAT_HOME/webapps/kwieri/resources/kwieriTests/ .
    • to be able to change the models easily
      • $ ln -s /home/sparqltrainer/$TOMCAT_HOME/webapps/ROOT/public/kwieriTrainer/models/ .
    • to add new users, or if you don't want to do $ ant config (in the jawa directory) again
    than link the users.xml instead
    • $ ln -s /home/sparqltrainer/$TOMCAT_HOME/webapps/ROOT/WEB-INF/config/modules/in/users.xml.in .

UpdateLocaleFiles.sh

UpdateUsersFile.sh

Usermanagement

If you want to add a new system user you need to edit this file: $TOMCAT_HOME/webapps/ROOT/WEB-INF/config/modules/users.xml.
Please consider that if you do run $ ant configure again, the users.xml file gets recreated, so it might be better to edit the $TOMCAT_HOME/webapps/ROOT/WEB-INF/config/modules/in/users.xml.in file instead. You need to restart tomcat after you change the users file, or you simple you the script provided here.

Example user file

<user> <login>newUser</login> // the user name <password> // md5 hash of the user password, create it with $ echo -n "password" | md5sum <md5>21232f297a57a5a743894a0e4a801fc3</md5> // sha1 hash of the user password, create it with $ echo -n "password" | sha1sum <sha>680990854eb710e7b862cb1311578dcb090aa92f</sha> </password> <groups>admin</groups> // at the moment you only need to add group admin </user>

Testmanagement

Your test files are located under $TOMCAT_HOME/webapps/kwieri/resources/kwieriTests/. A sample test file, with a short description of the elements could look like this:
The according XSD schema can be found here.


<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <kwieriTest> // true -> the test is activated and get's shown in the left menu bar <enabled>true</enabled> // if you set a password, people need to enter first name, last name, // email and this password to do the test // after they finished the test, an email is send to them and the admin <password>aksw</password> // the title of the test, get's shown in the left menu bar <title>Title</title> // you can see this descriptions before you start the test <description>a description of what the test is about</description> // true -> questions in this test get randomized <random>false</random> // you can only go to next question if you have successfully solved the actual question <stepByStep>false</stepByStep> // the email address of the person in charge of this test <email>admin@admin.de</email> // the number of question the attendees have to solve (if greater than number of questions, // than question count is equal to number to questions) <questionCount>5</questionCount> // a list of questions <questions> // a single question does consist of a title, description, defaultGraph, // the solution query and the result check <question> // simple title <title>Persons</title> // a brief description of what to do <description>What are the names of all persons! Use the properties rdf:type and foaf:name!</description> // either a resolvable url like http://www.w3.org/1999/02/22-rdf-syntax-ns# or // if it's a file it has to be located in // $TOMCAT_HOME/webapps/ROOT/public/kwieriTrainer/models/ and // you need to add "model:" before the filename, e.g. model:test.rdf <defaultGraph>model:aksw.rdf</defaultGraph> // the query needs to in a cdata field because of < or >, // it should be possible to use the prefixes defined in the test.rdf model <solutionQuery><![CDATA[ select ?name where { ?s rdf:type foaf:Person . ?s <http://xmlns.com/foaf/0.1/name> ?name }]]> </solutionQuery> <resultCheck> <condition>columnCondition</condition> // noCondition - the order of the columns and row is not important // columnCondition - only the order of the columns is important // rowCondition - only the order of the rows is important // columnRowCondition - the order of the rows and the columns is important // askCondition - use this, if the question is and sparql ask question </resultCheck> </question> </questions> </kwieriTest>

TODO's

  • provide feedback a lá number of lines is x, number of triple patterns is y, number of columns is z
  • create a proper test, extend the planets example in the Semantic Web Grundlagen book
  • make it possible to view the model in differnt serializations
  • support for test definition in rdf/xml (maybe a ontowiki component for easy creation)

 
There are 2 files on this page. [Display files/form]
There is no comment on this page. [Display comments/form]

Information

Last Modification: 2010-03-29 16:25:30 by Daniel Gerber