1st LarKC Early Adopters Workshop, 1 June 2009, Crete
Hands-on session - Urban Baby LarKC Scenario
Apart from the correct importing and configuration of platform, plugins and pipelines with the respective Eclipse project (as per the rest of the workshop), only a few configurations are needed to run the Urban Baby LarKC pipelines. They are explained in the following together with the detailed explanation of the activities. The installation and running of the final user application that invokes the LarKC platform and displays the results on a map should be considered an optional step for the workshop.
First pipeline
This pipeline identifies a subset of the Milano roads (only the city center), by loading a specific RDF dump of such data from a remote address. Those RDF triples are analyzed and passed on to the path-finding algorithm which returns the found path.
The first pipeline is structured as follows:
- a Decider manages the pipeline
- an Identifier plugin get the data from the source
- a Selecter plugin just takes the data from the step before and passes them on
- a Reasoner plugin processes the data and gets the results
The concrete plug-ins to realize the first pipeline are:
Decider --> eu.larkc.plugin.decider.urbancomputing.ubl.?UrbanBabyLarkcDecider
Identifier --> eu.larkc.plugin.indentify.urbancomputing.ubl.?RemoteGraphLoaderIdentifier
Selecter --> eu.larkc.plugin.select.simple.?GrowingDatasetSelecter
Reasoner --> eu.larkc.plugin.reason.urbancomputing.ubl.?PathFinderReasoner
Some of the aforementioned plug-ins need specific configurations; those configurations can be modified within the ?UrbanBabyLarkcDecider class at the begin of the pipeline, invoking methods contained in UBL configuration class eu.larkc.plugin.identify.urbancomputing.ubl.Config. In the following we list the needed steps to prepare them.
?RemoteGraphLoaderIdentifier configuration:
- Configuration parameter: location of the RDF file to be loaded
- Value: URL of the file on the Web server (setup as in first page)
- Method: Config.setRemoteGraphLoaderIdentifierURI(String uri);
Second pipeline
This pipeline identifies a subset of the Milano roads on the basis of some location-based choice of the relevant roads from the complete Milano map; to identify those roads, it takes into consideration the position of the starting and ending nodes. The identified RDF triples representing the roads subset are analyzed and passed on to the path-finding algorithm which returns the found path.
The second pipeline is structured as follows:
- a Decider manages the pipeline
- a Transformer extracts some parameters from the query
- an Identifier plugin get the data from the source on the basis of the parameters
- a Selecter plugin just takes the data from the step before and passes them on
- a Reasoner plugin processes the data and gets the results
The alternative options to realize the second pipeline are:
Decider --> eu.larkc.plugin.decider.urbancomputing.ubl.?UrbanBabyLarkcDecider
Transformer --> eu.larkc.plugin.transform.urbancomputing.ubl.?SparqlToGeoQueryTransformer
Identifier1 --> eu.larkc.plugin.indentify.urbancomputing.ubl.?GeoLocationIdentifier
Identifier2 --> eu.larkc.plugin.indentify.urbancomputing.ubl.?MixedStrategyIdentifier
Selecter --> eu.larkc.plugin.select.simple.?GrowingDatasetSelecter
Reasoner --> eu.larkc.plugin.reason.urbancomputing.ubl.?PathFinderReasoner
Some of the aforementioned plug-ins need specific configurations; those configurations can be modified within the ?UrbanBabyLarkcDecider.java class (in the plugins project). In the following we list the needed steps to prepare them.
?GeoLocationIdentifier configuration:
- Behavior: it selects the roads contained in a circle with center in the middle point between the starting and the destination points and a suitable radius.
Configuration parameter: pointer to the ?AllegroGraph server (address, port and the folder with the triplesets on the server (it should be C:\\?AllegroGraphMilano\\ts\\)
Value: URL of the ?AllegroGraph server (setup as in ServerSideInstructions)
- Methods: Config.setGeoLocationIdentiferServer(String uri)
- Config.setGeoLocationIdentiferPort(int port) Config.setGeoLocationIdentiferFolder(String folder)
- Configuration parameter: point to be considered the center of the search area
- Value: one among: Config.MIDDLE (the middle point between start and goal), Config.START (the start point), Config.END (the goal node).
- Method: Config.setGeoLocationIdentiferMode(int mode)
?MixedStrategyIdentifier configuration:
- Behavior: it selects the roads contained in the union of: a circle with center in the starting point, a circle with center in the destination point, the graph of the main roads.
Configuration parameter: pointer to the ?AllegroGraph server (address, port and the folder with the triplesets on the server (it should be C:\\?AllegroGraphMilano\\ts\\)
Value: URL of the ?AllegroGraph server (setup as in first page)
- Methods: Config.setMixedStrategyIdentiferServer(String uri)
- Config.setMixedStrategyIdentiferPort(int port) Config.setMixedStrategyIdentiferFolder(String folder)
- Configuration parameter: location of the RDF file with the main roads to be loaded
Value: URL of the file on the Web server (setup as in ServerSideInstructions)
- Method: Config.setMixedStrategyIdentiferGraphUri(String uri);
Running the Urban Baby LarKC
In order to run the Urban Baby LarKC and test its various configurations, we prepared the eu.larkc.demo.ExecuteUrbanPipelineEAW.java class (located in the pipelines project and attached in a commented version); by changing the pipelines field in the first line of the main method, it is possible to launch the pipeline executions in the various pipeline configurations.
Running the UBL client
Once we tried the UBL from code, we can demonstrate the use of LarKC within a end-user application. In this case, we provide a client (within a Tomcat webapp) that displays a graphical interface to the user to select starting and ending point on a map, invokes the UBL to find the path and displays the result on the map itself.
Further UBL configuration
Some libraries must be added to the platform classpath in order to invoke it remotely.
Right-click on the "platform" project and select "Java Build Path", then go to the "Libraries" tab and click on "Add jars..."; then select the following libraries:
from plugins\lib: agraph-3-1-1.jar, jgrapht-jdk1.6.jar, slf4j-api-1.5.3.jar, slf4j-log4j12-1.5.3.jar
from platform\lib: xercesImpl-2.7.1.jar (then go to the "Order and Export" tab and move to bottom the library named xercesImpl.jar)
Edit the file plugins.ini that can be found under platform\conf: comment the line with the ?SimpleAnytimeDecider and add this line:
../plugins/bin/eu.larkc.plugin.decider.urbancomputing.ubl.UrbanBabyLarkcDecider.wsdl
In this way, you are instructing the platform to launch that decider.
Edit the eu.larkc.plugin.decider.urbancomputing.ubl.?UrbanBabyLarkcDecider.java class and at line 48 complete the code as follows:
public int configuration = 11;
In this way, you are telling the decider to execute the first pipeline.
Testing before launching the client
Run the eu.larkc.core.Larkc.java class under platform (configured as explained here).
Launch a SPARQL client like the one that can be downloaded here. Submit the following sample query:
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns/>
PREFIX lud: <http://www.linkingurbandata.org/onto/ama/>
SELECT ?p ?w ?n1 ?l ?n2
WHERE{
?p rdf:type lud:Path.
?p lud:pathFrom <http://seip.cefriel.it/ama/resource/nodes/node8578>.
?p lud:pathTo <http://seip.cefriel.it/ama/resource/nodes/node8137>.
?p lud:contain ?l.
?l lud:lFrom ?n1.
?l lud:lTo ?n2.
?p lud:length ?w.
} ORDER BY ?wIf everything goes right, a new window will pop up with the XML variable bindings of the SPARQL query response.
UBL client installation and configuration
The client is provided as a file named UBL-Client.war available on the project SVN here. Put this file in the webapps folder of an Apache Tomcat and start the Tomcat server.
If needed, edit the service.jsp file in the following line:
LarkcConnector lc = new LarkcConnector("http://localhost:8000/sparql/");by putting the correct address of the LarKC server running on your machine.
Having selected the first pipeline (1A), the client runs only with the streets belonging to the Milano city center. Please, be aware of this when you right-click on the map to select the starting and ending node: both points must be within the city center (see slide 14 of the presentation)
Server-side configuration (for workshop organizers only)
page in progress ...
more up-to-date information can be found on the project SVN at:
