[TASK] Generic commit.

This commit is contained in:
Jan Philipp Timme 2016-10-12 17:03:40 +02:00
parent 33d513ec03
commit fd6156fe71
3 changed files with 15 additions and 8 deletions

View File

@ -1,7 +1,9 @@
# CSPARQL-Carsimulation # CSPARQL-Carsimulation
This project uses the CEP engine C-SPARQL to demonstrate how event data from rdf streams can be processed. This project (which is more of a prototype than i am willing to admit) uses the CEP engine C-SPARQL to demonstrate how event data from rdf streams can be processed.
It consist of a rudimentary simulation which generates rdf event data that is then fed into the engine through rdf streams. It consist of a very rudimentary simulation that provides rdf event streams that can be fed into the C-SPARQL engine for further processing. It also brings along a bunch of C-SPARQL queries that are based on the results of my bachelor thesis that are meant to process the event stream data from the simulation in order to extract meaningful event patterns.
The project itself comes with a GUI that provides rough controls over whether the simulation is running plus a bunch of windows that show the data from the rdf streams and the results of the registered C-SPARQL queries for inspection.
This project uses maven, so in order to get all the dependencies and build the project, you can run ```mvn package```. This project uses maven, so in order to get all the dependencies and build the project, you can run ```mvn package```.

View File

@ -54,7 +54,7 @@ public class FancyTextObserverWindow extends JFrame implements Observer {
private volatile boolean autoScrollToBottom = true; private volatile boolean autoScrollToBottom = true;
private volatile boolean usePrefixManager = true; private volatile boolean usePrefixManager = true;
private volatile boolean clearInsteadOfEleminatingLines = true; private volatile boolean clearInsteadOfEleminatingLines = true;
private volatile boolean updateThisWindow = true; private volatile boolean updateThisWindow = false;
/** /**
* Constructor * Constructor
@ -162,7 +162,7 @@ public class FancyTextObserverWindow extends JFrame implements Observer {
this.setTitle(title); this.setTitle(title);
this.setResizable(true); this.setResizable(true);
this.setUndecorated(false); this.setUndecorated(false);
this.setDefaultCloseOperation(EXIT_ON_CLOSE); this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
Container contentPane = this.getContentPane(); Container contentPane = this.getContentPane();
contentPane.setLayout(new BorderLayout()); contentPane.setLayout(new BorderLayout());
@ -209,7 +209,7 @@ public class FancyTextObserverWindow extends JFrame implements Observer {
JCheckBox updateWindowCheckbox = new JCheckBox(); JCheckBox updateWindowCheckbox = new JCheckBox();
updateWindowCheckbox.setText("Update this window"); updateWindowCheckbox.setText("Update this window");
updateWindowCheckbox.setEnabled(true); updateWindowCheckbox.setEnabled(true);
updateWindowCheckbox.setSelected(true); updateWindowCheckbox.setSelected(this.updateThisWindow);
updateWindowCheckbox.addActionListener(new ActionListener() { updateWindowCheckbox.addActionListener(new ActionListener() {
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
@ -320,7 +320,7 @@ public class FancyTextObserverWindow extends JFrame implements Observer {
* Helper method to enforce a line limit for the window. * Helper method to enforce a line limit for the window.
*/ */
private void enforceLineLimit() { private void enforceLineLimit() {
int MAX_LINES = 300; int MAX_LINES = 250;
String[] lines = this.textPane.getText().split("\n"); String[] lines = this.textPane.getText().split("\n");
int totalLines = lines.length; int totalLines = lines.length;
int characters = 0; int characters = 0;

View File

@ -54,7 +54,7 @@ public class RentACarSimulation implements Runnable {
public RentACarSimulation(CsparqlEngine engine) { public RentACarSimulation(CsparqlEngine engine) {
this.engine = engine; this.engine = engine;
this.registerOwnPrefixes(); this.registerOwnPrefixes();
int numberOfCars = 2; // Maximum of 10 cars are in the ABox (0-9) int numberOfCars = 3; // Maximum of 10 cars are in the ABox (0-9)
int numberOfCustomers = 5; // Maximum of 5 drivers are in the ABox (0-4) int numberOfCustomers = 5; // Maximum of 5 drivers are in the ABox (0-4)
// Create a car pool and drivers // Create a car pool and drivers
this.carPool = new CarPool(numberOfCars); this.carPool = new CarPool(numberOfCars);
@ -215,6 +215,7 @@ public class RentACarSimulation implements Runnable {
+ " FILTER(?speed > 0) " + " FILTER(?speed > 0) "
+ "}"; + "}";
QueryContainer queryContainer = new QueryContainer("getMovingCars", query, true); QueryContainer queryContainer = new QueryContainer("getMovingCars", query, true);
queryContainer.useObserverWindow();
return queryContainer; return queryContainer;
} }
@ -250,6 +251,7 @@ public class RentACarSimulation implements Runnable {
+ " FILTER(?deltaSpeed > 25) " + " FILTER(?deltaSpeed > 25) "
+ "}"; + "}";
QueryContainer queryContainer = new QueryContainer("getStronglyAcceleratingCars", query, true); QueryContainer queryContainer = new QueryContainer("getStronglyAcceleratingCars", query, true);
//queryContainer.useObserverWindow();
return queryContainer; return queryContainer;
} }
@ -285,6 +287,7 @@ public class RentACarSimulation implements Runnable {
+ " FILTER(?deltaSpeed < -25) " + " FILTER(?deltaSpeed < -25) "
+ "}"; + "}";
QueryContainer queryContainer = new QueryContainer("getStronglyBrakingCars", query, true); QueryContainer queryContainer = new QueryContainer("getStronglyBrakingCars", query, true);
queryContainer.useObserverWindow();
return queryContainer; return queryContainer;
} }
@ -322,7 +325,7 @@ public class RentACarSimulation implements Runnable {
+ "}"; + "}";
QueryContainer queryContainer = new QueryContainer("getEngineWear", query, true); QueryContainer queryContainer = new QueryContainer("getEngineWear", query, true);
RentACarSimulation.setUpReasoningOnQueryContainer(queryContainer); RentACarSimulation.setUpReasoningOnQueryContainer(queryContainer);
queryContainer.useObserverWindow(); //queryContainer.useObserverWindow();
return queryContainer; return queryContainer;
} }
@ -347,6 +350,7 @@ public class RentACarSimulation implements Runnable {
+ "}"; + "}";
QueryContainer queryContainer = new QueryContainer("getBrakeWear", query, true); QueryContainer queryContainer = new QueryContainer("getBrakeWear", query, true);
RentACarSimulation.setUpReasoningOnQueryContainer(queryContainer); RentACarSimulation.setUpReasoningOnQueryContainer(queryContainer);
queryContainer.useObserverWindow();
return queryContainer; return queryContainer;
} }
@ -374,6 +378,7 @@ public class RentACarSimulation implements Runnable {
+ "}"; + "}";
QueryContainer queryContainer = new QueryContainer("getHandbrakeWear", query, true); QueryContainer queryContainer = new QueryContainer("getHandbrakeWear", query, true);
RentACarSimulation.setUpReasoningOnQueryContainer(queryContainer); RentACarSimulation.setUpReasoningOnQueryContainer(queryContainer);
queryContainer.useObserverWindow();
return queryContainer; return queryContainer;
} }