Below is a step-by-step sequence of instructions for running the example
demonstrated in the video shown in
the LivEMUSIC
Project web page.
Prerequisites
To run this demo as shown in the video, you will need to have installed:
Then, download the livemusic-demo.zip
zip archive, and unzip it in a directory of your
choice. This directory should now contain the following subdirectories:
DataGrandLyon
LatticeMiner
Libraries
CEDAR-V2.Beta
SPARQL
images
and the files:
data_velov.json
READ-ME.html (this file)
- Then, proceed as indicated below.
Running the demo
This demo shows how to make approximations and generate the
relevant ontologies and queries to provide the answer to the abstract
query seeking:
"all the Velo'V bike stations within a 1000 meter radius from my
current position that have at least 5 bikes available"
based on raw data coming from the Velo'V dataset from the Data Grand Lyon.
Set Eclipse's workspace
Start Eclipse, specifying the
directory on your machine where you unpacked the
files (see picture).
Load and compile the projects
Under Eclipse, create a
"New Java Project" with the following names in this order
(this is important due to dependencies among the various packages for each to compile):
SPARQL
CEDAR-V2.Beta
LatticeMiner
DataGrandLyon
All projects should compile without error as they are created (ignore warnings).
Start the initial GUI
In Eclipse's Package Explorer
(leftmost window), open the following:
then right-click on "GUI.java" under "com.dgl" and
select "Run As", then "Java Application".
This will open
a window named "Data Grand Lyon" with one "File" menu.
Select the Velo'V Data Set
In this "Data Grand Lyon"
window, under the "File" menu, select "Open" and choose
the file "data_velov.json" (see
picture).
This will load the Velo'V dataset's raw schema into the Data Grand
Lyon window to be customized (see
picture).
Customize the Velo'V Data Set
In the Data Grand Lyon window,
edit the Velo'V dataset's raw schema selecting the following objects
and attributes (see picture):
in the "Objects" column, check the row containing "number" in the Data" column
in the "Attributes" column, check the row containing "lat" in the Data" column
in the "Attributes" column, check the row containing "lng" in the Data" column
in the "Attributes" column, check the row containing "available_bikes" in the Data" column
Now, proceed to choose a data type for each selected attribute and
perform semantic approximations as indicated below:
Latitude:
click the "Filter" column of the row containing
"lat" in the Data" column; this will open a
blank data type selection window
(see picture)
in this data type selection window, in the "Data
type" menu, select "Latitude (distance
difference)"; this will open a data type window
for the latitude with all fields prefilled with defaults value
(see picture); keep these
as they are and click on "Validate"
Longitude:
click the "Filter" column of the row containing
"lng" in the Data" column; this will open a
blank data type selection window
(see picture)
in this data type selection window, in the "Data
type" menu, select "Longitude"; this will open
a data type window for the longitude (see picture)
proposing no specific options (this is because the chosen
data type and approximation values for the latitude suffice
as they are); just click on "Validate"
Available bikes:
click the "Filter" column of the row containing
"available_bikes" in the Data" column; this will open a
blank data type selection window
(see picture)
in this data type selection window, in the "Data
type" menu, select "Numerical threshold"; this
will open a data type window for the number of available
bikes with just one field with default value "10"
(see picture)
edit the field "Numerical threshold" and specify
the new value value "5" click on "Validate"
(see picture)
Generate the binary context
In the "Data Grand Lyon" window, click on "Generate file";
this will open a Lattice Miner window listing the Velo'V
stations (or rather their unique ids in the leftmost column), and
corresponding approximations constraint intervals for four
attributes: "position distance=>non","position
distance=>oui", "available_bikes=>inf", and
"available_bikes=>sup"
(see picture)
in this Lattice Miner window, go to the "Edit"
menu and select "Convert to Binary Context"; this will open a
window called "Valued Relation To Binary Relation"
(see picture)
in this new window, click on "Finish/Auto-Complete"; this
will open a window called "Number of relations" asking how
many relations should be created
(see picture)
this window has a default option called "One binary context for
all attributes"; click on "OK"
The Lattice Miner window now contains the generated FCA binary context table
(see picture)
Generate the concept lattice
In the Lattice Miner window, the option row with icons
contains now (next to last) the icon of a lattice ungreyed (it was
before); clik on it
this will open an acknowledgement window informing you
that the number of concepts in the generated lattice
is "10" (see
picture)
click "OK"
this will open two windows:
one called "Lattice: data_velov_conv"
(see picture)
one called "CEDAR Reasoner Evaluation Tool"
(see picture)
you may minimize or close the first one: "Lattice:
data_velov_conv" (by selecting "Quit" in its "File" menu)
Use the CEDAR Reasoner
Using the "CEDAR Reasoner
Evaluation Tool" window, proceed as follows:
click on the "Select Reasoner" menu and choose "CEDAR"
(last option in the menu)
click on "Load Ontology" and navigate to the proper
directory, then select the file "data_velov.osf" (make sure
it is the correct one among several so-named with different extensions),
and click on "Open" (see picture)
the CEDAR window acknowledges loading the ontology
click on "Classify Ontology"
CEDAR will ask you whether you wish to save the classified ontology
(see picture); click on "No"
CEDAR has now loaded and classified the OSF attributed ontology
produced by the approximation concept lattice from the Velov dataset
(see picture)
check the "retrieve instance" option, then click on
"Load Query " and navigate to the subdirectory of
"CEDAR-V2.Beta" called "queries"
(see picture) and
select the file called "station.txt"
(see picture); click on
"Open"
CEDAR has now loaded the query from the file
"station.txt"
(see
picture)
click on "Execute Query" to execute the query and
retrieve the relevant instances (see
picture)
click on "Export Results" to export the result to the
underlying SPARQL engine; this will launch the SPARQL Interface GUI
opening a window called "SPARQL Requests Manager"
(see picture)
Use the SPARQL Interface GUI
Using the "SPARQL
Requests Manager" window, proceed as follows:
click on "Load Ontology" to load the
OWL/RDF ontology corresponding to the OSF ontology by selecting
"data_velov.owl" (see
picture)
click on "Generate Query" to generate the SPARQL
query corresponding to the OSF query (see picture)
click on "Execute Query" to execute the SPARQL query
on the ABox corresponding to the approximated concepts; the results
are displayed in intelligible form
(see picture).